shops
The shard shop in shops/ - permission, menu layout, flash icons, item format and items.
Each shop is one file, shops/<id>.yml, and the file name is the shop id. The default is
shards.yml. /shardshop and /afkzone shop open the shop named by Shop.Default-Shop in
config.yml. After editing, run /afkzoneadmin reload.
Every item in a shop is always for sale. When there are more items than Item-Slots, they spread
over several pages.
A walkthrough is in Setting Up the Shard Shop.
Settings: Permission: ""
Menu: Title: "Shard Shop" Size: 36 Item-Slots: [11, 12, 13, 14, 15, 20, 21, 22, 23, 24] Items: Filler-Item: Material: BLACK_STAINED_GLASS_PANE Slots: [0-10, 16-19, 25-35] Name: "&r" Balance-Item: Material: AMETHYST_SHARD Slot: 4 Name: "&d&lYour Shards" Lore: - "&7Earn shards by staying AFK" - "&7inside an AFK zone." - "" - "&5 - &7Balance: {shards} {currency}" - "" - "&7Ranks and shard boosters" - "&7multiply what you earn." Temporary-Icons: Insufficient-Funds: Material: BARRIER Name: "&c&lError!" Lore: - "&7You don't have enough shards for this!" No-Permission: Material: BARRIER Name: "&c&lError!" Lore: - "&7You don't have permission to buy this!"
Item-Format: Name: "&d&l{name}" Lore: - "&8Shard Shop" - "" - "&dInformation:" - "&5 - &7Price: {price} {currency}" - " " - "&e➥ Click to purchase!"
Items: diamond_block: Material: DIAMOND_BLOCK Price: 400 netherite_scrap: Material: NETHERITE_SCRAP Amount: 2 Price: 650 booster_2x: Material: AMETHYST_SHARD Name: "&d&l2x Shard Booster" Glow: true Lore: - "&7Doubles the shards you earn" - "&7in AFK zones for 1 hour." Price: 800 Actions: - "afkzoneadmin booster give {player} shard2x 1" fly_1h: Material: FEATHER Name: "&d&l1 Hour of Flight" Glow: true Lore: - "&7Fly anywhere on the server" - "&7for one hour." Price: 1000 Actions: - "[message] &5[&d&lAFK&5] &7Flight enabled for 1 hour." - "lp user {player} permission settemp essentials.fly true 1h"The shipped file has ten items: diamond_block, netherite_scrap, enchanted_golden_apple,
elytra, totem, shulker_box, xp_bottles, golden_carrots, booster_2x and fly_1h. The
fly_1h item uses LuckPerms and EssentialsX commands; change it if you run other plugins.
Settings
Section titled “Settings”Required.
| Key | Default | Description |
|---|---|---|
Permission |
"" |
Node required to open this shop. Empty means anyone with optimalafkzone.shop. Without it, opening the shop replies NO-PERMISSION. |
Required. The shop’s menu layout.
| Key | Default | Description |
|---|---|---|
Title |
&5&lShard Shop |
Menu title. |
Size |
54 |
Inventory size, a multiple of 9 between 9 and 54. |
Item-Slots |
- | Required. The slots shop items are placed in, in order. Numbers or a-b ranges, all inside Size. |
Items |
- | Decoration and buttons, see below. |
Temporary-Icons |
- | Flash icons, see below. |
Each entry under Menu.Items is an item definition plus Slot: (one number) or Slots: (a list of
numbers and a-b ranges). The entry names are free-form. When entries share a slot, the one with
fewer slots wins, so a full-size filler never covers a button.
Every entry renders with these tokens:
| Token | Value |
|---|---|
{shards} / {currency} |
The viewer’s balance and the currency name. |
{player} |
The viewer’s name. |
{page}, {pages}, {results} |
Current page, page count, number of items in the shop. |
An entry may have an Actions list, run on click. Besides the
shared actions ([message], [console], [player],
[sound], [close], …), the shop understands [next] and [previous] to turn pages when there
are more items than Item-Slots. Untagged lines do nothing in a menu.
Temporary-Icons
Section titled “Temporary-Icons”Icons flashed for two seconds in the clicked slot when a click is refused. While a slot is flashing it ignores clicks.
| Key | Flashed when |
|---|---|
Insufficient-Funds |
The player cannot afford the item. |
No-Permission |
The player lacks the item’s Permission. |
No-Next-Page / No-Previous-Page |
A page button is clicked with no page in that direction. |
Each is optional and takes the item tokens below. Without an icon nothing flashes, but the FAILURE
sound still plays.
Item-Format
Section titled “Item-Format”Optional. The template every item is shown with in the menu.
| Key | Default | Description |
|---|---|---|
Name |
{name} |
Used as the menu name of items that have no Name of their own. |
Lore |
[] |
Appended below each item’s own lore. |
Item tokens (also available in the item’s own Name and Lore):
| Token | Value |
|---|---|
{name} / {item} |
The item’s Name, or its material name (Diamond Block). |
{amount} |
The item’s Amount. |
{price} |
The price, formatted with the currency’s color and symbol. |
{currency} |
The currency name. |
{shards} |
The viewer’s balance. |
{player} |
The viewer’s name. |
Item-Format only changes how the item looks in the menu. A bought item is handed over with its own
Name and Lore.
Optional, but a shop without items is empty. Each key is the item id; each entry is an item definition plus the shop fields.
| Key | Default | Description |
|---|---|---|
Price |
0 |
Cost in shards. Cannot be negative. |
Permission |
"" |
Node required to buy the item. |
Amount |
1 |
Stack size, shown in the menu and given on purchase. |
Actions |
- | If present, these actions run instead of giving the item. They get {item} (the name) and {price} (raw number). Untagged lines run from console. |
A purchase is checked again when it goes through: the player must still have the item’s Permission
and enough shards. Items that do not fit in the inventory are dropped at the player’s feet with
INVENTORY-FULL.
Item fields
Section titled “Item fields”Shop items, menu entries, flash icons, the wand, zone icons and booster items all use the same item definition:
| Field | Description |
|---|---|
Material |
Any material name. Resolved through XSeries, so legacy and modern names both work. |
Name |
Display name. |
Lore |
Lore lines. |
Amount |
Stack size (default 1). |
Glow |
true adds an enchant glint. |
Base64 |
Head texture value, for PLAYER_HEAD. |
Custom-Model-Data |
Custom model data for resource packs. |
Item-Model |
Item model key for resource packs. |
Item-Flags |
Bukkit item flags such as HIDE_ATTRIBUTES. |
Enchantments |
Enchantments to apply. |
Unbreakable, Hide-Tooltip, Damage |
Further item options. |
Upgrading from the rotating shop
Section titled “Upgrading from the rotating shop”Shops used to rotate a weighted selection of items on a timer, with per-player purchase limits. That was removed. On the first load, each shop file loses:
Settings.RotationMenu.Items.Rotation-ItemMenu.Temporary-Icons.Limit-Reached- every item’s
WeightandLimit - the
Item-Format.Lorelines that use{stock}or{limit}
The file is rewritten and the change is logged in the console. Everything else in the file is kept.
