DtlTraders/basics
This tutorial will show you how to create an Admin shop like trader, how to change his stock and what you should be aware of when managing a trader. I will show you some exceptions and behavior connected with the manager mode and it's sub-modes. I'll also show you how to change the configuration to help you set up prices.
Creating a trader
You can create a trader in 2 different ways, first one is using the /trader create <name> command, or the trait assignment command from citizens /trait trader.
When you should use these command? Generally the create command create a new NPC with the given name, ready to be edited with the next click, whereas the trait command should be used on existing NPCs, so if you got, lets say, a NPC walking a long path you don't need to set his path from scratch.
Lets create a new trader so we can manage him not being afraid of any mistakes.
Lets create a trader with the name Chef Otto, we will also make Otto to have his title in a golden color.
/trader create &6Chef &rOtto
As you see we use the & character to tell that the next number or character is a color code, where &6 means gold and &r is used to reset any formating, so only the title has a color. All color codes are listed [|here].
After that command we have our npc standing before us, and we got three messages:
You created a new trader: Chef Otto
Manager mode enabled for: Chef Otto
Sell Stock managing toggled
Every time you create a new trader with this command it switches automatically to manager mode for you and unlocks the sell stock. Unlocking the stock allows to change the content.
Now we only need to right click on the trader and get to the next section in this tutorial :)
First opening and manager mode introduction
Opening the trader first time, just after creating him, will look like a empty chest with just one yellow wool on the bottom. Now we can just simply drag each item we want to sell to players into the inventory.
You can any item you want, this plugin supports all items with all custom properties. After you have added all items you want to sell just simply click the yellow wool. It will lock the stock, saving all items and updating old ones, and switch to the general management section.
Now you got 4 different wools on the bottom, with options (from left to right):
- Stock unlocking - allows to change the content and its layout
- Limit management - still not added
- Price management - allows to set prices to items in stock
- Stock switching - shows the current stock and upon clicking switches to the other stock, this button is visible always (except unlocked stock)