Example Menu Configuration File

The simplest way to create a menu is to create a .yml file in the MenuService folder. Here I will show you a simple example of a menu.

First, you'll need to know the basic setup of a menu. Menu's are made of components. Menus and Components can have Attributes to describe them. All Menus and components need to have the Attribute "type".

There are many supported attributes. Here is a list of some of the common ones:

  • type: either menu or button
  • title: Sets the title for the menu
  • text: sets the text for a button
  • actions: a complex attribute that allows player interaction
  • permissions: a list of permissions a player needs
  • size: the number of rows of the menu
  • x: the x position of a component
  • y: the y component of a menu

The following menu consists of a single button. It is opened when a player types "/example"

type: menu
openCommand: example
size: 1
title: My Example Menu
components:
  example_button:
    type: button
    text: Do Something!
    image: 276
    lore: ["This is lore", "this is another"]
    actions:
      leftClick:
        tags: [6, 7]
        commands: ["kill <player>"]

When the player opens the menu by typing "/example", he will see one row of inventory above his inventory. In this row will be a sword. Left clicking on the sword will kill the player.

Since MenuService is still in beta, I can't guarantee that these attributes will stay the same. However, the should not change too drastically


Comments

Posts Quoted:
Reply
Clear All Quotes