How to Make a Category
A category is the actual shop screen, the menu where players buy and sell; a shop is just a doorway to one or more of them. Each category is one file holding an icon, an optional dynamic pricing block, the GUI layout, and a list of items. This page covers building one from scratch.
Quick start
Open the
categories/folder in your EcoShop config directory.Copy
_example.ymland rename the copy, e.g.gear.yml. The file name (without.yml) becomes the category ID.Set the
item:icon and thegui.titleplayers will see.Add at least one entry under
items:(see How to make an Item).Reference this category from a shop, by ID, under that shop's
categoriesordirect-category.Save, then run
/ecoshop reload.Open the shop in game and click through to the category; your items should appear.
Naming and IDs
The file name without .yml is the category's ID, and that is what shops reference and what placeholders use. The item: icon uses the Item Lookup System syntax. One category can sit in as many shops as you like.
The structure of a category
A category is made of four parts:
| Part | What it controls |
|---|---|
| Category info | The icon, lore, and access permission for the category |
| Dynamic pricing | Optional demand-based price changes for every item inside |
| GUI | The menu's size, title, navigation, and page layout |
| Items | The items players actually buy and sell |
Here is a complete category with every part in place:
# === Category info: icon, lore, access ===
item: diamond_sword name:"&fExample Category" # The icon shown for this category in a shop.
lore: # Lore lines on that icon.
- "&aBuy all the best gear here!"
permission: ecoshop.category.permission1 # Optional; permission required to open the category.
# === Dynamic pricing: demand-based prices ===
dynamic-pricing:
enabled: false # Off by default; see the Dynamic Pricing page for the full system.
max-increase: 1.5 # Cap prices at 150% of base.
max-decrease: 0.5 # Floor prices at 50% of base.
buy:
enabled: true
formula: "%base_price% * (1 + 0.0781 * log(1 + max(%buys% - %sells%, 0)) - 0.0781 * log(1 + max(%sells% - %buys%, 0)))"
# === GUI: the category menu ===
gui:
rows: 6 # Height of the menu (1-6).
title: "Demo Category" # The menu title.
forwards-arrow:
item: arrow name:"&fNext Page"
row: 6
column: 6
backwards-arrow:
item: arrow name:"&fPrevious Page"
row: 6
column: 4
pages:
- page: 1
mask: # Decorative background.
items:
- gray_stained_glass_pane
- black_stained_glass_pane
pattern: # 0 empty, 1 first mask item, 2 second mask item.
- "222222222"
- "211111112"
- "211111112"
- "211111112"
- "211111112"
- "222222222"
custom-slots: [ ] # Extra decorative or command slots.
# === Items: what players buy and sell ===
items: [] # Each entry is a shop item; see How to make an Item.
Category info
These fields decide how the category looks in its parent shop and who may open it.
item: diamond_sword name:"&fExample Category" # The icon shown for this category in a shop.
lore: # Lore lines on that icon.
- "&aBuy all the best gear here!"
permission: ecoshop.category.permission1 # Optional; without it the category is open to everyone.
Dynamic pricing
This optional block makes every item in the category respond to server-wide demand, with caps on how far prices can move.
dynamic-pricing:
enabled: false # Turn the whole system on or off for this category.
max-increase: 1.5 # Highest a price may reach, as a multiple of base (1.5 = 150%).
max-decrease: 0.5 # Lowest a price may reach, as a multiple of base (0.5 = 50%).
buy:
enabled: true # Apply dynamic pricing to the buy price.
formula: "%base_price% * (1 + 0.0781 * log(1 + max(%buys% - %sells%, 0)) - 0.0781 * log(1 + max(%sells% - %buys%, 0)))"
Dynamic pricing is a system of its own, including decay, per-price-type formulas, and per-item overrides. See Dynamic Pricing for the full reference.
GUI
The GUI block lays out the category menu itself. See GUI Options for the mask, pattern, and page fields.
gui:
rows: 6 # Height of the menu (1-6).
title: "Demo Category" # The menu title.
forwards-arrow: # Hidden on the last page.
item: arrow name:"&fNext Page"
row: 6
column: 6
backwards-arrow: # Hidden on the first page.
item: arrow name:"&fPrevious Page"
row: 6
column: 4
pages:
- page: 1
custom-slots: [ ] # Add as many pages as you want by appending to this list.
Items
The items list is the point of the category. Each entry is a shop item with its own buy and sell options and GUI position.
items:
- id: cooked_mutton # See How to make an Item for the full item format.
item: cooked_mutton
buy:
type: coins
value: 20
display: "$%value%"
gui:
row: 1
column: 4
page: 1
Building items is a topic on its own; see How to make an Item.
Where to go next
Stock the shelves: How to make an Item is the next step.
React to demand: Dynamic Pricing explains the pricing block above in full.
Rotate the stock: Rotating Shops covers the optional
rmask cells and rotation config.Wire it up: How to make a Shop shows how shops point at this category.