Add a category
How to add a new market category — requires changing the MarketCategory enum and rebuilding the JAR.
Based on GrzybcioRynek 1.0.3 and web 0.1.0 source.
This is a developer task. Adding an entry in gui.yml alone does not create a category. An admin who only wants to change the name / icon of an existing category edits messages.gui.category.* and browse.categories — without a new enum constant.
The source of truth is the Java enum. YAML and messages must use the same key (configKey() = lowercase enum name).
Farming already exists
Do not add a “Farming” category from scratch — that is FARMING:
public enum MarketCategory {
ALL,
TOOLS,
WEAPONS,
ARMOR,
BLOCKS,
FOOD,
FARMING,
REDSTONE,
DECORATIONS,
POTIONS,
ENCHANTED_BOOKS,
OTHER;
}configKey() → farming. messageKey() → gui.category.farming.
In gui.yml:
browse:
categories:
farming:
slot: 16
material: WHEATIn config.yml:
messages:
gui:
category:
farming: "&cFarming"New category — three places + rebuild
1. Enum MarketCategory.java
Add a constant, a rule in matches(), and an exclusion in the OTHER branch.
public enum MarketCategory {
ALL,
TOOLS,
// ...
OTHER,
MUSIC; // example — requires matches() logic
}Without matches(), the filter shows nothing (default: return false).
2. gui.yml → browse.categories
browse:
categories:
music:
slot: 24
material: JUKEBOXAvoid slot collisions with the defaults (10–16, 19–23).
3. config.yml → messages.gui.category.*
messages:
gui:
category:
music: "&cMusic"Existing keys
all, tools, weapons, armor, blocks, food, farming, redstone, decorations, potions, enchanted_books, other.
A YAML key like rolnictwo: will not work. The enum has no ROLNICTWO.
After changing Java
Build a new JAR (Build), deploy to Paper 26.2, and restart the server — /market reload does not swap enum classes.