{
	"format_version": "1.16.0",
	"minecraft:entity": {
		"description": {
			"identifier": "ldz:ender_wraith",
			"is_spawnable": true,
			"is_summonable": true,
			"is_experimental": false,
			"animations": {
				"effect": "animation.ender_wraith.effect",
				"attack_loop": "animation.ender_wraith.attack_loop",
				"summon_end_force_power_4": "animation.generic.summon_end_force_power_4",
				"ctrl.ice_timer": "controller.animation.vanilla.ice_timer",
				"ice_timer": "animation.vanilla.ice_timer",
				"ice_damage": "animation.vanilla.ice_damage"
			},
			"scripts": {
				"animate": [
					"effect",
					"ctrl.ice_timer",
					{
						"attack_loop": "q.facing_target_to_range_attack || q.property('ldz:is_shooting')"
					},
					{
						"summon_end_force_power_4": "!q.is_alive"
					}
				]
			},
			"properties": {
				"ldz:is_shooting": {
					"type": "bool",
					"default": false,
					"client_sync": true
				},
				"ldz:ice_overlay": {
					"type": "bool",
					"client_sync": true,
					"default": false
				}
			}
		},
		"component_groups": {
			"ice_overlay": {
				"minecraft:is_shaking": {}
			},
			"instant_despawn": {
				"minecraft:instant_despawn": {}
			},
			"spawn_projectile": {
				"minecraft:spawn_entity": {
					"entities": {
						"spawn_entity": "ldz:ender_wraith_projectile",
						"single_use": true,
						"max_wait_time": 0,
						"min_wait_time": 0,
						"num_to_spawn": 1
					}
				},
				"minecraft:timer": {
					"time": 0.1,
					"looping": false,
					"time_down_event": {
						"event": "remove_spawn_projectile"
					}
				}
			}
		},
		"components": {
			"minecraft:type_family": {
				"family": [
					"ldz",
					"ender",
					"ender_wraith",
					"monster",
					"mob"
				]
			},
			"minecraft:nameable": {},
			"minecraft:loot": {
				"table": "loot_tables/entities/ender_wraith.json"
			},
			"minecraft:health": {
				"value": 40,
				"max": 40
			},
			"minecraft:hurt_on_condition": {
				"damage_conditions": [
					{
						"filters": {
							"test": "in_lava",
							"subject": "self",
							"operator": "==",
							"value": true
						},
						"cause": "lava",
						"damage_per_tick": 4
					}
				]
			},
			"minecraft:attack": {
				"damage": 7
			},
			"minecraft:follow_range": {
				"value": 20,
				"max": 20
			},
			"minecraft:collision_box": {
				"width": 0.6,
				"height": 2.4
			},
			"minecraft:navigation.walk": {
				"can_path_over_water": false,
				"avoid_water": true
			},
			"minecraft:movement.basic": {},
			"minecraft:movement": {
				"value": 0.25
			},
			"minecraft:jump.static": {},
			"minecraft:can_climb": {},
			"minecraft:behavior.float": {
				"priority": 0
			},
			"minecraft:behavior.hurt_by_target": {
				"priority": 1,
				"entity_types": [
					{
						"filters": {
							"test": "is_family",
							"value": "wraith"
						}
					}
				]
			},
			"minecraft:behavior.nearest_prioritized_attackable_target": {
				"priority": 0,
				"attack_interval": 0,
				"must_reach": true,
				"must_see": true,
				"must_see_forget_duration": 3,
				"persist_time": 0,
				"reselect_targets": true,
				"scan_interval": 10,
				"set_persistent": false,
				"target_search_height": -1,
				"within_radius": 0,
				"entity_types": [
					{
						"filters": {
							"any_of": [
								{
									"test": "is_family",
									"subject": "other",
									"value": "player"
								},
								{
									"test": "is_family",
									"subject": "other",
									"value": "snowgolem"
								},
								{
									"test": "is_family",
									"subject": "other",
									"value": "irongolem"
								},
								{
									"test": "is_family",
									"subject": "other",
									"value": "wandering_trader"
								}
							]
						},
						"max_dist": 20
					},
					{
						"filters": {
							"all_of": [
								{
									"test": "is_family",
									"subject": "other",
									"value": "villager"
								},
								{
									"test": "has_component",
									"subject": "other",
									"operator": "!=",
									"value": "minecraft:is_baby"
								}
							]
						},
						"max_dist": 20
					}
				]
			},
			"minecraft:behavior.ranged_attack": {
				"attack_radius_min": 6,
				"priority": 3,
				"attack_interval_min": 4,
				"attack_interval_max": 8,
				"charge_shoot_trigger": 0.5,
				"attack_radius": 2
			},
			"minecraft:behavior.move_towards_target": {
				"priority": 4,
				"within_radius": 8
			},
			"minecraft:behavior.avoid_mob_type": {
				"max_dist": 1,
				"max_flee": 2,
				"priority": 1,
				"walk_speed_multiplier": 2.5,
				"sprint_speed_multiplier": 2.5,
				"probability_per_strength": 1,
				"ignore_visibility": false,
				"remove_target": true,
				"entity_types": [
					{
						"filters": {
							"any_of": [
								{
									"test": "is_family",
									"subject": "other",
									"value": "player"
								}
							]
						},
						"max_dist": 1
					}
				]
			},
			"minecraft:mob_effect": {
				"effect_range": 2,
				"mob_effect": "wither",
				"effect_time": 3,
				"entity_filter": {
					"any_of": [
						{
							"all_of": [
								{
									"test": "is_family",
									"subject": "other",
									"value": "player"
								},
								{
									"test": "has_ability",
									"subject": "other",
									"operator": "!=",
									"value": "instabuild"
								},
								{
									"test": "enum_property",
									"domain": "ldz:morph",
									"subject": "other",
									"operator": "!=",
									"value": "wraith"
								}
							]
						}
					]
				}
			},
			"minecraft:behavior.random_stroll": {
				"priority": 4,
				"interval": 70,
				"speed_multiplier": 1
			},
			"minecraft:behavior.look_at_player": {
				"priority": 8,
				"look_distance": 16,
				"probability": 1
			},
			"minecraft:behavior.random_look_around": {
				"priority": 6
			},
			"minecraft:environment_sensor": {
				"triggers": [
					{
						"filters": {
							"any_of": [
								{ "test": "is_difficulty", "value": "peaceful" },
								{ "test": "distance_to_nearest_player", "operator": ">=", "value": 70 }
							]
						},
						"event": "despawn"
					}
				]
			},
			"minecraft:damage_sensor": {
				"triggers": [
					{
						"cause": "wither",
						"deals_damage": false
					},
					{
						"on_damage": {
							"filters": {
								"test": "has_damage",
								"value": "void"
							},
							"event": "despawn"
						},
						"deals_damage": false
					},
					{
						"on_damage": {
							"filters": {
								"any_of":[
									{ "test": "has_equipment", "subject": "other", "domain": "hand", "value": "minecraft:iron_axe" },
									{ "test": "has_equipment", "subject": "other", "domain": "hand", "value": "minecraft:iron_sword" },
									{ "test": "has_equipment", "subject": "other", "domain": "hand", "value": "minecraft:gold_sword" },
									{ "test": "has_equipment", "subject": "other", "domain": "hand", "value": "minecraft:diamond_sword" },
									{ "test": "has_equipment", "subject": "other", "domain": "hand", "value": "minecraft:netherite_sword" }
								]
							}
						},
						"damage_multiplier": 0.75
					},
					{
						"on_damage": {
							"filters": {
								"test": "is_family",
								"subject": "other",
								"value": "player_lord_wisp"
							},
							"target": "other",
							"event": "add_1_to_hits"
						}
					},
					{
						"on_damage": {
							"filters": {
								"any_of": [
									{ "test": "is_family", "subject": "other", "value": "ender_wraith_projectile" },
									{ "test": "is_family", "subject": "other", "value": "ender_wraith" },
									{ "test": "is_family", "subject": "other", "value": "ender_wraith_puddle" }
								]
							}
						},
						"deals_damage": false
					}
				]
			},
			"minecraft:physics": {},
			"minecraft:pushable": {
				"is_pushable": true,
				"is_pushable_by_piston": true
			},
			"minecraft:despawn": {
				"despawn_from_distance": {}
			},
			"minecraft:behavior.look_at_target": {
				"priority": 4,
				"look_distance": 6,
				"probability": 1
			}
		},
		"events": {
			"add_spawn_projectile": {
				"add": {
					"component_groups": [
						"spawn_projectile"
					]
				}
			},
			"remove_spawn_projectile": {
				"remove": {
					"component_groups": [
						"spawn_projectile"
					]
				}
			},
			"set_is_shooting_to_true": {
				"set_property": {
					"ldz:is_shooting": true
				}
			},
			"set_is_shooting_to_false": {
				"set_property": {
					"ldz:is_shooting": false
				}
			},
			"despawn": {
				"add": {
					"component_groups": [
						"instant_despawn"
					]
				}
			},
			"set_ice_overlay_to_true": {
				"set_property": {
					"ldz:ice_overlay": true
				},
				"add": {
					"component_groups": [
						"ice_overlay"
					]
				}
			},
			"set_ice_overlay_to_false": {
				"set_property": {
					"ldz:ice_overlay": false
				},
				"remove": {
					"component_groups": [
						"ice_overlay"
					]
				}
			}
		}
	}
}