CodeLock allows you to lock chests and doors without using any commands. Rather than locking a chest to a specific player, it locks it with a code. Then, anybody who wants to access the chest, including the owner, must enter the code to gain access.
Usage
To lock a chest or door, click on it while sneaking. This will open a fake chest window that looks something like this:

Then click on the icons in the order you desire to create your code. When you're done, just close the inventory window, and the chest or door will be locked! Now whenever you try to open it, that same window will pop up and ask you for your code. If you enter it incorrectly, you can just close the window and try again.
To remove a lock, just sneak and click again. It will ask you for your code, and when you enter it the lock will be removed.
The following blocks can be locked:
- Chests
- Doors
- Dispensers
- Furnaces
- Brewing stands
- Enchantment tables
- Levers
- Buttons
Installation
Just drop the CodeLock.jar file into your plugins folder!
Configuration
When the plugin first loads, a config.yml file will be created in its folder. These are the config options:
| Option | Description |
|---|---|
| lock-inventory-size | The size of the inventory to use for the lock screen. This should be a multiple of 9. |
| lock-title | The title of the lock screen. |
| buttons | The item ids of the buttons for the lock screen. |
| button-positions | The positions of the buttons in the lock screen inventory window. |
| letter-codes | The letters that match with the buttons. This is used to tell the player what their code is. |
| auto-door-close | How long to wait to close a door that was recently unlocked. Set it to 0 to disable this feature. |
| check-build-perms | Whether to check if the player has permission to build before allowing them to lock a door or chest. |
| lockable | A list of lockable blocks. Other blocks cannot be added to the default list, but blocks can be removed. |
| str-locked | The message that shows appears a player locks a door or chest. It also tells them the code used. |
| str-removed | The message that appears when a lock is removed. |
Permissions
| Node | Description | Default |
|---|---|---|
| codelock.bypass | Anyone with this permission can open a door or chest without entering the code, and it will tell them the code when they open it. | op |
| codelock.lock | This permission is required to add and remove locks. | true |

