#attack
execute as @s[tag=!enemy_attack,scores={enemy_move=..0}] at @s if entity @e[type=#main:not_enemies,tag=ally,distance=..2] run function main:game/mobs/ai/attack/check

$execute as @s[tag=enemy_attack,scores={enemy_cooldown=..0}] at @s run function main:game/mobs/ai/attack/hit {"id":$(id),"positioned_3":"$(positioned_3)","positioned_4":"$(positioned_4)","cooldown":$(cooldown)}

#cooldown
# $execute as @s[scores={enemy_move=..0,stun=..0,confusion=..0}] at @s run function main:game/mobs/ai/attack/start {"cooldown":$(cooldown)}

#out of range
# execute as @s[scores={enemy_move=20..30}] at @s positioned ~ ~2.5 ~ run function main:particles/green_indicator
# execute as @s[scores={enemy_move=10..20}] at @s positioned ~ ~2.5 ~ run function main:particles/yellow_indicator
# execute as @s[scores={enemy_move=1..10}] at @s positioned ~ ~2.5 ~ run function main:particles/red_indicator