Skip to content

Locking Mechanics

Parker Hawke edited this page Jul 9, 2020 · 4 revisions

This page will explain to you how to get started with LockSecurity's block locking mechanics. In this wiki, a chest will be used as an example but it should be known that more than just chests are supported by default including doors, fence gates and trapdoors.

Crafting an Unsmithed Key

First and foremost, in order to lock a block, the player must craft a key. Keys that have not yet been used to lock a block are referred to as "Unsmithed Keys". LockSecurity provides players with a set of recipes they may use in order to craft them in the crafting table.

Recipe

As you can see, LockSecurity also adds the recipes for Unsmithed Keys to the player's recipe book. You may craft the recipe with any type of plank and in any orientation in the crafting table. These recipes are unlocked automatically after the player has discovered the recipe for a chest.

Locking a Block

To lock a block, one must be holding an Unsmithed Key and right click on the block they wish to lock. The block will successfully lock under the following conditions:

  • The player has permission to do so (See Permission Nodes wiki)
  • The block is not protected by another protection plugin (i.e. WorldGuard, GriefPrevention, etc.)
  • The block is not already locked by another player

Locking a Block

Upon being locked, no player will be able to open, destroy nor grief the block in any way unless they have in their hand a key that may unlock it.

Unlocking a Block

To unlock a block, one must be sneaking and right click on the block they wish to unlock while holding a key that can open it. Only the owner of the block is permitted to unlock it. As this may be a dangerous action done by accident, LockSecurity will ask the player to confirm by repeating the action to complete the unlock.

Unlocking a Block

Upon being unlocked, all players may once again access and destroy the block as it were before it had been locked. The block may be locked once again by any user with an Unsmithed Key in hand (such that they meet the conditions listed in Locking a Block.

Nicknaming a Block

Block coordinates can be quite obnoxious on a key and are seemingly arbitrary from a user-experience standpoint. It's difficult to recognize. As such, LockSecurity allows players to nickname their locked blocks using a named name tag. Right clicking a locked block with a name tag in hand will change the block's nickname. These nicknames are then displayed on any keys the player may have (after running /refreshkeys on existing keys, or on any newly created keys)

Nicknaming a Block Nicknamed Key

Way Too Many Keys?

Do you notice a lot of keys piling up in your inventory? Having more than a few locked blocks can be quite inconvenient if players want to lock all of their chests. Luckily, LockSecurity provides players with a way to merge multiple keys into one using dynamic, shapeless recipes. See Keys and Flags for more information on merging, duplicating and resetting keys.