{
	"format_version": "1.16.0",
	"minecraft:entity": {
		"description": {
			"identifier": "ldz:tutorial_enderman",
			"is_spawnable": false,
			"is_summonable": true,
			"is_experimental": false,
			"animations": {
				"summon_end_force_power_2": "animation.generic.summon_end_force_power_2",

				"patrol": "animation.tutorial_enderman.patrol",
				"random_teleport": "animation.tutorial_enderman.random_teleport",
				"random_teleport_timer": "animation.tutorial_enderman.random_teleport_timer",
				"water_damage": "animation.tutorial_enderman.water_damage",
				"summon_backup": "animation.tutorial_enderman.summon_backup",

				"ctrl.states": "controller.animation.tutorial_enderman.states"
			},
			"scripts": {
				"animate": [
					"ctrl.states",
					{ "patrol": "q.property('ldz:patrol')" },
					{ "summon_backup": "!q.is_alive" },
					{ "summon_end_force_power_2": "!q.is_alive" }
				]
			},
			"properties": {
				"ldz:patrol": {
					"type": "bool",
					"default": false,
					"client_sync": true
				},
				"ldz:ice_overlay": { // This is here only to prevent an error
					"type": "bool",
					"default": false,
					"client_sync": true
				}
			}
		},
		"component_groups": {
			"despawn": {
				"minecraft:instant_despawn": {}
			},
				"minecraft:enderman_calm": {
				"minecraft:on_target_acquired": {
					"event": "minecraft:become_angry",
					"target": "self"
				},
				"minecraft:movement": {
					"value": 0.3
				}
			},
			"minecraft:enderman_angry": {
				"minecraft:angry": {
					"duration": 60,
					"calm_event": {
						"event": "minecraft:on_calm",
						"target": "self"
					}
				},
				"minecraft:movement": {
					"value": 0.45
				},
				"minecraft:behavior.melee_attack": {
					"priority": 2
				},
				"minecraft:is_ignited": {}
			},
			"jump": {
				"minecraft:jump.static": {}
			},
			"no_movement": {
				"minecraft:movement": {
					"value": 0.0
				}
			},
			"random_look_stroll": {
				"minecraft:behavior.random_stroll": {
					"priority": 7,
					"speed_multiplier": 1
				},
				"minecraft:behavior.random_look_around": {
					"priority": 8
				}
			}
		},
		"components": {
			"minecraft:type_family": {
				"family": [
					"ldz",
					"tutorial_enderman"
				]
			},
			"minecraft:health": {
				"value": 5,
				"max": 5
			},
			"minecraft:loot": {
				"table": "loot_tables/entities/enderman.json"
			},
			"minecraft:hurt_on_condition": {
				"damage_conditions": [
					{
						"filters": {
							"test": "in_lava",
							"subject": "self",
							"operator": "==",
							"value": true
						},
						"cause": "lava",
						"damage_per_tick": 4
					},
					{
						"filters": {
							"test": "in_contact_with_water",
							"operator": "==",
							"value": true
						},
						"cause": "drowning",
						"damage_per_tick": 1
					}
				]
			},
			"minecraft:attack": {
				"damage": 1
			},
			"minecraft:follow_range": {
				"value": 64,
				"max": 64
			},
			"minecraft:collision_box": {
				"width": 0.6,
				"height": 2.9
			},
			"minecraft:lookat": {
				"search_radius": 64,
				"set_target": true,
				"look_cooldown": 5,
				"filters": {
					"all_of": [
						{
							"subject": "other",
							"test": "is_family",
							"value": "player"
						},
						{
							"test": "has_equipment",
							"domain": "head",
							"subject": "other",
							"operator": "not",
							"value": "carved_pumpkin"
						}
					]
				}
			},
			"minecraft:behavior.nearest_attackable_target": {
				"priority": 5,
				"must_see": true,
				"attack_interval": 10,
				"entity_types": [
					{
						"filters": {
							"test": "is_family",
							"subject": "other",
							"value": "endermite"
						},
						"max_dist": 64
					}
				]
			},
			"minecraft:navigation.walk": {
				"can_path_over_water": false,
				"avoid_water": true
			},
			"minecraft:movement.basic": {},
			"minecraft:jump.static": {},
			"minecraft:can_climb": {},
			"minecraft:behavior.float": {
				"priority": 0
			},
			"minecraft:behavior.random_stroll": {
				"priority": 7,
				"speed_multiplier": 1
			},
			"minecraft:behavior.random_look_around": {
				"priority": 8
			},
			"minecraft:behavior.hurt_by_target": {
				"priority": 3
			},
			"minecraft:physics": {},
			"minecraft:pushable": {
				"is_pushable": true,
				"is_pushable_by_piston": true
			}
		},
		"events": {
			"despawn": {
				"add": {
					"component_groups": [
						"despawn"
					]
				}
			},
			"minecraft:entity_spawned": {
				"remove": {},
				"add": {
					"component_groups": [
						"minecraft:enderman_calm"
					]
				}
			},
			"minecraft:become_angry": {
				"set_property": {
					"ldz:patrol": false
				},
				"remove": {
					"component_groups": [
						"minecraft:enderman_calm"
					]
				},
				"add": {
					"component_groups": [
						"minecraft:enderman_angry",
						"random_look_stroll"
					]
				}
			},
			"minecraft:on_calm": {
				"remove": {
					"component_groups": [
						"minecraft:enderman_angry"
					]
				},
				"add": {
					"component_groups": [
						"minecraft:enderman_calm"
					]
				}
			},
			"stop_moving": {
				"remove":{ "component_groups": [ "jump" ] },
				"add": { "component_groups": [ "no_movement" ] }
			},
			"patrol": {
				"set_property": {
					"ldz:patrol": true
				},
				"remove": {
					"component_groups": [
						"random_look_stroll"
					]
				},
				"add": {
					"component_groups": [
						"minecraft:enderman_calm"
					]
				}
			}
		}
	}
}