http://breezewiki.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/minecraft/wiki/Trapped_Chest
For example, to lock a trapped chest at (0, 64, 0) so that only players holding an item named "Alice's Key" can open the trapped chest, use data merge block 0 64 0 {Lock:"Alice's Key"} . Redstone component See also: Redstone circuit Trapped chests can be used to detect when their inventory is accessed by players.