@@ -83,7 +83,7 @@ In the root of the file, the `menus` block is created, in which separate menus a
...
@@ -83,7 +83,7 @@ In the root of the file, the `menus` block is created, in which separate menus a
To create a menu, whether in a separate file, or in a single file with other menus, you need to set its parameters. The table below will introduce you to the parameters that can be specified in the menu:
To create a menu, whether in a separate file, or in a single file with other menus, you need to set its parameters. The table below will introduce you to the parameters that can be specified in the menu:
| title | String | {+Yes+} | Sets the title of the menu |
| title | String | {+Yes+} | Sets the title of the menu |
| size | Number | {+Yes+} | Sets the vertical size of the menu, that is, the number of cells |
| size | Number | {+Yes+} | Sets the vertical size of the menu, that is, the number of cells |
| items | [List of objects](Data types#list) | {-No-} | Sets items in the menu |
| items | [List of objects](Data types#list) | {-No-} | Sets items in the menu |
...
@@ -119,12 +119,12 @@ In this example, the standard [placeholder](Placeholders) plugin was used.
...
@@ -119,12 +119,12 @@ In this example, the standard [placeholder](Placeholders) plugin was used.
The button in the menu is an ordinary [item](Item format) with advanced functionality. Below are all the parameters that can be specified in addition to the standard parameters of the subject.
The button in the menu is an ordinary [item](Item format) with advanced functionality. Below are all the parameters that can be specified in addition to the standard parameters of the subject.
| [slot](Item format#slot) | Integer, Object, Text | Sets item position in inventory | {+ Yes +} |
| [slot](Item format#slot) | Integer, Object, Text | {+Yes+} | Sets item position in inventory |
| [rules](#btnRules) | [List of objects](Data types#list) | [Rules](Rules) to display the button in the menu | {-No-} |
| [rules](#btnRules)| [List of objects](Data types#list) | {-No-} | [Rules](Rules) to display the button in the menu |
| [iRules](#btnRules) | [List of objects](Data types#list) | [Rules](Rules) to display a button on a menu that works exactly the opposite | {-No-} |
| [iRules](#btnRules)| [List of objects](Data types#list) | {-No-} |[Rules](Rules) to display a button on a menu that works exactly the opposite |
| [click](#btnClicks) | [Object](Data types#object) | It contains actions on a click as well as a description of actions for different types of clicks | {-No-} |
| [click](#btnClicks)| [Object](Data types#object) | {-No-} | It contains actions on a click as well as a description of actions for different types of clicks |
As you can see, only the `slot` parameter is mandatory for the button, because the item must be in a specific cell.
As you can see, only the `slot` parameter is mandatory for the button, because the item must be in a specific cell.
...
@@ -148,9 +148,9 @@ items: [
...
@@ -148,9 +148,9 @@ items: [
]
]
```
```
In this example, the menu has two items. The first (Iron Sword) will be displayed in slot 0 in any case. The second (Diamond Sword) will be displayed in slot 0, and will replace the first item only if the player has the right "some.perm".
In this example, the menu has two items. The first _(Iron Sword)_ will be displayed in slot 0 in any case. The second _(Diamond Sword)_ will be displayed in slot 0, and will replace the first item only if the player has the right "some.perm".
Consider a similar example, but using inverted iRules rules.
Consider a similar example, but using inverted `iRules` rules.
```hocon
```hocon
...
@@ -194,7 +194,7 @@ In this example, a diamond sword will appear in the menu only if the player has
...
@@ -194,7 +194,7 @@ In this example, a diamond sword will appear in the menu only if the player has
Almost any menu is meaningless without handling button clicks. The plugin provides a convenient system for processing clicks on buttons.
Almost any menu is meaningless without handling button clicks. The plugin provides a convenient system for processing clicks on buttons.
So, let's look at what a click block is all about.
So, let's look at what a `click` block is all about.
```hocon
```hocon
items:[
items:[
...
@@ -210,7 +210,7 @@ items: [
...
@@ -210,7 +210,7 @@ items: [
]
]
```
```
Inside the click block, the left block is specified. This is nothing more than the type of click that triggers the actions within the block. Inside the block responsible for the type of click, you can describe the same [actions](Actions) and [rules](Rules) as in the click block itself.
Inside the `click` block, the `left` block is specified. This is nothing more than the type of click that triggers the actions within the block. Inside the block responsible for the type of click, you can describe the same [actions](Actions) and [rules](Rules) as in the click block itself.
You can find all types of clicks [here](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/ClickType.html). We will describe the main working on all versions:
You can find all types of clicks [here](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/ClickType.html). We will describe the main working on all versions:
...
@@ -223,7 +223,7 @@ You can find all types of clicks [here](https://hub.spigotmc.org/javadocs/spigot
...
@@ -223,7 +223,7 @@ You can find all types of clicks [here](https://hub.spigotmc.org/javadocs/spigot
| SHIFT_RIGHT | Right-click with Shift |
| SHIFT_RIGHT | Right-click with Shift |
| DOUBLE_CLICK | Double click left mouse button |
| DOUBLE_CLICK | Double click left mouse button |
Any of these types can be used in the click block, either individually or together with other types in the same block.
Any of these types can be used in the `click` block, either individually or together with other types in the same block.