{
	"format_version": "1.20.80",
	"minecraft:entity": {
		"description": {
			"identifier": "manalabs_zombie:doc_zombie",
			"is_spawnable": true,
			"is_summonable": true,
			"is_experimental": false,
			"properties": {
				"manalabs_zombie:hovering": {
					"client_sync": true,
					"default": false,
					"type": "bool"
				},
				"manalabs_zombie:digging_out": {
					"type": "bool",
					"client_sync": true,
					"default": true
				},
				"manalabs_zombie:last_dmg_player": {
					"type": "bool",
					"default": false
				}
			},
			"animations": {
				"death": "controller.animation.manalabs_zombie.doc_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
				},
				"minecraft:pushable": {
					"is_pushable": false,
					"is_pushable_by_piston": false
				},
				"minecraft:collision_box": {
					"height": 0,
					"width": 0
				},
				"minecraft:timer": {
					"time": 3.85,
					"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:collision_box": {
					"height": 6,
					"width": 0.1
				},
				"minecraft:movement": {
					"value": 0.3
				}
			},
			"manalabs_zombie:on_ground": {
				"minecraft:custom_hit_test": {
					"hitboxes": [
						{
							"width": 2,
							"height": 2,
							"pivot": [0, 2, 0]
						}
					]
				},
				"minecraft:environment_sensor": {
					"triggers": [
						{
							"event": "manalabs_zombie:push_away_attack",
							"target": "self",
							"filters": {
								"test": "target_distance",
								"operator": "<=",
								"value": 6
							}
						},
						{
							"event": "manalabs_zombie:start_hovering",
							"target": "self",
							"filters": {
								"test": "actor_health",
								"operator": "<=",
								"value": 250
							}
						}
					]
				}
			},
			"manalabs_zombie:hovering": {
				"minecraft:custom_hit_test": {
					"hitboxes": [
						{
							"width": 2,
							"height": 2,
							"pivot": [0, 5.2, 0]
						}
					]
				}
			},
			"manalabs_zombie:push_away_attack": {
				"minecraft:behavior.knockback_roar": {
					"priority": 0,
					"attack_time": 0.75,
					"cooldown_time": 0,
					"duration": 1,
					"knockback_damage": 10,
					"knockback_horizontal_strength": 6,
					"knockback_vertical_strength": 3,
					"knockback_range": 15,
					"on_roar_end": {
						"event": "manalabs_zombie:remove_push_away_attack",
						"target": "self"
					},
					"damage_filters": {
						"test": "is_family",
						"subject": "other",
						"value": "player"
					},
					"knockback_filters": {
						"test": "is_family",
						"subject": "other",
						"value": "player"
					}
				}
			},
			"manalabs_zombie:summon_attack": {
				"minecraft:behavior.summon_entity": {
					"priority": 0,
					"summon_choices": [
						{
							"weight": 1,
							"cast_duration": 1,
							"cooldown_time": 20,
							"do_casting": true,
							"min_activation_range": 5,
							"max_activation_range": 512,
							"sequence": [
								{
									"base_delay": 0.75,
									"entity_type": "manalabs_zombie:drone",
									"entity_lifespan": -1,
									"num_entities_spawned": 1,
									"shape": "line",
									"target": "self",
									"size": 1,
									"summon_cap": 10,
									"summon_cap_radius": 100
								}
							]
						}
					]
				}
			},
			// Flamethrower attacks
			"manalabs_zombie:blaze_sprayer_on_hover": {
				"minecraft:variant": {
					"value": 0
				},
				"minecraft:shooter": {
					"def": "manalabs_zombie:fire_charge_doc_zombie<manalabs_zombie:on_hover>"
				},
				"minecraft:behavior.ranged_attack": {
					"priority": 1,
					"charge_charged_trigger": 0,
					"charge_shoot_trigger": 0.8,
					"burst_interval": 0.1,
					"burst_shots": 21,
					"attack_radius_min": 5,
					"attack_radius": 15
				}
			},
			"manalabs_zombie:blaze_sprayer_on_ground": {
				"minecraft:variant": {
					"value": 0
				},
				"minecraft:shooter": {
					"def": "manalabs_zombie:fire_charge_doc_zombie<manalabs_zombie:on_ground>"
				},
				"minecraft:behavior.ranged_attack": {
					"priority": 1,
					"charge_charged_trigger": 0,
					"charge_shoot_trigger": 0.8,
					"burst_interval": 0.1,
					"burst_shots": 21,
					"attack_radius_min": 5,
					"attack_radius": 15
				}
			},
			// Potion attacks
			"manalabs_zombie:potion_throw_on_ground": {
				"minecraft:variant": {
					"value": 1
				},
				"minecraft:shooter": {
					"power": 0.75,
					"def": "minecraft:splash_potion",
					"aux_val": 23, // harming
					"sound": "throw",
					"projectiles": [
						{
							"def": "minecraft:splash_potion",
							"aux_val": 17, // slowness
							"filters": {
								"all_of": [
									{
										"test": "target_distance",
										"subject": "self",
										"value": 8.0,
										"operator": ">="
									},
									{
										"none_of": [
											{
												"test": "has_mob_effect",
												"subject": "other",
												"value": "slowness"
											}
										]
									}
								]
							}
						},
						{
							"def": "minecraft:splash_potion",
							"aux_val": 25, // poison
							"filters": {
								"all_of": [
									{
										"test": "actor_health",
										"subject": "other",
										"value": 8,
										"operator": ">="
									},
									{
										"none_of": [
											{
												"test": "has_mob_effect",
												"subject": "other",
												"value": "poison"
											}
										]
									}
								]
							}
						},
						{
							"def": "minecraft:splash_potion",
							"aux_val": 34, // weakness
							"filters": {
								"all_of": [
									{
										"test": "target_distance",
										"subject": "self",
										"value": 3,
										"operator": "<="
									},
									{
										"none_of": [
											{
												"test": "has_mob_effect",
												"subject": "other",
												"value": "weakness"
											}
										]
									}
								]
							},
							"chance": 0.25
						}
					],
					"magic": true
				},
				"minecraft:behavior.ranged_attack": {
					"priority": 1,
					"charge_charged_trigger": 0,
					"charge_shoot_trigger": 0.6,
					"attack_radius_min": 5,
					"attack_radius": 15
				}
			},
			"manalabs_zombie:potion_throw_on_hover": {
				"minecraft:variant": {
					"value": 1
				},
				"minecraft:shooter": {
					"power": 0.75,
					"def": "minecraft:splash_potion",
					"aux_val": 23, // harming
					"sound": "throw",
					"projectiles": [
						{
							"def": "minecraft:splash_potion",
							"aux_val": 17, // slowness
							"filters": {
								"all_of": [
									{
										"test": "target_distance",
										"subject": "self",
										"value": 8.0,
										"operator": ">="
									},
									{
										"none_of": [
											{
												"test": "has_mob_effect",
												"subject": "other",
												"value": "slowness"
											}
										]
									}
								]
							}
						},
						{
							"def": "minecraft:splash_potion",
							"aux_val": 25, // poison
							"filters": {
								"all_of": [
									{
										"test": "actor_health",
										"subject": "other",
										"value": 8,
										"operator": ">="
									},
									{
										"none_of": [
											{
												"test": "has_mob_effect",
												"subject": "other",
												"value": "poison"
											}
										]
									}
								]
							}
						},
						{
							"def": "minecraft:splash_potion",
							"aux_val": 34, // weakness
							"filters": {
								"all_of": [
									{
										"test": "target_distance",
										"subject": "self",
										"value": 3,
										"operator": "<="
									},
									{
										"none_of": [
											{
												"test": "has_mob_effect",
												"subject": "other",
												"value": "weakness"
											}
										]
									}
								]
							},
							"chance": 0.25
						}
					],
					"magic": true
				},
				"minecraft:behavior.ranged_attack": {
					"priority": 1,
					"charge_charged_trigger": 0,
					"charge_shoot_trigger": 0.6,
					"attack_radius_min": 5,
					"attack_radius": 15
				}
			},
			//Syringe attacks
			"manalabs_zombie:syringe_throw_on_ground": {
				"minecraft:variant": {
					"value": 2
				},
				"minecraft:shooter": {
					"def": "manalabs_zombie:syringe_projectile<manalabs_zombie:on_ground>"
				},
				"minecraft:behavior.ranged_attack": {
					"priority": 1,
					"charge_charged_trigger": 0,
					"charge_shoot_trigger": 0.2,
					"attack_radius_min": 5,
					"attack_radius": 15,
					"burst_interval": 0.3,
					"burst_shots": 3
				}
			},
			"manalabs_zombie:syringe_throw_on_hover": {
				"minecraft:variant": {
					"value": 2
				},
				"minecraft:shooter": {
					"def": "manalabs_zombie:syringe_projectile<manalabs_zombie:on_hover>"
				},
				"minecraft:behavior.ranged_attack": {
					"priority": 1,
					"charge_charged_trigger": 0,
					"charge_shoot_trigger": 0.2,
					"attack_radius_min": 5,
					"attack_radius": 15,
					"burst_interval": 0.3,
					"burst_shots": 3
				}
			},
			// Randomize attacks
			"manalabs_zombie:randomize_attacks": {
				"minecraft:timer": {
					"time": 10,
					"looping": true,
					"time_down_event": {
						"event": "manalabs_zombie:randomize_attack",
						"target": "self"
					}
				}
			}
		},
		"components": {
			"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_doc_zombie", "zombie", "undead", "monster", "mob"]
			},
			"minecraft:boss": {
				"hud_range": 55,
				"name": "Doctor Zombie",
				"should_darken_sky": true
			},
			"minecraft:health": {
				"value": 500,
				"max": 500,
				"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:attack": {
				"damage": 10
			},
			"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
					}
				]
			}
		},
		"events": {
			"manalabs_zombie:despawn": {
				"add": {
					"component_groups": ["manalabs_zombie:despawn"]
				}
			},
			"minecraft:entity_spawned": {
				"sequence": [
					{
						"trigger": {
							"event": "manalabs_zombie:start_digging_out",
							"target": "self"
						}
					}
				]
			},
			"manalabs_zombie:start_hovering": {
				"add": {
					"component_groups": ["manalabs_zombie:hovering"]
				},
				"remove": {
					"component_groups": ["manalabs_zombie:on_ground"]
				},
				"set_property": {
					"manalabs_zombie:hovering": true
				}
			},
			"manalabs_zombie:stop_hovering": {
				"add": {
					"component_groups": ["manalabs_zombie:on_ground"]
				},
				"remove": {
					"component_groups": ["manalabs_zombie:hovering"]
				},
				"set_property": {
					"manalabs_zombie:hovering": false
				}
			},
			"manalabs_zombie:randomize_attack": {
				"sequence": [
					{
						"add": {
							"component_groups": ["manalabs_zombie:randomize_attacks"]
						}
					},
					{
						"filters": {
							"test": "bool_property",
							"domain": "manalabs_zombie:hovering",
							"value": false
						},
						"randomize": [
							{
								"weight": 1,
								"add": {
									"component_groups": ["manalabs_zombie:blaze_sprayer_on_ground"]
								},
								"remove": {
									"component_groups": [
										"manalabs_zombie:potion_throw_on_ground",
										"manalabs_zombie:syringe_throw_on_ground",
										"manalabs_zombie:blaze_sprayer_on_hover",
										"manalabs_zombie:syringe_throw_on_hover",
										"manalabs_zombie:potion_throw_on_hover"
									]
								}
							},
							{
								"weight": 1,
								"add": {
									"component_groups": ["manalabs_zombie:potion_throw_on_ground"]
								},
								"remove": {
									"component_groups": [
										"manalabs_zombie:blaze_sprayer_on_ground",
										"manalabs_zombie:syringe_throw_on_ground",
										"manalabs_zombie:blaze_sprayer_on_hover",
										"manalabs_zombie:syringe_throw_on_hover",
										"manalabs_zombie:potion_throw_on_hover"
									]
								}
							},
							{
								"weight": 1,
								"add": {
									"component_groups": ["manalabs_zombie:syringe_throw_on_ground"]
								},
								"remove": {
									"component_groups": [
										"manalabs_zombie:potion_throw_on_ground",
										"manalabs_zombie:blaze_sprayer_on_ground",
										"manalabs_zombie:blaze_sprayer_on_hover",
										"manalabs_zombie:syringe_throw_on_hover",
										"manalabs_zombie:potion_throw_on_hover"
									]
								}
							}
						]
					},
					{
						"filters": {
							"test": "bool_property",
							"domain": "manalabs_zombie:hovering",
							"value": true
						},
						"randomize": [
							{
								"weight": 1,
								"add": {
									"component_groups": ["manalabs_zombie:blaze_sprayer_on_hover"]
								},
								"remove": {
									"component_groups": [
										"manalabs_zombie:potion_throw_on_hover",
										"manalabs_zombie:syringe_throw_on_hover",
										"manalabs_zombie:blaze_sprayer_on_ground",
										"manalabs_zombie:syringe_throw_on_ground",
										"manalabs_zombie:potion_throw_on_ground"
									]
								}
							},
							{
								"weight": 1,
								"add": {
									"component_groups": ["manalabs_zombie:potion_throw_on_hover"]
								},
								"remove": {
									"component_groups": [
										"manalabs_zombie:blaze_sprayer_on_hover",
										"manalabs_zombie:syringe_throw_on_hover",
										"manalabs_zombie:blaze_sprayer_on_ground",
										"manalabs_zombie:syringe_throw_on_ground",
										"manalabs_zombie:potion_throw_on_ground"
									]
								}
							},
							{
								"weight": 1,
								"add": {
									"component_groups": ["manalabs_zombie:syringe_throw_on_hover"]
								},
								"remove": {
									"component_groups": [
										"manalabs_zombie:potion_throw_on_hover",
										"manalabs_zombie:blaze_sprayer_on_hover",
										"manalabs_zombie:blaze_sprayer_on_ground",
										"manalabs_zombie:syringe_throw_on_ground",
										"manalabs_zombie:potion_throw_on_ground"
									]
								}
							}
						]
					}
				]
			},
			"manalabs_zombie:remove_push_away_attack": {
				"remove": {
					"component_groups": ["manalabs_zombie:push_away_attack"]
				}
			},
			"manalabs_zombie:push_away_attack": {
				"add": {
					"component_groups": ["manalabs_zombie:push_away_attack"]
				}
			},
			"manalabs_zombie:dead": {
				"add": {
					"component_groups": ["manalabs_zombie:dead"]
				},
				"remove": {
					"component_groups": [
						"manalabs_zombie:randomize_attacks",
						"manalabs_zombie:syringe_throw_on_hover",
						"manalabs_zombie:potion_throw_on_hover",
						"manalabs_zombie:blaze_sprayer_on_hover",
						"manalabs_zombie:blaze_sprayer_on_ground",
						"manalabs_zombie:syringe_throw_on_ground",
						"manalabs_zombie:potion_throw_on_ground"
					]
				}
			},
			"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",
						"manalabs_zombie:on_ground",
						"manalabs_zombie:randomize_attacks"
					]
				},
				"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
				}
			}
		}
	}
}
