Skip to content
Crypto Morin edited this page Mar 4, 2022 · 29 revisions

Each GUI uses an entire YAML file to parse its settings from the guis -> <lang> folder.
Unlike language files, they don't automatically add new options since their 100% customizable.
If your conditional GUI options are not changing that means your Java version is JRE instead of JDK.

Main Options

  • title: The title of the GUI.
  • rows: The rows of the GUI, it can be from 1 to 9
  • type: If no rows is specified, a type will be used. You can see all the types here.
  • sound: Sound when the GUI opens. Format is sound: <type>, [volume], [pitch] You can also use default to use the default sound specified in config.
  • message: Message when the GUI opens.
  • commands: Commands executed when the GUI opens.
  • interactable: Interactable slots of this GUI. If it only contains one slot and that number is lower than zero, then the list will act as a blacklist.
  • disallow-creative: true or false. Whether this GUI can be opened in creative mode or not.

Item Options

These options are used under the item names which are under options entry of GUIs. Option names are really important for some GUIs. They define what an option does from the code. If an option name doesn't have any actions attached to it, it'll not do anything when clicked on. This is where conditional GUIs come to use.
All the text options in items support color codes and placeholders.
Some people might find the following information hard to understand. If you have a question for any options below, ask me.

  • name: The name of the item.
  • lore: The lore of the item. You can use this differently. Either by using yaml lists or using strings and \n. You can also use \n if you're using a list.
  • material: The material of the item.
  • amount: The item amount.
  • damage: The item's damage (durability).
  • skull: The item's skull texture. This can be a player's name, UUID, a textures.minecraft.com link or a Base64. The recommended value is always Base64 as it doesn't require encoding and connections. A good website to get skull textures from that also supports Base64 is minecraft-heads.com. The value preference for this option from best to worst is as follows: base64 -> textures link -> UUID -> Name Note that you need to set the material to PLAYER_HEAD for this to work. You can use %player% to use the skull of the current player who opened the GUI.
  • unbreakable: true or false. Whether this item should have an unbreakable attribute.
  • model-data: The 1.14 custom data models feature.
  • enchants: Item's enchantments. It's a yaml entry with the entry keys as the enchantment name and the entry values as the enchantment level. Example:
enchants:
  ARROW_FIRE: 2
  DURABILITY: 3
  • flags: The item flags. Item flags in Minecraft are badly named, so it might not do the exact thing you're looking for. In this case, you might want to try other flags. Example:
flags: [HIDE_ATTRIBUTES, HIDE_POTION_EFFECTS]
  • attributes: Item attributes are the numbers shown in the bottom of the item's description under the item's lore. You can hide these with item flags but you can also change them with attributes.
    Format:
attributes:
  Attribute: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/Attribute.html
    name: https://minecraft.gamepedia.com/Attribute
    amount: The modifier's number.
    operation: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/AttributeModifier.Operation.html
    slot: HEAD - CHEST - LEGS - FEET - HAND - OFF_HAND
  • sound: The sound played when this item is clicked.
  • commands: The commands executed when this item is clicked.
  • message: The message sent to the player when this item is clicked.
  • can-take: true or false. If this item can be taken out of the GUI by the player.
  • slots/posx,posy/slot: The position(s) of the item. When using slot, you need to count the slots of the GUI from top to bottom and left to right and then subtract that number by one. When using posx and posy You just need to know the exact position in the GUI. When using slots it's the same as slot, but you can put the item in multiple slots with the same properties and actions. slots: [34, 35, 36, 37]
  • patterns: Only works if the item is a banner. It's a section list with format: Pattern as the key and Dye Color as the value.
  • color RGB color used for leather armor colors. Format: r, g, b
  • spawner Entity type used for spawner blocks.
  • projectiles A list of items for charged projectiles of a crossbow. The serialization for these items follow the same rules as these.
  • effects The effects used for suspicious stew. A config list.
  • color and pattern-color Dye Color used for tropical fish and pattern used for the pattern.
  • power The power of a firework.
  • firework
    • flicker true or false of the firework should have flicker.
    • trial true or false of the firework should have trial.
    • colors The RGB colors that this firework can have.
    • fade-colors The fading colors of this firework.
    • type The firework type.

Conditional

GUI items use a simple logical-relational evaluator to change item appearance depending on a condition. You can change the entire item property by using condition option and putting each under a custom condition name. You can also use conditions for sounds, slots and messages.

Currently this evaluator only supports numbers.
Supported operations:

Symbol Description
== Checks if two numbers are equal. (You could also use =, but == is conventional.
!= Checks if two numbers are not equal.
> Checks if a number is greater than a number.
< Checks if a number is less than a number.
>= Checks if a number is greater than or equals to a number.
<= Checks if a number is less than or equal to a number.
&& Checks if both conditions are true.
|| Checks if either conditions are true.

Example:

options:
  hello:
    # Note that "activated" and "else" are just normal names that have no effects.
    # The last condition which is always used if none of the conditions above it were met, is named "else" most of the times.
    activated:
      condition: "%kingdoms_members% > 10 && %kingdoms_members% < 20"
      name: "&2Activated"
      material: GREEN_WOOL
    else:
      # We use true here because if the previous condition wasn't met,
      # there is no need for us to use "%kingdoms_members% <= 10" here.
      condition: true
      name: "&4Disabled"
      material: RED_WOOL
      sound:
        "%kingdoms_members% <= 5": BLOCK_ANVIL_FALL
        "true": BLOCK_ANVIL_BREAK