Skip to content

Custom HUD

Naylek edited this page Nov 30, 2026 · 2 revisions

Custom HUD

One JSON file adds one element to the screen. Players place, resize and hide it with the HUD editor (F7), like any other element. Everything is read on the client: it works on servers that do not have the mod.

Quick start

  1. Create config/proscenium/elements/vitals.json in your game folder.
  2. Paste the file below.
  3. In game, press F3+T. Press F7 to move it.
{
  "version": 1,
  "name": "Vitals",
  "anchor": "top_left", "x": 4, "y": 4,
  "width": 120, "height": 30,
  "parts": [
    { "type": "item", "x": 0, "y": 0, "item": "minecraft:compass" },
    { "type": "text", "x": 20, "y": 4, "text": "{x} {y} {z}" },
    { "type": "bar", "x": 0, "y": 20, "width": 100, "height": 5, "value": "health", "max": "max_health",
      "color": "D0453A", "background": "301010" },
    { "type": "text", "x": 104, "y": 19, "text": "LOW", "color": "FF6B6B",
      "when": { "var": "health", "below": 7 } }
  ]
}

The vitals.json example, when health is low:

Position, direction, time, health and food bars, with a low health warning

The equipment.json example: worn armor, uses left, ping and frame rate.

Four armor pieces with their durability, then ping and frames per second

More complete examples: docs/examples.

Where the files go

You are Folder Element identifier
A modpack maker config/proscenium/elements/<name>.json custom:<name>
A mod or resource pack author assets/<namespace>/proscenium/hud/<name>.json <namespace>:<name>
  • File names use lower case letters, digits, _, - and ..
  • Images are resource pack textures in both cases.
  • F3+T reads both folders again.
  • A resource pack higher in the list replaces a file of the same name.
  • The player's layout is saved in config/proscenium/hud/<namespace>.json (custom.json for the config folder).
  • A default layout for your elements can be shipped in assets/<namespace>/ui/hud.json, see HUD editor.

When files exist, the built-in showcase of Proscenium steps aside: your main menu stays.

The element

Field Required Default Meaning
version yes Always 1
width, height yes Size of the element, in interface pixels: used to place it
parts yes 1 to 64 parts, drawn in order
name no file name Name in the editor: a text, or { "translate": "key" }
anchor no top_left top_left, top, top_right, left, center, right, bottom_left, bottom, bottom_right
x, y no 0 Offset from the anchor; negative goes left or up
scale no 1 0.5 to 2
visible no true false: hidden until the player shows it
enlarge no false Also grows on screens that are large for the interface scale
when no always Condition for the whole element

Parts

Every part has a type, and accepts x, y (from the top left of the element, default 0) and when.

text

Field Required Default Meaning
text yes, or translate Text with variables: {health}, {x:1}, {{ for a brace
translate Translation key of your resource pack; the translation may hold variables
color no FFFFFF RRGGBB or AARRGGBB
shadow no true
align no left left, center, right: which end of the text sits at x

bar

Field Required Default Meaning
value, max yes A number, or the name of a variable
width, height yes
color no FFFFFF Fill color
texture no Image uncovered by the value, instead of a color; its size is the bar's
background no none Color behind the bar
direction no right Where the bar grows: right, left, up, down

image

Field Required Default Meaning
texture yes namespace:textures/gui/file.png
width, height yes Size drawn
u, v no 0 Top left of the region in the image
textureWidth, textureHeight no width, height Size of the whole image, for sprite sheets

item

Field Required Default Meaning
item yes, or slot Item identifier
slot mainhand, offhand, head, chest, legs, feet: what the player wears
count no false Also draws the stack size and the durability bar

Errors

A wrong file drops its own element only. The log (logs/latest.log) gives the file, the field and the reason:

HUD element custom:vitals ignored (.../vitals.json): parts[1].value: expected a number or a variable, got "mana"

JSON files run no code. In the editor, every element is shown with sample values and conditions are ignored, so that you can place what is not visible right now.

Not in this version

Several styles per element, lists and loops, calculations, animations, server data (scoreboard, NBT), images read outside resource packs, an in-game content editor, screens and buttons (planned for 0.5).

Clone this wiki locally