
# -> Debug particles
#particle soul_fire_flame ~ ~ ~ 0 0 0 0.0001 1 force @a

# -> If current block is blocked then return
execute unless block ~ ~ ~ #overly_realistic:spear_can_passthrough run \
    return fail

# -> If block below is a special block then trigger event
#execute positioned ~ ~-1 ~ \
    if block ~ ~ ~ #overly_realistic:water_bucket_special run \
        return run \
            function overly_realistic:players/items/entity_bucket/special_block_event

# -> If current block allows placement then place water bucket
execute if predicate overly_realistic:world/blocks/has_blocks_around run \
    return run \
        function overly_realistic:players/items/entity_bucket/place_block

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

# -> Recursive loop
execute unless score @s OverlyRealistic.General.LocalRaycastRange matches 8.. \
    positioned ~ ~-1 ~ run \
        function overly_realistic:players/items/entity_bucket/downwards_raycast_travel
