
# -> Detect blocks
execute unless block ~ ~ ~ #overly_realistic:spear_can_passthrough run \
    return fail

# -> Detect water
execute if block ~ ~ ~ water[level=0] run \
    return run \
        function overly_realistic:players/items/wooden_bucket/empty_bucket_use/get_water

# -> Detect water cauldron
execute if block ~ ~ ~ water_cauldron run \
    return run \
        function overly_realistic:players/items/wooden_bucket/empty_bucket_use/get_water

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

# -> Recursive 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/wooden_bucket/empty_bucket_use/raycast_travel
