How do I create a menu? #11


  • New
  • Other
Open
Assigned to m0pt0pmatt
  • Forge_User_08358637 created this issue Aug 1, 2013

    Hello,
    I downloaded your Plugin today and tryed to install it on my server

    I put the MenuService.jar in my Plugins folder and it create an MenuService folder.
    In this folder it were only 2 files named binds.yml and config.yml
    both files are empty...

    Now my question...
    How did i create a menu?
    I looked in the Comments from the Plugin but i don't understand it...

    ...your download link from the "complicated example of a menu config" is not available

    Can you give me a short example or a picture from the creation of a menu?

    (Sorry for this bad English, i'm German)

  • Forge_User_08358637 added the tags New Other Aug 1, 2013
  • m0pt0pmatt posted a comment Aug 1, 2013

    The easiest way to create a .yml file inside of the MenuService folder.

    I'll give you an example: Say I want to create a menu called "mymenu". In the MenuService folder I would create a file named "mymenu.yml"

    In mymenu.yml, I would define my menu. I can then add attributes and components to my menu.

    here is a quick example:

    tag: mymenu
    type: menu
    openCommand: openmenu
    size: 2
    title: Example menu
    components:
      example_button:
        type: button
        x: 0
        y: 0
        text: Example Button
        material: 276
        lore: ["This is", "an example"]
        actions:
          leftClick:
            commands: ["kill <player>"]
          rightClick:
            sender: <server>
            commands: ["give <player> 16 14", "say Hello!"]
    

    tag is the name of the menu. size is the # of rows. openCommand is the command the player can execute to open the menu. components are the buttons that players can click on. Here, I have added one button, named example_button.

    example_button has a section called "actions". Here is where I can define wat happens when a player clicks on a button. This is how you add interaction to a menu.

    Hope this is helpful!


To post a comment, please login or register a new account.