Skip to content

Creating a menu

Daniel Saukel edited this page Mar 19, 2018 · 13 revisions

To create a menu, all you need to do is adding a new file at plugins/HolographicMenus/menus. A menu script named for example mymenu.yml can be opened in game with /m mymenu if te player has the permission holographicmenus.menu.mymenu.

# PRIVATE If just the menu opener is supposed to see it
# PUBLIC If anyone may see it
type: PRIVATE

# The content of this section will change depending on the opened menu page.
# Take care of the indents.
menuPages:
  1:
    buttons:
      1:
# The text the button shows. Color codes are supported.
        label: "&5&l>> PAGE 1 <<"
# The type of the button.
# TITLE = A cosmetic button that players are not supposed to interact with.
# BUTTON = A clickable button that executes a command when punched.
# FIRST_PAGE = Switchs to the first of all menu pages.
# LAST_PAGE = Switchs to the last of all menu pages.
# PREVIOUS_PAGE = Switchs to the previous menu page.
# NEXT_PAGE = Swtichs to the next menu page.
# CLOSE = Closes the menu.
        type: TITLE
# The how far on the right the button shall appear relatively to the eye direction.
        x: 0.0
# How high the button shall appear relatively to the eye direction.
        y: 0.4
      2:
        label: "&4[ GIVE ITEM ]"
        type: BUTTON
# The command to execute when the button is punched.
# %v[number]% will be replaced with input fetched from the chat afterwards.
        command: "give %v1% %v2% %v3%"
# The messages to send to the player to ask for chat input
        variableMessages:
# Refers to %v1%
          - "&ePlease enter the receiver of the item to give."
# Refers to %v2%
          - "&ePlease enter the type of the item to give."
# ...and so on
          - "&ePlease enter the amount of the item to give."
# Shall the menu be closed when the button is touched?
        closeMenu: true
# The permission a player needs to see the button.
        permission: menu.click
        x: 0.0
        y: 0.1
  2:
    buttons:
      1:
        label: "&5&l>> PAGE 2 <<"
        type: TITLE
        x: 0.0
        y: 0.4

# The content of this section will remain the same for all pages.
staticButtons:
  1:
    label: "&6&lHEAD LINE"
    type: TITLE
    x: 0.0
    y: 0.7
  2:
    label: "&3<<<"
    type: PREVIOUS_PAGE
# The sound to play when the button is punched.
    sound: ui.button.click
    x: -0.5
    y: -0.5
  3:
    label: "&3>>>"
    type: NEXT_PAGE
    sound: ui.button.click
    x: 0.5
    y: -0.5
  4:
    label: "&a[CLOSE]"
    type: BUTTON
    sound: ui.button.click
    closeMenu: true
    x: 0.0
    y: -0.2
distance: 1.75

Clone this wiki locally