Skip to content
Update Menu structure authored by Nanit's avatar Nanit
......@@ -2,12 +2,13 @@
1. [Menu file](#file)
- [Single menu in a single file](#solo)
- [Multiple menus in a single file](#multi)
2. [Menu settings](#menuVar)
3. [Auto-update](#update)
4. [Buttons](#buttons)
1. [Menu settings](#menuVar)
1. [Menu types](#types)
1. [Auto-update](#update)
1. [Buttons](#buttons)
- [Display rules](#btnRules)
- [Click processing](#btnClicks)
5. [Templates](#templates)
1. [Templates](#templates)
- [Templates inside a menu file](#menuTemplates)
- [Templates file](#templatesConf)
......@@ -83,8 +84,9 @@ To create a menu whether in a separate file or in a single file you need to conf
| **Settings** | **Data type** | **Required** | **Description** |
|--------------|--------------|------------------|---------------------------------|
| title | String | {+Yes+} | Sets the title of a menu |
| size | Number | {+Yes+} | Sets the vertical size of a menu (a number of rows) |
| title | String | {+Yes+} | Set the title of a menu |
| size | Number | {+Yes+} | Set the vertical size of a menu (a number of rows) |
| type | String | {-No-} | Set menu's inventory type (chest by default). Read about it [below](#types) |
| items | [Object list](Data types#list) | {-No-} | Menu items |
| activators | [Object](Data types#object) | {-No-} | [Actions](Actions) to open a menu |
| rules | [Object](Data types#object)/[Object list](Data types#list) | {-No-} | [Rules](Rules) to open a menu. If one of those is **false** then menu won't open |
......@@ -94,6 +96,36 @@ To create a menu whether in a separate file or in a single file you need to conf
| closeActions | [Object](Data types#object) | {-No-} | [Actions](Actions), that perform **after** the menu closes |
| updateInterval | Integer | {-No-} | Sets the menu update interval in ticks |
## <a name="types">Menu types</a>
Menu type - this is a type of inventory in which the buttons will be placed. By default, if you do not specify the type, the menu will looks like a chest. But you can change it, for example, to a hopper, or a brewing stand. The ability to set some type of inventory depends on the version of your server.
For the latest server version, a list of all inventory types can be found [here](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/inventory/InventoryType.html). For earlier versions, you will have to search list of inventory types for yourself. I recommend ask Google like "InventoryType spigot <server version>".
To change the menu type, just specify the `type` parameter and the type of inventory available for you from the Spigot documentation.
```hocon
title: "&lCake factory"
size: 1
type: DROPPER
activators{
command: "menu"
}
items:[
{
slot: 0
material: CAKE
name: "Test item"
},
]
```
In this example, we used the DROPPER inventory type, and look what happened.
![image](uploads/387366812d0eddedd38e4c9835f131c7/image.png)
> ⚠️ **Important**: Please note that not all types of inventory can be used. Some will behave strangely, such as not displaying the title, and some just won't work. This is a feature of the minecraft client, which we cannot influence. Also, if you are using any type other than a CHEST, we advise you to use the slot numbers, not the x,y positions.
## <a name="update">Auto updating (updateInterval)</a>
A bit more detailed about the `updateInterval` setting. If you want to create a menu that will automatically update including items, placeholders and any other dynamic data, you can specify the interval for updating the menu.
......
......