{
	"format_version": "1.18.30",
	"minecraft:entity": {
		"description": {
			"identifier": "minecraft:zoglin",
			"is_spawnable": true,
			"is_summonable": true,
			"is_experimental": false,
			"properties": {
				"ldz:ice_overlay": {
					"type": "bool",
					"client_sync": true,
					"default": false
				}
			},
			"animations": {
				"ctrl.ice_timer": "controller.animation.vanilla.ice_timer",
				"ice_timer": "animation.vanilla.ice_timer",
				"ice_damage": "animation.vanilla.ice_damage"
			},
			"scripts": {
				"animate": [
					"ctrl.ice_timer"
				]
			}
		},
		"component_groups": {
			"ice_overlay": {
				"minecraft:is_shaking": {}
			},
			"zoglin_baby": {
				"minecraft:type_family": {
					"family": [
						"zoglin",
						"zoglin_baby",
						"undead",
						"mob"
					]
				},
				"minecraft:is_baby": {},
				"minecraft:attack": {
					"damage": 0.5
				},
				"minecraft:scale": {
					"value": 0.5
				},
				"minecraft:collision_box": {
					"width": 0.85,
					"height": 0.85
				},
				"minecraft:custom_hit_test": {
					"hitboxes": [
						{
							"width": 1,
							"height": 0.85,
							"pivot": [
								0,
								0.5,
								0
							]
						}
					]
				}
			},
			"zoglin_adult": {
				"minecraft:type_family": {
					"family": [
						"zoglin",
						"zoglin_adult",
						"undead",
						"mob"
					]
				},
				"minecraft:collision_box": {
					"width": 1.4,
					"height": 1.4
				},
				"minecraft:custom_hit_test": {
					"hitboxes": [
						{
							"width": 2,
							"height": 1.75,
							"pivot": [
								0,
								1,
								0
							]
						}
					]
				},
				"minecraft:behavior.hurt_by_target": {
					"priority": 1
				},
				"minecraft:attack": {
					"damage": [
						3,
						8
					]
				}
			},
			"instant_despawn": {
				"minecraft:instant_despawn": {}
			}
		},
		"components": {
			"minecraft:is_hidden_when_invisible": {},
			"minecraft:nameable": {},
			"minecraft:loot": {
				"table": "loot_tables/entities/zoglin.json"
			},
			"minecraft:experience_reward": {
				"on_bred": "Math.Random(1,7)",
				"on_death": "query.last_hit_by_player ? 5 : 0"
			},
			"minecraft:health": {
				"value": 40,
				"max": 40
			},
			"minecraft:knockback_resistance": {
				"value": 0.6
			},
			"minecraft:behavior.nearest_attackable_target": {
				"priority": 3,
				"within_radius": 16,
				"entity_types": [
					{
						"filters": {
							"all_of": [
								{
									"test": "is_family",
									"subject": "other",
									"operator": "!=",
									"value": "zoglin"
								},
								{
									"test": "is_family",
									"subject": "other",
									"operator": "!=",
									"value": "creeper"
								}
							]
						},
						"max_dist": 16
					}
				],
				"must_see": true
			},
			"minecraft:behavior.melee_attack": {
				"priority": 4,
				"reach_multiplier": 2.15, // Matches Java reach which is 3.0 blocks (collision_box:width * reach_multiplier)
				"speed_multiplier": 1.4,
				"track_target": true
			},
			"minecraft:breathable": {
				"total_supply": 15,
				"suffocate_time": 0,
				"breathes_water": true
			},
			"minecraft:movement": {
				"value": 0.25
			},
			"minecraft:navigation.walk": {
				"is_amphibious": true,
				"can_path_over_water": false,
				"avoid_water": true,
				"avoid_damage_blocks": true
			},
			"minecraft:movement.basic": {},
			"minecraft:jump.static": {},
			"minecraft:can_climb": {},
			"minecraft:fire_immune": {},
			"minecraft:leashable": {
				"soft_distance": 4,
				"hard_distance": 6,
				"max_distance": 10
			},
			"minecraft:balloonable": {},
			"minecraft:despawn": {
				"filters": {
					"any_of": [
						{
							"all_of": [
								{
									"test": "is_persistent",
									"value": false
								},
								{
									"test": "distance_to_nearest_player",
									"operator": ">",
									"value": 54
								}
							]
						},
						{
							"all_of": [
								{
									"test": "is_persistent",
									"value": false
								},
								{
									"test": "inactivity_timer",
									"subject": "self",
									"value": 30
								},
								{
									"test": "random_chance",
									"value": 800
								},
								{
									"test": "distance_to_nearest_player",
									"operator": ">",
									"value": 32
								}
							]
						}
					]
				}
			},
			"minecraft:behavior.random_stroll": {
				"priority": 7,
				"speed_multiplier": 1
			},
			"minecraft:behavior.random_look_around": {
				"priority": 9
			},
			"minecraft:behavior.look_at_player": {
				"priority": 8,
				"look_distance": 6,
				"probability": 0.02
			},
			"minecraft:physics": {},
			"minecraft:pushable": {
				"is_pushable": true,
				"is_pushable_by_piston": true
			},
			"minecraft:conditional_bandwidth_optimization": {}
		},
		"events": {
			"minecraft:entity_transformed": {
				"sequence": [
					{
						"filters": {
							"test": "has_component",
							"subject": "other",
							"value": "minecraft:is_baby"
						},
						"add": {
							"component_groups": [
								"zoglin_baby"
							]
						}
					},
					{
						"filters": {
							"test": "has_component",
							"subject": "other",
							"operator": "!=",
							"value": "minecraft:is_baby"
						},
						"add": {
							"component_groups": [
								"zoglin_adult"
							]
						}
					}
				]
			},
			"minecraft:entity_spawned": {
				"randomize": [
					{
						"weight": 95,
						"add": {
							"component_groups": [
								"zoglin_adult"
							]
						}
					},
					{
						"weight": 5,
						"add": {
							"component_groups": [
								"zoglin_baby"
							]
						}
					}
				]
			},
			"minecraft:as_adult": {
				"add": {
					"component_groups": [
						"zoglin_adult"
					]
				}
			},
			"minecraft:as_baby": {
				"add": {
					"component_groups": [
						"zoglin_baby"
					]
				}
			},
			"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"
					]
				}
			},
			"despawn": {
				"add": {
					"component_groups": [
						"instant_despawn"
					]
				}
			}
		}
	}
}