Lock: Difference between revisions
No edit summary |
mNo edit summary |
||
Line 9: | Line 9: | ||
[[File: Unpaired Lock.png|thumb|An unpaired lock]] | [[File: Unpaired Lock.png|thumb|An unpaired lock]] | ||
[[File: Paired Lock.png|thumb|A paired lock, with the corresponding key’s id displayed in magenta.]] | [[File: Paired Lock.png|thumb|A paired lock, with the corresponding key’s id displayed in magenta.]] | ||
[[File: Chest Is Locked.png|thumb|A locked chest, and the message that is displayed when attempting to open it without the right key in hand.]] | |||
When initially crafted, locks are initially ''unpaired''. Unpaired locks have no enchantment glint and their item description is empty. Unpaired locks have only one use: they can be ''paired'' with a [[Key]] by putting both of them in a crafting grid in any position. A lock that is paired with a key will display the key’s id in its description. | When initially crafted, locks are initially ''unpaired''. Unpaired locks have no enchantment glint and their item description is empty. Unpaired locks have only one use: they can be ''paired'' with a [[Key]] by putting both of them in a crafting grid in any position. A lock that is paired with a key will display the key’s id in its description. | ||
Line 18: | Line 19: | ||
A locked container is treated as an unbreakable block: it cannot be mined, destroyed by explosions, moved with a piston, etc. The only thing you can do with a locked container is open it, provided you have the corresponding key. Attempting to open a container without the right key in hand will display a message showing what key you need. | A locked container is treated as an unbreakable block: it cannot be mined, destroyed by explosions, moved with a piston, etc. The only thing you can do with a locked container is open it, provided you have the corresponding key. Attempting to open a container without the right key in hand will display a message showing what key you need. | ||
A container can only have one lock, and it is impossible to apply a lock to an already locked container. | A container can only have one lock, and it is impossible to apply a lock to an already locked container. Locked chests get a lock icon on the lid, but other containers look the same.<ref>If you’re upset about that, feel free to add a texture and update the block entity renderer yourself and open a pull request [https://github.com/Agma-Schwa/Nguhcraft here].</ref> | ||
For info on how to remove locks and open locked containers, see [[Key|here]]. | For info on how to remove locks and open locked containers, see [[Key|here]]. |
Revision as of 14:04, 13 August 2024
The Lock is a modded item that is craftable on Nguhcraft and can be used together with the Key to lock chests.
Crafting Recipe
A lock can be crafted using iron ingots and redstone.
Pairing



When initially crafted, locks are initially unpaired. Unpaired locks have no enchantment glint and their item description is empty. Unpaired locks have only one use: they can be paired with a Key by putting both of them in a crafting grid in any position. A lock that is paired with a key will display the key’s id in its description.
A lock can be paired with a key even if it is already paired: the old pairing will simply be removed, i.e. the lock will only be paired with the new key.
Locking Containers
A paired lock can be applied to a container[1] by using the lock while sneaking[2]. This will consume the lock and make it so the container can only be opened if you have the corresponding key.
A locked container is treated as an unbreakable block: it cannot be mined, destroyed by explosions, moved with a piston, etc. The only thing you can do with a locked container is open it, provided you have the corresponding key. Attempting to open a container without the right key in hand will display a message showing what key you need.
A container can only have one lock, and it is impossible to apply a lock to an already locked container. Locked chests get a lock icon on the lid, but other containers look the same.[3]
For info on how to remove locks and open locked containers, see here.
Notes
- ↑ Basically anything that has an inventory that can store things, including chests, barrels, double chests, etc., but not ender chests. A double chest can only have one lock.
- ↑ I.e. holding shift and right-clicking on the container with the lock in hand
- ↑ If you’re upset about that, feel free to add a texture and update the block entity renderer yourself and open a pull request here.