
# -> 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

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

# -> Place display
summon minecraft:block_display ~ ~ ~ {Tags:["OverlyRealistic.Block.WoodenDrum"],Passengers: [{block_state: {Name: "minecraft:white_carpet"}, id: "minecraft:block_display", transformation: {left_rotation: [0.0f, 0.0f, 0.0f, 1.0f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [0.9924874f, 0.9924874f, 0.9924874f], translation: [-0.4962437f, 0.45012775f, -0.4962437f]}}, {block_state: {Name: "minecraft:oak_trapdoor", Properties: {facing: "north", half: "bottom", open: "false", powered: "false", waterlogged: "false"}}, id: "minecraft:block_display", transformation: {left_rotation: [0.0f, 0.0f, 0.0f, 1.0f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [1.024694f, 1.024694f, 1.024694f], translation: [-0.512347f, 0.30015302f, -0.512347f]}}, {block_state: {Name: "minecraft:oak_trapdoor", Properties: {facing: "north", half: "bottom", open: "false", powered: "false", waterlogged: "false"}}, id: "minecraft:block_display", transformation: {left_rotation: [1.0f, 0.0f, 0.0f, 0.0f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [1.024694f, 1.024694f, 1.024694f], translation: [-0.512347f, 0.3001091f, 0.512347f]}}], block_state: {Name: "minecraft:barrel", Properties: {facing: "up", open: "false"}}, transformation: {left_rotation: [0.0f, 0.0f, 0.0f, 1.0f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [1.0f, 0.99999994f, 0.99999994f], translation: [-0.5f, -0.5f, -0.5f]}}

# -> Place block
setblock ~ ~ ~ barrier

# -> Place interaction
summon interaction ~ ~-0.501 ~ {response:1b,Tags:["OverlyRealistic.Block.WoodenDrum","OverlyRealistic.Block.IsCustomBlock"],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"}}

# -> Remove marker
kill @s
