
# -> Give torch
give @s torch

# -> Sound RNG
execute store result score #or.global OverlyRealistic.General.ArbitraryData run \
    random value 1..3

# -> Sound
execute if score #or.global OverlyRealistic.General.ArbitraryData matches 1 \
    at @s run \
        playsound item.firecharge.use block @a ~ ~ ~ 0.7 0.7
execute if score #or.global OverlyRealistic.General.ArbitraryData matches 2 \
    at @s run \
        playsound item.firecharge.use block @a ~ ~ ~ 0.7 0.2
execute if score #or.global OverlyRealistic.General.ArbitraryData matches 3 \
    at @s run \
        playsound item.firecharge.use block @a ~ ~ ~ 0.7 0.4

# -> Remove unlit torch
execute if items entity @s weapon.offhand *[custom_data={IsUnlitTorch:1b}] \
    unless items entity @s weapon.mainhand *[custom_data={IsUnlitTorch:1b}] run \
        return run \
            item modify entity @s weapon.offhand overly_realistic:multipurpose/remove_one_item
item modify entity @s weapon.mainhand overly_realistic:multipurpose/remove_one_item
