Placeholders
AstralHud registers three ComplexPlaceholder namespaces, all backed by the in-memory cache ImageManipulationService builds from image-manipulation.yml on load. For the placeholder syntax itself (%a_b_c%, %a_{b_c}%, $e(...)) see Placeholders.
Namespace | Backing class | Path tokens required |
|---|---|---|
|
| 1 — the manipulation |
|
| 3 — id, amount, upper bound |
|
| 2 — id, lookup value |
All three return null (rendering as nothing) on any lookup miss — unknown id, missing amount, or a value outside the cached range — rather than throwing.
%imgmanip_<id>_<amount>%
Renders one of a manipulations entry's pre-built, repeated-glyph images.
Path token | Description |
|---|---|
| The manipulation's |
(rest of the path) | Consumed as the |
Resolution: the resolved amount is rounded to the nearest int (Math.round). If it falls outside the entry's lower-bound/upper-bound (inclusive), the placeholder returns null. Otherwise it returns the pre-built Component for that exact amount from ImageManipulationService's cache — the element string repeated that many times.
Note the amount field in image-manipulation.yml is not actually consulted for the manipulation's build-time behavior (the cache is built for every integer in the bound range regardless of what amount says) — it only matters at render time, and only as a default; a placeholder call can supply a different amount expression in its own path, as shown above.
%imgprovider_<id>_<amount>_<upperBound>%
Renders a value from an image-provider lookup table, rescaled from an arbitrary <amount>/<upperBound> pair onto the table's own index range. Requires at least 3 remaining path tokens; fewer returns null.
Path token | Description |
|---|---|
| The |
| Resolved as an |
| Resolved as an |
Resolution: the table for <id> must already contain a literal entry keyed by <amount> — if it doesn't, the placeholder returns null regardless of <upperBound>. Otherwise, <amount> is rescaled onto the table's size (ceil(amount / upperBound * tableSize), clamped to [0, tableSize - 1]) and that rescaled index is what's actually returned. In effect, <amount> is checked directly against the table's own keys as a presence gate, but the value returned comes from the rescaled index — keep the two consistent (e.g. only call this with <amount> values that also exist as literal table keys) to get predictable output.
%stringprovider_<id>_<value>%
Renders a value from an image-provider-string lookup table by exact string key. Requires at least 2 remaining path tokens; fewer returns null.
Path token | Description |
|---|---|
| The |
| Resolved as a |
See also
Image manipulation — the
image-manipulation.ymlshape these placeholders read from.Overview — how the cache is built.