
# -> If heat is over 100 then return
execute if score @s OverlyRealistic.World.CrucibleHeat matches 100.. run \
    return fail

# -> Add to heat
scoreboard players add @s OverlyRealistic.World.CrucibleHeat 2

# -> Globalize heat value
scoreboard players operation #or.crucible_heat OverlyRealistic.General.ArbitraryData = @s OverlyRealistic.World.CrucibleHeat

# -> Show player the heat value
scoreboard players set #or.heat_crucible_success OverlyRealistic.General.ArbitraryData 1

# -> If heat < 100 then return
execute unless score @s OverlyRealistic.World.CrucibleHeat matches 100.. run \
    return fail

# -> Show player the max heat value
scoreboard players set #or.heat_crucible_success OverlyRealistic.General.ArbitraryData 2

# -> Particles
particle lava ~0.5 ~0.4 ~0.5 0.1 0 0.1 0.1 8 normal @a
particle campfire_signal_smoke ~0.5 ~0.4 ~0.5 0.1 0 0.1 0.1 5 normal @a

# -> Sound
playsound item.firecharge.use block @a ~ ~ ~ 1 1.5

# --> Heat contents

# -> Copper fragments
execute if entity @s[tag=OverlyRealistic.Block.Crucible_HasCopperFragments] run \
    return run \
        function overly_realistic:general/custom_blocks/bellow/bellow_events/heat_copper_fragments

# -> Iron fragments
execute if entity @s[tag=OverlyRealistic.Block.Crucible_HasIronFragments] run \
    return run \
        function overly_realistic:general/custom_blocks/bellow/bellow_events/heat_iron_fragments

# -> Gold fragments
execute if entity @s[tag=OverlyRealistic.Block.Crucible_HasGoldFragments] run \
    return run \
        function overly_realistic:general/custom_blocks/bellow/bellow_events/heat_gold_fragments
