Create a GUI

GUI's are made of rows from 1 up to 6 (limited by Minecraft)

#
#   0   1   2   3   4   5   6   7   8   |
#   β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  | ROW 1 - [MIN]
#   9   10  11  12  13  14  15  16  17  |
#   β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  | ROW 2
#   18  19  20  21  22  23  24  25  26  |
#   β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  | ROW 3
#   27  28  29  30  31  32  33  34  35  |
#   β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  | ROW 4
#   36  37  38  39  40  41  42  43  44  |
#   β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  | ROW 5
#   45  46  47  48  49  50  51  52  53  |
#   β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ  | ROW 6 - [MAX]
#

Structure

Structure - Foundation

Each GUI file must contain the following:

gui:
  title: "<black>Title"
  size: 6
  refresh-rate: 1
  inactivity-timer: 2400
  inactivity-message:
    - "<dark_grey>GUI closed due to inactivity."
  open-sound: "block.chest.open 1.0 1.0"
  close-sound: "block.chest.close 1.0 1.0"
  switch-sound: "block.chest.open 0.0 0.0"
  • title - Displayed at the top of the inventory

  • size - Number of rows

  • refresh-rate - How often to refresh the GUI items (in ticks)

  • inactivity-timer - After how many ticks of inactivity to close the GUI

  • inactivity-message - Message to show after the inactivity-timer has ended

  • open/close/switch-sound - Sounds to play when opening, closing or switching GUIs

Structure - Empty slots

Used to fill any unused slot in the GUI

empty-slots:
  material: "BLACK_STAINED_GLASS_PANE"
  model-data: 0
  name: ""
  hide-tooltip: true

Structure - Item groups

Groups can contain single items, or pages, see bellow examples.

Single item group:

groups:
  group-id:
    item-type: "NONE"
    slots: [ "1" ]
    amount: 1
    model-data: 499
    flags:
      - "HIDE_ATTRIBUTES"
    material: "DIAMOND"
    name: "<gray>Diamond"
    lore:
      - "<dark_gray>Shiny"
    actions:
      LEFT_CLICK:
        - "[SOUND] ui.button.click 1 1"
  • group-id - Name of the group

  • item-type - Type of item (used for plugin-specific properties)

  • amount - The amount of the item

  • model-data - Custom model data applied to the item

  • flags - Minecraft item flags

  • material - The material of the item

  • name - The name of the item

  • lore - The lore of the item

  • actions - Used to execute custom logic, such as commands, messages, sounds or more per-click


Multi-page group:

groups:
  group-id:
    settings:
      fill-empty: true
      switch:
        auto: false
        order: [ "1", "2", "3" ]
        delay: 20
        interact:
          stop: true
          timer: 0
    1: # Page number
      apple: # Item ID
        item-type: "NONE"
        slots: [ "1-4" ]
        amount: 1
        gradual-amount: false
        model-data: 499
        enchants:
          - "infinity"
        flags:
          - "HIDE_ATTRIBUTES"
          - "HIDE_ENCHANTS"
        gradual-model-data: false
        material: "APPLE"
        name: "<dark_gray>Page 1"
        actions:
          LEFT_CLICK:
            - "[SOUND] ui.button.click 1 1"
    2: # Page number
      dirt: # Item ID
        item-type: "NONE"
        slots: [ "1-4" ]
        amount: 1
        gradual-amount: false
        model-data: 499
        enchants:
          - "infinity"
        flags:
          - "HIDE_ATTRIBUTES"
          - "HIDE_ENCHANTS"
        gradual-model-data: false
        material: "DIRT"
        name: "<dark_gray>Page 2"
        actions:
          LEFT_CLICK:
            - "[SOUND] ui.button.click 1 1"

Multi-paged groups have an extra section named settings, which includes:

  • fill-empty - Fill empty slots for the page that were previously unoccupied

  • switch.auto - Automatically start switching between pages

  • switch.order - Order in which to switch the pages

  • switch.delay - Delay of switching in between pages

  • switch.interact.stop - Stop the switching if the player has interacted with the page

  • switch.interact.timer - Timer for the stop, set to 0 to permanently pause

Other than the settings section and having page numbers, the items have the same layout as group-items (see above).

Last updated