Lock a Chest and Protect It from Other Players
Prepare Your Key
Rename a trial key (ominous or normal) inside an anvil. You can use any name you want—this becomes your unique password. Write it down or remember it, as you'll need an identical key to open the chest later.
Lock the Container
Hold your renamed key in your hand and right-click the chest, barrel, or shulker box you want to protect. The container is now locked to that key name only. No other player can open or break it without the exact matching key.
Keep Your Key Safe
Store your renamed key somewhere secure. If you lose it, you'll need to either craft lockpicks to break in (and solve the minigame), or use the locksmith recovery system if enabled on your server. For double chests, lock one half—both will be protected together.
Unlock When Needed
Whenever you want to open your locked container, simply hold the matching renamed key in your inventory and right-click normally. The container opens as if it were unlocked.