#vfx
execute at @s[tag=!no_shield] positioned ~ ~1 ~ run particle dust{color:[0.0,1.0,1.0],scale:1} ~ ~1 ~ 1 1 1 1 25 force
execute at @s[tag=!no_shield] positioned ~-2.5 ~-2.5 ~-2.5 as @a[dx=4,dy=4,dz=4] run scoreboard players operation @s shield += @s shield_10

tp @s 0 0 0 0 0
execute if score .hit_death hit matches 0 run playsound atmos:splatter_2 master @a ~ ~ ~ 10 1
scoreboard players set .hit_death hit 1

#splatter vfx
summon item_display ~ ~2 ~ {item:{id:"minecraft:potion",count:1,components:{"minecraft:item_model":"minecraft:splatter"}},Tags:["particle","splatter_newborn"]}
execute as @e[type=item_display,tag=splatter_newborn] run function main:game/mobs/ai/splatter
execute as @e[type=armor_stand,tag=splatter_newborn] run scoreboard players set @s particle_lifetime 20

execute as @e[type=#main:not_enemies,tag=splatter_newborn] run tag @s remove splatter_newborn

#kill
execute as @s[scores={health=..0}] on vehicle run kill @s
execute as @s[scores={health=..0}] on passengers run kill @s
execute as @s[scores={health=..0}] run kill @s

#clean
execute as @e[type=text_display,tag=healthBar,predicate=healthbars:invalid-bar] run kill @s
execute as @e[type=marker,tag=enemy_marker,predicate=healthbars:invalid-bar] run kill @s
execute as @e[type=text_display,tag=nameBar,predicate=healthbars:invalid-bar] run kill @s

execute at @s[tag=boss] run scoreboard players set @e[type=#main:enemies,tag=enemy] health 0