
# -> If block is not in air then return and break
execute unless block ~ ~ ~ #air run \
    return run \
        function overly_realistic:general/custom_blocks/preparation_plate/preparation_plate_break

# -> Sound
playsound block.stone.place block @a ~ ~ ~ 1 1
playsound block.leaf_litter.place block @a ~ ~ ~ 1 1
playsound block.leaf_litter.place block @a ~ ~ ~ 1 1.5
playsound block.leaf_litter.place block @a ~ ~ ~ 1 0.5

# -> Place display
summon minecraft:block_display ~ ~ ~ {Tags:["OverlyRealistic.Block.PreparationPlate"],Passengers: [{block_state: {Name: "minecraft:leaf_litter", Properties: {facing: "north", segment_amount: "4"}}, id: "minecraft:block_display", transformation: {left_rotation: [0.05055639f, -0.7052971f, -0.050556213f, 0.70529723f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [1.0f, 0.9999992f, 0.99999964f], translation: [0.50000006f, -0.36481664f, -0.5662026f]}}, {block_state: {Name: "minecraft:leaf_litter", Properties: {facing: "north", segment_amount: "4"}}, id: "minecraft:block_display", transformation: {left_rotation: [0.0f, 0.0f, 0.042268623f, 0.99910635f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [0.99999976f, 0.99999976f, 1.0f], translation: [-0.4559825f, -0.4816063f, -0.5f]}}, {block_state: {Name: "minecraft:leaf_litter", Properties: {facing: "north", segment_amount: "4"}}, id: "minecraft:block_display", transformation: {left_rotation: [0.0f, 0.0f, -0.07118339f, 0.99746335f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [0.9999995f, 0.9999995f, 0.99999976f], translation: [-0.5659358f, -0.36509222f, -0.5f]}}, {block_state: {Name: "minecraft:leaf_litter", Properties: {facing: "north", segment_amount: "4"}}, id: "minecraft:block_display", transformation: {left_rotation: [-0.050556313f, 0.70529723f, -0.050556343f, 0.7052972f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [1.0f, 0.9999996f, 1.0f], translation: [-0.5f, -0.3648166f, 0.56620264f]}}, {block_state: {Name: "minecraft:vine", Properties: {east: "false", north: "false", south: "false", up: "true", west: "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.0f, 0.9999998f, 0.9999998f], translation: [-0.5f, 0.52221674f, 0.4521031f]}}], block_state: {Name: "minecraft:stone_pressure_plate", Properties: {powered: "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, 1.0f, 1.0f], translation: [-0.5f, -0.5f, -0.5f]}}

# -> Place interaction
summon interaction ~ ~-0.5 ~ {response:1b,Tags:["OverlyRealistic.Block.PreparationPlate","OverlyRealistic.Block.IsCustomBlock"],width:1.001f,height:0.25f,data:{PlateItems:[],interaction_call:"overly_realistic:general/custom_blocks/preparation_plate/preparation_plate_interact",break_call:"overly_realistic:general/custom_blocks/preparation_plate/preparation_plate_broken_by_player"}}

# -> Remove marker
kill @s
