
# -> If block is a chest then return and operate
execute if block ~ ~ ~ #overly_realistic:chests \
    align xyz \
    positioned ~0.5 ~0.5 ~0.5 run \
        return run \
            function overly_realistic:players/vanilla_block_use/chest/block_detect

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

# -> Recursive loop
execute unless score @s OverlyRealistic.General.LocalRaycastRange >= @s OverlyRealistic.General.LocalRaycastRangeMax \
    positioned ^ ^ ^0.1 run \
        function overly_realistic:players/vanilla_block_use/chest/raycast_travel
