{
	"format_version": "1.19.50",
	"minecraft:entity": {
		"description": {
			"identifier": "dotvi:alatar",
			"is_spawnable": true,
			"is_summonable": true,
			"is_experimental": false,
			"animations": {
				"alatarah_server_enrage": "controller.animation.alatarah_server_enrage"
			},
			"scripts": {
				"animate": [
					"alatarah_server_enrage"
				]
			}
		},
		"components": {
			"minecraft:is_hidden_when_invisible": {},
			"minecraft:experience_reward": {
				"on_death": "10"
			},
			"minecraft:type_family": {
				"family": [
					"evocation_illager",
					"monster",
					"illager",
					"mob",
					"disciple",
					"newdisciple",
					"alatarah",
					"heretic",
					"disciplevoli"
				]
			},
			"minecraft:breathable": {
				"total_supply": 15,
				"suffocate_time": 0
			},
			"minecraft:nameable": {},
			"minecraft:loot": {
				"table": "loot_tables/entities/alatar.json"
			},
			"minecraft:health": {
				"value": 600
			},
			"minecraft:hurt_on_condition": {
				"damage_conditions": [
					{
						"filters": {
							"test": "in_lava",
							"subject": "self",
							"operator": "==",
							"value": true
						},
						"cause": "lava",
						"damage_per_tick": 4
					}
				]
			},
			"minecraft:collision_box": {
				"width": 0.6,
				"height": 1.9
			},
			"minecraft:movement": {
				"value": 0.25
			},
			"minecraft:navigation.walk": {
				"can_path_over_water": true,
				"can_pass_doors": true,
				"can_open_doors": true,
				"avoid_water": true
			},
			"minecraft:movement.basic": {},
			"minecraft:jump.static": {},
			"minecraft:can_climb": {},
			"minecraft:behavior.float": {
				"priority": 0
			},
			"minecraft:behavior.send_event": {
				"priority": 3,
				"event_choices": [
					{
						"min_activation_range": 0,
						"max_activation_range": 16,
						"cooldown_time": 5,
						"cast_duration": 3,
						"particle_color": "#FFB38033",
						"weight": 3,
						"filters": {
							"all_of": [
								{
									"test": "is_family",
									"subject": "other",
									"value": "sheep"
								},
								{
									"test": "is_color",
									"subject": "other",
									"value": "blue"
								}
							]
						},
						"start_sound_event": "cast.spell",
						"sequence": [
							{
								"base_delay": 2,
								"event": "wololo",
								"sound_event": "prepare.wololo"
							}
						]
					}
				]
			},
			"minecraft:behavior.summon_entity": {
				"priority": 2,
				"summon_choices": [
					{
						"min_activation_range": 0,
						"max_activation_range": 12,
						"cooldown_time": 0,
						"weight": 5,
						"cast_duration": 2,
						"particle_color": "#FFAFA8FF",
						"start_sound_event": "cast.spell",
						"sequence": [
							{
								"shape": "circle",
								"target": "self",
								"base_delay": 1,
								"delay_per_summon": 0,
								"num_entities_spawned": 5,
								"entity_type": "minecraft:evocation_fang",
								"size": 1.5,
								"entity_lifespan": 1.5,
								"sound_event": "prepare.attack"
							},
							{
								"shape": "circle",
								"target": "self",
								"base_delay": 0.15,
								"delay_per_summon": 0,
								"num_entities_spawned": 9,
								"entity_type": "minecraft:evocation_fang",
								"size": 2.5,
								"entity_lifespan": 1.5
							},
							{
								"shape": "circle",
								"target": "self",
								"base_delay": 0.15,
								"delay_per_summon": 0,
								"num_entities_spawned": 12,
								"entity_type": "minecraft:evocation_fang",
								"size": 3.5,
								"entity_lifespan": 1.5
							},
							{
								"shape": "circle",
								"target": "self",
								"base_delay": 0.15,
								"delay_per_summon": 0,
								"num_entities_spawned": 15,
								"entity_type": "minecraft:evocation_fang",
								"size": 4.5,
								"entity_lifespan": 1.5
							},
							{
								"shape": "circle",
								"target": "self",
								"base_delay": 0.15,
								"delay_per_summon": 0,
								"num_entities_spawned": 18,
								"entity_type": "minecraft:evocation_fang",
								"size": 5.5,
								"entity_lifespan": 1.5
							}
						]
					},
					{
						"min_activation_range": 3,
						"weight": 5,
						"cooldown_time": 0,
						"cast_duration": 2,
						"particle_color": "#FFAFA8FF",
						"start_sound_event": "cast.spell",
						"sequence": [
							{
								"shape": "line",
								"target": "self",
								"base_delay": 1,
								"delay_per_summon": 0.05,
								"num_entities_spawned": 16,
								"entity_type": "minecraft:evocation_fang",
								"size": 20,
								"entity_lifespan": 1.1
							},
							{
								"shape": "line",
								"target": "self",
								"base_delay": 0.25,
								"delay_per_summon": 0.05,
								"num_entities_spawned": 16,
								"entity_type": "minecraft:evocation_fang",
								"size": 20,
								"entity_lifespan": 1.1
							}
						]
					},
					{
						"weight": 2,
						"cooldown_time": 3,
						"cast_duration": 2,
						"particle_color": "#FFB3B3CC",
						"sequence": [
							{
								"shape": "circle",
								"target": "self",
								"base_delay": 5,
								"num_entities_spawned": 7,
								"entity_type": "minecraft:vex",
								"summon_cap": 8,
								"summon_cap_radius": 16,
								"size": 3,
								"sound_event": "prepare.summon",
								"entity_lifespan": 20,
								"delay_per_summon": 0.5
							}
						]
					},
					{
						"weight": 5,
						"cooldown_time": 0,
						"cast_duration": 2,
						"particle_color": "#FF46090B",
						"sequence": [
							{
								"shape": "circle",
								"target": "self",
								"base_delay": 2,
								"num_entities_spawned": 5,
								"entity_type": "dotvi:boom_bat",
								"summon_cap": 8,
								"summon_cap_radius": 16,
								"size": 3,
								"sound_event": "mob.ghast.fireball"
							}
						]
					},
					{
						"min_activation_range": 0,
						"max_activation_range": 10,
						"weight": 2,
						"cooldown_time": 0,
						"cast_duration": 2,
						"particle_color": "#FF27541F",
						"start_sound_event": "cast.spell",
						"sequence": [
							{
								"shape": "circle",
								"target": "self",
								"base_delay": 1,
								"delay_per_summon": 0.1,
								"num_entities_spawned": 6,
								"entity_type": "minecraft:vindicator",
								"size": 8,
								"entity_lifespan": 10,
								"sound_event": "mob.ghast.fireball"
							}
						]
					}
				]
			},
			"minecraft:behavior.random_stroll": {
				"priority": 8,
				"speed_multiplier": 0.6
			},
			"minecraft:behavior.nearest_attackable_target": {
				"priority": 2,
				"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"
								},
								{
									"test": "is_family",
									"subject": "other",
									"value": "wandering_trader"
								}
							]
						},
						"max_dist": 20
					},
					{
						"filters": {
							"all_of": [
								{
									"test": "is_family",
									"subject": "other",
									"value": "villager"
								},
								{
									"test": "has_component",
									"subject": "other",
									"operator": "!=",
									"value": "minecraft:is_baby"
								}
							]
						},
						"max_dist": 20
					},
					{
						"filters": {
							"any_of": [
								{
									"test": "is_family",
									"subject": "other",
									"value": "dragon"
								}
							]
						},
						"max_dist": 20
					},
					{
						"filters": {
							"any_of": [
								{
									"test": "is_family",
									"subject": "other",
									"value": "puppet"
								}
							]
						},
						"max_dist": 20
					}
				],
				"must_see": true
			},
			"minecraft:behavior.look_at_player": {
				"priority": 9,
				"look_distance": 3,
				"probability": 1
			},
			"minecraft:behavior.look_at_entity": {
				"priority": 10,
				"look_distance": 8,
				"filters": {
					"test": "is_family",
					"subject": "other",
					"value": "mob"
				}
			},
			"minecraft:behavior.hurt_by_target": {
				"priority": 1
			},
			"minecraft:persistent": {},
			"minecraft:physics": {},
			"minecraft:pushable": {
				"is_pushable": true,
				"is_pushable_by_piston": true
			},
			"minecraft:follow_range": {
				"value": 64
			},
			"minecraft:conditional_bandwidth_optimization": {},
			"minecraft:knockback_resistance": {
				"value": 50
			},
			"minecraft:boss": {
				"hud_range": 10,
				"name": "Alatarah, Heritic of Magik"
			},
			"minecraft:damage_sensor": {
				"triggers": [
					{
						"cause": "entity_explosion",
						"deals_damage": false
					}
				]
			},
			"minecraft:on_death": {
				"target": "self",
				"event": "dotvi:on_death"
			},
			"minecraft:environment_sensor": {
				"triggers": {
					"target": "self",
					"event": "dotvi:vexbuff",
					"filters": {
						"test": "has_component",
						"subject": "self",
						"value": "minecraft:boss"
					}
				}
			}
		},
		"events": {
			"dotvi:on_death": {
				"run_command": {
					"command": [
						"function defeattriggers/heriticslain",
						"event entity @e[type=dotvi:alatar_swordphase] dotvi:despawn"
					],
					"target": "self"
				}
			},
			"dotvi:vexbuff": {
				"run_command": {
					"command": [
						"effect @e[type=minecraft:vex, r=25] strength 1 2 true",
						"effect @e[type=minecraft:vex, r=25] resistance 1 4 true",
						"execute as @e[type=minecraft:vex, r=25] at @s run particle dotvi:vexbuff ~~~"
					]
				}
			},
			"dotvi:phaselock_event": {
				"add": {
					"component_groups": [
						"dotvi:phaselock"
					]
				},
				"run_command": {
					"command": [
						"summon dotvi:alatar_swordphase ~~~ ~~ dotvi:spawn_alatarassist Majar"
					]
				}
			}
		},
		"component_groups": {
			"dotvi:phaselock": {
				"minecraft:is_sheared": {}
			}
		}
	}
}