Rarity YAML Reference
A rarity defines an id and a display item. The id becomes the namespace of every blueprint that references the rarity — Key.key(rarity.id(), blueprint.id) is what ends up in the ItemStack PDC.
Rarities live in plugins/AstralItems/rarities/ (sub-folders are scanned recursively). The file name is irrelevant; the id field inside the file is the identifier.
Minimal example
Top-level fields
Field | Type | Required | Description |
|---|---|---|---|
| String | Yes | Unique rarity identifier. Becomes the namespace of every blueprint that references it. Duplicates are skipped with a warning. |
|
| Yes | Item shown in UIs that surface the rarity. Standard AstralCore item wrapper — see Menu Items for the full schema. |
Referencing a rarity from a blueprint
A blueprint references a rarity by its id:
When the blueprint is deserialised the loader resolves the rarity through RarityService.findByNamespace() (the method name is a hold-over — it actually looks up by id). Blueprint loading fails if the rarity is missing — the file is logged and skipped.
Built-in placeholders
A rarity is itself a placeholder source (ComplexPlaceholder namespace rarity). Access its fields with:
Placeholder | Resolves to |
|---|---|
| The rarity id (when invoked from a context where |
| The display |
| Iterable of every blueprint registered under this rarity — used by menus to paginate items per rarity. |
Validation
The rarity loader rejects entries that fail any of these checks:
The
idfield is missing or empty.The
displayfield cannot be parsed as anItemStackWrapper.Two rarities share the same id — the duplicate is logged as a warning and skipped.
Errors are logged to the server console. A bad rarity does not prevent the rest from loading.
Hot reload
/items reload re-reads every rarity file from disk and rebuilds the index, then reloads blueprints. Items already in player inventories keep the rarity reference they were created with — only blueprints freshly deserialised pick up new rarity definitions.