execute as @e[type=zombie,tag=jjc_frozen_zombie,tag=jjc_frozen_zombie,scores={jjc_303=50..}] at @s on target run tag @s add jjc_t
execute as @e[type=zombie,tag=jjc_frozen_zombie,scores={jjc_303=50..}] at @s if entity @a[tag=jjc_t,distance=..5] run scoreboard players set @s jjc_303 -20
execute as @e[type=zombie,tag=jjc_frozen_zombie,scores={jjc_303=50..}] at @s anchored eyes run summon armor_stand ^ ^ ^ {Small:1b,Invisible:1b,Invulnerable:1b,DisabledSlots:16191,Tags:["jjc","jjc_snowball","jjc_snowball0"],attributes:[{id:"generic.gravity",base:0.04}],Passengers:[{id:"item_display",Tags:["jjc","jjc_nov","jjc_snowball2"],item:{id:"snowball"},billboard:"center",transformation:{translation:[0f,-1f,0f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.5f,0.5f,0.5f]}}]}
execute as @e[type=armor_stand,tag=jjc_snowball0] at @s run playsound entity.snowball.throw hostile @a[distance=..200] ~ ~ ~ 1 0
execute as @e[type=armor_stand,tag=jjc_snowball0] at @s positioned ~ ~1 ~ run data modify entity @n[distance=..200,type=item_display,tag=jjc_snowball2] Rotation set from entity @s Rotation
execute as @e[type=armor_stand,tag=jjc_snowball0] at @s store result score @s jjc_x1 run data get entity @s Pos[0] 1000
execute as @e[type=armor_stand,tag=jjc_snowball0] at @s store result score @s jjc_z1 run data get entity @s Pos[2] 1000
execute as @e[type=armor_stand,tag=jjc_snowball0] at @s store result score @s jjc_y1 run data get entity @s Pos[1] 1000
scoreboard players remove @e[type=armor_stand,tag=jjc_snowball0] jjc_y1 3000
execute as @e[type=armor_stand,tag=jjc_snowball0] at @s as @n[distance=..60,tag=jjc_t] at @s store result score @s jjc_x2 run data get entity @s Pos[0] 1000
execute as @e[type=armor_stand,tag=jjc_snowball0] at @s as @n[distance=..60,tag=jjc_t] at @s store result score @s jjc_z2 run data get entity @s Pos[2] 1000
execute as @e[type=armor_stand,tag=jjc_snowball0] at @s as @n[distance=..60,tag=jjc_t] at @s store result score @s jjc_y2 run data get entity @s Pos[1] 1000
execute as @e[type=armor_stand,tag=jjc_snowball0] at @s store result entity @s Motion[0] double -0.00015 run scoreboard players operation @s jjc_x1 -= @n[distance=..60,tag=jjc_t] jjc_x2
execute as @e[type=armor_stand,tag=jjc_snowball0] at @s store result entity @s Motion[2] double -0.00015 run scoreboard players operation @s jjc_z1 -= @n[distance=..60,tag=jjc_t] jjc_z2
execute as @e[type=armor_stand,tag=jjc_snowball0] at @s store result entity @s Motion[1] double -0.0001 run scoreboard players operation @s jjc_y1 -= @n[distance=..60,tag=jjc_t] jjc_y2
tag @e[type=armor_stand,tag=jjc_snowball0] remove jjc_snowball0
execute as @e[type=zombie,tag=jjc_frozen_zombie,scores={jjc_303=50..}] at @s store result score @s jjc_303 run random value -20..0
tag @a[tag=jjc_t] remove jjc_t
schedule function colosseum_of_fools:ss/frozen_zombie/snowball/tick 1t replace