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

# -> Add to item timer
scoreboard players add @s OverlyRealistic.Player.UseItem_MeltedGoldCrucible 1

# -> Sound
playsound block.lava.extinguish player @a ~ ~ ~ 0.1 2

# -> Particles
execute anchored eyes \
    positioned ^ ^ ^ \
    anchored feet run \
        particle falling_lava ^ ^ ^0.8 0.1 0 0.1 0.1 5 normal @a

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

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

# -> 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/melted_gold_crucible/raycast_travel
