This page describes how to configure item actions.
In CraftVentory, an item action is a behavior executed when a player clicks on an item. An item may have as many actions as you want.
Item actions are fully configurable and each action has its own set of customizable properties. In the inventory configuration, each action is declared in a subsection of the actions
section of an item.
In the list below, you can find all the actions provided by default by the library.
Close the opened inventory.
Send a message to the inventory viewer.
Broadcast a message in the chat.
Make the inventory viewer execute a list of commands.
When performed, this action makes the server execute a command.
Play a sound to the inventory viewer.
Trigger an update of the content of an opened inventory.
Trigger an update of the paginations in an opened inventory.
Open a new inventory.
Open the root inventory in the viewer's history.
Open a previously opened inventory in the history which is before the current one in the history.
Open a previously opened inventory in the history which is after the current one in the history.
CraftVentory enables to configure the type of click a user must do to execute an action by adding the click-types
property.
Example:
This page describes how to configure an inventory in YAML.
CraftVentory enables developers to create fully customizable inventories from configuration files. YAML is the default file format supported by the library for this purpose.
Each inventory must be defined in a separate configuration file. It is represented by a set of properties which are listed below:
An inventory is composed of a set of items. CraftVentory supports two ways to configure items in configuration files:
Using the default Bukkit YAML representation that supports complex ItemStack
configurations
Using the custom representation that only supports simple item configurations
An item is represented by a set of required properties. All these properties are listed below, with comments on what is configurable and supported.