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/:
| File | Level | Purpose |
|---|---|---|
pack_browser_gui.yml | First | Lists every item pack under items/. |
item_browser_gui.yml | Second | Lists 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.
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| Key | Default | Description |
|---|---|---|
display_name | directory name | Pack name shown on the first level, with MiniMessage support. Empty falls back to the directory name. |
icon | minecraft-chest | Pack icon as a CoreLib ItemSource shorthand, the same syntax as item.source in an item definition. |
lore | item count | Lore for the pack icon. %count% is the pack's item count and %pack% is the pack id. |
order | 100 | Sort weight on the first level, ascending. |
Three things to note:
- The pack id comes from the directory's relative path, independent of
pack.ymlcontents. - Without a
pack.yml, everything falls back: aminecraft:chesticon, the directory name as display name, and lore showing the item count. pack.ymlis 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
type | Purpose |
|---|---|
pack_entry | Pack 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_next | Page turning. |
page_info | Page numbers and statistics. |
close | Closes the window. |
filler | Decorative filler. |
Placeholders available to pack_entry and page_info:
| Placeholder | Where | Meaning |
|---|---|---|
%pack% | pack_entry | Pack id. |
%pack_name% | pack_entry | Pack display name. |
%pack_lore% | pack_entry | Pack lore taken from lore in pack.yml, or fallback text when undefined. |
%count% | pack_entry | Item count in that pack, the same value as %item_count%. |
%item_count% | pack_entry | Item count in that pack. |
%current_page% / %total_pages% | page_info | Current page number and total page count. |
%pack_count% | page_info | Total pack count. |
%item_count% | page_info | Total number of loaded item definitions. |
Second-Level Slot Types
type | Purpose |
|---|---|
item_entry | Item 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. |
back | Returns to the first level. |
page_prev / page_next | Page turning. |
page_info | Page numbers and statistics. |
close | Closes the window. |
filler | Decorative 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.