Emberstore logoEmberstore

Category files

Every key of a category file, from the category icon to item prices, stock, timed items, rewards and bundles.

Every .yml file in plugins/Emberstore/categories/ is one category. The file name is the category's key (used in applies-to, bundles and /store admin give), and every entry under items is something players can buy.

The VIP item from ranks.yml in three places: the menu tooltip built from display-name, icon, slot and lore, the checkout dialog showing checkout-lines and prices, and the reward commands with duration and revoke-commands after payment.

The category section

categories-version: 1

category:
  # Name shown in the main /store menu
  display-name: "<#ffd166><bold>Ranks"
  # Material shown as the category icon
  icon: DIAMOND
  # Slot in the main /store menu
  slot: 10
  # Title of this category's menu
  menu-title: "<gradient:#ff6a00:#ffb000><bold>Rank Store</bold></gradient>"
KeyRequiredWhat it does
display-nameyesName of the icon in the main menu. MiniMessage.
iconyesMaterial of the icon, for example DIAMOND.
slotyesSlot in the main menu, 0 to 44 but not 40. Must not clash with another category.
menu-titlenoTitle of this category's own menu. Defaults to display-name.

An item

items:
  vip:
    display-name: "<#ffd166><bold>VIP Rank"
    icon: IRON_INGOT
    slot: 11
    price: 4.99
    prices:
      eur: 4.59
      inr: 399
    stock: 100
    limit-per-player: 1
    max-quantity: 1
    duration: 30d
    billing: once
    lore:
      - "<#b0b7c3>Unlock VIP perks for 30 days"
      - ""
      - "<#82e0aa>◆ <white>Price: <#2ecc71><bold><price></bold> <#ef476f><st><old-price></st>"
      - "<#7fd8ea>◆ <white>In stock: <#00b4d8><bold><stock>"
      - ""
      - "<#2ecc71><bold>➜ Click to purchase"
    checkout-lines:
      - "<#b0b7c3>Includes all VIP commands and perks"
      - "<#b0b7c3>Delivered instantly after payment"
    reward:
      type: command
      commands:
        - "lp user %player% parent add vip"
      revoke-commands:
        - "lp user %player% parent remove vip"
      renew-commands: []
    delivery: instant
KeyRequiredWhat it does
display-nameyesName of the item. MiniMessage.
iconyesMaterial of the item.
slotyesSlot in the category menu, 0 to 44 but not 40.
priceyesPrice in price-currency. 0 is allowed and gives the item free.
pricesnoPrices in other currencies, used as written by gateways that bill in them. See Prices and currencies.
stocknoTotal that may ever be sold. Leave out for unlimited.
limit-per-playernoHow many one buyer may have. Leave out for unlimited.
max-quantitynoHighest quantity bought at once. Above 1 shows a quantity slider.
durationnoHow long the reward lasts, like 90m, 12h, 30d or 2w. Leave out for permanent.
billingnoonce (default) or recurring. recurring needs a duration. See Timed items.
lorenoLore lines in the menu. <price> is the current price, <old-price> the price before a sale (empty when there is none), <stock> what is left.
checkout-linesnoExtra lines shown in the checkout dialog for this item.
rewardyes, except bundlesWhat the player gets. See below.
bundlenoMakes the item a bundle of other items. See Stock, limits and gifts.
deliverynoOnly instant exists. Any other value skips the item.

Rewards

reward:
  type: command
  # Console commands to run. %player% is the player receiving the item, %buyer% is who paid, %quantity% is the amount bought
  commands:
    - "lp user %player% permission set cosmetics.trail.flame true"
  # Optional commands run when the reward is taken back (refund, dispute or the end of a timed item)
  revoke-commands:
    - "lp user %player% permission unset cosmetics.trail.flame"
  # Optional commands run each time a recurring payment renews
  renew-commands: []

Commands run from the console, once per unit bought, without a leading / (one is removed if you add it). Without revoke-commands, a refund or the end of a timed item cannot take the item back, and the console warns when the file loads.

PlaceholderInValue
%player%commandsThe player receiving the item (the gift recipient for gifts)
%buyer%commandsThe player who paid
%quantity%commandsThe quantity bought. Commands already run once per unit, see quantity

When something is wrong

Each item is checked when the file loads. A broken item is skipped and the console says which file, which item and why, for example "price is missing or negative" or "slot 13 already taken by mvp". The rest of the file still loads. A whole file is skipped only when its category section is missing or broken.

After editing, run /store admin reload and read the console.

On this page