previews
The previews folder - reward preview menu designs shared between crates, reward slots, paging and temporary icons.
Every reward preview design is one file in previews/. The file name is the design’s id, which
crates select with Settings.Preview-Menu. Several crates can share one design, or each crate can
have its own. After editing, run /cratesadmin reload.
One design ships, default.yml. A PICK crate’s picker is this same menu.
The default design
Section titled “The default design”Title: "{crate} Crate Preview"Size: 36Reward-Slots: [0-26]
Items: Filler-Item: Material: BLACK_STAINED_GLASS_PANE Name: "&r" Slots: [27-35]
Barrier-Item: Material: GLASS_PANE Name: "&r" Slots: [0-26]
Previous-Item: Material: ARROW Slot: 30 Name: "&c&l<- Previous Page" Lore: - "&7Click to view previous page" Actions: - "[previous]"
Page-Indicator: Material: CLOCK Slot: 31 Name: "&e&lPage: &6#{page}" Lore: - "&7Viewing page &f{page} &7out of &f{pages}&7." Actions: []
Next-Item: Material: ARROW Slot: 32 Name: "&a&lNext Page ->" Lore: - "&7Click to view next page" Actions: - "[next]"
Temporary-Icons: No-Previous-Page: Material: BARRIER Name: "&c&lError!" Lore: - "&7You are already on the first page!" No-Next-Page: Material: BARRIER Name: "&c&lError!" Lore: - "&7You are already on the last page!"| Key | Description |
|---|---|
Title |
Menu title. Takes {crate}, {keys}, {rewards} and {player}. |
Size |
Menu size, a multiple of 9. |
Reward-Slots |
The slots rewards are placed in, in crate order. When a crate has more rewards than slots, the rest go on the next pages. Ranges like 0-26 work. |
Items |
Background and buttons, in the same format as the other menus. Rewards are drawn on top, so a background item under the reward slots is only visible where there is no reward. |
Temporary-Icons |
Icons flashed for two seconds when a page turn fails. No-Previous-Page on the first page, No-Next-Page on the last. |
Tokens
Section titled “Tokens”Every item and temporary icon in a preview file can use:
| Token | Value |
|---|---|
{crate} |
The crate’s name. |
{keys} |
The viewer’s key balance for this crate. |
{rewards} |
Number of rewards in the crate. |
{player} |
The viewer’s name. |
{page}, {pages}, {max-page}, {results} |
Current page, page count, page count, number of rewards. |
The title is set once when the menu opens, so page tokens do not work there.
Reward icons
Section titled “Reward icons”Reward icons are each reward’s Display-Item from the crate file, with {crate}, {reward},
{chance} and {rewards} filled in.
- In a
ROLLcrate, theFilter-Formatslore from config.yml is added below, and clicking a reward filters it in or out. - In a
PICKcrate, the icon is shown exactly as the crate file writes it, so put any “click to pick” hint in the reward’s own lore. Clicking spends one key and gives that reward.
Actions
Section titled “Actions”Preview items can use [previous] / [next] (also [previous-page] / [next-page]) to turn pages,
plus every action listed on the menus page.
- A crate naming a missing design does not load. Check the console if a crate disappears after you rename or delete a preview file.
- The folder is only filled when it does not exist. Deleting
default.ymlkeeps it deleted. To restore it, delete the wholepreviews/folder and restart. - A design that fails to parse is logged to console with its id and skipped.
