
Lock & Key
一个将门或箱子锁定到特定钥匙的数据包。
简介
使用独特且无法猜测的钥匙来锁住箱子和门!
合成一把钥匙,潜行 + 右键点击一扇门或箱子,它就会被锁定!没有这把钥匙,其他玩家无法破坏、打开或通过红石激活被锁定的方块!
[!NOTE]
爆炸仍然可以破坏被锁定的物体。
使用方法
制作钥匙。使用 5 个铁粒和 1 个铁锭合成。

命名。钥匙通过其签名(首次使用者)和名称来识别。重命名钥匙会使其独一无二!
[!TIP]
在使用钥匙锁定任何物品之前,请在铁砧中为其命名,并制作备用钥匙!
不存在万能钥匙。丢失钥匙后,锁将保持关闭状态。
[!NOTE]
由于 Minecraft 字符串比较的限制,锁的名称中不能包含 " 字符。如果包含,你将无法锁定任何物品。
锁定。手持钥匙时,潜行并右键点击一扇门或箱子。这将自动将钥匙签名绑定到你的用户。
分享。给某人一把钥匙的副本,他们就可以打开所有被该钥匙锁定的物品。再制作一把,将其签名,命名为相同的名称,它就能打开同样的锁。
制作备用。手持多把未签名的钥匙时锁定物品,整组钥匙将一次性全部签名!
解锁。手持曾用于锁定该物品的钥匙时,潜行并右键点击被锁定的门或箱子。
特性
- 门无法通过红石打开。 门会保持在被锁定时的状态。
- 双层箱子的两半部分 会一起锁定和解锁。
- 如果方块以其他方式被破坏(例如爆炸),钥匙也会被销毁。
- 不可猜测的锁。 锁通过其名称 和 签名者进行密钥验证。即使名称相同,其他玩家也无法创建能打开你箱子的钥匙!
安装
- 下载发布版的
.zip 文件。
- 将其放入
<world>/datapacks/ 目录中。
- 执行
/reload,或者重新加载世界。
命令
| 命令 |
描述 |
/function lk:give |
无需合成即可获得一把未签名的 Lock Key。 |
/function lk:uninstall |
移除所有锁,并从数据包中删除任何存储、标签等。在删除数据包之前运行此命令。 |
[!TIP]
如果你丢失了钥匙,被锁定的方块将无法打开(爆炸等情况除外)。如果在有锁处于未加载区块时卸载,它将不会被移除。
要在没有钥匙或数据包的情况下移除锁,请在锁附近运行以下命令:
/kill @n[type=minecraft:interaction,tag=lock.lock,distance=..5]
符合 认证数据包要求
By TechnoBro03

Lock & Key
A datapack that locks a door or a chest to one key.
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.

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
- Download the release
.zip.
- Drop it into
<world>/datapacks/.
/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]
Meets the Certified Datapack requirements
By TechnoBro03
评论 0
登录后参与评分
还没有评论,来抢沙发吧