{
	"format_version": "1.21.0",
	"minecraft:entity": {
		"description": {
			"identifier": "manalabs_zombie:zombie",
			"is_spawnable": true,
			"is_summonable": true,
			"is_experimental": false,
			"properties": {
				"manalabs_zombie:torso": {
					"type": "int",
					"default": 1,
					"range": [0, 100],
					"client_sync": true
				},
				"manalabs_zombie:arm_left": {
					"type": "int",
					"default": 0,
					"range": [0, 100],
					"client_sync": true
				},
				"manalabs_zombie:arm_right": {
					"type": "int",
					"default": 0,
					"range": [0, 100],
					"client_sync": true
				},
				"manalabs_zombie:leg_left": {
					"type": "int",
					"default": 0,
					"range": [0, 100],
					"client_sync": true
				},
				"manalabs_zombie:leg_right": {
					"type": "int",
					"default": 0,
					"range": [0, 100],
					"client_sync": true
				},
				"manalabs_zombie:head": {
					"type": "int",
					"default": 0,
					"range": [0, 100],
					"client_sync": true
				},
				"manalabs_zombie:hair": {
					"type": "int",
					"default": 0,
					"range": [0, 100],
					"client_sync": true
				},
				"manalabs_zombie:clothes_top": {
					"type": "int",
					"default": 0,
					"range": [0, 100],
					"client_sync": true
				},
				"manalabs_zombie:clothes_bottom": {
					"type": "int",
					"default": 0,
					"range": [0, 100],
					"client_sync": true
				},
				"manalabs_zombie:overgrowth_arm_left": {
					"type": "int",
					"default": 0,
					"range": [0, 100],
					"client_sync": true
				},
				"manalabs_zombie:overgrowth_arm_right": {
					"type": "int",
					"default": 0,
					"range": [0, 100],
					"client_sync": true
				},
				"manalabs_zombie:overgrowth_leg_left": {
					"type": "int",
					"default": 0,
					"range": [0, 100],
					"client_sync": true
				},
				"manalabs_zombie:overgrowth_leg_right": {
					"type": "int",
					"default": 0,
					"range": [0, 100],
					"client_sync": true
				},
				"manalabs_zombie:digging_out": {
					"type": "bool",
					"client_sync": true,
					"default": true
				},
				"manalabs_zombie:amalgam": {
					"type": "bool",
					"client_sync": true,
					"default": false
				},
				"manalabs_zombie:amalgam_texture": {
					"type": "int",
					"default": 0,
					"range": [0, 1],
					"client_sync": true
				},
				"manalabs_zombie:is_natural_spawn": {
					"type": "bool",
					"default": false
				},
				"manalabs_zombie:has_a_chainsaw": {
					"type": "bool",
					"default": false,
					"client_sync": true
				},
				"manalabs_zombie:last_dmg_player": {
					"type": "bool",
					"default": false
				}
			},
			"animations": {
				"death": "controller.animation.manalabs_zombie.basic_zombie.death"
			},
			"scripts": {
				"animate": ["death"]
			}
		},
		"component_groups": {
			"manalabs_zombie:despawn": {
				"minecraft:instant_despawn": {}
			},
			"manalabs_zombie:dead": {
				"minecraft:movement": {
					"value": 0,
					"max": 0
				},
				"minecraft:pushable": {
					"is_pushable": false,
					"is_pushable_by_piston": false
				},
				"minecraft:collision_box": {
					"height": 0,
					"width": 0
				},
				"minecraft:body_rotation_blocked": {}
			},
			"manalabs_zombie:digging_out": {
				"minecraft:movement": {
					"value": 0,
					"max": 0
				},
				"minecraft:pushable": {
					"is_pushable": false,
					"is_pushable_by_piston": false
				},
				"minecraft:collision_box": {
					"height": 0,
					"width": 0
				},
				"minecraft:timer": {
					"time": 1.3,
					"looping": false,
					"time_down_event": {
						"event": "manalabs_zombie:stop_digging_out",
						"target": "self"
					}
				},
				"minecraft:body_rotation_blocked": {}
			},
			"manalabs_zombie:dug_out": {
				"minecraft:movement": {
					"value": 0.23,
					"max": 0.23
				},
				"minecraft:collision_box": {
					"width": 0.6,
					"height": 1.9
				},
				"minecraft:pushable": {
					"is_pushable": true,
					"is_pushable_by_piston": true
				}
			}
		},
		"components": {
			"minecraft:despawn": {
				"despawn_from_distance": {
					"min_distance": 64
				}
			},
			"minecraft:damage_sensor": {
				"triggers": [
					{
						"deals_damage": true,
						"on_damage": {
							"filters": [
								{
									"any_of": [
										{
											"test": "is_family",
											"subject": "other",
											"operator": "==",
											"value": "player"
										},
										{
											"test": "is_family",
											"subject": "damager",
											"operator": "==",
											"value": "manalabs_zombie_fire_charge_projectile"
										}
									]
								}
							],
							"target": "self",
							"event": "manalabs_zombie:last_dmg_player"
						}
					},
					{
						"deals_damage": true,
						"on_damage": {
							"filters": [
								{
									"test": "is_family",
									"subject": "other",
									"operator": "!=",
									"value": "player"
								}
							],
							"target": "self",
							"event": "manalabs_zombie:last_dmg_not_player"
						}
					}
				]
			},
			"minecraft:movement": {
				"value": 0.23,
				"max": 0.23
			},
			"minecraft:collision_box": {
				"width": 0.6,
				"height": 1.9
			},
			"minecraft:pushable": {
				"is_pushable": true,
				"is_pushable_by_piston": true
			},
			"minecraft:type_family": {
				"family": ["manalabs_zombie_zombie", "zombie", "undead", "monster", "mob"]
			},
			"minecraft:health": {
				"value": 15,
				"max": 15,
				"min": 1
			},
			"minecraft:burns_in_daylight": {},

			"minecraft:movement.basic": {},
			"minecraft:navigation.walk": {
				"is_amphibious": true,
				"can_pass_doors": true,
				"can_walk": true,
				"can_break_doors": true
			},
			"minecraft:jump.static": {},
			"minecraft:can_climb": {},

			"minecraft:breathable": {
				"total_supply": 15,
				"suffocate_time": 0,
				"breathes_air": true,
				"breathes_water": true
			},
			"minecraft:attack": {
				"damage": 1
			},
			"minecraft:is_hidden_when_invisible": {},
			"minecraft:behavior.melee_box_attack": {
				"can_spread_on_fire": true,
				"priority": 3
			},
			"minecraft:behavior.random_stroll": {
				"priority": 7,
				"speed_multiplier": 1
			},
			"minecraft:behavior.look_at_player": {
				"priority": 8,
				"look_distance": 6,
				"probability": 0.02
			},
			"minecraft:behavior.random_look_around": {
				"priority": 9
			},
			"minecraft:behavior.nearest_prioritized_attackable_target": {
				"priority": 0,
				"must_see": true,
				"reselect_targets": true,
				"within_radius": 25.0,
				"must_see_forget_duration": 17.0,
				"entity_types": [
					{
						"filters": {
							"test": "is_family",
							"subject": "other",
							"value": "manalabs_zombie_brain_jar_projectile"
						}
					}
				]
			},
			"minecraft:behavior.hurt_by_target": {
				"priority": 1,
				"alert_same_type": true,
				"hurt_owner": false,
				"entity_types": [
					{
						"filters": {
							"test": "is_family",
							"subject": "other",
							"value": "player"
						}
					}
				]
			},
			"minecraft:behavior.nearest_attackable_target": {
				"priority": 2,
				"must_see": true,
				"reselect_targets": true,
				"within_radius": 25.0,
				"must_see_forget_duration": 17.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"
								}
							]
						},
						"max_dist": 35
					},
					{
						"filters": {
							"any_of": [
								{
									"test": "is_family",
									"subject": "other",
									"value": "villager"
								},
								{
									"test": "is_family",
									"subject": "other",
									"value": "wandering_trader"
								}
							]
						},
						"max_dist": 35,
						"must_see": false
					},
					{
						"filters": {
							"all_of": [
								{
									"test": "is_family",
									"subject": "other",
									"value": "baby_turtle"
								},
								{
									"test": "in_water",
									"subject": "other",
									"operator": "!=",
									"value": true
								}
							]
						},
						"max_dist": 35
					}
				]
			},
			"minecraft:conditional_bandwidth_optimization": {},
			"minecraft:behavior.delayed_attack": {
				"attack_duration": 1,
				"attack_once": false,
				"hit_delay_pct": 0.5,
				"require_complete_path": true
			},
			"minecraft:physics": {},

			"minecraft:shareables": {
				"singular_pickup": true,
				"all_items": false,
				"all_items_max_amount": -1,
				"all_items_surplus_amount": -1,
				"all_items_want_amount": -1,
				"items": [
					{
						"item": "manalabs_zombie:machete",
						"max_amount": 1,
						"pickup_limit": 1,
						"priority": 0
					}
				]
			},
			"minecraft:behavior.equip_item": {
				"priority": 2
			},
			"minecraft:behavior.pickup_items": {
				"priority": 3,
				"pickup_same_items_as_in_hand": false,
				"can_pickup_any_item": false,
				"can_pickup_to_hand_or_equipment": true,
				"cooldown_after_being_attacked": true,
				"excluded_items": [],
				"goal_radius": 0.5,
				"max_dist": 10,
				"pickup_based_on_chance": false,
				"track_target": false
			},
			"minecraft:environment_sensor": {
				"triggers": [
					{
						"event": "manalabs_zombie:has_a_chainsaw",
						"target": "self",
						"filters": {
							"all_of": [
								{
									"test": "bool_property",
									"domain": "manalabs_zombie:has_a_chainsaw",
									"value": false
								},
								{
									"test": "has_equipment",
									"domain": "hand",
									"operator": "==",
									"value": "manalabs_zombie:chainsaw"
								}
							]
						}
					},
					{
						"event": "manalabs_zombie:no_chainsaw",
						"target": "self",
						"filters": {
							"all_of": [
								{
									"test": "bool_property",
									"domain": "manalabs_zombie:has_a_chainsaw",
									"value": true
								},
								{
									"test": "has_equipment",
									"domain": "hand",
									"operator": "!=",
									"value": "manalabs_zombie:chainsaw"
								}
							]
						}
					}
				]
			}
		},
		"events": {
			"manalabs_zombie:has_a_chainsaw": {
				"set_property": {
					"manalabs_zombie:has_a_chainsaw": true
				}
			},
			"manalabs_zombie:no_chainsaw": {
				"set_property": {
					"manalabs_zombie:has_a_chainsaw": false
				}
			},
			"minecraft:entity_spawned": {
				"sequence": [
					{
						"trigger": {
							"event": "manalabs_zombie:randomize_appearance",
							"target": "self"
						}
					},
					{
						"trigger": {
							"event": "manalabs_zombie:start_digging_out",
							"target": "self"
						}
					},
					{
						"randomize": [
							{
								"weight": 5,
								"queue_command": {
									"command": "replaceitem entity @s slot.weapon.mainhand 0 manalabs_zombie:machete"
								}
							},
							{
								"weight": 95
							}
						]
					}
				]
			},
			"manalabs_zombie:start_digging_out": {
				"add": {
					"component_groups": ["manalabs_zombie:digging_out"]
				},
				"remove": {
					"component_groups": ["manalabs_zombie:dug_out"]
				},
				"set_property": {
					"manalabs_zombie:digging_out": true
				}
			},
			"manalabs_zombie:stop_digging_out": {
				"remove": {
					"component_groups": ["manalabs_zombie:digging_out"]
				},
				"add": {
					"component_groups": ["manalabs_zombie:dug_out"]
				},
				"set_property": {
					"manalabs_zombie:digging_out": false
				}
			},
			"manalabs_zombie:randomize_appearance": {
				"set_property": {
					"manalabs_zombie:torso": 1,
					"manalabs_zombie:arm_left": "Math.random(0,3)",
					"manalabs_zombie:arm_right": "Math.random(0,3)",
					"manalabs_zombie:leg_left": "Math.random(0,3)",
					"manalabs_zombie:leg_right": "Math.random(0,3)",
					"manalabs_zombie:head": "Math.random(0,6)",
					"manalabs_zombie:hair": "Math.random(0,4)",
					"manalabs_zombie:clothes_top": "Math.random(0,4)",
					"manalabs_zombie:clothes_bottom": "Math.random(0,5)",
					"manalabs_zombie:overgrowth_arm_left": "Math.random(0,1)",
					"manalabs_zombie:overgrowth_arm_right": "Math.random(0,1)",
					"manalabs_zombie:overgrowth_leg_left": "Math.random(0,1)",
					"manalabs_zombie:overgrowth_leg_right": "Math.random(0,1)"
				}
			},
			"manalabs_zombie:despawn": {
				"add": {
					"component_groups": ["manalabs_zombie:despawn"]
				}
			},
			"manalabs_zombie:amalgam": {
				"trigger": "manalabs_zombie:start_digging_out",
				"set_property": {
					"manalabs_zombie:amalgam": true,
					"manalabs_zombie:amalgam_texture": "Math.random(0,1)"
				}
			},
			"manalabs_zombie:dead": {
				"add": {
					"component_groups": ["manalabs_zombie:dead"]
				}
			},
			"manalabs_zombie:natural_spawn": {
				"set_property": {
					"manalabs_zombie:is_natural_spawn": true
				},
				"trigger": "minecraft:entity_spawned"
			},
			"manalabs_zombie:last_dmg_player": {
				"set_property": {
					"manalabs_zombie:last_dmg_player": true
				}
			},
			"manalabs_zombie:last_dmg_not_player": {
				"set_property": {
					"manalabs_zombie:last_dmg_player": false
				}
			}
		}
	}
}
