Placeholders
AstralItems registers a root items placeholder for global lookups and exposes per-context placeholders through PipelineContext, ItemInstance, and the item data adapters. Every placeholder participates in the standard AstralCore placeholder system — %name%, %outer_{inner}%, $e(...).
Global
These resolve through RootPlaceholderContainer — usable anywhere AstralCore evaluates a placeholder (menus, dialogs, action arguments, lore templates).
Placeholder | Returns | Notes |
|---|---|---|
| Iterable of every loaded | Wrapped in an |
| Iterable of every loaded | Wrapped in an |
Example — populate a menu layout with every rarity:
Rarity
A rarity is itself a ComplexPlaceholder (namespace rarity). It is most often reached through a menu parameter or via the iterable above.
Placeholder | Returns |
|---|---|
| The rarity id. |
| The display |
| Iterable of every blueprint registered under this rarity. |
Blueprint
A blueprint is a ComplexPlaceholder (namespace blueprint).
Placeholder | Returns |
|---|---|
| The blueprint's composite |
| The blueprint's display |
| The blueprint's version as |
| The |
| The blueprint's |
| Iterable of the blueprint's stat templates, wrapped in an |
Item instance
Inside a pipeline run, instance_* resolves the ItemInstance of the triggering custom item.
Placeholder | Returns |
|---|---|
| The per-item |
| The blueprint (chain into |
| The version captured when the item was created. |
| The typed item-data bag (chain into per-key namespaces). |
| Iterable of the item's rolled stats. |
| The rolled stat for |
The data bag is reached as %instance_data_<key>_<subkey>% — the <key> is whichever string the data class returns from ComplexPlaceholder.namespace(). Built-in keys:
Chain | Resolves to |
|---|---|
| Current level on a |
| Accumulated XP on a |
| Stored |
| Translatable display name of the stored material — or the |
| Inline sprite component for the stored material. |
Pipeline context
PipelineContext itself is a Function<String, Object> — any placeholder accepted by the underlying container resolves against it. The container is pre-populated with:
player_*(AstralCore + PAPI fallback) for the triggering player.item_*forcontext.itemStack()viaItemStackPlaceholder.instance_*forcontext.instance().location_*forcontext.location()if any was captured.extra-context_*for adapter-supplied extras.
That means component config can reference any of these in placeholder fields:
Extra context
Every entry added to PipelineContext.extraContext() that implements ComplexPlaceholder is reachable through the extra-context_<namespace>_… chain. This is how heads expose event-specific data without polluting the main context.
Extra | Namespace | Placeholders |
|---|---|---|
|
|
Example — read the cursor material into a set-stored-material link:
Lore-template placeholders
ItemService.updateLore exposes three extra placeholders that are only meaningful inside a blueprint's display.lore template:
Placeholder | Returns |
|---|---|
| A list of |
| A single-line list containing the |
| The |
Use them inline: