
# -> If block is not a campfire then return and break
execute unless block ~ ~ ~ #campfires run \
    return run \
        function overly_realistic:general/custom_blocks/charcoal_clump/charcoal_clump_break

# -> If block is inside another custom block then return and break
execute align xyz \
    if entity @n[type=interaction,tag=OverlyRealistic.Block.IsCustomBlock,tag=!OverlyRealistic.Block.IsFullBlock,dx=0,dy=0,dz=0] run \
        return run \
            function overly_realistic:general/custom_blocks/charcoal_clump/charcoal_clump_break

# -> Sound
playsound block.stone.place block @a ~ ~ ~ 0.45 1

# -> Place interaction
summon interaction ~ ~-0.5 ~ {response:1b,Tags:["OverlyRealistic.Block.CharcoalClump","OverlyRealistic.Block.IsCustomBlock"],width:0.9f,height:0.4f,data:{interaction_call:"",break_call:"overly_realistic:general/custom_blocks/charcoal_clump/charcoal_clump_break"},Passengers:[{id:"item_display",item: {count: 1, id: "minecraft:coal_block", components:{"minecraft:item_model":"overlyrealistic:blocks/charcoal_clump_placed"}}, transformation: {left_rotation: [0.0f, 0.0f, 0.0f, 1.0f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [0.757f, 0.37999994f, 0.757f], translation: [0.0f, -0.17f, 0.0f]}}]}

# -> Advancement
advancement grant @p[tag=OverlyRealistic.Player.PlacedCustomBlock,distance=..64] only overly_realistic:advancements/iron_age/town_of_ember

# -> Remove marker
kill @s
