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 |
| Iterable of every loaded | Wrapped in an |
items_rarities, items_blueprints, and items_skins are the only keys the root items placeholder answers.
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 blueprint's |
| The blueprint's |
| Iterable of the blueprint's stat templates, wrapped in an |
Blueprint metadata
ItemMetadata is itself a ComplexPlaceholder (namespace metadata), reached through %blueprint_metadata_*% — the authoring surface for lore lines that used to be hard-coded status messages. Sub-key casing is inconsistent by design; use it exactly as listed.
Placeholder | Returns |
|---|---|
| The |
| The |
| The |
| The |
| Iterable of the whitelisted enchantments, wrapped in an |
Each element of available-enchantments resolves under the enchantment namespace, with the cap exposed as %enchantment_level% on top of Bukkit's own enchantment fields (%enchantment_key%, %enchantment_name%, %enchantment_max-level%, %enchantment_anvil-cost%, …):
Skin
A skin is a ComplexPlaceholder (namespace skin). Reach one through %items_skins% iteration or through the %instance_data_skin_blueprint_*% chain.
Placeholder | Returns |
|---|---|
| The skin id. |
| The |
| The optional |
| The skin's display |
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. |
| Direct lookup of one rolled stat's value ( |
| The lore page the item is on, 1-based. |
| Total lore-page count ( |
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. Resolves to nothing when no material is stored — render a fallback yourself. |
| Inline sprite component for the stored material. |
| Id of the applied skin, if any. |
| The applied skin's model |
|
|
| Chains into the |
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 |
|---|---|---|
|
| |
|
|
|
AgeableBlockContext is not attached by an event context adapter: the PipelineContext constructor adds it whenever the context captured a block whose BlockData is Ageable (crops, nether wart, cocoa, beetroots, sweet-berry bushes, …) and no such context is present yet. Any head that captures a block — block-break, harvest-block, shear-block, interact — therefore gets it for free.
Example — read the cursor material into a set-stored-material link:
Lore-template placeholders
ItemService.applyLore exposes one extra placeholder that is only meaningful inside a blueprint's display.lore template (and inside its lore pages, which resolve through the same path):
Placeholder | Returns |
|---|---|
| A list of |
Use it inline: