{
	"format_version": "1.17.0",
	"animation_controllers": {
		"controller.animation.shapescape_mb.piglin_boss.death": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"death": "q.health == 1"
						}
					]
				},
				"death": {
					"on_entry": ["@s death", "variable.death = q.life_time + 3;"],
					"transitions": [
						{
							"despawn": "(variable.death < q.life_time)"
						}
					],
					"on_exit": ["/function shapescape/mb/piglin_boss/death"]
				},
				"despawn": {
					"on_entry": ["@s despawn"]
				}
			}
		},
		"controller.animation.shapescape_mb.piglin_boss.sword_attack": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"start": "1.0"
						}
					],
					"on_exit": ["@s move"]
				},
				"start": {
					"transitions": [
						{
							"sword_attack": "q.is_delayed_attacking && !q.is_sheared && q.variant != 42 && q.variant != 100"
						}
					]
				},
				"sword_attack": {
					"on_entry": ["@s not_move"],
					"transitions": [
						{
							"start": "q.is_sheared || q.variant == 42 || q.variant == 100"
						},
						{
							"stop_sword_attack": "!q.is_delayed_attacking && !q.is_sheared"
						}
					]
				},
				"stop_sword_attack": {
					"on_entry": ["@s move"],
					"transitions": [
						{
							"start": "1.0"
						}
					]
				}
			}
		},
		"controller.animation.shapescape_mb.piglin_boss.phase_4_choose_attack": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"start": "q.is_delayed_attacking && q.variant == 41 && !q.is_sheared"
						}
					]
				},
				"start": {
					"transitions": [
						{
							"end": "!q.is_delayed_attacking"
						}
					]
				},
				"end": {
					"on_entry": ["@s phase_4_choose_attack"],
					"transitions": [
						{
							"default": "1.0"
						}
					]
				}
			}
		},
		"controller.animation.shapescape_mb.piglin_boss.phase_4_melee_torch_prep": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"start": "q.is_delayed_attacking && q.variant == 42 && !q.is_sheared"
						},
						{
							"end": "q.variant == 43 && !q.is_sheared"
						}
					]
				},
				"start": {
					"on_entry": ["@s phase_4_melee_torch_exec", "variable.phase_4_melee_torch_prep = q.life_time + 1.4;"],
					"transitions": [
						{
							"end": "variable.phase_4_melee_torch_prep < q.life_time"
						}
					]
				},
				"end": {
					"on_entry": ["/execute if entity @s[family=shapescape_mb_boss_class_common] run summon shapescape_mb:boss_knock ^^1^3 ~~ piglin_knockback_common", "/execute if entity @s[family=shapescape_mb_boss_class_uncommon] run summon shapescape_mb:boss_knock ^^1^3 ~~ piglin_knockback_uncommon", "/execute if entity @s[family=shapescape_mb_boss_class_rare] run summon shapescape_mb:boss_knock ^^1^3 ~~ piglin_knockback_rare", "/execute if entity @s[family=shapescape_mb_boss_class_epic] run summon shapescape_mb:boss_knock ^^1^3 ~~ piglin_knockback_epic", "/execute if entity @s[family=shapescape_mb_boss_class_legendary] run summon shapescape_mb:boss_knock ^^1^3 ~~ piglin_knockback_legendary", "/execute if entity @s[family=shapescape_mb_boss_class_impossible] run summon shapescape_mb:boss_knock ^^1^3 ~~ piglin_knockback_impossible", "variable.phase_4_melee_torch_prep = q.life_time + 1.0;"],
					"transitions": [
						{
							"default": "variable.phase_4_melee_torch_prep < q.life_time "
						}
					],
					"on_exit": ["@s phase_4_melee"]
				}
			}
		},
		"controller.animation.shapescape_mb.piglin_boss.phase_change_prep": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"phase_transition": "q.variant != 100 && !q.is_sheared && q.health > 1 && ((q.health < q.max_health*0.80) && q.mark_variant == 1) || ((q.health < q.max_health*0.60) && q.mark_variant == 2) || ((q.health < q.max_health*0.40) && q.mark_variant == 3)"
						},
						{
							"phase_change_exec": "q.variant == 100"
						}
					]
				},
				"phase_transition": {
					"on_entry": ["@s phase_change_prep", "v.phase_change_prep = q.life_time + 4.5;"],
					"transitions": [
						{
							"phase_change_exec": "v.phase_change_prep < q.life_time"
						}
					]
				},
				"phase_change_exec": {
					"on_entry": ["@s phase_change_exec"],
					"transitions": [
						{
							"default": "1.0"
						}
					]
				}
			}
		},
		"controller.animation.shapescape_mb.piglin_boss.resist_suffocation": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"resist": "q.property('shapescape_mb:boss_class') == 'epic'"
						},
						{
							"resist": "q.property('shapescape_mb:boss_class') == 'legendary'"
						},
						{
							"resist": "q.property('shapescape_mb:boss_class') == 'impossible'"
						}
					]
				},
				"resist": {
					"on_entry": ["/effect @s water_breathing 1 0 true"],
					"transitions": [
						{
							"default": "q.state_time >= 0.9"
						}
					]
				}
			}
		}
	}
}