## CHEF_EXHALE
## CHEF_ACTIVATED.MCFUNCTION
## @s=PLAYER

tag @s add chef_exhale

scoreboard objectives add ChefInhaled dummy
scoreboard players add @s ChefInhaled 0

execute positioned ~ ~1 ~ positioned ^ ^ ^2 if score @s ChefInhaled matches 1 run structure load swallowed_mob_1 ~ ~ ~
execute positioned ~ ~1 ~ positioned ^ ^ ^2 if score @s ChefInhaled matches 2 run structure load swallowed_mob_2 ~ ~ ~
execute positioned ~ ~1 ~ positioned ^ ^ ^2 if score @s ChefInhaled matches 3 run structure load swallowed_mob_3 ~ ~ ~
execute positioned ~ ~1 ~ positioned ^ ^ ^2 if score @s ChefInhaled matches 4 run structure load swallowed_mob_4 ~ ~ ~
execute positioned ~ ~1 ~ positioned ^ ^ ^2 if score @s ChefInhaled matches 5 run structure load swallowed_mob_5 ~ ~ ~
execute positioned ~ ~1 ~ positioned ^ ^ ^2 if score @s ChefInhaled matches 6 run structure load swallowed_mob_6 ~ ~ ~
execute positioned ~ ~1 ~ positioned ^ ^ ^2 if score @s ChefInhaled matches 7 run structure load swallowed_mob_7 ~ ~ ~
execute positioned ~ ~1 ~ positioned ^ ^ ^2 if score @s ChefInhaled matches 8 run structure load swallowed_mob_8 ~ ~ ~
execute positioned ~ ~1 ~ positioned ^ ^ ^2 run tp @e[type=!player,r=1,c=1] ~ ~ ~
execute positioned ~ ~1 ~ positioned ^ ^ ^2 run tag @e[type=!player,r=1,c=1] add ChefLaunched
execute positioned ~ ~1 ~ positioned ^ ^ ^2 run tag @e[type=!player,r=1,c=1] add HasSpawnedEnderman


scoreboard players set @s ChefInhaled 0
scoreboard players remove .var ChefInhaled 1
event entity @s set_chef_full_to_false
playsound chef.exhale @a ~ ~ ~

execute as @s[rxm=10] run summon ldz:chef_knockback ~ ~ ~ ~ ~ knockback_height_-1
execute as @s[rx=10,rxm=-18] run summon ldz:chef_knockback ~ ~ ~ ~ ~ knockback_height_0
execute as @s[rx=-18,rxm=-36] run summon ldz:chef_knockback ~ ~ ~ ~ ~ knockback_height_1
execute as @s[rx=-36,rxm=-54] run summon ldz:chef_knockback ~ ~ ~ ~ ~ knockback_height_2
execute as @s[rx=-54,rxm=-72] run summon ldz:chef_knockback ~ ~ ~ ~ ~ knockback_height_3
execute as @s[rx=-72,rxm=-90] run summon ldz:chef_knockback ~ ~ ~ ~ ~ knockback_height_4

tag @s add chef_dirty
tag @s remove chef_exhale