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

# -> Set block
setblock ~ ~ ~ barrier

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

# -> Place display
summon interaction ~ ~ ~ {response:1b,Tags:["OverlyRealistic.Block.Composter","OverlyRealistic.Block.IsCustomBlock","OverlyRealistic.Block.IsFullBlock"],width:1.01f,height:1.01f,data:{or_custom_block_id:"composter",or_is_custom_block:1b,interaction_call:"overly_realistic:general/custom_blocks/composter/composter_interaction",break_call:"overly_realistic:general/custom_blocks/composter/composter_break"},Passengers:[{id:"item_display",Tags:["OverlyRealistic.Block.Composter"],item: {components: {"minecraft:item_model": "overlyrealistic:blocks/composter_placed"}, count: 1, id: "minecraft:copper_block"}, 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.5f,0.0f]}}]}
