
# -> Remove Display
execute on passengers run \
    kill @s

# -> Remove barrier
fill ~ ~1 ~ ~ ~2 ~ air replace barrier strict

# -> Check for creative mode
scoreboard players set #or.is_player_in_creative_break_figure OverlyRealistic.General.ArbitraryData 0
execute on attacker \
    if entity @s[gamemode=creative] run \
        scoreboard players set #or.is_player_in_creative_break_figure OverlyRealistic.General.ArbitraryData 1

# -> Drop item
execute unless score #or.is_player_in_creative_break_figure OverlyRealistic.General.ArbitraryData matches 1 run \
    function overly_realistic:general/custom_blocks/lay_figure/lay_figure_break with entity @s data

# -> Sound
playsound block.wood.break block @a ~ ~1 ~ 1 1
playsound block.stone.break block @a ~ ~1 ~ 1 1
playsound entity.zombie.break_wooden_door block @a ~ ~1 ~ 0.2 1.5

# -> Particles
particle block{block_state:"cobblestone"} ~ ~0.5 ~ 0.3 0.1 0.3 0.1 9 normal @a

# -> Remove interaction
kill @s
