{
  "format_version": "1.16.0",
  "minecraft:entity": {
    "description": {
      "identifier": "vatonage:summonskeleton",
      "is_spawnable": false,
      "is_summonable": true,
      "is_experimental": false
    },
    "component_groups": {
      "minecraft:lightning_immune": {
        "minecraft:damage_sensor": {
          "triggers": {
            "on_damage": { "filters": { "other_with_families": "lightning" } },
            "deals_damage": false
          }
        }
      },
      "minecraft:ranged_attack": {
        "minecraft:behavior.ranged_attack": {
          "priority": 0,
          "attack_interval_min": 1.0,
          "attack_interval_max": 3.0,
          "attack_radius": 10.0
        },
        "minecraft:shooter": {
          "def": "minecraft:arrow"
        },
        "minecraft:environment_sensor": {
          "triggers": [
            {
              "filters": {
                "test": "is_underwater",
                "subject": "self",
                "operator": "==",
                "value": true
              },
              "event": "minecraft:melee_mode"
            },
            {
              "filters": {
                "test": "has_ranged_weapon",
                "subject": "self",
                "operator": "==",
                "value": false
              },
              "event": "minecraft:melee_mode"
            }
          ]
        }
      },
      "minecraft:melee_attack": {
        "minecraft:behavior.melee_attack": {
          "priority": 4,
          "track_target": true,
          "speed_multiplier": 1.25
        },
        "minecraft:attack": {
          "damage": 5
        },
        "minecraft:environment_sensor": {
          "triggers": [
            {
              "filters": {
                "all_of": [
                  {
                    "test": "in_water",
                    "subject": "self",
                    "operator": "==",
                    "value": false
                  },
                  {
                    "test": "has_ranged_weapon",
                    "subject": "self",
                    "operator": "==",
                    "value": true
                  }
                ]
              },
              "event": "minecraft:ranged_mode"
            }
          ]
        }
      }
    },

    "components": {
      "minecraft:is_hidden_when_invisible": {
      },
      "minecraft:equip_item": {
      },
      "minecraft:collision_box": {
        "width": 0.6,
        "height": 1.9
      },
      "minecraft:breathable": {
        "total_supply": 15,
        "suffocate_time": 0,
        "breathes_water": true
      },
      "minecraft:health": {
        "value": 20,
        "max": 20
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "filters": { "test": "in_lava", "subject": "self", "operator": "==", "value": true },
            "cause": "lava",
            "damage_per_tick": 4
          }
        ]
      },
      "minecraft:movement": {
        "value": 0.25
      },
      "minecraft:navigation.walk": {
        "is_amphibious": true,
        "avoid_sun": false,
        "avoid_water": true
      },
      "minecraft:movement.basic": {
      },
      "minecraft:jump.static": {
      },
      "minecraft:can_climb": {
      },
      "minecraft:nameable": {
      },
      "minecraft:equipment": {
        "table": "loot_tables/entities/skeleton_gear.json"
      },
      "minecraft:shooter": {
        "def": "minecraft:arrow"
      },
      "minecraft:environment_sensor": {
        "triggers": [
          {
            "filters": {
              "test": "is_underwater",
              "subject": "self",
              "operator": "==",
              "value": true
            },
            "event": "minecraft:melee_mode"
          },
          {
            "filters": {
              "test": "has_ranged_weapon",
              "subject": "self",
              "operator": "==",
              "value": false
            },
            "event": "minecraft:melee_mode"
          }
        ]
      },
      "minecraft:despawn": {
        "despawn_from_distance": {}
      },
      "minecraft:behavior.ranged_attack": {
        "priority": 0,
        "attack_interval_min": 0.5,
        "attack_interval_max": 1.0,
        "attack_radius": 15.0
      },
         "minecraft:behavior.nearest_attackable_target":{
            "priority":2,
            "reselect_targets":true,
            "must_see":true,
            "within_radius":12.0,
            "must_see_forget_duration":17.0,
            "persist_time":0.5,
            "entity_types":[
               {
                  "filters":{
                     "all_of":[
                        {
                           "any_of":[
                              {
                                 "test":"is_family",
                                 "subject":"other",
                                 "value":"monster"
                              }
                           ]
                        }
                     ]
                  },
                  "max_dist":32
               }
            ]
         },
      "minecraft:behavior.avoid_mob_type": {
        "priority": 4,
        "entity_types": [
          {
            "filters": {
              "test": "is_family",
              "subject": "other",
              "value": "wolf"
            },
            "max_dist": 4,
            "walk_speed_multiplier": 1.2,
            "sprint_speed_multiplier": 1.2
          }
        ]
      },
      "minecraft:behavior.random_stroll": {
        "priority": 6,
        "speed_multiplier": 1
      },
      "minecraft:behavior.look_at_player": {
        "priority": 7,
        "look_distance": 8
      },
      "minecraft:behavior.random_look_around": {
        "priority": 8
      },
      "minecraft:physics": {
      },
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:conditional_bandwidth_optimization": {
      }
    },

    "events": {
      "minecraft:entity_spawned": {
        "add": {
          "component_groups": [
            "minecraft:ranged_attack"
          ]
        }
      },
      "minecraft:spring_trap": {
        "add": {
          "component_groups": [
            "minecraft:lightning_immune"
          ]
        }
      },
      "minecraft:melee_mode": {
        "remove": {
          "component_groups": [
            "minecraft:ranged_attack",
            "got_out_of_powder_snow_environment_sensor"
          ]
        },
        "add": {
          "component_groups": [
            "minecraft:melee_attack"
          ]
        }
      },
      "minecraft:ranged_mode": {
        "remove": {
          "component_groups": [
            "minecraft:melee_attack",
            "got_out_of_powder_snow_environment_sensor"
          ]
        },
        "add": {
          "component_groups": [
            "minecraft:ranged_attack"
          ]
        }
      }
    }
  }
}