execute if score #a looper matches ..0 run setblock ~ ~ ~ amethyst_block execute positioned ~ ~1 ~ if score #a looper matches 1.. run function bktsb:structgen/helpers/amethyst/cast_ray execute if score #a looper matches 1.. run scoreboard players operation #a looper -= #a loopstep