
# -> Reset adv trigger
advancement revoke @s only overly_realistic:items/use_powder_snow_bucket

# -> Add to bucket timer
scoreboard players add @s OverlyRealistic.Player.UseItem_PowderSnowBucket 1

# -> Sound
playsound block.snow.place player @a ~ ~ ~ 0.3 0

# -> Particles
execute anchored eyes \
    positioned ^ ^ ^ \
    anchored feet run \
        particle item{item:"snow"} ^ ^ ^0.8 0.0 0 0.0 0.01 5 normal @a

# -> If timer is less than the max then return
execute unless score @s OverlyRealistic.Player.UseItem_PowderSnowBucket matches 60.. run \
    return fail

# -> Reset timer
scoreboard players reset @s OverlyRealistic.Player.UseItem_PowderSnowBucket

# -> Reset raycast values
scoreboard players set @s OverlyRealistic.General.LocalRaycastRange 0
scoreboard players set @s OverlyRealistic.General.LocalRaycastRangeMax 8

# -> Perform raycast
execute anchored eyes \
    positioned ^ ^ ^ \
    anchored feet run \
        function overly_realistic:players/items/powder_snow_bucket/raycast_travel
