# Trail
function items:wand/trail

# Trigger spell
function mrcd:ray_tick
execute if entity @s[tag=mrcd_touch_edge,tag=mrcd_touch_y_plus] run function items:wand/arch/sort

# Gavity for the arch trajectory
execute if score @s mrcd_y0 matches -19999.. run scoreboard players remove @s mrcd_y0 50
execute if score @s mrcd_y0 matches ..-20001 run scoreboard players set @s mrcd_y0 -20000

# Y- axies bounces fine
execute if entity @s[tag=mrcd_touch_edge,tag=mrcd_touch_x_plus] run scoreboard players set @s mrcd_x0 0
execute if entity @s[tag=mrcd_touch_edge,tag=mrcd_touch_x_minus] run scoreboard players set @s mrcd_x0 0
execute if entity @s[tag=mrcd_touch_edge,tag=mrcd_touch_z_plus] run scoreboard players set @s mrcd_z0 0
execute if entity @s[tag=mrcd_touch_edge,tag=mrcd_touch_z_minus] run scoreboard players set @s mrcd_z0 0
execute if entity @s[tag=mrcd_touch_edge,tag=!mrcd_touch_y_plus,tag=!mrcd_touch_y_minus] at @s anchored eyes run tp @s ^ ^ ^-.02
# execute if entity @s[tag=mrcd_touch_edge,tag=!mrcd_touch_y_plus,tag=!mrcd_touch_y_minus] run data modify entity @s Rotation[1] set value -90
