Skip to content
SuperRonanCraft edited this page Jul 27, 2020 · 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
Server: 'lobby'
Menu-Item:
  <See Menu-Item page>
Items:
  <See Items page>

Summary

Title

Required? Type Supports Placeholders? Tags
Yes String/StringList Yes Title, Menu-Name

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.md
      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 if the menu is not allowed in their world

  • 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 whitelist 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 (9 - 54 slots)
  • Player Creates a chest inv, but always 4 rows (36 slots)
  • Ender_Chest Creates an ender chest inv, locked at 3 rows (27 slots)
  • Shulker_Box Creates a shulker box inv, locked at 3 rows (27 slots)
  • Dispenser Create a dispenser inventory (9 slots)
  • Dropper Create a dropper inventory (9 slots)
  • Hopper Create a hopper inventory (5 slots)
  • Brewing Create a brewing stand inventory (5 slots)
  • Workbench Create a crafting inventory (10 slots) (Not recommended for 1.13 users)
  • Beacon Create a beacon inventory (1 slot) (Issue: Drops item when closing inventory)
  • View any other inventory types on the Spigot api. (Not all types are supported!)

Invalid types are Creative, Crafting and Merchant as they are client-side.

Buggy types are Beacon, Enchanting, Workbench and Anvil

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.

Server

Required? Type Supports Placeholders? Default
No String No null

In the config.yml, the section Settings.Server, if the name does not match, this menu will be disabled

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!