Skip to content

Categories

joogiebear edited this page Jul 14, 2026 · 1 revision

Categories

The categories down column 1 of the browser are defined by files in plugins/RoyalAuctions/categories/. The file name is the category idcategories/weapons.yml defines weapons. Add a category by dropping in a file; remove one by deleting its file. Column order comes from each file's priority (lowest first).

A category file

# categories/weapons.yml
display-name: "&cWeapons"
icon: DIAMOND_SWORD
priority: 10

match:
  items: []                                 # exact pins — see below
  #  - "ecoitems:brazen_sword"
  material-suffixes: ["_SWORD", "_AXE"]
  materials: ["BOW", "CROSSBOW", "TRIDENT", "MACE"]
  tags: ["WEAPON"]                          # EDIBLE BLOCK ARMOR TOOL WEAPON

The default set is weapons, armor, accessories, consumables, blocks, and tools_misc (the catch-all).

Match rules

Rule Matches
items Exact item pins — eco ids (ecoitems:brazen_sword) and vanilla (minecraft:trident).
eco-namespaces A whole eco plugin → this category ([talismans], [ecoarmor], …).
materials Exact Bukkit material names.
material-suffixes Material name ends with any of these (_SWORD).
material-prefixes Material name starts with any of these.
tags Built-in flags: EDIBLE, BLOCK, ARMOR, TOOL, WEAPON.
any true = catch-all (matches everything).

How an item's category is decided

Resolution order for every item:

  1. match.items — an exact pin. Beats every other rule, in any category, at any priority. This is the escape hatch.
  2. match.eco-namespaces — a whole eco plugin maps to one category.
  3. materials / suffixes / prefixes / tags — inferred from the item's base material.
  4. match.any: true — the catch-all.

The important caveat: rules 2–3 infer from the base material, which is only ever a guess for a custom item. A custom sword built on a STICK would otherwise land in Tools & Misc — so you pin it with match.items.

Exactly one category must be the catch-all (any: true, highest priority number) or items matching nothing would have nowhere to go. That's tools_misc.yml by default.

Two tools so it's never a black box

/ah category

Hold an item and run /ah category. It prints the item key, where it lands, which rule decided it, and its tier. This is how you check whether the plugin is guessing.

The startup audit

On startup, every eco item that only hit the catch-all is logged:

[RoyalAuctions] Category audit: 24 of 141 eco item(s) fell through to 'tools_misc'.
                Pin them under a category's match.items: if they belong elsewhere:
                  - ecoitems:enchanted_diamond
                  - stattrackers:arrows_shot
                  ...

This tells you exactly which items are worth pinning — instead of leaving you to enumerate every material in the game. When everything resolves it prints Category audit: all N eco items resolved to a category.

Zero-inference mode

category-options:
  strict-items: true    # ONLY items pinned via match.items: get a category.
                        # Everything else goes to the catch-all. No guessing at all.

false (default) uses pins first, then the inference rules — works out of the box. true is for servers that want total control and no surprises.

Renaming a category

A listing's category is stamped when it's created, so renaming a category id would strand every existing listing under an id no button matches. RoyalAuctions re-derives and persists those on load instead:

[RoyalAuctions] Re-categorised 3 listing(s) whose category no longer exists.

Migrating from an inline block

Upgrading from an old version with a categories: block inside config.yml? It's split into categories/*.yml automatically on first start, and the plugin tells you the old block can be deleted.

Clone this wiki locally