Configuration Tutorial - Staartvin/Graphical-Shop GitHub Wiki

When you first install Graphical Shop, the config files can be a little daunting. Do not fear though, this wiki has got you covered!


When you open your Graphical Shop folder, you'll see two files. config.yml and shops.yml. I'll be explaining what they do.

Config.yml

This file stores the miscellaneous options. It let's you control general things of Graphical Shop. The entries are:

option what does it do? examples
categories Defines the active menu's available. Accessable via /gc 'category' any string
show requirements State of whether to show the requirements on an item or not true or false
show results State of whether to show the results on an item or not true or false

Shops.yml

In the shops.yml, you are able to customise every menu you made. Make sure that every category listed in the config.yml is also listed in your shops.yml!

This is the default file that is created: Default file

When you want to add an item (to, let's say the 'shop' menu), you'll need to create a new icon name. This icon name can be anything, it doesn't matter. It doesn't even have to be remembered. It only has to be unique of the other icon names in the menu.

I created an extra icon name: Added an extra icon name

Now, we need to specify a few things.

option what does it do? format is it required?
item id The item id of the item to show any number yes
data Extra data value, can be a damage value (e.g. for wools or potions) any number no
amount The amount of that item any number yes
enchantments Any enchantments applied to the item. Those can be unrealistic, such as sharpness 9000 enchantment id; enchantment level no
display name The display name of the item any string, colour codes are allowed no
lore Extra lore added to the item any string, colour codes are allowed no
slot The slot number this item will be put in (for more info, click here) any number yes

I've created a new iron sword, with a few enchantments, and specific lore. For a list of enchantment id's, click here.

We've got a good start!

Now, this item doesn't do anything by itself. When you click on it, nothing will happen.. You'll need to add requirements and results to the item.


Requirements & results

Every item has its own requirements. When a player tries to click on an item, Graphical Shop will check if that player meets all the requirements for that clicked item. If he does, all the results of that item will be performed. If not, the player will get a message telling them that they didn't meet all requirements yet. This can be used for very customisable shops. You can make a slot that sells ranks. When you have enough money (that will be a requirement) and click on that slot, all the results of that item will be ran. For instance, you could promote a player to a new group, or give them a special permission. It's all up to you!

For a list of requirement and results, click here!


Now I like my players to be able to buy some a new rank. I already have a slot created, the iron sword. I'll add a requirement that will check if a player has enough money, and I'll also add a two results: one for performing the command to promote a player, and the other for giving him that item as a gift.

Look at its beauty: Dem letters

That's basically it! You've created a new slot that does something cool! You can repeat this process for as many items as you like!