execute unless entity @s[scores={stun=..0,confusion=..0}] run return fail
$execute as @s at @s run particle $(particle) ~ ~1 ~ 0.25 0.25 0.25 0 25
# $scoreboard players set @s throw_prediction $(prediction)
# execute if entity @a[scores={left=15..}] run scoreboard players add @s throw_prediction 15
# execute if entity @a[scores={right=15..}] run scoreboard players remove @s throw_prediction 15
# execute store result storage enemy throw_prediction int 1 run scoreboard players get @s throw_prediction

$summon block_display $(position) {teleport_duration:1,Glowing:1b,Tags:["throw","$(id)_throw"],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[$(translation)],scale:[$(size)]},block_state:{Name:"$(texture)"}}
$team join red_color @e[type=block_display,tag=$(id)_throw]

$execute as @e[type=block_display,tag=throw,tag=!thrown] at @s run teleport @s $(position) $(rotation)

execute as @e[type=block_display,tag=throw,tag=!thrown] at @s run rotate @s facing entity @p eyes

$execute as @e[type=block_display,tag=throw,tag=!thrown] at @s run rotate @s $(rotation)

execute as @e[type=block_display,tag=throw,tag=!thrown] at @s run function main:game/mobs/ai/projectile/throw_prediction with storage enemy

execute as @e[type=block_display,tag=throw,tag=!thrown] at @s facing entity @p eyes run scoreboard players set @s throw_distance 0

execute as @e[type=block_display,tag=throw,tag=!thrown] at @s run tag @s add thrown
