
# -> If block is not air then break
execute unless block ~ ~ ~ air run \
    return run \
        function overly_realistic:general/leaf_traps/leaf_trap_break_on_place

# -> Place block
setblock ~ ~ ~ oak_leaves[persistent=true]

# -> Create marker
execute align xyz run \
    summon marker ~0.5 ~ ~0.5 {Tags:["OverlyRealistic.LeafTrapActive","OverlyRealistic.Block.LeafTrap"]}

# -> Sound
playsound block.leaf_litter.break block @a ~ ~ ~ 0.5 0
