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

# -> If current block is a special block then trigger event
execute if block ~ ~ ~ #overly_realistic:lava_bucket_special run \
    return run \
        function overly_realistic:players/items/powder_snow_bucket/special_block_event

# -> If raycast is blocked then return
execute unless block ~ ~ ~ #overly_realistic:spear_can_passthrough \
    positioned ^ ^ ^-0.1 run \
        return run \
            function overly_realistic:players/items/powder_snow_bucket/downwards_raycast_start

# -> Add to range
scoreboard players add @s OverlyRealistic.General.LocalRaycastRange 1

# -> If current range >= max range then operate
execute if score @s OverlyRealistic.General.LocalRaycastRange >= @s OverlyRealistic.General.LocalRaycastRangeMax run \
    return run \
        function overly_realistic:players/items/powder_snow_bucket/downwards_raycast_start

# -> Recursive loop
execute positioned ^ ^ ^0.1 run \
    function overly_realistic:players/items/powder_snow_bucket/raycast_travel