
# -> If block is not in air then return and break
execute unless block ~ ~ ~ #air run \
    return run \
        function overly_realistic:general/custom_blocks/mortar/mortar_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/mortar/mortar_break

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

# -> Place display
summon minecraft:item_display ~ ~ ~ {Passengers: [{id:"interaction",response:1b,Tags:["OverlyRealistic.Block.Mortar","OverlyRealistic.Block.Mortar_Status_Empty","OverlyRealistic.Block.IsCustomBlock"],width:1.0f,height:-0.5f,data:{MortarItems:[],interaction_call:"overly_realistic:general/custom_blocks/mortar/mortar_interaction",break_call:"overly_realistic:general/custom_blocks/mortar/mortar_broken_by_player"}},{id: "minecraft:item_display", item: {count: 1, id: "minecraft:cobblestone_slab",components:{item_model:"overlyrealistic:blocks/mortar"}}, transformation: {left_rotation: [0.0f, 0.0f, 0.0f, 1.0f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [0.4375f, 0.4375f, 0.4375f], translation: [0.0f, -0.29f, 0.0f]}}]}
