Skip to content

Layout and your own buttons

Layout

rows and layout go at the top of a file. In wardrobe.yml, they go under each look. A place is one square of the menu. Places are numbered from the top left: row 1 is 0 to 8, and row 2 is 9 to 17.

# menus/collection.yml
rows: 6
layout:
  back: 45            # a button takes one place
  previous: 48
  colors: 49
  next: 50
  filter: 53
  categories: 0-8     # an area takes a range of places
  cosmetics: 9-44

A button takes one place. Set to none, -1, false or "", it is left out of the menu:

# menus/collection.yml
layout:
  filter: none

An area takes a range (9-44, 8-0), a list of places, a list of both ([9, 10, 18-26]), or none:

# menus/collection.yml
layout:
  categories: 8-0              # a range, here written high to low
  cosmetics: [9, 10, 18-26]    # a list of places and ranges

With none, an area has no places, so the menu shows nothing of it: categories: none leaves out every category button, All too. A button or an area written in a way this page does not list is named in the console, and it keeps its places as shipped.

auto

auto lets the menu pick the place itself, as the list menus do:

# menus/lists.yml
rows: auto
layout:
  back: 0
  places: auto

Every key that takes auto also takes something else in its place:

Key auto Instead of auto
rows lists.yml: just tall enough for the places, Back and your buttons. Other menus: the default in the table below A number, in the range the table below gives
A button Its place as shipped. In collection.yml, admin.yml and showcase.yml, it keeps its column in the last row, whatever rows is One place, or none
cosmetics Every row between the first and the last Places, or none
places in lists.yml As many places as the player may wear, up to 8, in the middle of the top row (places 1 to 8). If a button has one of those places, the list takes the free places in order from 0 instead Places. A list has no more places than you write
Any other area Its places as shipped Places, or none

The list menus with numbers in place of auto:

# menus/lists.yml: three rows, the places in the middle row
rows: 3
layout:
  back: 0
  places: 10-16
  • After changing rows, move your places to fit, or use auto.
  • A rows number outside the menu's range is named in the console, and the menu keeps its default rows.
  • Buttons get their places first, in the order of the table below, then areas. A place that is already taken, or outside the menu, is left out.
  • If categories has fewer places than there are categories, the last categories are left out. The All button always keeps a place, unless categories.all is false in config.yml. Even then, a player with boxcosmetics.admin sees it.
  • When there are fewer category buttons than places, the buttons sit in the middle of the area.
  • Title pictures do not move when you change places (Titles).

The rows and places of each menu as shipped:

Menu rows Buttons (default) Areas (default)
wardrobe.yml, per look 1 to 6 (default 4) See looks The slots, placed by columns
collection.yml 3 to 6 (default 6) back 45, previous 48, colors 49, next 50, filter 53 categories 0-8, cosmetics 9-44
admin.yml 3 to 6 (default 6) previous 48, next 50 As in collection.yml: categories 0-8, cosmetics 9-44
showcase.yml 3 to 6 (default 6) wardrobe 45, previous 48, filter 49, next 50, sidebar 53 As in collection.yml: categories 0-8, cosmetics 9-44
lists.yml 1 to 6 (default auto) back 0 places auto
colors.yml Always 6 back 45, reset 48, preview 49, confirm 50 swatches 0-35, hues 36-44
  • cosmetics shows one cosmetic per place, and the rest go on further pages. categories shows one category button per place, with All after the last one.
  • With places set to auto, a list menu has as many places as the player may wear, in the middle of the top row. If the list still holds items past a limit that was lowered, it has a place for each of them too.
  • swatches needs exactly 36 places, and hues exactly 9. With any other count, the menu uses the shipped layout.

Your own buttons

Add your own buttons under custom-buttons in any menu file but common.yml. This button sends the player to spawn:

# menus/collection.yml
custom-buttons:
  spawn:
    slot: 47
    item: COMPASS
    name: "<gold>Spawn"
    left:
      - "[player] spawn"
      - "[close]"

In wardrobe.yml, put them under each look:

# menus/wardrobe.yml
looks:
  all:
    custom-buttons:
      spawn:
        slot: 8
        item: COMPASS
        name: "<gold>Spawn"
        left:
          - "[player] spawn"

Every key a button takes, and every kind of line it can run:

# menus/collection.yml
custom-buttons:
  spawn:                                   # any name you like
    slot: 47                               # its place; a button with no slot is left out
    item: COMPASS                          # its icon; default PAPER
    name: "<gold>Spawn"
    lore:
      - "<gray>Back to spawn, {player}"
    permission: myserver.spawn             # only players with this permission see the button and can click it
    left:
      - "[sound] ui.button.click 1 1"      # plays a sound: [sound] <sound> [volume] [pitch]
      - "[player] spawn"                   # runs the command as the player
      - "[close]"                          # closes the menu
    right:
      - "[message] <gray>Left click to go to spawn"   # messages the player, in MiniMessage
    shift-left:
      - "[console] say {player} went to spawn"        # runs the command from the server console
    shift-right:
      - "[open] wardrobe"                  # opens wardrobe, collection or colors
    click:                                 # any other click: here middle and drop
      - "spawn"                            # a line without [...] runs as [player]
  • No button, area or wardrobe slot may be using the button's slot. item, glow and modeldata work as on every icon.
  • name and lore take MiniMessage, as under Names and lore. Without name, the button shows its item's own name. Without permission, every player sees the button.
  • The click keys are left, right, shift-left, shift-right, middle and drop. click holds the lines for any click without its own key.
  • lore: [] shows no lore. A click key set to [], such as left: [], makes that click do nothing: the click lines do not run for it.
  • Lines run in order, the tick after the click. A line with any other word in [...] does nothing, and the console names it.
  • [player] <command> also works for commands that open a menu plugin's menu. [console] <command> runs the command from the server console, and [message] <text> takes MiniMessage. [open] colors runs /bc color as the player: it opens the palette of the item in the player's hand, or else their Collection with Colors on. [open] also takes cosmetics and menu for the wardrobe, and color for the palette. The console names any other word after [open]. In [sound], the volume and the pitch are 1 when left out.
  • {player} and PlaceholderAPI placeholders work in the name, lore and lines. Updates never add or remove custom-buttons.