Menu forms

The various possible form menus with TabulaUI.

Three types of menus can be created, each with its characteristics and functioning differently, but they still share a common operation.

Common foundation

Framework

# Name of different commands to access the menu
commands:
  - STRING
  - ...

# Register or not the command and its aliases as a command with tab detection (optional)
registerCommand: BOOLEAN

# Response when opening a menu (set of optional actions)
open:
  - ACTION
  - ...

# Responses when a java player try to open the menuu
javaOpen:
  - ACTION
  - ...

# Conditions to be able to open the menu (optional)
conditions:
  # Set of conditions to be able to open the menu
  list:
    - CONDITION
    - ...

  # Set of actions if opening is not possible (conditions not met)
  unauthorized:
    - ACTION
    - ...

# Arguments when opening the menu (optional)
args:
 - ARGUMENT
 - ...

# Simple title that has no conditions.
title: STRING
#
# OR
#
# The title can also be applied conditionally
# If the first element or all conditions are met (or no conditions are present), then the specified text is displayed
title:
  -
    condition:
      - CONDITION
      - ...
    text: STRING
  -
    text: STRING

...

Form: Info

Framework

...

# Specify the menu type
type: "INFO"

# Content (description) of the menu written in a simple way
content: STRING
#
# OR
#
# Content can also be written as a list (each line corresponds to a line break in the menu)
content:
 - STRING
 - ...
#
# OR
#
# Content can also be applied conditionally
# If the first element or all conditions are met (or no condition is present), then the specified text is displayed
content:
  -
    # Conditions to display the content
    condition:
      - CONDITION
      - ...

    # Content written in a simple way
    text: STRING
    #
    # OR
    #
    # Content as a list (each line corresponds to a line break)
    text:
     - STRING
     - ...
  - ...

# "Yes" button, which can be written simply as follows:
trueButton:
  # Button text
  text: STRING
  
  # Actions when the button is pressed
  response:
    - ACTION
    - ...
  #
  # OR
  #
  # Actions when the button is pressed conditionally
  # If the first element or all conditions are met (or no condition is present), then the specified response is executed
  response:
    -
      # Response conditions
      condition:
        - CONDITION
        - ...

      # Action for the response
      action:
        - ACTION
        - ...
        
    - ...
#
# OR
#
# This button, like the "content" section, can be written conditionally
trueButton:
  -
    condition:
      - CONDITION
      - ...
 
    # Button text
    text: STRING
    
    response:
      - ACTION
      - ...
    #
    # OR
    #
    # Actions when the button is pressed conditionally
    # If the first element or all conditions are met (or no condition is present), then the specified response is executed
    response:
      -
        # Response conditions
        condition:
          - CONDITION
          - ...
  
        # Action for the response
        action:
          - ACTION
          - ...
          
      - ...
  - ...
        
# "No" button, which can be written simply as follows:
falseButton:
  # Button text
  text: STRING
  
  # Actions when the button is pressed
  response:
    - ACTION
    - ...
  #
  # OR
  #
  # Actions when the button is pressed conditionally
  # If the first element or all conditions are met (or no condition is present), then the specified response is executed
  response:
    -
      # Response conditions
      condition:
        - CONDITION
        - ...

      # Action for the response
      action:
        - ACTION
        - ...
        
    - ...
#
# OR
#
# This button, like the "content" section, can be written conditionally
falseButton:
  -
    condition:
      - CONDITION
      - ...
 
    # Button text
    text: STRING
    
    response:
      - ACTION
      - ...
    #
    # OR
    #
    # Actions when the button is pressed conditionally
    # If the first element or all conditions are met (or no condition is present), then the specified response is executed
    response:
      -
        # Response conditions
        condition:
          - CONDITION
          - ...
  
        # Action for the response
        action:
          - ACTION
          - ...
          
      - ...
  - ...

Example

commands:
  - rules
  - rule
registerCommand: true
type: INFO
open:
  - "[message] &eYou have opened the rules menu."
  - "[sound] ENTITY_EXPERIENCE_ORB_PICKUP 1 1"

title:
  -
    condition:
      - "[!permission] rules.read"
    text: "&c&lRules &f- &eMust be read"
  -
    text: "&a&lRules"

content:
  -
    condition:
      - "[permission] rules.read"
    text:
      - "&fGood ! You have &ealready read &fthe rules."
      - ""
      - "&f➤ &b&lRules"
      - "&a&l✔ &fYou can't kill other players."
      - "&a&l✔ &fGriefing is not allowed."
      - "&a&l✔ &fYou can't steal from other players."
      - "&a&l✔ &fYou can't use hacks or cheats."
      - "&a&l✔ &fYou can't use offensive language."
      - ""
  -
    text:
      - "&c&oWarning!"
      - "&fYou &cmust read &fthe rules before you can play on the &eserver&f."
      - ""
      - "&f➤ &b&lRules"
      - "&a&l✔ &bYou can't kill other players."
      - "&a&l✔ &bGriefing is not allowed."
      - "&a&l✔ &bYou can't steal from other players."
      - "&a&l✔ &bYou can't use hacks or cheats."
      - "&a&l✔ &bYou can't use offensive language."
      - ""

trueButton:
  text: "&a&lI have read"
  response:
    -
      condition:
        - "[!permission] rules.read"
      action:
        - "[console] lp user %player% permission set rules.read true"

falseButton:
  text: "&c&lClose"

Form: List

Framework

...

# Specify the type of the menu
type: "LIST"

# Content (description) of the menu written in a simple way
content: STRING
#
# OR
#
# The content can also be written as a list (each line corresponds to a newline in the menu)
content:
 - STRING
 - ...
