
# -> If block is not in air then return and break
execute unless block ~ ~ ~ #air \
    unless block ~ ~ ~ #overly_realistic:forging_plate/is_cool_block \
    unless block ~ ~ ~ #overly_realistic:forging_plate/is_hot_block run \
        return run \
            function overly_realistic:general/custom_blocks/forging_plate/forging_plate_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/forging_plate/forging_plate_break

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

# -> Place display
summon minecraft:interaction ~ ~ ~ {response:1b,Tags:["OverlyRealistic.Block.ForgingPlate","OverlyRealistic.Block.ForgingPlate_Status_Empty","OverlyRealistic.Block.IsCustomBlock"],width:0.8f,height:0.2f,data:{interaction_call:"overly_realistic:general/custom_blocks/forging_plate/forging_plate_interaction",break_call:"overly_realistic:general/custom_blocks/forging_plate/forging_plate_broken_by_player"}, Passengers:[{id: "minecraft:item_display", item: {count: 1, id: "minecraft:stone_pressure_plate",components:{item_model:"overlyrealistic:blocks/forging_plate"}}, transformation: {left_rotation: [0.0f, 0.0f, 0.0f, 1.0f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [1.0000002f, 0.99999994f, 0.99999994f], translation: [0.0f, 0.3f, 0.0f]}}]}
