
# -> Get the amount of raw ore
execute store result score #or.raw_ore_amount OverlyRealistic.General.ArbitraryData \
    if data storage overly_realistic:temp_values temp_mortar_items[{components:{"minecraft:custom_data":{or_raw_ore_type:"copper"}}}]

# -> If the amount of ores is incorrect then return
execute if score #or.raw_ore_amount OverlyRealistic.General.ArbitraryData matches ..3 run \
    return fail

# -> Sound
playsound block.stone.break block @a ~ ~ ~ 0.5 1
playsound block.stone.hit block @a ~ ~ ~ 0.45 2

# -> Particle
particle item{item:"raw_copper"} ~ ~ ~ 0.1 0.1 0.1 0.1 8 normal @a

# -> Drop item
loot spawn ~ ~ ~ loot overly_realistic:items/mortar_pestle_interaction_items/copper_fragments

# -> Advancement
execute on target run \
    advancement grant @s only overly_realistic:advancements/copper_age/crushing_realization

# -> Remove items
function overly_realistic:general/custom_blocks/mortar/interactions/int_remove_all_items_no_drop
