Bottoni/Tasti
All information about the buttons
Informations
Buttons allow you to customize the actions of your inventory. You have to specify the type of the button each time and configure the elements specific to the type of button. Here you find the buttons that are integrated by default in the plugin, other plugins can also add new types of buttons.
For each button you will have to specify an ItemStack, to know how to configure an itemstack go here.
Default
Here are the configuration elements that are common to all types of buttons. You can use these elements everywhere.
TYPE
The type of the button, by default the type will be NONE.
SLOT
Position the slot on which your item will be displayed.
Slots start at 0.
You can specify the page number directly in the slot. You should do it like this:
<page>-<slot>
. So for example for a button on page 2 and slot 8 we have: 2-8.To have multiple items on the same slot you must use the else button.
To display a button on several slots you can do like this:
You can also create slot ranges this way: <startslot>-<end slot>
Page
Allows you to specify the page where the button will be displayed. By default the page will be number 1.
IsPermanent
Allows you to specify if the button should be displayed on all pages of the inventory. If your inventory has only one page then you don’t need to use it.
useCache
Allows to enable or not the cache on the item, by default it will always be used if the button item does not contain a placeholder.
Item
Allows you to specify the item that will be displayed, more information here.
Sound
Allows to send a sound to the player when clicking. You must use the sounds present in XSound. You can then adjust the pitch and volume of the sound.
Messages
Allows you to send a list of messages to the player when clicking.
Openlink
Allows you to send a clickable message to the player. You have to put in your message list a text that will be replaced by the clickable link. You have an example below.
ToDo: Make sure you can choose the type of action between SHOW_LINK, SUGGEST_COMMAND and PERFORM_COMMAND
Example:
CloseInventory
Allows you to close the inventory after clicking.
RefreshOnClick
Allows to refresh the button after a click. For example you can use this to make a shop, an example is provided in the default configuration.
PlayerHead
Allows to display a player's head according to a placeholder. You can put the placeholder %player%
to get the player who opens the inventory.
A cache system allows a direct display of the skin for the heads.
Permission
Allows to define a permission that the player must have to display the item. You can reverse the permission by adding !
in front of the permission. Thereby the plugin will check that the player does not have the permission.
You can also define a list of permissions the player must have:
Or Permission
Allows you to define a permission list, but the player should only have one of his permissions.
Else
Allows to display an else button if the player doesn't have permission. You can put several else button in a row without problem. You have an example of use in the default configuration.
Example:
Placeholder
Allows you to define a permission using a placeholder. You must specify the placeholder, the action to be performed with the value, and the value that will be checked.
Action:
BOOLEAN
(aliase:b=
): Check if a value is true or falseEQUALS_STRING
(aliase:s=
): Allows to check if the text is strictly equal to the textEQUALSIGNORECASE_STRING
(aliase:s==
): Allows to check if the text is equal by ignoring the case to the textCONTAINS_STRING
(aliase:sc
): Allows to check if the text is contained in the valueSUPERIOR
(aliase:>
): Used to check if a number is strictly superior than the valueLOWER
(aliase:<
): Used to check if a number is strictly lower than the valueSUPERIOR_OR_EQUAL
(aliase:>=
): Allows you to check if a number is superior than or equal to the valueLOWER_OR_EQUAL
(aliase:<=
): Allows you to check if a number is lower than or equal to the valueEQUAL_TO
(aliase:==
): Allows to verify that two numbers are identical
You can check multiple placeholders like this:
Update
Allows to set the name and the lore of the item automatically. To set the interval you must do it from here.
updateOnClick
Allows you to update the button when a player clicks on any other button in the inventory
Commands
Allows the player to execute a list of commands.
Console Commands
You can execute commands from the console based on the player's click. Also commands if the player has the permissions.
View Requirement
Sets the requirements the player should have to see the button. More information here.
Click Requirement
Sets the requirements the player should have to click on the button. More information here.
Actions
You can define a list of actions to perform when clicking. More information here.
Error item (zMenu+)
Example of inventory with Fail Item. In this example, if the player is not creative a barrier with the name error will be displayed for 10 ticks
NONE
The NONE
type is the default type, it allows to display a button. You don't have to specify it, it will be automatically chosen if the plugin doesn't find a type.
INVENTORY
The INVENTORY
type allows the player to open a new inventory.
inventory
is the name of the inventory you want to open. The name of the inventory will be the name of the inventory file.
plugin
is the name of the plugin from where the inventory comes from. It is advisable to specify the plugin name to avoid opening another inventory with the same name.
toPage
is the number of the page you want to open. Default will be 1.
arguments
is the list of arguments you can add. An argument can contain a name in the following format: <name>:<value>
You must specify the name of the inventory. The name of the inventory will be the name of the file where the inventory is located. We also advise you to specify the name of the plugin where the inventory comes from to avoid confusion if two inventories have the same name.
BACK
The BACK
type allows you to return to the previous inventory.
HOME
The HOME
type allows you to return to the main inventory, the one that was opened first.
NEXT
The NEXT
type allows you to go to the next page if it exists. You can use the else
element to display another button if there is no next page.
Example:
PREVIOUS
The PREVIOUS
type allows you to go to the previous page if it exists. You can use the else
element to display another button if there is no previous page.
MAINMENU
The MAINMENU
allows you to returns to the main inventory you chose in the config.json
JUMP
The JUMP
type allows to change page, to a predefined page.
PAGINATION (zMenu+)
Example of inventory with the Pagination button. In this example the items will be displayed on slot 21, 22 and 23 and on several pages.
The list of items contains the material and the name. You can put anything you want in the list. To use the value you must use the placeholder key. In this example the keys will be %material%
and %name%
.
You can also apply changes to the value like this:
%lower_<key>%
- Displays the value in lower case.%upper_<key>%
- Displays the value in upper case.%capitalize_<key>%
- Display the value in capital You can use placeholders everywhere. For your requirements, commands, placeholders etc.
DYNAMIC PAGINATION (zMenu+)
Lets you create a dynamic inventory with placeholders. You can use this to create a ranking for example. The only limit is your imagination.
In the example if below you have placeholders generates by zMenu+ as an example.
%zmenu+_pagination_size%
Returns the size of your list. This value will change when loading the plugin.
%zmenu+_pagination_name_<index>%
Returns text based on the index. The text is generated automatically when loading the plugin.
You must then specify the start and end of the pagination. For this you have the start
and end
, which works with PlaceholderAPI.
Then have 3 internal placeholders to help you get the button number that is displayed.
%index%
- Returns the index of the button, starts at 0.
%current%
- Returns the index of the button + 1, starts at 1.
%value%
- Returns the value of the button. If your pagination does not start with 0 you must use se placeholder to retrieve the index of the button.
Last updated