Chest Shops allow players to buy or sell items in exchange for coins.
Open a shop chest to see what’s inside. A chest that wants you to buy things will read [shop] or [buy]. If it says [sell] instead, you are supposed to sell things to it. You always buy or sell whole slots of items. Each slot, with whatever stack size present, will cost the designated price.
All transactions are performed via shift click. To buy items from a chest, shift click them into your inventory. Each whole slot you take out of the chest costs the designated price. You have to buy the whole slot. You need to have enough money or it won’t work. The money will be taken from your account.
A sell chest will allow you to sell any of the items that are already in the chest to it. The way this works is that whatever quantity of that item is in one slot of the chest, will be bought for the designated price. If there are different stack sizes of the same item type in the chest, the first one counts, starting from the top left. Items sold to a chest will be split accordingly, so the item stacks end up with the stack size that is accepted by the chest. The money will be transfered from the chest owner’s account to yours.
Looking at this from your customers’ perspectives, the sign should read “buy”, because that’s what they do: They buy things from your chest. Alternatively, it can say “shop”, since this is considered the default behavior of a shop chest.
Setup
When every item in the chest has been sold, the price line on the sign changes to “SOLD OUT”.
Once again, look at this from your customers’ perspectives to realize that this type of chest must say “sell”, because they get to sell things to it. This type of chest requires you to put at least one slot of whatever people can sell to you in the chest.
The chest buys exactly what it can find in any of its slots, including amount, damage and enchantments, from any player for the price that is written on the sign. Items that are put in by people selling to you will not stack with the other contents, as to not make any changes to the setup, corrupting your shop chest.
For example, if you put 12 apples in the first slot and write 5 as the price on the sign, any customer can sell 12 or a multiple of 12 apples to the chest and will get 5 coins per 12 apples. The chest will be filled with slots containing stacks of 12 apples each.
Setup
When the chest is full, the price on the sign will change to “SOLD OUT“.
Compact Chest Shops can also be created without using signs.