{
	"format_version": "1.20.80",
	"minecraft:entity": {
		"description": {
			"identifier": "manalabs_zombie:amalgam",
			"is_spawnable": true,
			"is_summonable": true,
			"is_experimental": false,
			"animations": {
				"death": "controller.animation.manalabs_zombie.amalgam.death"
			},
			"scripts": {
				"animate": ["death"]
			},
			"properties": {
				"manalabs_zombie:digging_out": {
					"type": "bool",
					"client_sync": true,
					"default": true
				},
				"manalabs_zombie:last_dmg_player": {
					"type": "bool",
					"default": false
				}
			}
		},
		"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
				},
				"minecraft:pushable": {
					"is_pushable": false,
					"is_pushable_by_piston": false
				},
				"minecraft:collision_box": {
					"height": 0,
					"width": 0
				},
				"minecraft:timer": {
					"time": 11.25,
					"looping": false,
					"time_down_event": {
						"event": "manalabs_zombie:stop_digging_out",
						"target": "self"
					}
				},
				"minecraft:body_rotation_blocked": {}
			},
			"manalabs_zombie:dug_out": {
				"minecraft:pushable": {
					"is_pushable": false,
					"is_pushable_by_piston": false
				},
				"minecraft:movement": {
					"value": 0.2
				},
				"minecraft:collision_box": {
					"height": 3,
					"width": 2.5
				}
			},
			"manalabs_zombie:knockback_attack": {
				"minecraft:behavior.knockback_roar": {
					"priority": 0,
					"attack_time": 0.6,
					"cooldown_time": 10,
					"duration": 1.5,
					"knockback_damage": 5,
					"knockback_horizontal_strength": 4,
					"knockback_range": 4,
					"knockback_vertical_strength": 2,
					"damage_filters": {
						"test": "is_family",
						"subject": "other",
						"value": "player"
					},
					"knockback_filters": {
						"test": "is_family",
						"subject": "other",
						"value": "player"
					},
					"on_roar_end": {
						"event": "manalabs_zombie:knockback_attack_end",
						"target": "self"
					}
				}
			},
			"manalabs_zombie:summon_attack_cooldown": {
				"minecraft:timer": {
					"time": 10,
					"looping": true,
					"time_down_event": {
						"event": "manalabs_zombie:summon_attack",
						"target": "self"
					}
				}
			},
			"manalabs_zombie:summon_attack": {
				"minecraft:timer": {
					"time": [20, 40],
					"looping": true,
					"time_down_event": {
						"event": "manalabs_zombie:knockback_attack",
						"target": "self"
					}
				},
				"minecraft:behavior.summon_entity": {
					"priority": 0,
					"summon_choices": [
						{
							"weight": 1,
							"cast_duration": 1,
							"cooldown_time": 6,
							"do_casting": true,
							"min_activation_range": 5,
							"max_activation_range": 512,
							"sequence": [
								{
									"base_delay": 0.75,
									"entity_type": "manalabs_zombie:zombie<manalabs_zombie:amalgam>",
									"entity_lifespan": -1,
									"num_entities_spawned": 1,
									"shape": "line",
									"target": "self",
									"size": 1,
									"summon_cap": 10,
									"summon_cap_radius": 100
								}
							]
						}
					]
				}
			}
		},
		"components": {
			"minecraft:persistent": {},
			"minecraft:burns_in_daylight": {},
			"minecraft:type_family": {
				"family": ["manalabs_zombie_amalgam", "zombie", "undead", "monster", "mob"]
			},
			"minecraft:boss": {
				"hud_range": 55,
				"name": "Amalgam",
				"should_darken_sky": true
			},
			"minecraft:health": {
				"value": 400,
				"max": 400,
				"min": 1
			},

			"minecraft:breathable": {
				"total_supply": 15,
				"breathes_air": true
			},
			"minecraft:physics": {
				"has_collision": true,
				"has_gravity": true
			},
			"minecraft:knockback_resistance": {
				"value": 100
			},
			"minecraft:movement.generic": {
				"max_turn": 10
			},
			"minecraft:navigation.walk": {
				"avoid_damage_blocks": false,
				"avoid_portals": false,
				"avoid_sun": false,
				"avoid_water": true,
				"blocks_to_avoid": [],
				"can_breach": false,
				"can_break_doors": false,
				"can_jump": true,
				"can_open_doors": false,
				"can_open_iron_doors": false,
				"can_pass_doors": false,
				"can_path_from_air": false,
				"can_path_over_lava": false,
				"can_path_over_water": false,
				"can_sink": true,
				"can_swim": false,
				"can_walk": true,
				"can_walk_in_lava": false,
				"is_amphibious": false
			},
			"minecraft:jump.static": {
				"jump_power": 0.46
			},
			"minecraft:behavior.random_stroll": {
				"priority": 4,
				"interval": 20,
				"speed_multiplier": 0.5
			},
			"minecraft:follow_range": {
				"value": 32
			},
			"minecraft:behavior.nearest_attackable_target": {
				"priority": 2,
				"must_reach": false,
				"must_see": false,
				"must_see_forget_duration": 3,
				"reselect_targets": true,
				"entity_types": [
					{
						"filters": {
							"test": "is_family",
							"subject": "other",
							"value": "player"
						}
					},
					{
						"filters": {
							"any_of": [
								{
									"test": "is_family",
									"subject": "other",
									"value": "villager"
								},
								{
									"test": "is_family",
									"subject": "other",
									"value": "wandering_trader"
								}
							]
						},
						"max_dist": 35,
						"must_see": false
					}
				]
			},
			"minecraft:attack": {
				"damage": 7
			},
			"minecraft:behavior.delayed_attack": {
				"priority": 1,
				"attack_duration": 1,
				"attack_once": false,
				"hit_delay_pct": 0.5,
				"reach_multiplier": 3,
				"require_complete_path": true
			},
			"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"
						}
					}
				]
			}
		},
		"events": {
			"minecraft:entity_spawned": {
				"sequence": [
					{
						"trigger": {
							"event": "manalabs_zombie:start_digging_out",
							"target": "self"
						}
					}
				]
			},
			"manalabs_zombie:despawn": {
				"add": {
					"component_groups": ["manalabs_zombie:despawn"]
				}
			},
			"manalabs_zombie:knockback_attack_end": {
				"remove": {
					"component_groups": ["manalabs_zombie:knockback_attack"]
				},
				"add": {
					"component_groups": ["manalabs_zombie:summon_attack_cooldown"]
				}
			},
			"manalabs_zombie:summon_attack": {
				"remove": {
					"component_groups": ["manalabs_zombie:summon_attack_cooldown"]
				},
				"add": {
					"component_groups": ["manalabs_zombie:summon_attack"]
				}
			},
			"manalabs_zombie:knockback_attack": {
				"add": {
					"component_groups": ["manalabs_zombie:knockback_attack"]
				},
				"remove": {
					"component_groups": ["manalabs_zombie:summon_attack"]
				}
			},
			"manalabs_zombie:dead": {
				"add": {
					"component_groups": ["manalabs_zombie:dead"]
				}
			},
			"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", "manalabs_zombie:summon_attack"]
				},
				"set_property": {
					"manalabs_zombie:digging_out": false
				}
			},
			"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
				}
			}
		}
	}
}
