Placeholders
AstralPets registers one root placeholder namespace with AstralCore (pets) and a set of chained ComplexPlaceholder types that only resolve once something registers an instance into the current placeholder container: pet, blueprint, rarity, food, skin, preset and effect. For the placeholder syntax itself (%a_b_c%, %a_{b_c}%, $e(...)) see Placeholders.
pets_* (root)
Resolved by PetsPlaceholder, registered globally on RootPlaceholderContainer — usable anywhere AstralCore evaluates a placeholder.
Placeholder | Type | Description |
|---|---|---|
| Optional<Pet> | The viewer's currently-selected pet, from |
| ItemProvider<Pet> | The viewer's active pets ( |
| ItemProvider<Pet> | Every pet the viewer owns ( |
| ItemProvider<PetPreset> | The viewer's presets ( |
| ItemProvider<PetBlueprint> | Every loaded pet blueprint ( |
| ItemProvider<PetSkin> | Every skin on the server, whether or not the viewer owns any — a catalogue, the way |
%pets_blueprints% and %pets_skins% are checked before anything else, so they resolve in any context (console, non-player menus, …). equipped/actives/all/presets additionally require context.context() to be a Player and that player's PetPlayerData to be loaded via SyncAPI.findData — either check failing makes the whole placeholder resolve to null.
A PetPlayerData instance registered directly on a container answers the same namespace with a slightly different key set — pets, activePets, selectedPet, hasSelectedPet, presets — and shadows the root placeholder for as long as it is registered.
pet_*
A Pet placeholder (namespace pet). Only resolves where something has registered a Pet instance into the container — see Chaining and context below.
Placeholder | Type | Description |
|---|---|---|
| UUID | The pet's unique id. |
| Component | The pet's current display name (set at creation, changeable via rename). |
| String | Plain-text serialization of |
| PetBlueprint | Chain into |
| ItemStack | The blueprint's |
| double | Current accumulated experience. |
| int | Current level. |
| double | Experience required to reach |
| PetInventory | Chain into |
| boolean |
|
| boolean |
|
| boolean? |
|
| boolean? |
|
| ItemProvider<PetSkin> | The skins the pet permanently wears, in application order. Walk it with a |
| Component | Those skins' names, comma-joined, for a lore that wants them on one line. |
| boolean | Whether the pet wears any skin. |
| int | How many it wears (counts stored ids, including any whose file is missing). |
| ItemProvider<PetEffectView> | Every effect on the pet's blueprint, each bound to the pet's current level. Iterate it with a |
| ItemProvider<PetEffectView> | The same, filtered to the effects that gain something at |
| PetEffectView? | One effect by the id it was written under in the blueprint, bound to the pet's level — for a lore line about a specific effect rather than the whole list. Chain into |
Example — a blueprint's item template is rendered with its own pet as the context:
effect_* — one effect on one pet
Each entry of %pet_effects%/%pet_nextLevelEffects% is a PetEffectView: one of the blueprint's effects bound to the level the pet is actually at. Inside a list transformer it reads as %parameter_effect_…%; the namespace itself is effect.
Every value question is answered against a level that is already known, so a display line never has to feed a level back in or do arithmetic to work out whether an effect is maxed.
Placeholder | Type | Description |
|---|---|---|
| String | The key the effect was written under in the blueprint. |
| Component | Its |
| String | Its |
|
| How it reads at a glance — the one key a |
| String | Total granted at the pet's current level, formatted. |
| String | Total at the effect's last level, formatted. |
| String | What the current level alone granted, formatted. |
| double | The same three unformatted — what a requirement or |
| int | The next level that grants something, or |
| String? | What that level adds, formatted; nothing when there is no next gain. |
| String? | What the total will stand at once that gain lands — usually the more useful number on a "next level" line. |
| double | The gain unformatted; |
| boolean | Whether any further level grants something. |
| boolean | Whether the gain lands on the very next level specifically. |
| int | The pet's level. |
| int | The effect's highest configured level. |
| int | The first level that grants anything. |
| boolean | State as individual flags. |
| double | How far along, |
| long | The same, rounded to |
| PetEffect | The effect implementation itself, for what only it knows (below). |
Formatted values are space-grouped with up to two decimals (12 345.67), shared by every path a pet value reaches a player through.
Any key not listed above falls through to the effect implementation's own extraPlaceholder, so %effect_stat% and %effect_modifier_type%/%effect_modifier_key% work on a stats effect, and %effect_duration% (the interval, in milliseconds) on a money one.
blueprint_*
A PetBlueprint placeholder (namespace blueprint). See Pet Blueprints for the blueprints/*.yml shape this reflects.
Placeholder | Type | Description |
|---|---|---|
| String | The blueprint's id (its |
| Component |
|
| ItemStack | The blueprint's |
| PetRarity | Chain into |
| int |
|
| ItemProvider<PetSkin> | The skins a pet of this blueprint may still take on, resolved against the loaded skin files (ids with no file are skipped). Iterate it to list one pet's skins with the same entry template a full catalogue uses. |
|
| The raw ids the blueprint lists — for testing membership rather than drawing entries. |
| boolean | Whether it accepts any. |
rarity_*
A PetRarity placeholder (namespace rarity), reached from blueprint_rarity/pet_blueprint_rarity.
Placeholder | Type | Description |
|---|---|---|
| String | The rarity id (e.g. |
| Component | The rarity's rendered display name (e.g. |
| TextColor | The colour the rarity's name is written in. |
| TextColor | The lighter tone its detail text is written in ( |
The rarity's level-expression (the Crunch math expression that derives XP requirements) is not exposed as a placeholder.
food_*
A FoodBlueprint placeholder (namespace food). See Pet Food.
Placeholder | Type | Description |
|---|---|---|
| String | The food blueprint's id. |
| ItemStack | The food's |
| double | Experience granted to a pet fed this item. |
skin_*
A PetSkin placeholder (namespace skin), reached from %pets_skins%/%pet_skins%/%blueprint_skins%, from a skin item's own template, and from the skin messages. See Pet Skins.
Placeholder | Type | Description |
|---|---|---|
| String | The skin id. |
| Component | Display name. |
| ItemStack? | The skin's item template. Null-safe — a skin file may omit |
| ItemProvider<PetBlueprint> | The pets this skin fits, in blueprint load order — the question a skin seen on its own, in a catalogue or a shop, cannot otherwise answer. |
| Component | Those pets' default names, comma-joined. |
| int | How many there are — a skin every pet shares reads better as a number than as a list of twenty. |
| ItemProvider<PetSkin> | The skins this one cannot be worn with, in both directions of the conflict. |
| Component | Their names, comma-joined — for a lore line that warns before a player spends the item. |
| int | How many there are. |
preset_*
A PetPreset placeholder (namespace preset), reached from %pets_presets% entries. See Pet Presets.
Placeholder | Type | Description |
|---|---|---|
| UUID | The preset's unique id. |
| String | Its name. |
|
| The raw pet ids it holds. |
| ItemProvider<Pet> | The viewer's pets that it names. Player context required. |
Chaining and context
Unlike pets, the pet/blueprint/rarity/food/skin/preset/effect namespaces are not registered on RootPlaceholderContainer — they only resolve where the surrounding code has explicitly registered an instance into the placeholder container being evaluated. In practice that happens:
Inside a blueprint's own
item/entity.name/entity.sub-nametemplates, evaluated with thatPetregistered (see the example above), and inside every transformer those templates call.Inside a skin's
itemtemplate (with the skin registered) and itsentity.equipmentitems (with the pet registered).In command feedback —
/pets giveand/pets foodbuild a container fromAstralPaperAPI.createPlaceholderContainer(target)(giving%player_name%etc.) and register the resolved blueprint on top, sogive-success/give-food-successcan reference%player_name%and%blueprint_name%/%food_item_name%together:
In menus and other pet-related messages (pet added/removed/spawned/leveled-up, etc.), where the relevant
Petis registered before the message is sent.
Chains compose across namespaces: %blueprint_rarity_display% reads a blueprint's rarity display, and %pet_blueprint_rarity_id% walks pet → blueprint → rarity from a single Pet instance. Any *_item% key (pet_item, blueprint_item, food_item) resolves to an ItemStackPlaceholder — see Placeholders for its sub-keys.