# What is LWC and sharing chests?
LWC is a plugin that allows users to place a lock on various blocks to prevent or control access to chests, furnaces, and various other blocks.
Various blocks that LWC can protect besides chests and furnaces:
- Signs*
- Trapped Chests
- Iron Doors
- Wooden Doors
- Brewing Stands
- Wooden Trapdoors
- Iron Trapdoors
- Fence Gates
*Note that the block the sign is placed on will also be protected.*
So how do you go about creating a basic LWC protection?
First and foremost, every chest you place in the world will automatically be locked using LWC. You would need to manually unlock said chest or modify who can access it. To lock a chest that was unlocked, you can use the command /lock or /cprivate. You will then have to punch the chest or furnace to lock it.
So now your chests are protected, great right? But what if you want your friend to look at all the coal you've mined? If you want to add someone to your protected chests, you can do /cmodify [name], for example /cmodify DirewolF_ZA. After doing this, you will need to punch the chest and if done correctly that person will now be able to access your chest.
To remove someone from your chests you will need to type the same command but with a - in front of their name, for example /cmodify -DirewolF_ZA. If you want to let a group of people access your chest, you can put multiple usernames in a single /cmodify command, for example /cmodify DirewolF_ZA CptForest xRymeria. The same method applies to remove multiple people.
Other protection types
Public Protection
The /cpublic protection makes it so anyone can access the protection, but not remove the block. This is useful for public furnaces you want everyone to use. You simply type /cpublic and punch your protection.
Password Protection
To make a password lock, set the lock with /cpassword followed by a password. For example, if your password is BlameForest, anyone wanting to access the chest must type /cunlock BlameForest.
There is no point in adding someone with /cmodify as they will not be exempt from entering the password. You could add someone as an admin to remove the chest or unlock it with /unlock if they forget the password, but otherwise there is no reason to add anyone to the chest.
Donation Protection
A lesser-known type of protection is called /cdonation. You set this lock like all the others: /cdonation and a punch. A donation chest can be opened by anyone and they can look inside as well as put things in, but they cannot take anything out. This is useful for donation chests or display chests in shops.
Adding someone with /cmodify will not allow them to bypass this behavior.
The Five Flags
There are actually six flags in LWC, although one is admin-only so we will not discuss it here. These flags are used to customize the functionality of your protected items. These flags can be set with /c[flag] on or /c[flag] off.
/chopper: Sets whether or not a hopper can interact with your protection. Use/chopper onor/chopper off./cautoclose: For doors and similar devices. Determines whether or not the protected object closes automatically. Use/cautoclose onor/cautoclose off./credstone: Determines whether or not your protected object interacts with redstone. Use/credstone onor/credstone off./cmagnet: Determines whether or not your protected object pulls dropped items towards it. Use/cmagnet onor/cmagnet off./callowexplosions: Determines whether or not your protected object can be destroyed by explosions. It is usually a good idea to keep this off. Use/callowexplosions onor/callowexplosions off.
A few other things that you should know
If you create any sort of protection, even /cpublic, on an iron door or trapdoor, you can right-click to open it as if it were wood.
- Need to set a password lock on many chests? Want to save time? Try
/lwc mode persist onand type in a command. You can then punch all of the things you want to affect with that command without having to type it again. Make sure you use/lwc mode persist offafterward unless you want to spam your chat. - Are your chests just a little too far away sometimes? Want to send items home without going home? Try
/lwc mode droptransfer selecton a protection, ideally a chest, then do/lwc mode droptransfer on. Now when you drop items, they will go into that chest instead of falling on the ground. Make sure to use/lwc mode droptransfer offwhen you're done so you do not transfer items when you actually mean to drop them.