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

# Save speed and direction
execute as @e[tag=root_wave,tag=init,limit=1] store result score @s mrcd_x0 run data get entity @s Pos[0] 1000
execute as @e[tag=root_wave,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=root_wave,tag=init,limit=1] mrcd_x0 -= #var0 mrcd_system
scoreboard players operation @e[tag=root_wave,tag=init,limit=1] mrcd_z0 -= #var2 mrcd_system

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

playsound block.grass.break hostile @a ~ ~ ~ 1 .5
