Adds key items that can lock chests, doors and trapdoors
Items:
| item | loot table |
|---|---|
Key Blank |
lock:key_blank |
Key |
lock:key |
Advancements:
| title | description |
|---|---|
The Illusion of Safety |
use a key to lock a container |
This is an uncut key, that can't open or close items; its only purpose is to generate the actual key items by using it.
When created by using a blank, a random key code is generated and stored in the key nbt data.
Crouching and using the key in any container, door, or trapdoor will lock it:
{lock:<key object>}, an unused vanilla feature
that does in fact lock the container.The locked block can be unloked by using the original key on it.
Uses a number of advancements:
The interaction entity around doors and trapdoors takes the entirety of the block(s) the occupy; that means that a small mob that got into the space will be covered by it, and become non-interactive itself.
All locking and unlocking sounds were extracted from Locking Unlocking Door 1 Para by Paradoxxxical, published under Attribution 4.0 International (CC BY 4.0)