The bug
When you have two locked chests next to each other forming a double chest, the lock for both chests is only set when a player tries to open the chest and is set based on the direction the chests are placed.
Expected behavior
When a chest is placed next to an existing chest, the lock of the existing chest should be set to the lock of the placed chest.
Same should apply when using /blockdata
.
How to reproduce
Lock set when player tries to open chest
Place two locked chests next to each other
/setblock ~1 ~ ~ chest default replace {Lock:"chestA"}
/setblock ~1 ~ ~1 chest default replace {Lock:"chestB"}
Use
/blockdata
to show the NBT data of the chests
→ The chests showLock:"chestA"
andLock:"chestB"
Try to open the chest
Use
/blockdata
again
→ The chests show bothLock:"chestA"
Direction based
This is caused by how inventories of double chests are returned, changing it so that the lock is not set when the inventory is opened solves this as well
Place two locked chests next to each other
/setblock ~1 ~ ~ chest default replace {Lock:"chestA"}
/setblock ~1 ~ ~-1 chest default replace {Lock:"chestB"}
Try to open the chest
Use
/blockdata
→ Now both chests showLock:"chestB"
whereas in the steps above they showedLock:"chestA"
I can't reproduce it in 1.14.3 pre-release2