
# -> Check for block collision
execute unless block ~ ~ ~ #overly_realistic:spear_can_passthrough run \
    return fail

# -> Debug particles
#particle small_flame ~ ~ ~ 0 0 0 0.001 1 force @a

# -> Check for sheep
execute positioned ~-0.5 ~-0.5 ~-0.5 \
    as @n[type=sheep,dx=0,dy=0,dz=0,predicate=!overly_realistic:animal/sheep_has_been_sheared,sort=arbitrary] \
    at @s run \
        return run \
            function overly_realistic:players/items/shears/sheep_shearing/shear_sheep_attempt

# -> Increment raycast
scoreboard players add #or.Raycast.RayRange OverlyRealistic.General.ArbitraryData 1

# -> Loop
execute unless score #or.Raycast.RayRange OverlyRealistic.General.ArbitraryData >= #or.Raycast.RayRangeMax OverlyRealistic.General.ArbitraryData \
    positioned ^ ^ ^0.1 run \
        function overly_realistic:players/items/shears/sheep_shearing/shears_raycast_travel
