Minecraft Data Packs / Item

Key (Lock Chests)

  • check_circle Advancements
  • check_circle Functions
  • check_circle Recipes
  • 31,794 views, 30 today
  • 5,178 downloads, 5 today
  • 87
  • 89
  • 202
CMD-Golem avatar CMD-Golem
Level 60 : High Grandmaster Engineer
178
Lock your Chest to protect your items from other players and Creepers. Shift right click on the Chest to lock or unlock it. You can only unlock the Chest if you originally locked it. It doesn't matter which Key you use.

Even if something destroys the Chest or a Hopper is placed under the Chest, your items can't be stolen. However, be aware that items you put a locked Chest with a Hopper will drop out when you unlock it.


Crafting
Key (Lock Chests) Minecraft Data Pack

The Crafting Table will show a Gold Nugget as result, but you will get the correct item after you take it out.

[​1.16+] You can repair your Key, if you drop a Gold Ingot with the Key on an Anvil. To get more durability you can also enchant it with Unbreaking.

Observer Addon
Use this add-on to automatically unlock the locked Chest if you are in a radius of 2 blocks.

Download

Settings
Show messages in the chat instead of above the hotbar.
/scoreboard players set #message chestlock 1

Get the Admin Key.
/function chest_lock:craft/admin_key
[​1.16+] Disable tool damage when locking a Chest.
/scoreboard players set #damage chestlock 1
If you get a Green Shulker Box when you lock or unlock a chest you can use this two commands to fix it. Afterwards the Key won't get damaged and all items which are putted into the chest, while it is looked will be lost if you unlock it.
/scoreboard players set #compatible chestlock /scoreboard players set #damage chestlock 1
To disable the setting again you need to execute the same command except of the 1 replace with a 0.





If you have questions or you discovered a bug, please write a comment below.
CompatibilityMinecraft 1.15
toMinecraft 1.19
Tags

12 Update Logs

v3.4 : by CMD-Golem 04/09/2022 4:17:01 pmApr 9th

Fixed bug with addon
LOAD MORE LOGS

Create an account or sign in to comment.

1
06/22/2022 5:52 am
Level 1 : New Miner
IceMonsterKing
IceMonsterKing avatar
Hey! I just installed the pack in my friend's server but for some reason, the key spawns every 3 seconds and it's annoying, is there anything that I can stop this?
1
06/22/2022 6:32 am
Level 60 : High Grandmaster Engineer
CMD-Golem
CMD-Golem avatar
You probably use a crafting recipe unlocker.
If yes. This is the problem. You need to use my crafting recipe unlocker. if you want one.
If you don't use one, could you send me a list of all other data packs you have installed
1
06/16/2022 6:50 am
Level 1 : New Miner
IKoned
IKoned avatar
How to remove all locks for all chests?
1
06/16/2022 11:48 am
Level 60 : High Grandmaster Engineer
CMD-Golem
CMD-Golem avatar
You can get yourself the admin key with the following command and unlock all the chest with it, no matter who locked it
/function chest_lock:craft/admin_key
2
06/09/2022 5:57 pm
Level 1 : New Miner
setlegend
setlegend avatar
hi, great datapack worked for almost 3 weeks but the datapack crashed once i added a hopper feeding into a locked chest then the chest wouldnt open or close with any type of key all the items that were in the chest disappeared and the items fed by the hoppers are dropped when the chest is broken (the chest was locked and it broke somehow) playing in 1.18.2 can you see further into the issue ? thanks
1
06/11/2022 11:40 am
Level 60 : High Grandmaster Engineer
CMD-Golem
CMD-Golem avatar
I don't thing that the data pack had any thing to do with the game crash, which probably also caused the other issues.
You can try to place a new chest at the spot where the broken one was placed and unlock the chest with the key, you get from this command:
/function chest_lock:craft/admin_keyIf this doesn't work there is probably no way to restore your items anymore. Im really sorry.

Can you anyway send me the crash log. Then I can hopefully find out what caused the problem.
You can get the crash log if you press the key combination windows key + r and enter the following text in the little window which should have opened: "%appdata%\.minecraft\crash-reports"
1
06/09/2022 10:36 am
Level 1 : New Miner
baooduy
baooduy avatar
Hi, after installed the datapack all the chest will not drop when you break it, disable the datapack fixes the issue, am I doing something wrong?
1
06/09/2022 11:33 am
Level 60 : High Grandmaster Engineer
CMD-Golem
CMD-Golem avatar
You cant break a chest when its locked. All the other ones should still be breakable.
1
06/11/2022 4:21 am
Level 1 : New Miner
baooduy
baooduy avatar
No i mean the unlocked chest doesnt drop, the item inside drops out but not the chest, they just disappear
1
06/11/2022 11:05 am
Level 60 : High Grandmaster Engineer
CMD-Golem
CMD-Golem avatar
Hmm. Execute the following command and try again:
/gamerule doTileDrops trueIf it still doesn't work. Delete the data pack file from your world and download it.
Hopefully it works afterwards.
Planet Minecraft

Website

© 2010 - 2022
www.planetminecraft.com

Welcome