Skip to main content

Showing server data on the HUD

A server or script can send data to the HUD only through text channels (title, subtitle, action bar, sidebar scoreboard). The resource pack's ui/hud_screen.json reads that text with bindings and expressions, turns it into text, bars or icons, and hides the vanilla display when the data is its own. This page uses the title channel as the base and gives only the selection criteria for the other channels.

When to use it​

What to showChannel and methodRules
A notification or one latest value (status, toast)Title + a hud_title_text_factory in my own layerHOST-14, HOST-27, PAT-08
One number that changes often (progress, angle)Show a title, then change only the subtitle with updateSubtitle. The control is not created againBND-40
A last value that must stay when the next title arrivesTitle + a value-preserving latchBND-18
Action bar text drawn my wayA second hud_actionbar_text_factory, variable $actionbar_textHOST-30, HOST-48
Several lines that must always be visible (quests, scores)Split the sidebar scoreboard by section markers (up to 15 lines)HOST-45
Notifications that pile up at the same timeA second chat_item_factory on chatHOST-14, HOST-29, PAT-09

Cases where it does not fit, and the alternative:

CaseAlternative
The player must choose or type somethingA server form host (Reskinning a server form, HOST-01)
It must follow a 3D positionNot JSON UI (When JSON UI does not fit, HOST-01)
Text must show while a chest menu is openThe chest screen cannot read the title or the sidebar. Send it as slot item names (#hover_text) (HOST-53, HOST-17)
Drawing item icons without knowing numeric item IDs (Script API add-on)A texture path image or an inventory mirror (HUD item icons)

Minimal example​

Source: the example in section 10 of HUD and title channels. It worked on Windows 1.26.65 with the code below as is {measured} (2026-11-27). It shows a HUD label only while the title starts with the prefix hudlabel_demo:, draws the text after the prefix in the label, and hides the vanilla title.

hud_label_example/
manifest.json
ui/
_ui_defs.json
hud_screen.json
hudlabel.json

manifest.json (make new UUIDs):

{
"format_version": 3,
"header": {
"name": "HUD label example",
"description": "Shows a HUD label while the title starts with a fixed prefix",
"uuid": "5d1c8b0e-3f42-4a6b-9c71-0e2a7b9d4f13",
"version": "1.0.0",
"min_engine_version": "1.26.40"
},
"modules": [
{ "type": "resources", "uuid": "b7e94a21-6c3d-4f58-8a0b-1d5e2c7f9a64", "version": "1.0.0" }
],
"metadata": { "authors": ["Example"] }
}

ui/_ui_defs.json registers only the new file:

{
"ui_defs": [
"ui/hudlabel.json"
]
}

ui/hudlabel.json:

{
"namespace": "hudlabel",
"label_box": {
"type": "panel",
"size": [ 160, 16 ],
"anchor_from": "top_middle",
"anchor_to": "top_middle",
"offset": [ 0, 24 ],
"anims": [ "@hudlabel.stay" ],
"controls": [
{
"text": {
"type": "label",
"text": "#body",
"localize": false,
"bindings": [
{ "binding_type": "global", "binding_name": "#hud_title_text_string", "binding_name_override": "#raw" },
{ "binding_type": "view", "source_property_name": "(('%.14s' * #raw) = 'hudlabel_demo:')", "target_property_name": "#visible" },
{ "binding_type": "view", "source_property_name": "(#raw - 'hudlabel_demo:')", "target_property_name": "#body" }
]
}
}
]
},
"stay": { "anim_type": "wait", "duration": 3.0, "next": "@hudlabel.leave" },
"leave": {
"anim_type": "offset",
"easing": "in_back",
"duration": 0.5,
"from": [ 0, 0 ],
"to": [ 0, -40 ],
"destroy_at_end": "hud_title_text"
}
}

ui/hud_screen.json (same path as vanilla):

{
"hud_title_text": {
"modifications": [
{
"array_name": "bindings",
"operation": "insert_back",
"value": [
{ "binding_type": "global", "binding_name": "#hud_title_text_string" },
{
"binding_type": "view",
"source_property_name": "(not (('%.14s' * #hud_title_text_string) = 'hudlabel_demo:'))",
"target_property_name": "#visible"
}
]
}
]
},
"root_panel": {
"modifications": [
{
"array_name": "controls",
"operation": "insert_back",
"value": [
{
"hudlabel_factory": {
"type": "panel",
"size": [ "100%", "100%" ],
"factory": {
"name": "hud_title_text_factory",
"control_ids": { "hud_title_text": "hud_title_text@hudlabel.label_box" }
}
}
}
]
}
]
}
}

The sending side calls player.onScreenDisplay.setTitle("hudlabel_demo:Welcome"). Welcome showed at the top center and disappeared within about 4 seconds, and the factory-created control was gone too. The vanilla title did not appear for this prefix, and a title without the prefix appeared as in vanilla {measured}. The label's position, size and animation times are example values.

Variant: keeping the last value​

To show the last hudlabel_demo: value after the label is gone, add a latch. The latch structure is copied from juc_hud.json of the measurement add-on json-ui-claims and worked on Windows 1.26.65.1 {measured} (BND-18). This exact combination, with the keyword changed to the example prefix and a reading expression that removes the prefix, was not measured in game {inferred}.

Add one more definition to ui/hudlabel.json:

{
"keep_host": {
"type": "panel",
"size": [ "100%", "100%" ],
"controls": [
{
"keep_latch": {
"type": "panel",
"size": [ 0, 0 ],
"property_bag": { "#saved": "" },
"bindings": [
{ "binding_name": "#hud_title_text_string" },
{ "binding_name": "#hud_title_text_string", "binding_name_override": "#saved", "binding_condition": "visibility_changed" },
{
"binding_type": "view",
"source_property_name": "((not ((#hud_title_text_string - 'hudlabel_demo:') = #hud_title_text_string)) and (not (#hud_title_text_string = #saved)))",
"target_property_name": "#visible"
}
]
}
},
{
"keep_text": {
"type": "label",
"size": [ 200, 8 ],
"anchor_from": "top_left",
"anchor_to": "top_left",
"offset": [ 4, 40 ],
"localize": false,
"text": "#text",
"bindings": [
{ "binding_type": "view", "source_control_name": "keep_latch", "source_property_name": "('Last: ' + (#saved - 'hudlabel_demo:'))", "target_property_name": "#text" }
]
}
}
]
}
}

Add one more item, { "keep_host@hudlabel.keep_host": {} }, to the root_panel value array in ui/hud_screen.json. When a new title contains the prefix and differs from the saved value, keep_latch is visible for one frame, and at that moment the visibility_changed binding copies the title into #saved. Other titles do not change #saved.

Must match​

Files and wiring:

  • ui/hud_screen.json must be at the same path as vanilla for its modifications to apply (MOD-02). This file is not listed in _ui_defs.json; only new files are (FILE-01).
  • The binding that hides the vanilla title goes on the whole hud_title_text. On title_frame alone, the subtitle can flash briefly (HOST-27). hud_title_text has no bindings to begin with, so insert_back is safe (MOD-04).
  • The second factory's factory.name is hud_title_text_factory and the control_ids key is hud_title_text (COL-14, HOST-27). For the action bar they are hud_actionbar_text_factory and the key hud_actionbar_text (HOST-30).
  • A factory-created control stays after the title ends unless an animation removes it. The value of destroy_at_end must be the control_ids key hud_title_text. An instance name or definition name did not remove it {measured} (claim measurements 6.2).
  • Make the prefix long and unique, and let one prefix decide both hiding the vanilla display and showing mine (HOST-15).

Expressions and bindings:

  • N in '%.Ns' is the UTF-8 byte count of the prefix. Letters and digits are 1 byte, § 2, Korean 3, most emoji 4 (EXP-09, EXP-24). Fields cut by position use ASCII only, and multibyte characters go at the end.
  • The only working format is '%.Ns'. Padding formats such as '%7.4s' return the input unchanged (EXP-25). The sending side does the padding.
  • A view binding expression must contain at least one #property. Without one, the control's whole bindings array is dropped. An expression with only $variables counts too (BND-05, BND-42).
  • A control that uses a global value in an expression binds that value itself ({ "binding_name": "#hud_title_text_string" }). Another control's bound value is read only through source_control_name (BND-04, BND-08).
  • #visible takes only JSON booleans. An integer or string put in as is becomes the default true, so build a comparison such as (#n > 0) (BND-27).
  • Give labels "localize": false. Through translation, tokens containing % disappear (TXT-01, TXT-17).
  • Numbers are not drawn by a label as is. Join them to a string as in ('n=' + #v); a float stays empty even when joined (TXT-06, EXP-22).
  • A latch needs all four: a size 0 panel, a default in property_bag, the copy with binding_condition: "visibility_changed", and a #visible condition of "contains the keyword and differs from the saved value" (BND-18).
  • Inside a factory-created control, $title_text and $subtitle_text are strings, so they go straight into ignored and variables requires expressions. $actionbar_text is an object, so a direct comparison inside an expression is always false. Copy it with "$copy": "$actionbar_text" and compare the copy (HOST-28, HOST-48, FILE-17).

Common expressions (#s is the bound title string):

GoalExpressionRules
Prefix check(('%.14s' * #s) = 'hudlabel_demo:')EXP-08
Contains check at any position(not ((#s - 'KEY') = #s))EXP-07
Remove the prefix(#s - 'hudlabel_demo:'). The same text later in the body is removed tooEXP-12
Skip the first N bytes and take L bytes('%.11s' * (#s - ('%.20s' * #s)))EXP-11
String to number((#s - 'hp:') - 0). * 1 gives an empty string, + 0 appends a 0EXP-16, EXP-31
Greater than or equal((#v > 10) or (#v = 10)), (not (#v < 10)). There is no >=, <=, != or %EXP-02, EXP-03
Range((#v > 5) and (#v < 17)). Do not chain comparisonsEXP-04, EXP-28
A 0 to 100 value as a bar ratio((100 - (#v - 0)) * .01) into #clip_ratio. 0.01 is the integer 0EXP-27, PAT-10
Pick a texture from text('textures/wiki/ui/example_' + #s) into #textureHUD and title channels 3.1

A bar is an image with "clip_direction": "left" and a bound #clip_ratio (the ratio cut away, 0 to 1) (PAT-10). Integer division gives an integer, so (#cur / #max) gives only 0 or 1 (EXP-18).

When drawing item icons (inventory_item_renderer) from the subtitle:

  • Put runtime ID x 65536 in the subtitle as fixed-width fields, with a letter at the very start to keep it a string (HUD item icons 3.1).
  • The renderer reads #item_id_aux only when it is a JSON integer, so end the expression with - 0. Put numeric fields after a letter marker {code (binary)} (EXP-47).
  • To read through a binding, give the icon's property_bag "#item_id_aux": 0 and set the view binding to binding_condition: "always". To read through a variable, cut it from $subtitle_text and put it in #item_id_aux of property_bag {measured} (HUD item icons 3.4).

Common mistakes​

SymptomCauseFix
The vanilla title appears together with my labelNo hiding binding, or N in '%.Ns' differs from the prefix byte countA hiding binding on hud_title_text; count N again in bytes (HOST-27, EXP-08, EXP-24)
Text flashes briefly in the centerHiding was put on title_frame onlyPut it on the whole hud_title_text (HOST-27)
My label is always visibleThe expression failed and #visible took the default true (>=, !=, % and so on)Fix the expression. A failed expression may leave no log (BND-09, EXP-02, EXP-03)
None of a control's bindings work, and the log has Must define a source property name in the binding!One expression has no #propertyAdd a #property. For constant math, put "#z": 0 in property_bag and add + #z (BND-05, BND-42)
A number label is blankOnly a number was put into #text, or it is a float('n=' + #v); send floats as integers (TXT-06, EXP-22)
A number comparison is always falseTitle pieces are strings, and = between a string and a number is false((#v - 0) = 35) (EXP-16, EXP-34)
(#v * 1) is emptyString * number is an empty string(#v - 0) (EXP-31)
Text starting with Info: ... or nan... disappearsThe result was read again as a floatSend it starting with a letter prefix such as §r (EXP-48, EXP-15)
A numeric field after the prefix breaksAn intermediate result starting with a digit dropped the text after itPut numeric fields after a letter marker (EXP-44, EXP-30)
Fields with Korean text break or shift'%.Ns' counts bytesASCII for fields cut by position, Korean at the end (EXP-09, TXT-13)
The label stays after the title endsNo removing animation, or a wrong destroy_at_end namedestroy_at_end: "hud_title_text" (claim measurements 6.2)
My HUD disappears when another add-on sends a titleThere is only one title channelPut values that must stay in a latch or the sidebar, and design assuming they can be overwritten (HOST-14, BND-18, HOST-45)
The client stops responding when the screen opensA string was divided by a numberConvert with (#v - 0) before dividing (EXP-49, EXP-21)
An action bar variable comparison is always false$actionbar_text is an objectCompare a copy variable (HOST-48)
HUD values are not visible while a server form is openThe HUD is not drawn while a form is open"force_render_below": true on third_party_server_screen (HOST-44)
Gray cells and an expected a string warningThe subtitle was sent as digits onlyPut a letter at the start (HUD item icons 4)
A HUD with many cells is slowA fixed expression per cell was chosen with requiresKeep one expression in the definition and pass only the position to each cell as a variable (BND-33, binding expression caching)

Performance and limits:

  • Send only when the content changes. For a data title, send fade in and fade out as 0 and a long stay, and send again before it ends (HUD item icons 3.5).
  • Each title creates the factory control again and restarts its animation (ANI-12, COL-17). Send values that change often as the subtitle (BND-40).
  • Parse strings in one place, a parent or a size 0 data control, and let children read only the result with source_control_name (BND-10, BND-11). Values that are decided once use binding_condition: "once" (BND-06).
  • At 64 cells the two expression layouts showed no difference; at 256 cells screen frames were about 4 to 5 against about 22 {measured} (mobile, binding expression caching).
  • There is a community report that titles and the action bar keep being processed while the HUD is covered (inventory, chat, F1), and heavy bindings can then stall (JSON UI optimization 3).
  • Integers in expressions are 32-bit (EXP-18). Large numbers such as 64-bit IDs are not handled as numbers in expressions (EXP-50).
  • #hud_title_text_string kept the last value after the title left the screen, and was empty after rejoining the world {measured} (claim measurements 6.5).
  • Hiding the vanilla HUD with setHudVisibility (SetHud) leaves elements the pack added {record} (HUD and title channels).

Version conditions​

  • An expression dividing a string by a number froze the Windows 1.26.65 client and did not freeze mobile 1.26.63. On every version, convert with (#v - 0) before dividing (EXP-49).
  • The 26.70 preview (26.70.20) reports wrong binding expressions and view binding loops as content log errors {docs} (26.70 preview). Expressions that fail silently on release can appear in the log on the preview.

How to check​

  1. Turn on Content Log GUI under Creator in the settings. On Windows the file is %APPDATA%/Minecraft Bedrock/logs/ContentLog<date>.txt (DBG-01, DBG-33).
  2. If the pack is new, restart the game and enable it in the world's resource pack list (DBG-18).
  3. Enter the world and search the log for Must define a source property name in the binding!, Invalid expression, JSON UI parse failure - expected a string., Expected variable not found and Unknown property lines (DBG-34). An empty log does not prove an expression is right (DBG-33).
  4. Send a title with the prefix: setTitle from a script, or /title @s title hudlabel_demo:Welcome in chat. Check that my label shows and the vanilla title does not.
  5. Send a title without the prefix (/title @s title plain). The vanilla title must appear and my label must not. With the latch, check that the Last: line keeps the previous value.
  6. If hiding does not work, draw the expression and its negation at the same spot, or print ('V' + #property) in a label, to tell whether the expression itself failed (DBG-03).
  7. After editing a development resource pack, run /reload all. /reload all rereads development resource packs, and /reload reloads only scripts and functions (Diagnosing load failures). If the UI still does not change, restart the game (Debugging and versions).

Further reading​

Sources
idSourceLicenseCommitAccessed
ms-learnMinecraft Creator documentation (Microsoft Learn)CC BY 4.0 (documentation), MIT (code)a9fd1c02026-11-13
bedrock-wikiBedrock WikiCC BY 4.0 (docs/licenses/CC-BY-4.0.md in the repository)0930b392026-11-13
private-researchPrivate research (-)-2026-11-13
repo-guideJSON UI comprehensive guide (this repository) (guide/)This project's material2026-11-13
repo-bedrock-corebedrock-core UI analysis (this repository) (bedrock-core/)This project's material2026-11-13
bedrock-corebedrock-core UI (@bedrock-core/ui)MIT (confirmed in the repository LICENSE, Copyright 2026 bedrock-core)aee2bbd (analysis baseline, clone HEAD 51d5cf2)2026-11-13
advancementpackAdvancementPack (r4isen1920)MIT (confirmed in the repository LICENSE, Copyright 2024 r4isen1920)0a79929 (analyzed v4.2, researched 2026-10-20)2026-11-13
bedrock-samplesMojang bedrock-samplesMinecraft EULA applies, (c) Mojang AB. All rights reserved15701fa9 (guide baseline 46ba6ea)2026-11-13
cinnabarCinnabar (json-ui crate)PolyForm Noncommercial License 1.0.0 (confirmed in the repository LICENSE). Used only to check behavior and as an implementation reference; the original text is not copiedceb0fb6 (analysis baseline, clone HEAD df826f5)2026-11-13
minecraft-feedback-mojiraMinecraft Feedback posts and Mojira issuesEach author's work. Facts only, rewritten2026-11-13