Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lock & Key

Lock & Key

A datapack that locks a door or a chest to one key.

Version Minecraft Certified


Introduction

Lock chests and doors with unique and unguessable keys!

Craft a key, sneak + right-click a door or a chest, and it is now locked! No player can break, open, or activate (via redstone) the locked block without the key!

Note

Explosions are still able to break locked objects

How to Use it

Craft the key with 5 Iron Nuggets and 1 Iron Ingot.

Crafting Recipe

Name it. A key is identified by its signature (who first used the key) and its name. Renaming a key is unique from any other key!

Tip

Name your key in an anvil before you lock anything with it, and make a spare! There is no master key. Lose the key and the lock stays shut.

Note

Due to the limitations of Minecraft string comparison, a lock cannot have a " character in the name. If it does, you will not be able to lock anything.

Lock it. Sneak and right-click a door or a chest while holding the key. This will automatically sign the key to your user.

Share it. Give somebody a copy of the key and they can open everything it locked. Craft another, sign it, name it the same, and it opens the same locks.

Make spares. Lock something while holding multiple unsigned keys and the entire stack is signed at once!

Unlock it. Sneak and right-click a locked door or chest while holding the key that locked it.

Features

  • Doors cannot be opened with redstone. The door stays in the same state as when it was locked.
  • Both halves of a double chest lock, and unlock, together.
  • If the block is destroyed some other way (e.g. an explosion), the key is also destroyed.
  • Unguessable locks. Locks are keyed via their name AND who signed it. Another player cannot create a key that will open your chest, even if the name is the same!

Installation

  1. Download the release .zip.
  2. Drop it into <world>/datapacks/.
  3. /reload, or load the world.

Commands

Command Description
/function lk:give Gives an unsigned Lock Key without crafting one.
/function lk:uninstall Takes every lock off and removes any storage, tags, etc from the datapack. Run this before deleting the pack.

Tip

If you lose the key, a locked block cannot be opened (except via explosion, etc). If you uninstall while a lock is in unloaded chunks, it will not be removed. To remove a lock without a key or datapack, run the following command near the lock: /kill @n[type=minecraft:interaction,tag=lock.lock,distance=..5]


Certified Compatibility

Meets the Certified Datapack requirements

By TechnoBro03

About

A datapack that locks doors and chests to a key.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Sponsor this project

Contributors

Languages