Roanoke Development
  • Home
  • Terms and Conditions
  • Product Pricing
  • Mods
    • CobbledSync
    • Lazy NPCs
      • Molang
        • Economy Methods
        • Player Methods
    • Oxygen
      • Player Warps
        • Commands & Permissions
      • Commands & Permissions
        • Configured TP (CTP)
      • RTP (Random Teleport)
        • Configured RTP (Admin Command)
      • Migrating from EEssentials
    • WonderTrade
      • Announcements
      • Commands & Permissions
      • Trade Pool(s)
    • Teams
    • Tournaments
      • Time Limits
    • CobbledSpawners
      • Config
      • Spawners
      • Spawn Groups
      • Commands & Permissions
    • ScavengerHunts
    • PPokedex
      • Commands
      • Configurable GUI
      • Configuration
      • Items
      • Ranks
      • Pokedex
    • GGyms
      • Gym Rewards
      • Gym Requirements
      • Commands & Permissions
    • BetterBreeding
      • Egg Encryption
      • Pasture Based Breeding
      • Configurable Items
      • Commands & Permissions
      • GUIs
      • Breeding Configuration
    • Research Tasks
    • Roanoke Library (Rib)
      • Placeholders
        • Pokemon Placeholders
        • Player Placeholders
      • Rewards
      • Item Builder
      • Custom GUI
      • Requirements
        • Multiple Requirements Requirement
        • Pokemon Party Requirements
        • Registering Custom Requirements
        • Permission Requirement
      • Quests
        • Other Quests
        • Placeholder Quests
        • Cobblemon Quests
        • Minecraft Quests
        • Registering Custom Quests
      • PokeMatch
        • IVs/EVs
    • GiftBox
      • Quick Start
      • Commands & Permissions
      • Player Groups
      • Gift Definitions
    • Cobblemon Bank
      • Commands & Permissions
      • Bank Transactions
      • Bank Config
    • Boosters
      • Commands & Permissions
Powered by GitBook
On this page
  1. Mods
  2. Roanoke Library (Rib)

Custom GUI

Allowing you to customise your Mod GUIs to make your server unique - without any code.

PreviousItem BuilderNextRequirements

Last updated 10 months ago

Custom GUI support will be rolled out to all of our mods over time. As of now, GGyms is our first public mod to get access to it. This is a new system that'll get improvements & new features over time.

GUI Directory

Inside of your mod's config, you'll find a "GUI" folder.

This contains a "Menu" folder alongside "item_definitions.json". The item definitions file lets you define items that are used globally across GUI system. This is mostly used for "GUI Fill" items, such as glass panes.

{
  "defaultFillItem": {
    "id": "minecraft:black_stained_glass_pane",
    "name": ""
  },
  "defaultElementFillItem": {
    "id": "minecraft:gray_stained_glass_pane",
    "name": ""
  }
}

Most mods come with this Item Definition config by default. Our GUIs are filled with Black Stained Glass by default. The "defaultElementFillItem" is generally used to denote that an element (say, a Gym, or Team) would be in that space if one existed.

Inside of the "Menus" directory, GUIs are configured.

Each file contains a config for that specific GUI. This one defines the player facing Gym menu when a player does /gyms.

{
  "id": "player_gyms_view",
  "gui_type": "G9X6",
  "gui": [
    "#########",
    "####C####",
    "##X#X#X##",
    "###X#X###",
    "##X#X#X##",
    "#########"
  ],
  "keys": {
    "#": "defaultFillItem",
    "C": "defaultFillItem",
    "X": "defaultElementFillItem"
  }
}

This config results in the above in game view. You can define the GUI type, which is effectively the size of the GUI, and then the actual elements themselves. The "id" field must be unique and should not be changed, as it's what is called in the code to get the specific menu.

Each element is a single character, the keys for which are defined below the GUI itself in the "keys" value. Here, "#" ties to the "defaultFillItem" which is defined in the global "item_definitions.json" file. "X" is defined as the "defaultElementFillItem".

In the code, the dynamic elements are passed into this config (in this case, Gym Items) with a specific key. In this case, the key is "X". The code goes through each key and places a Gym where an "X" is found. If there are less Gyms than "X" keys, it defaults to using the key value, which is "defaultElementFillItem".

You'll often see other characters, such as "C" above. Each mod will have its own documentation telling you what elements will attempt to be placed there. In this case, "C" is the challenge item - if a player has an active Gym challenge, it should be displayed on the menu. If there isn't a challenge, the code doesn't pass it into the GUI, and the default "C" key value is used instead - "defaultFillItem". In the screenshot, the player doesn't have an active challenge, so the "defaultFillItem" is used.

GUI directory inside of GGyms
Menus directoy inside of GGyms
How the default Gyms View looks in game