
# -> If chest is 'type = left' then return and create marker
execute if block ~ ~ ~ #overly_realistic:chests[type=left] run \
    return run \
        execute unless entity @n[type=marker,tag=OverlyRealistic.Block.ContainerIsChest,distance=..1] run \
            summon marker ~ ~ ~ {Tags:["OverlyRealistic.Block.ContainerIsChest","OverlyRealistic.Block.ChestLeftSide","OverlyRealistic.Block.IsContainer"]}

# -> If chest is 'type = single' then return and create marker
execute if block ~ ~ ~ #overly_realistic:chests[type=single] run \
    return run \
        execute unless entity @n[type=marker,tag=OverlyRealistic.Block.ContainerIsChest,distance=..1] run \
            summon marker ~ ~ ~ {Tags:["OverlyRealistic.Block.ContainerIsChest","OverlyRealistic.Block.ChestSingle","OverlyRealistic.Block.IsContainer"]}

# --> If not returned yet, then chest = right

# -> Create a marker on the left chest
execute if block ~ ~ ~ #overly_realistic:chests[facing=north] run \
    return run \
        execute positioned ~-1 ~ ~ \
        unless entity @n[type=marker,tag=OverlyRealistic.Block.ContainerIsChest,distance=..1] run \
            summon marker ~ ~ ~ {Tags:["OverlyRealistic.Block.ContainerIsChest","OverlyRealistic.Block.ChestLeftSide","OverlyRealistic.Block.IsContainer"]}
execute if block ~ ~ ~ #overly_realistic:chests[facing=south] run \
    return run \
        execute positioned ~1 ~ ~ \
        unless entity @n[type=marker,tag=OverlyRealistic.Block.ContainerIsChest,distance=..1] run \
            summon marker ~ ~ ~ {Tags:["OverlyRealistic.Block.ContainerIsChest","OverlyRealistic.Block.ChestLeftSide","OverlyRealistic.Block.IsContainer"]}
execute if block ~ ~ ~ #overly_realistic:chests[facing=east] run \
    return run \
        execute positioned ~ ~ ~-1 \
        unless entity @n[type=marker,tag=OverlyRealistic.Block.ContainerIsChest,distance=..1] run \
            summon marker ~ ~ ~ {Tags:["OverlyRealistic.Block.ContainerIsChest","OverlyRealistic.Block.ChestLeftSide","OverlyRealistic.Block.IsContainer"]}
execute positioned ~ ~ ~1 \
    unless entity @n[type=marker,tag=OverlyRealistic.Block.ContainerIsChest,distance=..1] run \
        summon marker ~ ~ ~ {Tags:["OverlyRealistic.Block.ContainerIsChest","OverlyRealistic.Block.ChestLeftSide","OverlyRealistic.Block.IsContainer"]}
