{
	"format_version": "1.21.0",
	"minecraft:entity": {
		"description": {
			"identifier": "manalabs_zombie:demolisher",
			"is_spawnable": true,
			"is_summonable": true,
			"is_experimental": false,

			"animations": {
				"ac.knockback": "controller.animation.manalabs_zombie.demolisher.knockback",
				"ac.death": "controller.animation.manalabs_zombie.demolisher.death"
			},
			"scripts": {
				"animate": ["ac.knockback", "ac.death"]
			},
			"properties": {
				"manalabs_zombie:digging_out": {
					"type": "bool",
					"client_sync": true,
					"default": true
				},
				"manalabs_zombie:is_natural_spawn": {
					"type": "bool",
					"default": false
				},
				"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:knockback_roar": {
				"minecraft:behavior.knockback_roar": {
					"priority": 0,
					"attack_time": 0.1,
					"cooldown_time": 0,
					"duration": 0.1,
					"knockback_damage": 3,
					"knockback_horizontal_strength": 3,
					"knockback_range": 4,
					"knockback_vertical_strength": 3,
					"damage_filters": {
						"test": "is_family",
						"subject": "other",
						"value": "player"
					},
					"knockback_filters": {
						"test": "is_family",
						"subject": "other",
						"value": "player"
					},
					"on_roar_end": {
						"event": "manalabs_zombie:remove_knockback_roar",
						"target": "self"
					}
				}
			},
			"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:behavior.timer_flag_1": {
					"priority": 0,
					"cooldown_range": [0, 0],
					"duration_range": [1.65, 1.65],
					"on_end": {
						"event": "manalabs_zombie:stop_digging_out",
						"target": "self"
					}
				}
			},
			"manalabs_zombie:dug_out": {
				"minecraft:pushable": {
					"is_pushable": false,
					"is_pushable_by_piston": false
				},
				"minecraft:collision_box": {
					"height": 2,
					"width": 1.5
				},
				"minecraft:movement": {
					"value": 0.27
				}
			},
			"manalabs_zombie:charge_attack_cooldown": {
				// If editing, be sure to copy to the component group below
				"minecraft:attack": {
					"damage": 10
				},
				"minecraft:behavior.delayed_attack": {
					"priority": 1,
					"attack_duration": 1.1,
					"attack_once": false,
					"hit_delay_pct": 0.5,
					"random_stop_interval": 0,
					"reach_multiplier": 2,
					"require_complete_path": true,
					"speed_multiplier": 1
				},
				"minecraft:timer": {
					"time": 10,
					"looping": true,
					"time_down_event": {
						"event": "manalabs_zombie:melee_attack",
						"target": "self"
					}
				}
			},
			"manalabs_zombie:melee_attack": {
				// If editing, be sure to copy to the component group above
				"minecraft:attack": {
					"damage": 10
				},
				"minecraft:behavior.delayed_attack": {
					"priority": 1,
					"attack_duration": 1.1,
					"attack_once": false,
					"hit_delay_pct": 0.5,
					"random_stop_interval": 0,
					"reach_multiplier": 2,
					"require_complete_path": true,
					"speed_multiplier": 1
				},
				"minecraft:environment_sensor": {
					"triggers": [
						{
							"event": "manalabs_zombie:charge_attack",
							"target": "self",
							"filters": {
								"test": "target_distance",
								"operator": ">=",
								"value": 5
							}
						}
					]
				}
			},
			"manalabs_zombie:charge_attack": {
				"minecraft:attack": {
					"damage": 0
				},
				"minecraft:area_attack": {
					"damage_per_tick": 2,
					"damage_range": 1,
					"cause": "entity_attack",
					"entity_filter": {
						"test": "is_family",
						"subject": "other",
						"value": "player"
					}
				},
				"minecraft:behavior.charge_attack": {
					"priority": 0,
					"speed_multiplier": 2.5,
					"max_distance": 15,
					"min_distance": 5,
					"success_rate": 1
				},
				"minecraft:break_blocks": {
					"breakable_blocks": [
						// These are NOT identifiers. Well, they are, but the legacy ones from 1.12.2 and below it seems
						"minecraft:stone", // stone, but also andesite, diorite, granite, etc.
						"minecraft:grass",
						"minecraft:dirt",
						"minecraft:podzol",
						"minecraft:cobblestone",
						"minecraft:planks",
						"minecraft:sapling",
						"minecraft:sand",
						"minecraft:gravel",
						"minecraft:gold_ore",
						"minecraft:iron_ore",
						"minecraft:coal_ore",
						"minecraft:log",
						"minecraft:log2",
						"minecraft:leaves",
						"minecraft:leaves2",
						"minecraft:glass",
						"minecraft:lapis_ore",
						"minecraft:lapis_block",
						"minecraft:sandstone",
						"minecraft:web",
						"minecraft:tallgrass",
						"minecraft:deadbush",
						"minecraft:seagrass",
						"minecraft:sea_pickle",
						"minecraft:wool",
						"minecraft:yellow_flower",
						"minecraft:red_flower",
						"minecraft:brown_mushroom",
						"minecraft:red_mushroom",
						"minecraft:wooden_slab",
						"minecraft:stone_slab",
						"minecraft:stone_slab2",
						"minecraft:double_stone_slab",
						"minecraft:smooth_red_sandstone",
						"minecraft:smooth_sandstone",
						"minecraft:brick_block",
						"minecraft:tnt",
						"minecraft:bookshelf",
						"minecraft:mossy_cobblestone",
						"minecraft:torch",
						"minecraft:oak_stairs",
						"minecraft:chest",
						"minecraft:diamond_ore",
						"minecraft:crafting_table",
						"minecraft:furnace",
						"minecraft:ladder",
						"minecraft:stone_stairs",
						"minecraft:redstone_ore",
						"minecraft:snow",
						"minecraft:ice",
						"minecraft:cactus",
						"minecraft:clay",
						"minecraft:jukebox",
						"minecraft:fence",
						"minecraft:pumpkin",
						"minecraft:netherrack",
						"minecraft:soul_sand",
						"minecraft:glowstone",
						"minecraft:lit_pumpkin",
						"minecraft:iron_trapdoor",
						"minecraft:trapdoor",
						"minecraft:birch_door",
						"minecraft:spruce_door",
						"minecraft:jungle_door",
						"minecraft:acacia_door",
						"minecraft:dark_oak_door",
						"minecraft:monster_egg",
						"minecraft:stonebrick",
						"minecraft:brown_mushroom_block",
						"minecraft:red_mushroom_block",
						"minecraft:iron_bars",
						"minecraft:glass_pane",
						"minecraft:melon_block",
						"minecraft:vine",
						"minecraft:fence_gate",
						"minecraft:brick_stairs",
						"minecraft:stone_brick_stairs",
						"minecraft:mycelium",
						"minecraft:waterlily",
						"minecraft:nether_brick",
						"minecraft:nether_brick_fence",
						"minecraft:nether_brick_stairs",
						"minecraft:sandstone_stairs",
						"minecraft:emerald_ore",
						"minecraft:cobblestone_wall",
						"minecraft:trapped_chest",
						"minecraft:stained_hardened_clay",
						"minecraft:carpet",
						"minecraft:hardened_clay",
						"minecraft:grass_path",
						"minecraft:double_plant",
						"minecraft:stained_glass",
						"minecraft:stained_glass_pane",
						"minecraft:prismarine",
						"minecraft:sea_lantern",
						"minecraft:red_sandstone",
						"minecraft:red_sandstone_stairs",
						"minecraft:magma",
						"minecraft:nether_wart_block",
						"minecraft:red_nether_brick",
						"minecraft:bone_block",
						"minecraft:concrete",
						"minecraft:concrete_powder",
						"minecraft:iron_door",
						"minecraft:wooden_door",
						"minecraft:birch_door",
						"minecraft:spruce_door",
						"minecraft:jungle_door",
						"minecraft:acacia_door",
						"minecraft:dark_oak_door",
						// "minecraft:bed",
						"minecraft:bamboo",
						"minecraft:bamboo_sapling",
						"minecraft:beetroot",
						"minecraft:carrots",
						"minecraft:carved_pumpkin",
						"minecraft:chorus_flower",
						"minecraft:chorus_plant",
						"minecraft:melon_stem",
						"minecraft:potatoes",
						"minecraft:pumpkin_stem",
						"minecraft:crimson_fungus",
						"minecraft:warped_fungus",
						"minecraft:reeds",
						"minecraft:snow_layer",
						"minecraft:sweet_berry_bush",
						"minecraft:turtle_egg",
						"minecraft:dandelion",
						"minecraft:azalea",
						"minecraft:flowering_azalea",
						"minecraft:azalea_leaves",
						"minecraft:azalea_leaves_flowered",
						"minecraft:cave_vines",
						"minecraft:cave_vines_body_with_berries",
						"minecraft:cave_vines_head_with_berries",
						"minecraft:small_dripleaf_block",
						"minecraft:big_dripleaf",
						"minecraft:spore_blossom",
						"minecraft:hanging_roots",
						"minecraft:mangrove_leaves",
						"minecraft:pale_hanging_moss",
						"minecraft:cherry_leaves",
						"minecraft:pale_oak_leaves"
					]
				},
				"minecraft:timer": {
					"time": 5,
					"looping": true,
					"time_down_event": {
						"event": "manalabs_zombie:charge_attack_cooldown",
						"target": "self"
					}
				}
			}
		},
		"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:type_family": {
				"family": ["manalabs_zombie_demolisher", "zombie", "undead", "monster", "mob"]
			},
			"minecraft:health": {
				"value": 150,
				"max": 150,
				"min": 1
			},
			"minecraft:breathable": {
				"total_supply": 15,
				"breathes_air": true
			},

			"minecraft:physics": {
				"has_collision": true,
				"has_gravity": true
			},
			"minecraft:knockback_resistance": {
				"value": 1
			},
			"minecraft:jump.static": {
				"jump_power": 0.4
			},
			"minecraft:movement.generic": {
				"max_turn": 30
			},
			"minecraft:burns_in_daylight": {},
			"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: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.nearest_attackable_target": {
				"priority": 1,
				"must_reach": false,
				"must_see": false,
				"must_see_forget_duration": 3,
				"reselect_targets": true,
				"within_radius": 20,
				"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: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.random_stroll": {
				"priority": 5,
				"speed_multiplier": 0.5,
				"interval": 120,
				"xz_dist": 10,
				"y_dist": 7
			}
		},
		"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:melee_attack": {
				"add": {
					"component_groups": ["manalabs_zombie:melee_attack"]
				},
				"remove": {
					"component_groups": ["manalabs_zombie:charge_attack_cooldown"]
				}
			},
			"manalabs_zombie:charge_attack": {
				"add": {
					"component_groups": ["manalabs_zombie:charge_attack"]
				},
				"remove": {
					"component_groups": ["manalabs_zombie:melee_attack"]
				}
			},

			"manalabs_zombie:charge_attack_cooldown": {
				"add": {
					"component_groups": ["manalabs_zombie:charge_attack_cooldown"]
				},
				"remove": {
					"component_groups": ["manalabs_zombie:charge_attack"]
				}
			},
			"manalabs_zombie:knockback_roar": {
				"add": {
					"component_groups": ["manalabs_zombie:knockback_roar"]
				}
			},
			"manalabs_zombie:remove_knockback_roar": {
				"remove": {
					"component_groups": ["manalabs_zombie:knockback_roar"]
				}
			},
			"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:melee_attack"]
				},
				"set_property": {
					"manalabs_zombie:digging_out": false
				}
			},
			"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
				}
			}
		}
	}
}
