Lock

Adds key items that can lock chests, doors and trapdoors

Requirements

Contents

Items:

item loot table
key_blank Key Blank lock:key_blank
key Key lock:key

Advancements:

title description
key The Illusion of Safety use a key to lock a container

Usage

Key Blank

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.

Key

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:

The locked block can be unloked by using the original key on it.

Overhead

Uses a number of advancements:

Known Issues

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.

Attributions

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)