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

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

# -> Place block
setblock ~ ~ ~ barrier

# -> Place interaction
summon interaction ~ ~-0.501 ~ {response:1b,Tags:["OverlyRealistic.Block.WoodenDrum","OverlyRealistic.Block.IsCustomBlock","OverlyRealistic.Block.IsFullBlock"],width:1.001f,height:1.002f,data:{interaction_call:"overly_realistic:general/custom_blocks/wooden_drum/wooden_drum_interaction",break_call:"overly_realistic:general/custom_blocks/wooden_drum/wooden_drum_broken_by_player"},Passengers:[{id:"item_display",Tags:["OverlyRealistic.Block.WoodenDrum"], item: {components: {"minecraft:item_model": "overlyrealistic:blocks/wooden_drum"}, count: 1, id: "minecraft:paper"}, transformation: {left_rotation: [0.0f, 0.0f, 0.0f, 1.0f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [1.0f, 1.0f, 1.0f], translation: [0.0f, -0.501f, 0.0f]}}]}

# -> Remove marker
kill @s
