# Order matters (at least for the throw of the stones)
execute if entity @s[tag=enemy] run function enemies:0_tick
execute if entity @s[tag=boss] run function bosses:0_tick

# Next soud
scoreboard players remove @s[tag=custom_sound] EB_next_sound 1

# Next attack, ( has two steps, rng cooldown and after that the attk cooldown is set (when particles are dispalyed) )
execute if entity @s[tag=custom_attack,tag=attacking,tag=!mega_slime] run particle angry_villager ~ ~1.9 ~ 0.25 0.25 0.25 .1 1 force
scoreboard players remove @s[tag=custom_attack] EB_next_attack 1
tag @s[scores={EB_next_attack=0},tag=!attacking] add attacking

# Curse particle
execute if entity @s[tag=cursed] run function 0_enemy_boss:curse_particles
# Water Speed
execute if entity @s[tag=water_speed_I] if predicate entity/in_water run effect give @s speed 2 4 true
execute if entity @s[tag=water_speed_II] if predicate entity/in_water run effect give @s speed 2 10 true
execute if entity @s[tag=water_speed_I] unless predicate entity/in_water run effect clear @s speed
execute if entity @s[tag=water_speed_II] unless predicate entity/in_water run effect clear @s speed
# Avoid mobs turning to drwoned
execute if entity @s[type=zombie] run data modify entity @s InWaterTime set value -1

scoreboard players add n_mobs EB_generic 1