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

FileWhat it controls
presets/donut/menu.ymlMain menu title and rows, category buttons, shared category layout, price lines, sounds.
presets/donut/buy-menu.ymlThe amount picker: buttons (+1, +10, max, set to 1, ...), max amount, what happens after buying.
presets/donut/categories/*.ymlOne file per category. The file name is the category id.
presets/donut/regear.ymlOptional regear loadouts. See Regear.

Item settings

KeyMeaning
slot / pageWhere the item sits. Slots start at 0 (top-left).
materialA Minecraft material, or nexo:id, oraxen:id, itemsadder:namespace:id.
amountItems given per purchase (one "unit").
price / currencyPrice per unit and money or shards. Shard prices are whole numbers.
name / loreDisplay text. Supports &a codes and &#RRGGBB hex colors.
enchantments / potionFor enchanted gear, enchanted books and potions/tipped arrows.
spawnerMob type for SPAWNER items. The placed spawner gets that mob, no spawner plugin needed.
commandsConsole commands run on purchase. %player%, %uuid% and %quantity% are replaced.
give-itemSet to false for command-only items (ranks, crates).
keep-name-loreGive the item with the shop name and lore instead of a plain item.
max-quantityUpper limit in the amount picker for this item.
permissionOnly players with this permission can buy the item.
freeSet to true to allow a price of 0.
yaml
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: money

What 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 thisResult
Give the item shown in the menugive-item: true (default), no commandsThe player receives the item.
Only run a command (another plugin gives the reward)give-item: false and commandsThe menu item is only a picture. The command runs instead.
Give the item and also run a commandgive-item: true and commandsThe 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:

PlaceholderBecomes
%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.

yaml
  zombie-spawner:
    slot: 11
    material: SPAWNER
    name: "&dZombie Spawner"
    give-item: false
    commands:
      - "spawner give %player% zombie %quantity%"
    price: 350
    currency: shards

Example: give an item and run a command

The player receives the totem, and a console command announces the purchase.

yaml
  totem:
    slot: 13
    material: TOTEM_OF_UNDYING
    give-item: true
    commands:
      - "say %player% bought a Totem of Undying!"
    price: 1500
    currency: money
Good to know
The command runs once per purchase, so put %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

  1. Copy presets/donut to presets/myshop.
  2. Edit the files in the new folder.
  3. Set preset: myshop in config.yml.
  4. Run /storefront reload.
Money without an economy plugin
Money items stay visible. If Vault or an economy plugin is missing, buying them is refused with a message and the console warns at startup. Disable money with 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.