Shop & presets
The classic shop opens with /shop. Everything about it lives in a preset folder, so you can change any slot, item, price, title or sound.
Preset files
| File | What it controls |
|---|---|
presets/donut/menu.yml | Main menu title and rows, category buttons, shared category layout, price lines, sounds. |
presets/donut/buy-menu.yml | The amount picker: buttons (+1, +10, max, set to 1, ...), max amount, what happens after buying. |
presets/donut/categories/*.yml | One file per category. The file name is the category id. |
presets/donut/regear.yml | Optional regear loadouts. See Regear. |
Item settings
| Key | Meaning |
|---|---|
slot / page | Where the item sits. Slots start at 0 (top-left). |
material | A Minecraft material, or nexo:id, oraxen:id, itemsadder:namespace:id. |
amount | Items given per purchase (one "unit"). |
price / currency | Price per unit and money or shards. Shard prices are whole numbers. |
name / lore | Display text. Supports &a codes and &#RRGGBB hex colors. |
enchantments / potion | For enchanted gear, enchanted books and potions/tipped arrows. |
spawner | Mob type for SPAWNER items. The placed spawner gets that mob, no spawner plugin needed. |
commands | Console commands run on purchase. %player%, %uuid% and %quantity% are replaced. |
give-item | Set to false for command-only items (ranks, crates). |
keep-name-lore | Give the item with the shop name and lore instead of a plain item. |
max-quantity | Upper limit in the amount picker for this item. |
permission | Only players with this permission can buy the item. |
free | Set to true to allow a price of 0. |
items:
totem:
slot: 13
material: TOTEM_OF_UNDYING
price: 1500
currency: money
zombie-spawner:
slot: 11
material: SPAWNER
spawner: zombie
price: 350
currency: shards
vip-rank:
slot: 15
material: NAME_TAG
name: "&6VIP Rank"
give-item: false
commands:
- "lp user %player% parent add vip"
price: 50000
currency: moneyWhat the player gets: item, command or both
Every shop item decides what happens after the player pays. This works in every category, including spawners and the rotating item shop.
| You want to… | Set this | Result |
|---|---|---|
| Give the item shown in the menu | give-item: true (default), no commands | The player receives the item. |
| Only run a command (another plugin gives the reward) | give-item: false and commands | The menu item is only a picture. The command runs instead. |
| Give the item and also run a command | give-item: true and commands | The player receives the item, then the command runs. |
Commands run from the console right after the purchase is paid. Write them without the leading slash (a slash also works). These placeholders are filled in for you:
| Placeholder | Becomes |
|---|---|
%player% | The buyer's name |
%uuid% | The buyer's UUID |
%quantity% or %amount% | How many they bought (from the amount picker) |
Example: spawners from another spawner plugin
The menu shows a spawner, but your spawner plugin gives it. Replace the command with the give command from your spawner plugin's own documentation.
zombie-spawner:
slot: 11
material: SPAWNER
name: "&dZombie Spawner"
give-item: false
commands:
- "spawner give %player% zombie %quantity%"
price: 350
currency: shardsExample: give an item and run a command
The player receives the totem, and a console command announces the purchase.
totem:
slot: 13
material: TOTEM_OF_UNDYING
give-item: true
commands:
- "say %player% bought a Totem of Undying!"
price: 1500
currency: money%quantity% in it when players can buy more than one at a time. If the player leaves before the reward is delivered, they get their money or shards back. An item with give-item: false and no commands gives nothing, so Storefront skips it and warns in the console. Run /storefront reload after editing.Categories
Add a file to categories/ and a button for it under categories: in menu.yml. A button can set permission to lock the category. Players can also open a category directly with /shop <category>.
Your own preset
- Copy
presets/donuttopresets/myshop. - Edit the files in the new folder.
- Set
preset: myshopinconfig.yml. - Run
/storefront reload.
enabled: false under money: (inside currencies:) if you only use shards.Purchase safety
- One purchase at a time per player, so lag and double clicks can't buy twice.
- Inventory space is checked before the player is charged.
- If the player leaves between payment and delivery, the payment is refunded.
- Menus ignore shift-click, number keys, dragging and double-click collecting.