
# -> Add to heat value
scoreboard players add @s OverlyRealistic.World.ClayMoldHeat 1

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

# -> Store mold type
data modify storage overly_realistic:clay_molds hardened_clay_mold_type set from entity @s data.molded_mold_type

# -> Change data
tag @s add OverlyRealistic.Block.HardenedClayMold
tag @s remove OverlyRealistic.Block.ClayMold_HasBeenMolded
tag @s remove OverlyRealistic.Block.ClayMold

data merge entity @s \
    {\
        data:\
            {\
                interaction_call:"overly_realistic:general/custom_blocks/hardened_clay_mold/hardened_clay_mold_interaction", \
                break_call:"overly_realistic:general/custom_blocks/hardened_clay_mold/hardened_clay_mold_break" \
            }\
    }

execute on passengers run \
    function overly_realistic:general/custom_blocks/clay_mold/looping_operations/clay_mold_set_item_from_heat with storage overly_realistic:clay_molds