#
# OR
#
# The content can also be conditionally applied
# If the first element or all conditions are met (or no condition is present), then the specified text is displayed
content:
  -
    # Conditions to display the content
    condition:
      - CONDITION
      - ...
 
    # Content written in a simple way
    text: STRING
    #
    # OR
    #
    # Content as a list (each line corresponds to a newline)
    text:
     - STRING
     - ...
  - ...

# Set of buttons present in the menu
buttons:
  # Button name
  STRING:
    # Button text
    text: STRING
    #
    # OR
    #
    # Button text as a list (each line corresponds to a newline)
    text:
     - STRING
     - ...
    
    image: URL | SRC
    
    # Actions when the button is triggered
    response:
     - ACTION
     - ...
    #
    # OR
    #
    # Actions when the button is triggered conditionally
    # If the first element or all conditions are met (or no condition is present), then the specified response is executed
    response:
     -
       # Conditions of the response
       condition:
        - CONDITION
        - ...
 
       # Action on the response
       action:
        - ACTION
        - ...
  
  # The button can also be in conditional form
  # If the first element or all conditions are met (or no condition is present), then the specified button is displayed
  STRING:
    -
      # Button text
      text: STRING
      #
      # OR
      #
      # Button text as a list (each line corresponds to a newline)
      text:
       - STRING
       - ...
      
      image: URL | SRC
      
      # Actions when the button is triggered
      response:
       - ACTION
       - ...
      #
      # OR
      #
      # Actions when the button is triggered conditionally
      # If the first element or all conditions are met (or no condition is present), then the specified response is executed
      response:
       -
         # Conditions of the response
         condition:
          - CONDITION
          - ...
   
         # Action on the response
         action:
          - ACTION
          - ...
  
       - ...
 
    - ...
  
  ...

Example

commands:
  - menu
registerCommand: true
type: LIST

title: "&d&lTeleport to a server"

content:
  - "Welcome to the &bserver&f! You can choose the &bgame mode &fyou want to play!"
  - ""
  - "&f➤ Don't forget to &bjoin our networks&f:"
  - " &a&l✔ &b&owww.myserver.com"
  - " &a&l✔ &9&odiscord.gg/myser"
  - ""

buttons:
  survival:
    text:
      - "&c&lSMP &f- &e&lSurvival"
    image: "https://oyster.ignimgs.com/mediawiki/apis.ign.com/minecraft/5/5a/Ender_Dragon.png"
    response:
      - "[send] survival"
  skyBlock:
    text:
      - "&2&lSky&a&lBlock"
    image: "https://static.wikia.nocookie.net/minecraft_gamepedia/images/a/a4/Grass_Block_%28item%29_BE5.png/revision/latest?cb=20200901112517"
    response:
      - "[send] skyblock"
  prison:
    text:
      - "&c&lPrison"
    image: "https://static.wikia.nocookie.net/minecraft_gamepedia/images/e/e7/Diamond_Pickaxe_JE3_BE3.png/revision/latest/scale-to-width/360?cb=20200226193952"
    response:
      - "[send] prison"
  close:
    text: "&c&lClose"

Form: Custom

Structure

...

# Specify the menu type
type: "CUSTOM"

# Set of elements present in the menu
elements:
  # Element name
  STRING:
    # Element type
    type: ENUM
    
    ...(Element properties)
    
    # Actions when the button is triggered
    response:
     - ACTION
     - ...
    #
    # OR
    #
    # Actions when the button is triggered conditionally (in addition to the "simple" way)
    # If the first condition or all conditions are met (or no conditions are present), then the specified response is executed
    response:
      -
        condition:
         - CONDITION
         - ...
        action:
         - ACTION
         - ...
  
  # The element can also be in conditional form
  # If the first condition or all conditions are met (or no conditions are present), then the specified element is displayed
  STRING:
    -
     # Element type
     type: ENUM
     
     # Displayed text
     text: STRING
     #
     # OR
     #
     # The text can also be written in the form of a list (each line corresponding to a newline in the menu)
     text:
      - STRING
      - ...
     
     ...(Element properties)
     
     # Actions when the button is triggered
     response:
      - ACTION
      - ...
     #
     # OR
     #
     # Actions when the button is triggered conditionally (in addition to the "simple" way)
     # If the first condition or all conditions are met (or no conditions are present), then the specified response is executed
     response:
       -
         condition:
          - CONDITION
          - ...
         action:
          - ACTION
          - ...
    - ...
         
  ...

Propriétés

Description: Allows displaying informative text

Example

commands:
  - settings
type: CUSTOM
open:
  - "[sound] ENTITY_EXPERIENCE_ORB_PICKUP 1 1"

conditions:
  list:
    - "[permission] settings.edit"
  unauthorized:
    - "[message] &cYou are not allowed to edit settings!"

title: "&b&lSettings editor"

elements:
  content:
    type: LABEL
    text:
      - "&rYou are editing your &bsettings &fwith a full customization."
      - ""
      - "&f➤ Propose new settings on our discord: &9&odiscord.gg/myserver"
      - ""
  notifications:
    type: TOGGLE
    text: "&bNotifications"
    toggled: true
    response:
      - "[console] setsettings %player% notifications %result%"
      - "[message] &fYou have switch &9'Notifications' &fto &a%result%&f."
  scoreboard:
    type: TOGGLE
    text: "&bScorebard"
    toggled: true
    response:
      - "[console] setsettings %player% scoreboard %result%"
      - "[message] &fYou have switch &9'Scorebard' &fto &a%result%&f."
  dm:
    type: DROPDOWN
    text: "&bAccess to PM"
    options: ["Everyone", "Friends only", "Staff", "Nobody"]
    defaultOption: 0
    response:
      - "[console] setsettings %player% access_pm %result%"
      - "[message] &fYou have switch &9'Access to PM' &fto &a%result%&f."

Last updated