Skip to content

Menus and GUI

joogiebear edited this page Jul 15, 2026 · 2 revisions

Menus & GUI

RoyalBazaar's menus live in plugins/RoyalBazaar/gui/ and use the EcoMenus dialect shared across the Royal suite. Run /bazaar reload after edits.

There are three menus:

File Menu What it is
gui/bazaar_main.yml Main The category picker — one button per category
gui/bazaar_category.yml Category A paged grid of the items in one category
gui/bazaar_product.yml Product A single item's buy / sell screen

The dialect

A menu file has a title, rows, an optional page mask, and a list of slots:

title: "&8Bazaar"
rows: 6

pages:
  - page: 1
    mask:
      items:
        - black_stained_glass_pane   # the filler item
      pattern:
        - "111111111"                # 1 = filler
        - "100000001"                # 0 = a content slot (items are placed here)
        - "100000001"
        - "100000001"
        - "100000001"
        - "111111111"

slots:
  - item: wheat name:"&aFarming"     # inline item: material [flags] name:"..."
    lore:
      - "&7Crops, seeds and enchanted drops."
      - ""
      - "&eClick to browse!"
    location:
      row: 2
      column: 3
    left-click:
      - id: open_menu
        args:
          menu: bazaar_category
          category: farming
      - id: play_sound
        args:
          sound: ui_button_click
          pitch: 1
          volume: 1
  • mask paints filler; 0 cells are content slots the category/product grid fills with live items.
  • slots are fixed, hand-placed buttons. location is 1-based row/column. Each has a left-click (and optional right-click) list of effects run top to bottom.
  • item is the inline material [hide_enchants] [hide_attributes] name:"..." syntax. Use a vanilla material or an ecoitem: id.

Effect ids

Effect Args Does
open_menu menu, category Open another menu (optionally scoped to a category)
close_inventory Close the menu
play_sound sound, volume, pitch Play a sound to the clicker
send_message message Send a chat message
rbazaar_open_product item Open the product screen for an item
rbazaar_buy item, amount Buy — amount may be a number or all
rbazaar_sell item, amount Sell — amount may be a number or all
rbazaar_buy_prompt item Ask for a custom amount in chat, then buy

The forwards/backwards paging arrows are configured with forwards-arrow / backwards-arrow blocks (item + location), and page automatically through a category's content.

Tips

  • Add a category to the main menu = add a slot whose open_menu points at its id (see Categories).
  • Menus are read-only surfaces — clicks never move items, they only run effects.
  • If a menu fails to parse, RoyalBazaar logs it and falls back to defaults; check the console after a reload.

Clone this wiki locally