Menusπ
BetonQuest allows the creation of fully custom GUIs using the events and items system.
Nearly everything can be done with these, from guis listing open quests over simple warp systems to
information GUIs that display player stats.
Try the working example for a quick overview.
Creating a menuπ
To create a new menu just create a menus
section in any file inside a quest package.
The name which can be used to identify each menu will be the name of another section as shown below.
menus:
myMenuName:
title: "My Menu Title"
slots: #...
items: #...
General Menu Settingsπ
These are general settings for customizing a menu.
Required Settingsπ
Setting Name | Example |
Description |
---|---|---|
title |
title: "&6&lQuests" |
Will be displayed in the top left corner of your menu. You can use color codes to color the title. Variables are supported. |
height |
height: 3 |
How many lines of slots your menu will have. Minimum 1, Maximum 6. |
Optional Settingsπ
Setting Name |
Example | Description |
---|---|---|
open_conditions |
open_conditions: "unlockedMenu,!sneaking" |
One or multiple conditions (separated by a , ) which all have to be true to open the menu with a bound item or a bound command. |
open_events |
open_events: "menuOpenSound" |
One or multiple events (separated by a , ) which will be fired when the menu is opened. |
close_events |
close_events: "menuCloseSound" |
One or multiple events (separated by a , ) which will be fired when the menu is closed. |
bind |
bind: "openMenuItem" |
Clicking with this quest item in hand will open the menu. You can create this item in the items section of your package. |
command |
command: "/quests" |
This command can be executed to open the menu. The server must be restarted to unregister command tab completions. |
The items
sectionπ
The items section contains all items which should be displayed in the menu, defined as individual sections of the config.
A basic item section looks like this:
menus:
myMenuName:
title: "My Menu Title"
slots: #...
items: #(1)!
skeletonQuestDone: #(2)!
item: "questDoneItem" #(3)!
goldQuestDone: #(4)!
item: "questDone"
- The
items
section with all items that are displayed in the menu. - The name of the item. Used to reference the item in the
slots
section. - The name of any quest item. This cannot be a vanilla item, it must be a quest item.
- Another item just like the previous one.
Optional Item Settingsπ
The three basic optional settings.
Name |
Example | Description |
---|---|---|
amount |
amount: 30 |
The size of the stack that will be displayed in the menu. Variables are supported. |
conditions |
conditions: "questDone" |
One or multiple conditions (separated by a , ) which all have to be true to display the item. |
close |
close: true |
If set to true the menu will be closed after clicking the item. If this is not set the default_close value from the plugins config will be used. |
The optional text
settingπ
By default, the name and description of the quest item is displayed when hovering over the item.
You can overwrite this by using the text
setting.
Both color codes and variables are supported.
The text can be provided as a single string with newlines, a multi-line string, or a list of strings, see examples.
skeletonQuestDone:
item: "questDoneItem"
text:
- "&2Reputation: &6&l%point.quest_reputation.amount%"
- "Make quests to gain reputation!"
skeletonQuestDone:
item: "questDoneItem"
text: "&2Reputation: &6&l%point.quest_reputation.amount% \nMake quests to gain reputation!"
skeletonQuestDone:
item: "questDoneItem"
text: |-
&2Reputation: &6&l%point.quest_reputation.amount%
Make quests to gain reputation!
Just like the text in conversations you can provide translations for all languages:
items:
skeletonQuestDone:
item: "questDoneItem"
text:
en: #(1)!
- "&7[Quest] &6&lThe lost amulet"
- "&4&o"
- "&eLeft click to locate npc"
- "&eRight click to cancel quest"
de: #(2)!
- "&7[Quest] &6&lDas verlorene Amulet"
- "&4&o"
- "&eLinksclick um den NPC zu finden"
- "&eRechstclick um die Quest abzubrechen"
- The name and description of the item in english.
- The name and description of the item in german.
The optional click
settingπ
You can define one or multiple events (separated by ,
) that are run whenever the item is clicked.
items:
skeletonQuestDone:
item: "questDoneItem"
click: "startQuest,closeMenu"
Click Typesπ
Different types of clicks can be distinguished:
items:
skeletonQuestDone:
item: "questDoneItem"
click:
left: "give_xp,msg_give_xp" #(1)!
shiftLeft: "give_xp,take_xp" #(2)!
right: "take_xp,msg_take_xp" #(3)!
shiftRight: "take_xp,msg_take_xp" #(4)!
middleMouse: "msg_beautifull_text" #(5)!
- Run when left-clicking the item.
- Run when shift + left-clicking the item.
- Run when right-clicking the item.
- Run when shift + right-clicking the item.
- Run when middle mouse clicking the item.
The slots
sectionπ
The slots section defines where the items from the items section should be displayed.
You can also assign multiple items to the same slot and use conditions in the items section to
specify which one should be used.
If you assign multiple items the first one for which all conditions are true will be displayed.
menus:
myMenuName:
title: "My Menu Title"
slots:
8: "reputation" #(1)!
9: "questStarted,questCompleted" #(2)!
- The item
reputation
will be displayed in the 8th slot. - The first item for which all conditions are true will be displayed in the 9th slot.
If the conditions for
questStarted
are true, it will be displayed. If the conditionquestCompleted
is true it will be displayed. If both conditions are true the first item (questStarted
) will be displayed.
Slot Numbers
Use these numbers to assign items to slots:
Row Assignmentπ
You can also assign multiple items to a row of slots. Now the slots are filled up one by one using the items whose conditions are true:
10-12: "quest1,quest2,quest3" #(1)!
- Assuming that the conditions for the items determine that
quest1
andquest3
should be displayed to the player butquest2
shouldn't, thenquest1
would be in the slot 10 andquest3
in the slot 11. Slot 12 would stay empty.
Rectangle Assignmentπ
Additionally, you can also assign items to a rectangle of slots. Just like with the row, the slots in this rectangle are filled up one by one using the items whose conditions are true
14*25: "quest1,quest2,quest3"