Minecraft wiki entry for Hopper, associated text: In Java Edition, a hopper's GUI can be "locked" (or subsequently unlocked) by setting the hopper's Lock tag with the data command. If a hopper's Lock tag is not blank, the hopper cannot be accessed except by players holding an item with the same name as the Lock tag's text. For example, to lock a hopper at (0,64,0) so that only players holding an item named "Steve's Key" can access the hopper, use /data merge block 0 64 0 {Lock:"Steve's Key"}.