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

# -> Particles
particle smoke ~ ~0.8 ~ 0.1 0.1 0.1 0.1 3 normal @a
particle campfire_cosy_smoke ~ ~0.8 ~ 0.1 0.1 0.1 0.01 1 normal @a

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

# -> Store mold type & contents
execute on passengers run \
    data modify storage overly_realistic:clay_molds hardened_clay_mold_type set from entity @s item.components."minecraft:entity_data".data.clay_mold_type
execute on passengers run \
    data modify storage overly_realistic:clay_molds hardened_clay_mold_cooled_contents set from entity @s item.components."minecraft:entity_data".data.cooled_contents

# -> Modify item
execute on passengers run \
    function overly_realistic:general/custom_blocks/hardened_clay_mold/looping_operations/hardened_clay_mold_set_item_from_cooling with storage overly_realistic:clay_molds

# -> Tag as having cooled contents
tag @s add OverlyRealistic.Block.HardenedClayMold_HasCooledContents

# -> Tag as drops item
tag @s add OverlyRealistic.Block.HardenedClayMold_DropsItem
