resourcepack.ai
DOCS

Content

HUD overlays

An overlay is drawn over the game rather than behind a window.

# huds/overlays.yml
mana:
  slot: action_bar       # action_bar | boss_bar
  height: 64
  ascent: 32

/rp hud mypack:mana shows one; /rp hud clear takes it away.

The two slots#

Both are places the game already draws text somewhere fixed, which is the whole trick: an overlay is a glyph placed into that text with enough negative space around it to land where you drew it.

SlotWhere it draws
action_barAbove the hotbar. Vanilla uses it for item names
boss_barThe top of the screen, where a boss health bar goes

There is no third slot, because there is no third piece of text the game will draw wherever you ask.

Height and ascent#

height is how tall the picture is drawn. ascent moves it up the screen from the slot's baseline — a bigger ascent is higher.

An ascent greater than the height is refused by the client and takes the whole font down with it, so if every icon on your server vanishes at once, this is the first number to check.

What it is not#

An overlay's picture cannot know anything. A mana bar that empties is several overlays and something of yours choosing which to show — RP Engine draws whichever you ask for and has no opinion about mana.

That "something of yours" is usually a scoreboard or menu plugin reading a placeholder, or your own plugin calling the API.

Its text is a different matter — see below.

Live values in an overlay's text#

Any {name} in an overlay's text is filled per player, one tick before the line is sent. Three things are asked, in this order, and the first that answers wins:

  1. Whatever a plugin published with overlays().set(player, name, value).
  2. The built-ins below.
  3. PlaceholderAPI, if the server has it — {vault_eco_balance} is %vault_eco_balance% in braces. Nothing to install on our side.

A name none of the three knows becomes empty rather than staying as {name}: a gap reads as "no value yet", where a brace reads as a broken pack.

PlaceholderWhat it answers
{player} · {displayname} · {uuid}Who they are
{health} · {health_max} · {health_percent}Hearts, rounded up
{food} · {air}Hunger out of 20, and seconds of breath left
{level} · {xp}Experience level, and progress to the next as a percentage
{ping}Latency in milliseconds
{world} · {x} · {y} · {z} · {direction}Where they are, and which way they face
{time} · {day}The world's 24-hour clock, and how many days it has run
{gamemode}Survival, Creative, …
{online} · {max_online}Players now, and the cap

Shader overlays from Studio#

Studio's Shaders editor builds overlays out of shapes, text, player heads and progress bars. It has three tabs, and they answer three different questions.

Design is the elements. The list on the left is everything in the object; the panel on the right is whatever you picked out of it. Drag anything on the stage, select something and press Delete to remove it, or Esc to deselect.

  • Canvas — the drawing area you see behind the elements. Shapes are clipped to it; labels, heads and bars are not, so they may sit outside it and the editor keeps a margin around it so you can still see them.
  • Player head draws Steve in the editor and, on a pack you Sync to somebody, their own face: the push bakes one head per person it goes to. An exported pack has nobody in particular in it, so its heads are Steve's.
  • Progress bar fills from a live value. Pick what fills it and what full means — both are placeholder names, and full at also takes a plain number for a bar out of a ceiling you chose.

Canvas is the object itself, and it is a tab rather than four more sections under whatever you had selected: the canvas size, which slot it draws on, where on the screen it sits, and what shows it are not about the circle you are dragging.

Preview is what it looks like in game, at the size it will really be, against a hotbar.

A bar is the one element besides a label that a live value can drive, and it is built out of text for that reason: a shape's geometry is compiled into the pack and cannot move, so the bar is a run of small rectangles the server sizes each tick. That costs nothing you can see — the ends land on exact pixels — but it is why a bar has a colour and a length rather than a corner radius.

Push the updated pack after editing. When several overlays are shown at once, the most recently shown one is the one you see.