execute if score @s EB_next_attack matches 0 run data merge entity @s {NoAI:1b}

execute if score @s EB_next_attack matches -20.. run tp @s ~ ~.07 ~ ~-4 ~
execute if score @s EB_next_attack matches -40..-21 run tp @s ~ ~.07 ~ ~-8 ~
execute if score @s EB_next_attack matches ..-41 run tp @s ~ ~ ~ ~-12 ~

execute as @e[tag=basic_slime,distance=..32] at @s facing entity @e[tag=mega_slime,sort=nearest,limit=1] feet run tp @s ^ ^ ^.1
execute as @e[tag=basic_slime,distance=..5] run function bosses:mega_slime/merge/merge

execute unless entity @e[tag=basic_slime,distance=..32,limit=1] run function bosses:mega_slime/merge/end
