ShopKeepers - GeneralMine/TUMine GitHub Wiki

Trading is an essential part of multiplayer gameplay. To achieve a fluent, secure and fast way of trading we decided to implent ShopKeepers in our plugin. These modified Villagers use custom GUI based system for trading. Its quite simple to use yet we explain each one of its feature in this page.

Crafting and Spawning

Unlike in other plugins our shops are not summoned buy commands or sepcial sign codes. Instead we added a new recipe to the game to keep original spirit of minecraft. In total you will 4xDiamonds and 1xEmerald Block to Craft a unique Shopmerald. This custom item allows you to spawn a villager by right clicking it. Keep in mind that the Shopkeeper is going to spawn on the center of the clicked block.

Craftin Recipe

Interaction

Shopowner

By right clicking one of your ShopKeepers a config GUI will open. This contains three options to choose of:

  • Edit
  • Storage
  • Payment

The Edit tab lets you configure your trades. Up to 9 trades are possible per each Shopkeeper and one row of slots is going to be a trade later. The items you want to sell have to be placed in the top row and the price you want for them directly below in the bottom row. The middle row is simply an indicator for each trade and has no further function. After closing the config tab you will get an instant feedback report which trade will work and which will not in your chat.

Storage: This inventory is used to store the items you want so sell. For example if you are going to sell 64xOak logs for 1xDiamond you have to place as much oak logs as you want to sell in the storage tab. If a purchase is made the Shopkeeper is giving these ressources to the customer.

Last the Payment tab, these slots are used for storing the payment you get from your deals. To refer to the example used in the storage section for each deal you make 1xDiamond will be added to this tab (and take from the customer obviously).

Customer

Compared to the Shopowner side we have just one GUI as a Customer. In this tab we are offered the diffrent deals the owner configured. If a trade is valid the middle slot will change to a lime green glass pane saying something like Purchase Offers #X. By clicking this glass pane you accept the deal and the purchase process will start.

Error Messages

In the process of interacting with a ShopKeeper possibly many thing could go wrong. We are listing here the most common erros and are giving a short fix for each one.

Cant handle purchase due to full player inventory --> The Customer inventory is not empty. Make space for new items first before you try to buy even more!

Shop is not stocked please contact the owner restock it --> The Shopkeepers item storage is empty or does not contain the needed item. The Shopkeeper has to (re-)fill his shop.

The shops cashbox is full please contact the owner to empty it --> The Shopkeepers payment storage is full. This way no further deals can be made unlike the owner will empty this storage slots.

Im sorry! You dont have enough of the required items to make this purchase --> The Customer does not have enough of the required payment in his inventory. Farm or get more to fix this issue.

Removing

First of all just the ShopOwner can remove his ShopKeepers. This process is not done by punching the villager till he is dead or any similar cruel methods. Simple grab a lava bucket and punch him once. The Shop will disapper immediatly aswell as LOOSING ALL HIS ITEMS. So be careful to empty the villagers inventory beforehand.