{
	"format_version": "1.19.0",
	"minecraft:entity": {
		"description": {
			"identifier": "dotvi:brawlatar",
			"is_spawnable": true,
			"is_summonable": true,
			"is_experimental": false,
			"animations": {
				"brawlatar_server_enrage": "controller.animation.brawlatar_server_enrage"
			},
			"scripts": {
				"animate": [
					"brawlatar_server_enrage"
				]
			}
		},
		"component_groups": {
			"melee_unit": {
				"minecraft:behavior.melee_attack": {
					"priority": 4,
					"speed_multiplier": 1,
					"track_target": true
				},
				"minecraft:attack": {
					"damage": 12
				},
				"minecraft:equipment": {
					"table": "loot_tables/entities/piglin_brute_gear.json"
				}
			},
			"angry": {
				"minecraft:angry": {
					"duration": 30,
					"broadcast_anger": false,
					"broadcast_anger_on_attack": false,
					"broadcast_anger_on_being_attacked": true,
					"broadcast_range": 16,
					"broadcast_targets": [
						"piglin"
					],
					"calm_event": {
						"event": "become_calm_event",
						"target": "self"
					},
					"filters": {
						"all_of": [
							{
								"test": "is_family",
								"subject": "other",
								"operator": "!=",
								"value": "piglin"
							}
						]
					},
					"angry_sound": "angry",
					"sound_interval": {
						"range_min": 2,
						"range_max": 5
					}
				}
			},
			"alert_for_attack_targets": {
				"minecraft:behavior.nearest_prioritized_attackable_target": {
					"priority": 3,
					"within_radius": 12,
					"persist_time": 2,
					"must_see": true,
					"entity_types": [
						{
							"filters": {
								"test": "is_family",
								"subject": "other",
								"value": "player"
							},
							"max_dist": 12,
							"priority": 0
						},
						{
							"filters": {
								"test": "is_family",
								"subject": "other",
								"value": "wither"
							},
							"max_dist": 12,
							"priority": 1
						}
					]
				}
			},
			"take_target_as_response_to_block_break": {
				"minecraft:behavior.nearest_attackable_target": {
					"priority": 3,
					"entity_types": [
						{
							"filters": {
								"test": "is_family",
								"subject": "other",
								"value": "player"
							},
							"max_dist": 16
						}
					]
				}
			},
			"dotvi:puke": {
				"minecraft:timer": {
					"looping": false,
					"time": 2.08,
					"time_down_event": {
						"event": "dotvi:puke_stop"
					}
				},
				"minecraft:variant": {
					"value": 1
				},
				"minecraft:movement": {
					"value": 0
				}
			},
			"dotvi:puke_enraged": {
				"minecraft:variant": {
					"value": 2
				},
				"minecraft:timer": {
					"looping": false,
					"time": 2.375,
					"time_down_event": {
						"event": "dotvi:puke_stop_enraged"
					}
				},
				"minecraft:movement": {
					"value": 0
				},
				"minecraft:behavior.knockback_roar": {
					"priority": 0,
					"knockback_range": 7,
					"duration": 3,
					"knockback_damage": 30,
					"knockback_horizontal_strength": 6,
					"knockback_vertical_strength": 3
				}
			},
			"dotvi:enraged": {
				"minecraft:is_sheared": {}
			},
			"dotvi:defaultvariant": {
				"minecraft:variant": {
					"value": 0
				},
				"minecraft:movement": {
					"value": 0.35
				}
			}
		},
		"components": {
			"minecraft:is_hidden_when_invisible": {},
			"minecraft:collision_box": {
				"width": 0.6,
				"height": 1.9
			},
			"minecraft:type_family": {
				"family": [
					"piglin",
					"adult_piglin",
					"piglin_brute",
					"monster",
					"disciplevoli"
				]
			},
			"minecraft:conditional_bandwidth_optimization": {},
			"minecraft:experience_reward": {
				"on_death": "query.last_hit_by_player?20:0"
			},
			"minecraft:on_target_acquired": {
				"event": "become_angry_event",
				"target": "self"
			},
			"minecraft:breathable": {
				"total_supply": 15,
				"suffocate_time": 0
			},
			"minecraft:health": {
				"value": 1200,
				"max": 1200
			},
			"minecraft:hurt_on_condition": {
				"damage_conditions": [
					{
						"filters": {
							"test": "in_lava",
							"subject": "self",
							"operator": "==",
							"value": true
						},
						"cause": "lava",
						"damage_per_tick": 4
					}
				]
			},
			"minecraft:loot": {
				"table": "loot_tables/entities/brawlatar.json"
			},
			"minecraft:navigation.walk": {
				"can_path_over_water": true,
				"can_open_doors": true
			},
			"minecraft:annotation.open_door": {},
			"minecraft:movement.basic": {},
			"minecraft:jump.static": {},
			"minecraft:nameable": {},
			"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.hurt_by_target": {
				"priority": 1
			},
			"minecraft:behavior.random_stroll": {
				"priority": 7,
				"speed_multiplier": 0.6
			},
			"minecraft:behavior.look_at_player": {
				"priority": 8,
				"look_distance": 8
			},
			"minecraft:behavior.random_look_around": {
				"priority": 9
			},
			"minecraft:physics": {},
			"minecraft:pushable": {
				"is_pushable": true,
				"is_pushable_by_piston": true
			},
			"minecraft:follow_range": {
				"value": 64
			},
			"minecraft:boss": {
				"hud_range": 10,
				"name": "Brawlatar, Disciple of Dissension"
			},
			"minecraft:on_hurt_by_player": {
				"target": "self",
				"event": "dotvi:puke_start"
			},
			"minecraft:knockback_resistance": {
				"value": 50
			},
			"minecraft:on_death": {
				"target": "self",
				"event": "dotvi:on_death"
			}
		},
		"events": {
			"minecraft:entity_spawned": {
				"add": {
					"component_groups": [
						"alert_for_attack_targets",
						"melee_unit",
						"dotvi:defaultvariant"
					]
				}
			},
			"become_angry_event": {
				"add": {
					"component_groups": [
						"angry"
					]
				}
			},
			"become_calm_event": {
				"remove": {
					"component_groups": [
						"angry"
					]
				},
				"add": {
					"component_groups": [
						"alert_for_attack_targets"
					]
				}
			},
			"important_block_destroyed_event": {
				"remove": {
					"component_groups": [
						"alert_for_attack_targets"
					]
				},
				"add": {
					"component_groups": [
						"take_target_as_response_to_block_break"
					]
				}
			},
			"dotvi:puke_start": {
				"randomize": [
					{
						"weight": 5,
						"add": {
							"component_groups": [
								"dotvi:puke_enraged"
							]
						},
						"filters": {
							"all_of": [
								{
									"test": "actor_health",
									"value": 600,
									"subject": "self",
									"operator": "<="
								}
							]
						},
						"run_command": {
							"command": [
								"summon dotvi:brawlatarpukeaura ~9~~9",
								"summon dotvi:brawlatarpukeaura ~-9~~9",
								"summon dotvi:brawlatarpukeaura ~9~~-9",
								"summon dotvi:brawlatarpukeaura ~-9~~-9",
								"summon dotvi:brawlatarpukeaura ~~~"
							],
							"target": "self"
						}
					},
					{
						"weight": 1,
						"add": {
							"component_groups": [
								"dotvi:puke"
							]
						},
						"filters": {
							"all_of": [
								{
									"test": "actor_health",
									"value": 600,
									"subject": "self",
									"operator": ">="
								}
							]
						},
						"run_command": {
							"command": [
								"summon dotvi:brawlatarpukeaura ~~~"
							],
							"target": "self"
						}
					},
					{
						"weight": 30
					}
				]
			},
			"dotvi:puke_stop": {
				"remove": {
					"component_groups": [
						"dotvi:puke",
						"dotvi:puke_enraged"
					]
				},
				"add": {
					"component_groups": [
						"dotvi:defaultvariant"
					]
				}
			},
			"dotvi:puke_stop_enraged": {
				"remove": {
					"component_groups": [
						"dotvi:puke",
						"dotvi:puke_enraged"
					]
				},
				"add": {
					"component_groups": [
						"dotvi:defaultvariant"
					]
				}
			},
			"dotvi:debugroaor": {
				"sequence": [
					{
						"add": {
							"component_groups": [
								"dotvi:puke_enraged"
							]
						},
						"filters": {
							"all_of": [
								{
									"test": "actor_health",
									"value": 600,
									"subject": "self",
									"operator": "<="
								}
							]
						},
						"run_command": {
							"command": [
								"summon dotvi:brawlatarpukeaura ~4~~4",
								"summon dotvi:brawlatarpukeaura ~-4~~4",
								"summon dotvi:brawlatarpukeaura ~4~~-4",
								"summon dotvi:brawlatarpukeaura ~-4~~-4",
								"summon dotvi:brawlatarpukeaura ~~~"
							],
							"target": "self"
						}
					},
					{
						"add": {
							"component_groups": [
								"dotvi:puke"
							]
						},
						"filters": {
							"all_of": [
								{
									"test": "actor_health",
									"value": 600,
									"subject": "self",
									"operator": ">="
								}
							]
						},
						"run_command": {
							"command": [
								"summon dotvi:brawlatarpukeaura ~~~"
							],
							"target": "self"
						}
					}
				]
			},
			"dotvi:enrage_trigger_event": {
				"add": {
					"component_groups": [
						"dotvi:enraged"
					]
				}
			},
			"dotvi:on_death": {
				"run_command": {
					"command": [
						"function defeattriggers/discipleslain"
					]
				}
			}
		}
	}
}