Skip to content

Item Browser GUI

/ei browse opens a two-level browser: the first level lists item packs, clicking a pack icon opens the second level listing the items inside it, and a left click takes one piece into the inventory (Shift + left click takes a full stack).

Each level has its own layout file, both under plugins/EmakiItem/gui/:

FileLevelPurpose
pack_browser_gui.ymlFirstLists every item pack under items/.
item_browser_gui.ymlSecondLists all items inside one pack.

The command requires the emakiitem.browse permission (default op) and is player-only. /ei browse [page] jumps straight to a page, counted from 1; values below 1 resolve to page 1, and a value beyond the total page count opens an empty page you can leave with the page buttons.

Pack metadata: pack.yml

Every subdirectory under items/ may carry a pack.yml defining how that pack's icon looks on the first level.

Items placed directly in the items/ root also form a "root pack": its pack id is the empty string, it still appears in the first-level list, and its display name comes from the browser.default_pack_name language key.

yaml
display_name: "<gold>Example Item Pack</gold>"
icon: "minecraft-chest"
lore:
  - "<gray><white>%count%</white> items</gray>"
  - "<dark_gray>Pack id: %pack%</dark_gray>"
  - ""
  - "<yellow>Click to browse</yellow>"
order: 10
KeyDefaultDescription
display_namedirectory namePack name shown on the first level, with MiniMessage support. Empty falls back to the directory name.
iconminecraft-chestPack icon as a CoreLib ItemSource shorthand, the same syntax as item.source in an item definition.
loreitem countLore for the pack icon. %count% is the pack's item count and %pack% is the pack id.
order100Sort weight on the first level, ascending.

Three things to note:

  • The pack id comes from the directory's relative path, independent of pack.yml contents.
  • Without a pack.yml, everything falls back: a minecraft:chest icon, the directory name as display name, and lore showing the item count.
  • pack.yml is not read by the item loader as an item definition.

How deep pack directories may be discovered is controlled by data_directories.max_depth in config.yml; directories beyond that depth do not become separate packs.

First-Level Slot Types

typePurpose
pack_entryPack icon area, filled by ascending order (pack id lexicographic order breaks ties), paginated when it overflows. Clicking opens that pack's second level.
page_prev / page_nextPage turning.
page_infoPage numbers and statistics.
closeCloses the window.
fillerDecorative filler.

Placeholders available to pack_entry and page_info:

PlaceholderWhereMeaning
%pack%pack_entryPack id.
%pack_name%pack_entryPack display name.
%pack_lore%pack_entryPack lore taken from lore in pack.yml, or fallback text when undefined.
%count%pack_entryItem count in that pack, the same value as %item_count%.
%item_count%pack_entryItem count in that pack.
%current_page% / %total_pages%page_infoCurrent page number and total page count.
%pack_count%page_infoTotal pack count.
%item_count%page_infoTotal number of loaded item definitions.

Second-Level Slot Types

typePurpose
item_entryItem icon area, filled in item id lexicographic order and paginated when it overflows. Left click takes one piece, Shift + left click takes a full stack; right clicks do nothing.
backReturns to the first level.
page_prev / page_nextPage turning.
page_infoPage numbers and statistics.
closeCloses the window.
fillerDecorative filler.

An item_entry icon is rendered from the item definition itself; when the slot declares lore, it is appended on top of the item's own lore.

On the second level, page_info supports %current_page%, %total_pages%, %pack% (current pack id), %pack_name% (current pack name), and both %item_count% and %count% (item count in the current pack).

Page Capacity Comes From the Layout

How many entries fit on a page depends on how many cells pack_entry / item_entry declare in the layout, not on a fixed number. The default layouts give 21 cells on both levels (rows 2 through 4 minus the side borders).

Changing the cell count of those areas changes pagination directly; the page buttons need no adjustment.