# Create marker
summon area_effect_cloud ~ ~.1 ~ {Tags:["ice_snake","obj","init","unspellable","mrcd_bullet"],Duration:30}
data modify entity @e[tag=ice_snake,tag=init,limit=1] Rotation[0] set from entity @s Rotation[0]
execute as @e[tag=ice_snake,tag=init,limit=1] at @s run tp @s ^ ^ ^.5

# Save speed and direction
execute as @e[tag=ice_snake,tag=init,limit=1] store result score @s mrcd_x0 run data get entity @s Pos[0] 1000
execute as @e[tag=ice_snake,tag=init,limit=1] store result score @s mrcd_z0 run data get entity @s Pos[2] 1000

execute store result score #var0 mrcd_system run data get entity @s Pos[0] 1000
execute store result score #var2 mrcd_system run data get entity @s Pos[2] 1000

scoreboard players operation @e[tag=ice_snake,tag=init,limit=1] mrcd_x0 -= #var0 mrcd_system
scoreboard players operation @e[tag=ice_snake,tag=init,limit=1] mrcd_z0 -= #var2 mrcd_system


# Clear tag
tag @e[tag=ice_snake,tag=init,limit=1] remove init

playsound block.glass.break ambient @a ~ ~ ~ .3 .5
