Patterns
Inventory
The patterns allow you to have a list of buttons that can be used in several inventories. Perfect to manage the decoraction of your inventories without having to copy the same thing dozens of times.
The patterns can be found in the patterns folder and you can create as many as you want.
A pattern must contain a name
, its name will be used in inventories to identify the pattern.
You then have a size
, which is that of the inventory, you have to put patterns of the same size with the inventories, a pattern of size 18 cannot go with an inventory of cut 27 for example.
You then have a list of items, it’s the same as for inventories.
Button
You can create a pattern for your buttons to avoid having to repeat the same thing hundreds of times. You will save hours of configuration with this system.
How to create a pattern ?
You must create a yml file in the pattern folder, the file name is important. It will be used in your inventory file. In the file you must specify the name, type and button. A default file will look like this:
You can then configure your button as you do for inventories. Except that here you will be able to define variables from the inventory file that will be used here. You can define an infinite number of variables, it all depends on your need.
Here is an example of a pattern with the name and slot that will change.
A variable can have prefixes to change their uses.
Prefix | Definition |
---|---|
%upper_<key>% | Displays the text in uppercase |
%lower_<key>% | Displays the text in lowercase |
%capitalize_<key>% | Display the text in capital |
%add_one_<key>% | Allows to add one to the value, attention the value must be a number. |
%remove_one_<key>% | Allows to remove one has the value, attention the value must be mandatory a number. |
How to use a pattern
Using a pattern is very simple. Simply display the pattern configuration in your button, set the file name and put your placeholders. For the example if above we will have:
The pattern can be used endlessly in inventory. This allows to create very optimized configs without having to repeat the same thing several times. Only the important items will be in your inventory file.
Example
This example provient de la resource Vote Menu.
Inventory Shop
Pattern
Last updated