scoreboard players remove @s manalabs_scp_ray_age 1

scoreboard players set @s manalabs_scp_continue_loop 0
execute if block ~ ~ ~ water run scoreboard players set @s manalabs_scp_continue_loop 1
execute if block ~ ~ ~ air run scoreboard players set @s manalabs_scp_continue_loop 1
execute if block ~ ~ ~ lava run scoreboard players set @s manalabs_scp_continue_loop 1
execute if block ~ ~ ~ flowing_water run scoreboard players set @s manalabs_scp_continue_loop 1
execute if block ~ ~ ~ flowing_lava run scoreboard players set @s manalabs_scp_continue_loop 1

execute if score @s manalabs_scp_continue_loop matches 0 run function manalabs/scp/flesh_tools/shovel_ray_finish

execute if score @s manalabs_scp_ray_age matches 1.. if score @s manalabs_scp_continue_loop matches 1 positioned ^ ^ ^0.1 run function manalabs/scp/flesh_tools/shovel_ray_tick