GUI/Item Options & Configurations

Oct 24, 2017
GUI/Item Options & Configurations
  • This page has a list of all the available options on GUI menus and the items. Each one will show the correct formatting for use, and then give a detailed description of what it does. The page is divided into 2 sections, GUI options and then Item options. GUI options are what comes first in the configuration, and the Item options are for any items defined underneath the "items:" section of the GUI config.

    Resource Links:
    Placeholders: https://www.spigotmc.org/wiki/placeholderapi-placeholders/
    Valid Materials: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
    Valid Enchantments: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/enchantments/Enchantment.html
    Valid Dye Colors: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/DyeColor.html
    Valid Pattern Types: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/banner/PatternType.html
    *Be aware that some enchantments are not available on some items.


    NOTE:

    TEXT = Replace this with any text. Check the description to find out if you can use color/formatting codes.
    BOOLEAN = Replace this with true or false (If used with PlaceholderAPI for view_requirements this may be yes/no instead of true/false [This is the default configuration for PlaceholderAPI]).
    EXPRESSION = A java/placeholder expression/comparison. See this page for more information.
    # = Replace this with a number. Check the description to see if there are limits.
    SOUND = Replace this with the sound name
    COMMAND = Replace this with the command you want without slash "/"

    GUI Options

    The syntax is very important. This is what the configuration should look like if you used all these GUI options:

    Code (YAML):
    gui_menus:
      menuname
    :
        menu_title
    : 'TEXT'
        open_command
    : TEXT
        open_requirement
    : EXPRESSION
        open_commands
    :
       - '[player] COMMAND'
        - '[console] COMMAND'
        - '[commandevent] COMMAND'
        - '[message] TEXT'
        - '[openguimenu] MenuName'
        - '[connect] ServerName'
        - '[json] {"text":"message"}'
        - '[refresh]'
        - '[broadcastsound] SOUND'
        - '[sound] SOUND'
        - '[takemoney] #'
        size
    : #
        update_interval
    : #
        items:


    Note: If you're using an external reference to a gui .yml file your configuration will start at the menu_title option!

    Code (YAML):
    menu_title: 'TEXT'
    This is the menu title that is shown at the top of the open GUI. You can use color and formatting codes in this area. You can also use Placeholders in this title (Like %player_name%).

    Code (YAML):
    open_command: COMMAND
    This defines the command used to open the GUI. This needs to be ONE word.

    Code (YAML):
    open_requirement:
      requirements
    :
        <TEXT>
    :
          type
    : <type>
    This will give you able to open the menu if you have for example a specific permission, amount of money, etc
    See this page for more information about it.

    Code (YAML):
    open_commands:
           - '[player] COMMAND'
            - '[console] COMMAND'
            - '[commandevent] COMMAND'
            - '[message] TEXT'
            - '[openguimenu] MenuName'
            - '[connect] ServerName'
            - '[json] {"text":"message"}'
            - '[refresh]'
            - '[broadcastsound] SOUND'
            - '[sound] SOUND'
            - '[takemoney] #'
    This will run the command you set when player open the the menu

    Code (YAML):
    size: #
    This option tells the plugin how large the inventory should be. 9,18, 27, 36, 45, 54 are the only acceptable numbers here. Each one adds another line to the GUI.

    Code (YAML):
    update_interval: #
    This is for any items that use the update: tag (See Item options). The number defines the amount of seconds between each refresh of the placeholders in an item lore/display name.

    Code (YAML):
    items:
    This line should be left as is. It is merely telling the plugin you are about to begin defining items.

    Item Options

    As a reminder, Here is what your syntax should look like with items. Be aware this varies depending on the amount of items and options:

    Code (YAML):
       items:
          'ItemName'
    :
            material
    : TEXT
            slot
    : 0
    Note:be aware that the 'itemname': can be anything you want, and does not effect the configuration at all. It is for you to have identifiers. It could be a simple number (like in the default config) or it could be a random string of text.

    Code (YAML):
    material: TEXT
    This option tells what material should be used for the item (The list of valid materials is available at the top of this page). This corresponds directly with the "data" tag (If you have something like potions or wool that have data). It can also interact with the "banner-meta" tag if you use a banner material. You can also use a player head by doing "head;username". The default config shows how you can use a player placeholder to create a dynamic item (head;%player_name%).

    Code (YAML):
    data: #
    This corresponds with the material tag. It simply defines the data for any block or item. Wool is the most common example. You will need to find the data number using a page like this. However, Doing a simple google search, you should easily find data values for anything you need.

    Code (YAML):
    amount: #
    This tag shows the number that will display beside an item (Like with a stack). This is useful for doing things like a lobby selector.

    Code (YAML):
    slot: #
    This tag tells which slot of the inventory the item should be in. Items can be put in the same slot, but you will need to use the priority and view_requirement tags to make them work properly. Remember that an inventory can have up to 54 slots, but the first position (from the top left) starts at 0. So, The 9th slot is actually slot 8. This is how minecraft has things setup, and we can not change it. Here is an image to help explain it:

    [​IMG]

    Code (YAML):
    priority: #
    This tag tells which item should have priority when in the same slot as another item (Corresponds with the slot and view_requirement tag). The larger the number...the lower the priority. So, An item with a priority of 5 will not show if another item has a priority of 2, and both would be covered up by an item with a priority of 1.

    Code (YAML):
    view_requirement: 'EXPRESSION'
    This tag corresponds with the priority and slot tag. This feature give you able to view the item if player have for example a specific permission, amount of money, etc
    See this page for more information about it.

    Code (YAML):
    update: BOOLEAN
    If this is set to true it will update any placeholders in the item display name and lore. The frequency of updates is determined by the GUI Option "update_interval". This is especially useful with statistics and cooldowns.

    Here is an example image showing how the update works in placeholders:

    [​IMG]

    Code (YAML):
    hide_attributes: BOOLEAN
    This tag will hide any vanilla attributes of an item. All tools (Swords, Picks, Axes, ETC.) show things like "+5 Attack" on them. This tag (when set to true) will hide those things.

    Code (YAML):
    hide_enchantments: BOOLEAN
    This tag corresponds with the enchantments tag. If set to true it will hide the enchantment list on an item. This is useful for if you want an item to have the enchanted effect, but not the annoying text that is added.

    Code (YAML):
    hide_effects: BOOLEAN
    Very similar to the hide_attributes tag, Except that it works with things like potions which have an effect listed beneath the name. Useful when you need a potion (rather than just a bottle of water), but none of the added text.

    Code (YAML):
    banner_meta:
           - <dyecolor>;<patterntype>
           - <dyecolor>;<patterntype>
    This tag will only be used if the material tag is set as a banner. It allows you to create your own patterns using the dye colors and pattern types. You can stack them to create unique designs. You can check the resource links at the top of the page for valid colors and patterns. It is very important that you use a semi-colon and not a regular colon as the divider in these lines.

    Code (YAML):
    display_name: 'TEXT'
    This tag will be the display name for the item. You can use placeholders and color/format codes.

    Code (YAML):
    lore:
           - 'TEXT'
           - 'TEXT'
    This tag defines what will be shown in the lore area of the item. You can use placeholders and color/format codes in this area. You can add as many lines as minecraft allows.

    Code (YAML):
    enchantments:
           - enchantmentid;level
           - enchantmentid;level
    This tag is used to define enchantments on the item. The list of valid enchantments is at the top of this page in the resource links area. Be aware that some items/blocks can not be enchanted, and others can only use certain enchantments. If you wish to hide the text and just have the effect you can use the hide_enchantments tag.

    Code (YAML):
    left_click_commands:
            - '[player] COMMAND'
            - '[console] COMMAND'
            - '[commandevent] COMMAND'
            - '[message] TEXT'
            - '[openguimenu] MenuName'
            - '[connect] ServerName'
            - '[json] {"text":"message"}'
            - '[refresh]'
            - '[broadcastsound] SOUND'
            - '[sound] SOUND'
            - '[takemoney] #'
            - '[close]'

    right_click_commands
    :
            - '[player] COMMAND'
            - '[console] COMMAND'
            - '[commandevent] COMMAND'
            - '[message] TEXT'
            - '[openguimenu] MenuName'
            - '[connect] ServerName'
            - '[json] {"text":"message"}'
            - '[refresh]'
            - '[broadcastsound] SOUND'
            - '[sound] SOUND'
            - '[takemoney] #'
            - '[close]'
    These tags are fairly self explanatory. Left_click_commands controls what happens if a player left clicks an item, and right_click_commands controls what happens if they right click the item. You can have as many lines as you want. Commands execute in order from top to bottom. There are several available types of commands. Here they are listed below (Be aware that all tags should have a space before the text or commands):

    [player] - Executes a command as a player.

    [console] -
    Executes a command as the console.

    [commandevent] -
    Executes a special command event like the ones used by MyCommand Aliases or DeluxeCommands.

    [message] -
    Sends a message to the player. You can use placeholders and color/format codes here.

    [openguimenu] -
    Opens another GUI. Just add the correct menu title.

    [connect] -
    Connects the player to a bungee server. Just add the correct server name.

    [close] -
    Closes the currently open GUI.

    [json] - Send a json message to the menu viewer

    [refresh] - Refresh items in the current menu view

    [broadcastsound] - Broadcast a sound to the server

    [sound] - Play a sound for a the specific player Eg,
    - '[sound] NOTE_PLING'
    - '[sound] LEVEL_UP'
    - '[sound] ORB_PICKUP'

    [takemoney] - take amount of money from player (vault requirement)

    <delay=(TIME IN TICKS)> - sets a delay that the command event will be ran at. Eg,
    - '[close]'
    - '[message] it has been 5 seconds since the menu closed!<delay=100>'
    - '[message] Now 10 seconds has passed<delay=200>'
    20 ticks is one second. It is suggested to not use a delay when opening a menu as players can spam click it and perform the action multiple times possibly causing lag.

    <chance=(CHANCE)> - set a chance to run the command Eg,
    - '[message] The chance to get this message is 80% <chance=80.0>'
    - '[message] The chance to get this message is 25% <chance=25.0>'

    Code (YAML):
    left_click_requirement:
              requirements
    : 'EXPRESSION'
              deny_commands
    :
            - '[player] COMMAND'
            - '[console] COMMAND'
            - '[commandevent] COMMAND'
            - '[message] TEXT'
            - '[openguimenu] MenuName'
            - '[connect] ServerName'
            - '[json] {"text":"message"}'
            - '[refresh]'
            - '[broadcastsound] SOUND'
            - '[sound] SOUND'
            - '[takemoney] #'
            - '[close]'

    right_click_requirement
    :
              requirements
    : 'EXPRESSION'
              deny_commands
    :
            - '[player] COMMAND'
            - '[console] COMMAND'
            - '[commandevent] COMMAND'
            - '[message] TEXT'
            - '[openguimenu] MenuName'
            - '[connect] ServerName'
            - '[json] {"text":"message"}'
            - '[refresh]'
            - '[broadcastsound] SOUND'
            - '[sound] SOUND'
            - '[takemoney] #'
            - '[close]'
    Checks a requirement using a java/placeholder expression/comparison using the same format as the view_requirement tag. Except in this case the player can see the item, but it checks if he can left or right click it. Deny commands are completely optional, but if you use them they work exactly the same as the normal left_click_commands tag and right_click_commands tag. If the requirement is met they will execute the commands defined under the left/right_click_commands. If the requirement is not met it will instead execute the deny commands (or no commands if you did not define any).

    Note: See top of page for links to the wiki page explaining how these expressions work.
  • Loading...
  • Loading...