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

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

# -> Place interaction
summon interaction ~ ~-0.5 ~ {response:1b,Tags:["OverlyRealistic.Block.GoryHide","OverlyRealistic.Block.IsCustomBlock","OverlyRealistic.Block.GoryHide_Temp"],width:0.5f,height:0.2f,data:{interaction_call:"overly_realistic:general/custom_blocks/gory_hide/gory_hide_interaction",break_call:"overly_realistic:general/custom_blocks/gory_hide/gory_hide_break"},Passengers:[{id:"item_display",Tags:["OverlyRealistic.Block.GoryHide_Item"], transformation: {left_rotation: [-0.7071068f, 0.0f, 0.0f, 0.7071068f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [0.99999994f, 0.9999999f, 0.9999999f], translation: [0.0f, -0.168f, 0.0f]}}]}

# -> Globalize data
data modify storage overly_realistic:blocks block_type_globalized set from entity @s data.or_hide_type

# -> Edit hide
execute align xyz \
    as @n[type=interaction,tag=OverlyRealistic.Block.GoryHide_Temp,dx=0,dy=0,dz=0] run \
        function overly_realistic:general/custom_blocks/gory_hide/gory_hide_placed_edit with storage overly_realistic:blocks

# -> Remove marker
kill @s
