Placeholders
AstralClasses registers three placeholder namespaces with AstralCore: classes (player context), class (AstralClass instance), and skill-entry (ability metadata). All three participate in the standard AstralCore placeholder system — %outer_{inner}%, $e(...), and chaining into other namespaces via variables.
classes_* (player context)
These placeholders require a Player in the placeholder context and access the player's current class state via ClassPlayerData. ClassExpansion checks for a Player in context before dispatching, so every classes_* placeholder resolves to null if there is no player in context. If a player is present but their ClassPlayerData hasn't synced yet, the placeholder throws an IllegalStateException.
Placeholder | Returns | Notes |
|---|---|---|
| Boolean | Player's auto-attack toggle setting. |
| String | The |
| String | Remaining cooldown for ability |
| String | Maximum (configured) cooldown for ability |
| String | ID of the player's currently selected class. |
| AstralClass | The player's selected class as an object — chain into |
| Component | Display name of the player's selected class. |
| String | ID of the player's currently selected subclass (defaults to |
| String | Player's level within the selected class. |
| String | Player's unlock level for ability |
| AstralClass | Lookup any class by ID — e.g. |
Context requirement
All classes_* placeholders require a Player in the resolution context. When used in:
Menus (via
AstralPaperAPI.createPlaceholderContainer(player)): Player is provided automatically.Chat, scoreboards (via PlaceholderAPI fallback): Player is implicit from the formatter's context.
Bare containers (
new PlaceholderContainer()without player setup): Resolves tonull.
Cooldown semantics
Cooldowns are not the raw configured duration — they reflect the ATTACK_SPEED-scaled effective cooldown:
A higher ATTACK_SPEED stat shortens the reported remaining cooldown. See Abilities & Input for input binding semantics.
class_* (AstralClass)
An AstralClass is itself a ComplexPlaceholder. It is typically reached via %classes_class_raw% or %classes_<classId>%, and may be bound to a variable for convenient chaining (see Example below).
Static metadata (no player required)
Placeholder | Returns | Notes |
|---|---|---|
| String | Class identifier. |
| Component | Display name (MiniMessage). |
| ItemStack | The equippable weapon carried by players of this class. |
| ItemStack | Cosmetic weapon shown in the class selection menu. |
| PlaceholderWrapper<Integer> | XP required per level (may be a placeholder expression). |
Subclasses (no player required)
Placeholder | Returns | Notes |
|---|---|---|
| String | Comma-separated list of subclass IDs. |
| int | Total subclass count. |
| Boolean | Whether the class has a subclass with ID |
| Boolean | Whether the player has unlocked this class. Requires a player in context — unlike the other static-metadata keys, |
Abilities
Placeholder | Returns | Notes |
|---|---|---|
| String | Comma-separated list of ability IDs in the currently-selected subclass. Without a player, falls back to the |
| String | Comma-separated list of ability IDs in subclass |
| int | Count of abilities in subclass |
| String | The underlying skill-id for ability |
| SkillEntry | The ability's metadata object — chain into |
Ability properties
Chain %class_ability_<abilityId>_<property>% to access individual ability settings:
Property | Returns | Notes |
|---|---|---|
| String | Ability identifier. |
| Component | Ability display name. |
| String | Underlying skill-id. |
| Long | Cooldown in milliseconds (resolved with player context if player present). |
| String | Default input binding (e.g. |
| Boolean | Whether the player can rebind this ability. |
| Integer | Class level at which the boosted version unlocks. |
| String | Comma-separated class levels at which this ability unlocks. |
Player-specific progress (require player)
Placeholder | Returns | Notes |
|---|---|---|
| int | Player's level within this class, or |
| int | Total experience accumulated in this class. |
| String | Player's selected subclass ID (falls back to |
| int | Player's unlock level for ability |
| Boolean | Whether ability |
skill-entry_* (ability metadata)
A SkillEntry represents a single ability within a subclass. It is reached via %class_skill-entry_<abilityId>% or directly from class configuration.
Placeholder | Returns | Notes |
|---|---|---|
| String | Ability identifier. |
| Component | Ability display name (MiniMessage). |
| Component | Ability description/flavor text. |
| String | Underlying skill-id — e.g. |
| Long | Cooldown in milliseconds (resolved against current placeholder context). |
| Component | Cosmetic damage range shown in menus — display-only; actual damage comes from the skill. |
| String | Default input binding (e.g. |
| Boolean | Whether the player cannot rebind this ability. |
| Integer | Class level at which the boosted version unlocks. |
| String | Comma-separated class levels at which this ability unlocks. |
Example usage
The class selection menu (menus/main.yml) demonstrates real-world chaining:
Breakdown:
%classes_class_raw%→ theAstralClassobject, bound to variableselected.%variables_selected_weapon-display%→ chains intoclass_weapon-display, fetching the cosmetic weapon.%variables_selected_name%→ chains intoclass_name, fetching the display name.%variables_selected_skill-id_attack-1%→ chains intoclass_skill-id_attack-1, returning the skill-id (e.g."knight-attack-1").%variables_selected_skill-entry_attack-1_name%→ chains intoclass_skill-entry_attack-1, thenskill-entry_name, fetching the ability's display name.%variables_selected_skill-entry_attack-1_cooldown%→ fetches the ability's cooldown in milliseconds, divided by 1000 inline with$e(...).%variables_selected_unlocked%→ chains intoclass_unlocked, checking if the player has unlocked this class.%variables_selected_id%→ chains intoclass_id, fetching the class id for the equip command.
See also
Classes — class configuration schema and fields these placeholders read.
Abilities & Input — input binding and ability selection.
AstralSkill — skill definitions and execution.