Item Position Crate Lock

Complexity: simple
<h1 class=Item Position Crate Lock"/>

Item Position Crate Lock

This circuit only gives a signal if the right items are placed in the right places in the chest.

The circuit is based on the command block instruction /testforblock. You do not need mods.


First you rebuild the circuit from the picture. The chest is a redstone chest, so that it emits a signal when it is opened. Behind it, the signal is reversed and the command block is activated. Now comes the most important thing: The command of the command block. This is to test if there is a chest with the specified contents at the location of the chest. The command is always different, in my case it is:
testforblock ~ ~ ~3 trapped_chest 1 {

The first bold area is the place for the coordinates of the redstone chest. There you can either use absolute coordinates (e.g. "295 65 -392") or, like me, relative coordinates (e.g. "~ ~ ~3", which means the block that is 3 blocks further on the Z-axis from the command block). Depending on how you built the circuit, you have to adjust the coordinates. The second bold position ("1"), indicates the orientation of the chest. It's best to try it with 1 first, and if that's wrong, the lower field of the command block will show the correct number for the orientation. Then you have to specify at which position which item should be "Slot:1b" indicates the position of the item in the box. The count starts at the top left with 0. So, for example, the field at the top right has the value 8. "id:minecraft:paper" indicates the type of item, here paper (the data values can be found in the Minecraftwiki for items/blocks in the box on the right).
In my case, the correct arrangement:

A comparator checks whether the command was executed correctly, i.e. the items are in the right places. After that comes an amplifier to amplify the signal and then you can connect something, for example a secret door.

You can also use a normal free-standing chest instead of the Redstone chest. Then you have to start the command at the comparator either manually with a switch or you use a pulse generator, which constantly executes the command, which leads to lags in my case.

I got these instructions from this video:


  1. No, the paper ID is already correct (see [[data values]]).
    I ran the command again on mine and it doesn't work for me now either, so some update must have changed something in the commands. I'll see if I can find the change.
    Edit: OK, it's because in Minecraft you don't specify the item IDs anymore, you specify the name. So instead of "339s", write "minecraft:paper". I also changed the description above.