Placeholders
AstralRanks registers one root placeholder namespace and three model namespaces that surface throughout its menus and messages. For the placeholder syntax itself (%a_b_c%, %a_{b_c}%, $e(...)) see Placeholders.
Namespace | Backing class | Globally registered? |
|---|---|---|
|
| Yes — |
|
| No — only reachable once a rank instance is placed into scope. See How rank/category/requirement enter menu scope. |
|
| No — same as |
|
| No — same as |
ranks_* (root)
Placeholder | Type | Description |
|---|---|---|
|
| Every category from |
|
| The player's next rank — |
|
| Up to 5 formatted lines, one per incomplete requirement in the player's enabled quest-display category, rendered through the |
| String — player-only | The category id (or |
| Boolean — player-only |
|
| Boolean — player-only |
|
Quest-display lines
%ranks_questsDisplay% walks configuration.requirements() for the player's next rank, skips any requirement outside the enabled category (unless it's "all"), skips any already at or above its amount, and renders each remaining one through the quest-display-format message. Each line gets its own small PlaceholderContainer with three bare, unprefixed keys — not the usual requirement_* namespace:
Placeholder (inside the format string only) | Value |
|---|---|
|
|
| The player's stored progress on that requirement. |
|
|
The resulting list is capped at 5 entries (.limit(5)) regardless of how many requirements remain incomplete.
rank_*
A RankConfiguration — see Ranks & Progression for the underlying YAML shape.
Placeholder | Type | Description |
|---|---|---|
| String | The rank's |
|
| The |
| Component |
|
| String |
|
| String | The rank's |
| ItemProvider |
|
| Boolean — requires player context |
|
| Boolean — requires player context |
|
category_*
A RequirementCategory — id, display item, and per-rank rewards from categories.yml.
Placeholder | Type | Description |
|---|---|---|
| String | The category id. |
|
| The category's display item. |
|
| Raw rewards map keyed by rank id — a leaf-level Java object, not further placeholder-chainable. |
| ItemProvider — requires | Every requirement on the in-scope rank whose |
requirement_*
A WrappedRankRequirement — one mission entry inside a rank's requirements map.
Placeholder | Type | Description |
|---|---|---|
| String | The requirement's map key. |
|
|
|
|
| The wrapped requirement itself — see Requirements & Missions for the |
| String | The |
| int — requires player + | The player's stored progress, via |
| int |
|
How rank/category/requirement enter menu scope
rank, category, and requirement are never registered globally — a value only becomes resolvable once something places an instance into the active PlaceholderContainer. AstralRanks does this three ways:
1. Layout taint — %parameter_<namespace>_...% (singular). A layouts: entry supplies a collection of placeholders and a taint; item variants with a matching taints: entry render once per element. While an item is rendering, core's ParameterPlaceholder (namespace parameter) exposes that one element under its own namespace() key:
The same pattern drives %parameter_category_...% (menus/categories.yml's categories layout, tainted category, provider %ranks_categories%) and %parameter_requirement_...% (menus/requirements.yml's categories layout, tainted requirement, provider %parameters_rank_requirements%).
2. Menu open-parameters — %parameters_<key>% (plural). MenuService passes Java objects into MenuContainer#computeAndOpen by key: openMainMenu passes ranks; openRankMenu passes rank and categories; openRequirementsMenu passes rank and category. Inside the opened menu, core's ParametersPlaceholder (namespace parameters) resolves those by key and chains into whichever namespace the value implements — %parameters_rank_id%, %parameters_category_id%, %parameters_rank_unlockable%. The same mechanism forwards a value from a %parameter_...% tainted element into an [open-menu] action's :key=value args, carrying a rank or category selected in one menu into the rank/category open-parameters of the next:
This parameters_rank open-parameter is also exactly what %category_requirements% and %requirement_current% look up directly in Java (context.function().apply("parameters_rank")) rather than through a nested config placeholder — both throw if the container they're evaluated in has no rank parameter in scope.
3. Direct registration — message placeholders. Outside menus, RankService#unlock and MainCommand#onBroadcast build a one-off PlaceholderContainer and call .registerPlaceholder(configuration), which registers the RankConfiguration under its own namespace (rank) directly — no parameter/parameters wrapper involved. That container backs the unlock-success and unlock-broadcast messages, so those templates use the bare form:
ItemStackPlaceholder sub-keys
%rank_item%, %category_item%, and %requirement_item% all resolve to an ItemStackPlaceholder wrapping the displayed ItemStack. Used bare (e.g. copy-from: "%parameter_requirement_item%") it yields the raw ItemStack; chained further, it exposes:
Sub-key | Returns |
|---|---|
| The item's |
| Display name — |
|
|
| The item's lore lines, or an empty list. |
| Stack size. |
| Custom model data value, or |
| Remaining durability ( |
| Current damage, or |
| The item's enchantment map. |
| Whether the item is flagged unbreakable. |
Seen throughout the shipped menus as %parameter_rank_item_name%/%parameter_rank_item_lore% (item name and lore, menus/ranks.yml), %parameter_category_item_name% (menus/categories.yml), and %parameter_requirement_item_lore% (menus/requirements.yml) — plus the bare %rank_item_name% form used inside messages.yml.
Where these are consumed
File | Usage |
|---|---|
|
|
|
|
|
|
|
|
Where to go next
Ranks & Progression — the
rankYAML shape and the unlock flow that registers%rank_*%for messages.Requirements & Missions —
category/requirementYAML shape and reward payout.Messages — the full message-key catalogue, including
unlock-success,unlock-broadcast, andquest-display-format.Developer API —
unlock-rank,update-rank-requirement, andset-displayed-ranks-quests, the action that drivescategoryQuestsDisplay.