
# -> Remove display
execute on passengers run \
    function overly_realistic:general/custom_blocks/preparation_plate/preparation_plate_break_operate_on_displays

# -> If preparation plate has indicator then remove it
execute if entity @s[tag=OverlyRealistic.Block.PreparationPlate_HasIndicator] run \
    function overly_realistic:general/custom_blocks/preparation_plate/preparation_plate_remove_indicator

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

# -> Particles
#particle block{block_state:"leaf_litter"} ~ ~-0.3 ~ 0.3 0 0.3 1 30 normal @a
particle block{block_state:"stone_pressure_plate"} ~ ~-0.3 ~ 0.3 0 0.3 1 20 normal @a
particle block{block_state:"vine"} ~ ~-0.3 ~ 0.3 0 0.3 1 20 normal @a

# -> Get if player who broke the block was in creative
scoreboard players set #or.break_player_in_creative OverlyRealistic.General.ArbitraryData 1
execute on attacker \
    if entity @s[gamemode=!creative] run \
        scoreboard players set #or.break_player_in_creative OverlyRealistic.General.ArbitraryData 0

# -> Drop item
execute if score #or.break_player_in_creative OverlyRealistic.General.ArbitraryData matches 0 \
    if entity @s[tag=!OverlyRealistic.Block.PreparationPlate_Type_GrassTuft,tag=!OverlyRealistic.Block.PreparationPlate_Type_DryGrassTuft] run \
        loot spawn ~ ~ ~ loot overly_realistic:blocks/preparation_plate/preparation_plate_leaf_litter
execute if score #or.break_player_in_creative OverlyRealistic.General.ArbitraryData matches 0 \
    if entity @s[tag=OverlyRealistic.Block.PreparationPlate_Type_GrassTuft] run \
        loot spawn ~ ~ ~ loot overly_realistic:blocks/preparation_plate/preparation_plate_grass_tuft
execute if score #or.break_player_in_creative OverlyRealistic.General.ArbitraryData matches 0 \
    if entity @s[tag=OverlyRealistic.Block.PreparationPlate_Type_DryGrassTuft] run \
        loot spawn ~ ~ ~ loot overly_realistic:blocks/preparation_plate/preparation_plate_dry_grass_tuft

# -> Remove interaction
kill @s
