Skip to content
SuperRonanCraft edited this page Jan 5, 2018 · 58 revisions

This page will explain you, how to create a basic menu with items.

Example

This example here shows a basic menu, with one item:

Title:
- '&2Title #1'
- '&aTitle #2'
Commands:
  Name: 'cmd1; cmd2'
  Description: 'Opens the cmd1 menu'
  Usage: '/cmd1 <player> <integer>'
  Leniant-Args: true
  Arguments: 'Player Integer'
Worlds:
  Whitelist:
  - 'world_nether'
  IsBlacklist: false
Frame-Delay: 20
Type: 'chest'
Rows: 4
Auto-Close: 0
Menu-Item:
  <See Menu-Item page>
Items:
  <See Items page>

Summary

Title

Required? Type Supports Placeholders?
Yes String/StringList Yes

This section is for setting the title of the menu.
It can be just one string, or a list:

# Single title
Title: 'This is one title'

# Multiple titles, delayed by the frame-delay
Title:
- 'Title 1'
- 'Title 2'

Commands

Required? Type
No String

The command string, use an ; to add an alias command (ex: cmd1; cmd2) This can also be a section to state more details

  • Name

    Type Supports Placeholders?
    String No

    The command to open the menu, use an ; to add aliases to the command (ex: cmd1; cmd2; cmd3)

  • Description

    Type Supports Placeholders? Default
    String No Opens the <menu> Menu!

    The description when someone types /help <menuCommand>

  • Usage-Help

    Type Supports Placeholders? Default
    String No /<menuCommand> [argument]

    The usage to the command when the someone types /help <menuCommand>

  • Usage-Command

    Type Supports Placeholders? Default
    String No Usage: /<cmd> [arguments]

    The usage to the command when the command doesn't have enough arguments when someone types /<menuCommand> [arguments]

  • Leniant-Args

    Type Supports Placeholders? Default
    Boolean No True

    Should we ignore if a command has more arguments than nessesary, or strinctly prohibit arguments to the amount stated (usually no arguments if just using simple menu commands)

  • Arguments

    Type Supports Placeholders?
    Node No

    The type of argument an argument must be to open the menu.
    To add multiple, just seperate them by a space! (ex: 'Player Integer Offline String')

    These arguments can be used as placeholders, called by %argument_<id>[_<placeholder without %'s>]%, the id is the position the argument is in, and the placeholder is any placeholder (if the type is Player).
    Arguments can be used as a normal placeholder, the only thing is that they are manipulated by what a player types into chat to open the Menu.
    A better example on how to use arguments below

    Valid Nodes:

    • String: Anything, argument can be literaly anything but empty
    • Integer: A Number, argument must be a numerical value
    • Player: A Player, argument must be the name of an online player
    • Offline: Any player, argument must be the name of any player (Warning, placeholders will not function on offline players)

    Example:

      # Arguments Example
      Commands:
        Arguments: 'Player Integer String'

    The first argument from the example above Player, can be used to get placeholder pointing to that player with %argument_0_<placeholder>%, lets say we want to get the players name, we would do %argument_0_player_name%

    The second argument being an integer could be used on purchasing items, or literally anything else, the way we get this integer would be the following: %argument_1%

    The third argument is a string, this can be used for anything, and the way we get this string would be the following: %argument_2%

Example:

# Simple Commands
Commands: 'cmd1; cmd2'

# Advanced Commands
Commands:
  Name: 'cmd1; cmd2'
  Description: 'Opens the cmd1 menu'
  Usage: '/cmd1 <player> <integer>'
  Leniant-Args: true
  Arguments: 'Player Integer'

Worlds

Required? Type
No Key Section

Restrict a menu to certain worlds, or allow only certain worlds!
This will make open commands and tab completion invisible to players

  • Whitelist

    Type Supports Placeholders?
    StringList No

    List all worlds you'd like to restrict a menu to function in

  • IsBlacklist

    Type Supports Placeholders? Default
    Boolean No False

    Make the world be a blacklist, not allowing those worlds to open the menu

Example:

Worlds:
  Whitelist:
  - 'world_nether'
  - 'world_the_end'
  IsBlacklist: false

Frame-Delay

Required? Type Supports Placeholders? Default
No Integer No 20

Let's you set the delay (in ticks) in which the inventory Title will switch through (if more than one). If delay is set to 0, it will be forced to 20!

Type

Required? Type Supports Placeholders? Default
No String No Chest

Sets the type of inventory to display.
The default is "Chest", if none is specified.

Valid types:

  • Chest See Rows to change the size (max of 63 visually)
  • Dispenser' Create a dispenser-inventory (9 slots)
  • Dropper Create a dropper-inventory (9 slots)
  • Hopper Create a hopper-inventory (5 slots)
  • And... any other inventory types on the Spigot api. Warning not all types are supported!

Rows

Required? Type Supports Placeholders?
No Integer No

Can only be used, if Type is set to "Chest".
Set the amount of rows that should be displayed (1 row is 9 slots)

Important A value above 6 will create a bugged texture!

Auto-Close

Required? Type Supports Placeholders? Default
No Integer No 0

Amount in ticks after being opened should the menu be closed again.
A value of 0 disables this feature.

Menu-Item

Required? Type
No Key Section

Learn how to create an item to open up a menu with a Menu-Item!

Items

Required? Type
No (But Recommemded) Key Section

Learn how to fill an inventory with Items!

Clone this wiki locally