{
	"format_version": "1.10.0",
	"animation_controllers": {
		"controller.animation.manalabs_zombie.amalgam.death": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"last_dmg_player": "q.health == 1 && q.property('manalabs_zombie:last_dmg_player')"
						},
						{
							"death": "q.health == 1"
						},
						{
							"death_in_the_morning": "query.time_of_day >= 0.25 && query.time_of_day <= 0.75" // Time between sunrise and sunset
						}
					]
				},
				"last_dmg_player": {
					"on_entry": ["/tag @s add MANALABS_LAST_DMG_PLAYER"],
					"transitions": [
						{
							"death": "1.0"
						}
					]
				},
				"death": {
					"on_entry": ["v.death_anim_time = q.life_time;", "@s manalabs_zombie:dead"],
					"transitions": [
						{
							"despawn": "q.life_time - v.death_anim_time > 1.8"
						}
					]
				},
				"despawn": {
					"on_entry": [
						"/execute as @s[tag=MANALABS_LAST_DMG_PLAYER] run summon manalabs_zombie:xp_entity ~ ~ ~ ~ ~ manalabs_zombie:xp_value_75",
						"/execute as @s[tag=MANALABS_LAST_DMG_PLAYER] run loot spawn ~ ~ ~ loot \"manalabs/zombie/amalgam.loot\"",
						"@s manalabs_zombie:despawn"
					]
				},
				"death_in_the_morning": {
					"on_entry": ["v.death_anim_time = q.life_time;", "@s manalabs_zombie:dead", "/playanimation @s death"],
					"transitions": [
						{
							"despawn_in_the_morning": "q.life_time - v.death_anim_time > 1.5"
						}
					]
				},
				"despawn_in_the_morning": {
					"on_entry": [
						"/particle minecraft:large_explosion ~ ~1 ~",
						"/playsound mob.phantom.death @a ~ ~ ~ 2 0.6 0.1",
						"@s manalabs_zombie:despawn"
					]
				}
			}
		}
	}
}
