{
  "format_version": "1.16.0",
  "minecraft:entity": {
    "description": {
      "identifier": "hostile:abyssal_wisp",
      "is_spawnable": false,
      "is_summonable": true,
      "is_experimental": true
    },
    "component_groups": {
      "despawn": {
        "minecraft:instant_despawn": {}
      },
      "despawn_timer": {
        "minecraft:timer": {
          "looping": true,
          "time": 0.25,
          "time_down_event": {
            "event": "despawn"
          }
        }
      },
      "tamed": {
        "minecraft:timer": {
          "looping": true,
          "time": [5,7],
          "time_down_event": {
            "event": "despawn"
          }
        },
        "minecraft:target_nearby_sensor": {
          "inside_range": 0.05,
          "must_see": false,
          "on_inside_range": {
            "event": "stun"
          }
        },
        "minecraft:is_tamed": {
        },
        "minecraft:behavior.teleport_to_owner": {
          "priority": 1,
          "filters": {
            "all_of": [
              {
                "test": "owner_distance",
                "operator": ">",
                "value": 50
              },
              {
                "test": "has_target",
                "value": false
              }
            ]
          }
        },
        "minecraft:behavior.owner_hurt_by_target": {
          "priority": 1
        },
        "minecraft:behavior.owner_hurt_target": {
          "priority": 2
        },
        "minecraft:behavior.follow_owner": {
          "priority": 6,
          "speed_multiplier": 1.0,
          "start_distance": 55,
          "stop_distance": 1,
          "filters": {
            "all_of": [
              {
                "test": "has_target",
                "value": false
              }
            ]
          }
        }
      },
      "minecraft:start_damage_timer": {
        "minecraft:timer": {
          "looping": false,
          "randomInterval": true,
          "time": [ 30, 119 ],
          "time_down_event": {
            "event": "minecraft:add_periodic_damage"
          }
        }
      },
      "minecraft:periodic_damage": {
        "minecraft:damage_over_time": {
          "damage_per_hurt": 1,
          "time_between_hurt": 1.0
        }
      }
    },
    "components": {
      "minecraft:behavior.nearest_attackable_target": {
        "priority": 3,
        "must_see": true,
        "reselect_targets": true,
        "within_radius": 20,
        "must_see_forget_duration": 100.0,
        "entity_types": [
          {
            "filters": {
              "any_of": [
              {
                "all_of": [
                  {
                    "test": "is_family",
                    "subject": "other",
                    "operator": "!=",
                    "value": "illager"
                  },
                  {
                    "test": "is_family",
                    "subject": "other",
                    "operator": "!=",
                    "value": "wisp"
                  }
                  ]
              }
                ]
            },
            "max_dist": 30
          }
        ]
      },
        "minecraft:behavior.random_stroll": {
          "priority": 3,
          "speed_multiplier": 0.75
        },
        "minecraft:tameable": {
          "probability": 0.03,
          "tame_items": "bone",
          "tame_event": {
            "event": "tamed"
          }
        },
      "minecraft:is_hidden_when_invisible": {
      },
      "minecraft:experience_reward": {
        "on_death": "query.last_hit_by_player ? 5 + (query.equipment_count * Math.Random(1,3)) : 0"
      },
      "minecraft:nameable": {
      },
      "minecraft:type_family": {
        "family": [ "wisp", "misc", "mob", "illager", "pet" ]
      },
      "minecraft:health": {
        "value": 10000,
        "max": 10000
      },
      "minecraft:attack": {
        "damage": 20
      },
      "minecraft:collision_box": {
        "width": 0.05,
        "height": 0.05
      },
      "minecraft:movement": {
        "value": 0.3
      },
      "minecraft:flying_speed": {
        "value": 0.3
      },
      "minecraft:navigation.hover": {
        "can_path_over_water": true,
        "can_pass_doors": true,
        "can_path_from_air": true
      },
      "minecraft:movement.basic": {
      },
      "minecraft:jump.static": {
      },
      "minecraft:can_fly": {
      },
      "minecraft:fire_immune": {
      },
      "minecraft:despawn": {
        "despawn_from_distance": {}
      },
      "minecraft:behavior.float": {
        "priority": 0
      },
      "minecraft:behavior.charge_attack": {
        "priority": 0,
        "max_distance": 55,
        "min_distance": 0.01,
        "speed_multiplier": 3,
        "success_rate": 5.0
      },
      "minecraft:behavior.look_at_player": {
        "priority": 9,
        "look_distance": 6.0,
        "probability": 0.02
      },
      "minecraft:behavior.look_at_entity": {
        "priority": 9,
        "look_distance": 6.0,
        "probability": 0.02
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 1
      },
      "minecraft:physics": {
        "has_gravity": false,
        "has_collision": true
      },
      "minecraft:conditional_bandwidth_optimization": {
      },
      "minecraft:game_event_movement_tracking": {
        "emit_move": false,
        "emit_swim": false
      }
    },
    "events": {
      "despawn": {
        "add": {
          "component_groups": [
            "despawn"
          ]
        }
      },
      "stun": {
        "sequence": [
          {
            "queue_command": {
              "command": [
                "tp @e[c=1,type=hostile:abyssal_wisp] @s"
                ],
              "target": "target"
            }
          },
          {
            "queue_command": {
              "command": [
                "scoreboard players set @e[r=1.25,scores={block=0,parry=0}] stun 5",
                "damage @e[tag=!iframes,r=1.25,scores={block=0,parry=0}] 10 magic"
                ]
            }
          },
          {
            "add": {
              "component_groups": [
                "despawn_timer"
                ]
            }
          }
          ]
      },
      "tamed": {
        "queue_command": {
          "command": [
            "spreadplayers ~ ~ 2 3 @s"
            ]
        },
        "add": {
          "component_groups": [
            "tamed"
            ]
        }
      },
      "minecraft:add_damage_timer": {
        "add": {
          "component_groups": [ "minecraft:start_damage_timer" ]
        }
      },
      "minecraft:add_periodic_damage": {
        "add": {
          "component_groups": [ "minecraft:periodic_damage" ]
        },
        "remove": {
          "component_groups": [ "minecraft:start_damage_timer" ]
        }
      }
    }
  }
}
