Community notes: data channels, HUD, expressions, layout
These are notes on JSON UI syntax and data channels from community reports. They cover the development workflow, file structure and modifications, bindings, the expression language, passing data from script to UI including the preserved title, HUD customization, and layout, text and animation.
The source tags at the ends of items are the same as in the header of the community reports and cross-check page, and verification level marks follow the legend on the wiki home page.
Development workflow and debugging
- Reload:
/reload allrereads JSON UI and the BP/RP of dev packs without leaving the world./reloadrereads only scripts. The pack must be indevelopment_resource_packsfor it to work reliably (a copy inresource_packsis snapshotted into the world). - Reload bug after 1.21.130:
/reload alloften failed to reread UI, textures and scripts (it worked in Preview). The UI reload of global resources was also broken. Workarounds are restarting the game, toggling or reordering a dummy pack, reopening the world, and putting the dev UI pack directly into the world. - Hot reload client: the Conduit client DLL (github.com/conduit-be/client) hot-reloads JSON UI with Ctrl+R. v0.4.4 fixed the hash check, and v0.5.0-beta removed the SHA check and supports .62/.63. Logs are left in
%LOCALAPPDATA%/ConduitClient/logs/standalone.log. There was an answer that LeviLauncher cannot read new files. Some people bind/reload allto Ctrl+C, but it was said to be doubtful whether chest_screen is reread that way. - How to learn: there is no official documentation, so learn by copying vanilla ui json (bedrock-samples) into the RP
ui/and changing values. Follow the tree down from the file's entry point ($screen_content) and search references by the name without the namespace and dot (main_button). There is no tool that maps screens to files, so hide elements one by one with"ignored": trueto find them. - Debug colors: giving an element
"debug": "red"and so on draws its bounding rectangle. It is for layout checking but the performance cost is large (reported 2026-06-01). A panel with no content and no debug color is not visible on screen. - Checking errors: turn on the Content Log GUI (Creator settings). If a pack has a red mark in Settings > Global Resources, there is an error in a file. A file with an error is ignored wholesale. UI parse errors show the file and position together (for example
ui/hud_screen.json: Unable to parse ... Missing ',' or ']'). The same symptom occurs when a file name is wrong, for examplesmithing_table_2_screen.jsonis right andsmithing_table_screen_2.jsonis wrong. - Error logging improvements: from the 2026-09-22 preview, wrong binding expressions and view binding loops are printed more in the content log. Crashes are still not recorded. In the 2026-10-13 update the error types changed again. There is also a mention that error logging improved in the 2026-10-06 preview. Most wrong things are still skipped silently. On 2026-10-29 there was a report that
[UI][error]-JSON UI parse failure: Invalid expression.appeared directly on a stable mobile screen (when a binding result started with/. Version unknown).{single report} - Editor autocomplete: put
"$schema": "https://kalmemarq.github.io/Bugrock-JSON-UI-Schemas/ui.schema.json"in the UI file (the binding list does not reflect 26.x). There is also the VS Code extension Sugger.json-ui-autocomplete. - Android: on recent Android, com.mojang is read-only so you must import the .mcpack again every time you change something. LeviLauncher or USB tethering/a desktop environment is recommended. If a file is saved as ISO-8859-1,
§breaks on Android, so save as UTF-8. - Texture problems: in the preview, UI textures sometimes did not show until a pack reload or PC restart. If the game holds an old form layout, clear the cache.
- AI tools: AI often invents JSON UI properties that do not exist (the learn.microsoft.com reference also has many "undefined" entries). Usage tips for AI are in the tools and material section of Limits, versions and tools notes.
JSON UI file structure, namespaces, modifications, variables
Files and namespaces
_ui_defs.json: register a new file or a new namespace file inui/_ui_defs.jsonas{"ui_defs":["ui/your_file.json"]}. Vanilla files do not need registration. A file that neither overrides a vanilla file nor is connected to a screen does nothing. If you forget to register, the form is empty or the UI does not open. Any extension is parsed as JSON (the.uidxcase).- Global variables: put global variables and colors in
ui/_global_variables.json(vanilla color definitions are also here). - Reference syntax: use
name@namespace.element. The referenced element must be at the top level of that namespace. Writing@otherwithout a namespace looks only in the current namespace. Acontrolsitem has the form{ "name": { ... } }. You can choose the base control with a variable, as inpanel@$panel_type. A namespace may contain/,\,:and spaces, but@breaks the template. - "Type not specified (or @-base not found)": the error when an element has neither
typenor@base, or when the referenced UI file was not loaded. Check the path inui/_ui_defs.json, namespace match, and the JSON syntax of that file (comments are allowed). - Adding content to a vanilla screen: leave the vanilla namespace as is and define a
custom_panelin the same file, as in"inventory_screen": {"$additional_screen_content": "crafting.custom_panel"}. When complete, change it to$screen_contentto replace the screen wholesale. Put only the part to change in the file and do not change the namespace name. Properties you did not touch follow the vanilla values. - Changing vanilla properties: ordinary properties can be redefined by name (
element_name: {"size":[100,100]}). Other properties are kept. Nested paths also work ("a/b/c": {...}, for example"hud_title_text/title_frame/title").
modifications
- Array operations: use
insert_front,insert_back,insert_before,insert_after,remove,replace,move_front,move_back,move_beforeandmove_afteron thecontrols,bindings,button_mappingsandvariablesarrays. Example:{"array_name":"controls","operation":"replace","control_name":"<existing>","value":[{"your_control":{}}]}. Awherefilter can delete only a particular binding ("where":{"binding_name_override":"#color"}). Reordering is meaningful only in a stack_panel. - Vanilla elements only:
modificationscan be used only on existing vanilla elements. Using it on your own element gives an "Unknown property [modifications]" error, and it does not work on a definition derived with@(light_text_button) either. It also does not apply to elements of other packs. Packs cannot reference each other's elements. replaceafterremove: if youremovethe same control first,replacecannot find the target and fails.- Beware of overriding bindings: if you define
bindingsdirectly on a control that inherits a template with@, the inherited bindings are replaced wholesale. There is a case wherescroll_gridlost its collection bindings and rendered nothing. To add bindings, usemodificationsinsert_back. - Coexistence between packs: if the upper pack defines an empty panel and the lower pack inserts into that panel, the two packs can insert into a panel of the same name together. In general, when modifying the same vanilla element, only the upper pack's
modificationsapplies. Custom crafting table UIs also collide with each other, so followmodificationsand the wiki best-practices.
variables
- Evaluated only at load time:
variables(therequirescondition) is evaluated once when the screen loads and does not change in real time. It can check only variables, and#bindingis read as a literal string. - A variable cannot hold a binding value:
"$var": "#bind"is only text substitution. Conversely, you can turn a variable into a binding withproperty_bag: {"#name": "$var"}(only in that element). There is no global mutable variable. - Choosing a layout by a binding (workaround): there is a report that using
"bindings":[{"binding_name":"#form_text","binding_name_override":"$binding_text"}]together with"variables":[{"requires":"($binding_text = 'x')","$layout":"ns.layout"}]andcontrols:[{"tab_layout@$layout":{}}]lets you choose a layout by a binding value. There is also a variant that puts it in property_bag first and checks in variables.{single report} - Comparing
$container_title/$actionbar_text: comparing directly fails. First copy them ("$chest_title": "$container_title","$atext": "$actionbar_text") and then compare the copy outsidevariables. String comparison uses quotes like'container.chestCopper'. There is no"requires": "default". Default syntax such as"$container_title_custom|default": "$container_title"can be used. requiressyntax: write conditions with word operators like"($left and not ($up or $down))". If you forget the$in the target variable name, the condition passes but nothing happens. Use one object per requirement. If there are several of the samerequiresobjects, they overwrite each other. It may not work inside an actionbar factory. There is no ternary operator.- Variable scope: a variable applies only to that element and its children and is not visible to siblings, so define it in a common parent or the root. The priority is the target control, then the parent, then a distant ancestor. Using several variables of the same scope in another variable fails "sometimes". Renaming sometimes fixes it.
ignoredand variables:ignoredaccepts only variables and not bindings. It cannot use variables defined in the same scope and can use only ancestors' variables. Since 1.19.20 the way operators are supported changed without documentation. The workaround is to put the variable in the parent and the property in the child. Expressions can be written directly invisible/ignored("visible": "($text_name - $_prefix = $text_name)","$ignored": "(not $touch)").- Platform global variables: there are
$touch(touch input, true on touch desktops too),$desktop_screen,$pocket_screen(the pocket UI profile, not "mobile"),$mouse,$game_pad,$pocket_editionand$is_pregame(unstable updating). The engine sets only$game_pad; there is no$gamepad{code}.$is_big_screen(added 2025-10-29, sometimes its value does not change) is not a global variable but a pause screen variable, set once when that screen's variables are built{code}. All are evaluated only at load time, so even if you unplug the mouse a restart is needed to reflect it. Bindings that change in real time include#inventory_touch_buttonand#hud_visible_not_centered(changes with pocket/classic). There is no GUI scale variable or binding. - PC/mobile layout branching: give two sibling panels
"visible": "$touch"and"visible": "(not $touch)".$touchis defined inside a server form window too: it was false on Windows 1.26.65.1 and true on mobile, with noExpected variable not foundlog (record, community reports). Text converted withproperty_bag {"#touch": "$touch"}was empty. The mobile screen height is about 200px, smaller than Windows' about 400px.
Binding basics
Binding kinds
global(default): fetches hardcoded properties decided per screen (for example#level_numberof hud_screen). Usesbinding_nameandbinding_name_override. It is not passed to children. Usingsource_property_namewith global gives a "Must define a source property name" error.view: reads or computes a property of another control. Usessource_control_name(the name without#),source_property_name(the expression) andtarget_property_name. A binding that goes into an expression must first be declared with{"binding_name":"#x"}. Principle: global to take a value or visibility as is, view to compute.collectionandcollection_details: write like{"binding_name":"#form_button_text","binding_type":"collection","binding_collection_name":"form_buttons"}. If you do not declare it, nothing shows for"text": "#form_button_text". To use#collection_index, acollection_detailsbinding is needed. There is an explanation that thebinding_nameof a collection binding cannot hold an operation, so bind first and then compute with a view. On the other hand, an example that hides an empty hover,{"binding_type":"collection","binding_collection_name":"$item_collection_name","binding_name":"(not (#hover_text = ''))","binding_name_override":"#visible"}, was shared.{conflict}- "Must define a binding name!": the error from a binding without
binding_name. - Unclear properties: what
binding_collection_prefixandnotify_on_ellipsesdo is not known.
Scope and reading other controls
- Parent to child: the parent declares
{"binding_name":"#bind"}and the child reads it with{"binding_type":"view","source_control_name":"parent","source_property_name":"#bind"}. Bindings are not inherited by children. - Siblings: put
"resolve_sibling_scope": trueon the consuming binding (not on the data_control side). Example:{"binding_type":"view","resolve_sibling_scope":true,"source_control_name":"title_mission","source_property_name":"#text","target_property_name":"#text"}. A custom property read withsource_control_namemust be insideproperty_bag. - The meaning of
resolve_sibling_scope: giving this flag limits the search to the sibling range, and without the flag any control is read, breadth-first from the screen root (BND-25). On Windows 1.26.65.1 with the flag, the sibling was read and the cousin was empty (BND-01). There is a case where this flag solved child indices all becoming 0 in acontainer_itemsfactory. resolve_ancestor_scope: added in the 1.21.130 changelog as a boolean only for view bindings. It fetches the value of the control matchingsource_control_namefrom ancestors such as the grandparent. On Windows 1.26.65.1 it read the ancestor without an error, but a read without the flag finds the same ancestor, so it is not needed (BND-01).- Dynamic
source_control_name: a binding cannot be put insource_control_name. A variable can:"$scn": "('data_control' + $technique_slot)",source_control_name: "$scn". If the control name equals its$namevalue, a collision where it finds itself arises. - Collection sibling data: to read the
#item_id_auxof slot 1 from slot 0, put elements with differentcollection_indexinside the same collection_panel and usesource_control_name+resolve_sibling_scope. The case where a nested collection overwrote the index was solved in the order dropdown collection, form collection, dropdown. You can also specify a particular slot by putting#collection_index/#collection_nameinproperty_bag. property_bag_for_children: passes property_bag values down even to children the factory created. It entered stable around 2026-05-07.ancestor_scope/factory_variables: for a factory to read ancestor variables,factory_variablesis needed. Without it you get the error "cannot find variable in ancestor tree".
binding_condition
- Value list:
always,always_when_visible,visible,once,none,visibility_changed.visibleevaluates when becoming visible,always_when_visibleevery frame while visible, andonceonly once. The individual meanings are{unverified}. - Uses:
visibility_changedis used for the preserved title trick.onceis put on the factory/grid bindings of big forms to reduce lag and ghost buttons. It was reported thatbinding_conditioncannot be put on view bindings (a rumor of a workaround was not confirmed).
Other binding rules
- Several bindings on the same target: you cannot put two
binding_names in one object. Declare each and merge them with a view from(#bind_1 or #bind_2)to#visible. If you attach several bindings to the same#visible, they are not merged and the last one wins. Merge them into one expression. - Self-reference: a view binding that reads and writes back a numeric toggle state works: on Windows 1.26.65.1 a view binding that reads
#stfrom theproperty_bagand writes it back into#stheld its state on the HUD, with no hang and no log error (BND-30, record). There is a report that a length counter that appends strings (from#lengthto#length) becomes a binding loop with string concatenation ("215") and growing memory, and a report that a self-referencing#visiblesuch as(#visible and ...)is unstable. Neither was measured. - Name typos: a nonexistent binding name (for example
#item_aux_id. The correct one is#item_id_aux) silently returns the property_bag default. - Complex logic:
#enabledbinding toggles were unstable in complex logic.#visibleworked well. - Mobile crash: writing
andinline insidebinding_namekills mobile. Compute with a view binding:(#hotbar_visible and not #hotbar_visible_not_centered). - Properties that can be bound:
#visible,#enabled,#text,#texture(only this name works. Other names break),#color,#alpha(unstable, for example 0.75 not showing, so#coloris the alternative),#clip_ratio,#size_binding_x/y(+_absolute),#anchored_offset_value_x/y,#font_scale_factor,#text_alignment,#font_type,#maximum_grid_items,#collection_length,#item_id_auxand#entity_id. Shadow has only a property (shadow) and no binding.
The binding expression language
Operators
- Usable operators:
+ - * / > < = and or not, and parentheses. There are no<=,>=,==,!=(measured: on Windows 1.26.65.1!=and>=gave no value, record),&&and||. The whole expression must be wrapped in parentheses:"((#title_text = 'a') or (#title_text = 'b'))".{}cannot be used insource_property_name. Using a wrong comparison like=><makes the element disappear.{community confirmed} - Replacing
>=: there is no>=, so split it as(a > b) or (a = b). - No Molang:
query.*andq.propertycannot be used. The one exception isquery.is_in_ui, the only Molang that affects the JSON UI paper doll (thev.is_paper_dollvariable is also used on the player model side). - Boolean arithmetic: booleans act as 1/0 in arithmetic:
(12 * #val),(1 - #val). If the target is#visible, the result must be a boolean.(#preserved_text - $update_string)is a string, so use a comparison such as(#text = 'x'). - String comparison:
<and>behave like dictionary order ('!hi' > '!'is true). It is undocumented and was confirmed in the CubeCraft UI. Comparison is case sensitive. Measured: on Windows 1.26.65.1'b' < 'c'was true, and'b' > 'c'and'b' < 'a'were false (record). - No array operations: arrays such as colors or offsets cannot be compared or computed.
'[' + ... + ']'makes a string, not an array. Array bindings (#equip_grid_dimensions) cannot be divided or changed either. - Quotes: write literals inside a double-quoted expression with single quotes. Inside an expression
\"is the same as'.
String operations
'%.Ns' * #text: cuts the first N bytes. It is the only printf specifier that is left. Write the format string first ('%.4s' * #text. After 1.21.130 there was a case where#text * '%.4s'broke). It is exactly%.12s, not%12s.- Extracting pieces: the remainder is
(#t - ('%.9s' * #t)), a middle piece is(('%.20s' * #s) - ('%.10s' * #s)), and a prefix check is('%.10s' * $container_title = 'container.'). - Several values in one string: append
:Nxxpieces to title/actionbar (the number ofxis the digit count, and the trailing:marks the end). When reading, skip the first N bytes as in(#data - '%.26s' * #data - ':'). Example: to read:2xinxCore:0x:1x:2x:, use%.12s. -(substring removal): several researchers said it removes every occurrence.:20:10 - ':'gives2010, and if the delimiter appears again in the payload the data breaks. One user wrote that it removes "only the first occurrence" ('abcdef' - 'cd'givesabef), but this example alone does not tell the two apart. In practice, design the data so the delimiter does not repeat. Measured: on Windows 1.26.65.1'xaxbx' - 'x'wasaband'abab' - 'ab'was an empty string, so "every occurrence" is right (record).- Containment idiom:
((#t - 'x') = #t)means "does not contain", and(not ((#t - 'x') = #t))means "contains". Several prefixes:((#t - 'A' - 'B') = #t)(contains neither). It is more efficient to write chained subtraction in one expression. Watch for prefix collisions (custom form 1vscustom form 10) and compare exactly with=where possible. Empty string handling:(... = #t) or (#t = ''). - When a string starts with a number or symbol: on Windows 1.26.65.1 results starting with
-,+, a digit,#,/or<left the label empty, and results starting with a space or:showed as they are. A result starting with#is read as a property name, and one starting with a digit as a number. Fix: put a harmless character such as§ror a letter in front. Examples:('§z' + (#a + '/' + #b)),combo:§r123. A/in the middle showed without doubling.>and\were not measured (record). - Breaking in long expressions: adding a subtraction (
- ' ') sometimes breaks the string multiplication inside one expression. Split it into several view bindings. On the other hand there is also advice to merge into one expression (more efficient than chained bindings), so it depends on the case. - Unstable variable insertion: using
$prefix + '1'inside a binding string failed in one case. Write a literal, or use$varalone. - Substitution (like a ternary): there are string tricks such as
((':' + (#value = '§4') + 'Option 1') - ':falseOption 1' - ':true')(the dynamic-N approach was reported to stop working after 1.21.130, but it worked in a Windows 1.26.65.1 measurement, measurement record). - String division: do not use it. Dividing a string by a number,
(#text / 100), froze the Windows 1.26.65 client (EXP-49). Several reports say string division kills the game. The report that#test / 'hi'counts occurrences (2026-06-03) was not measured. - Repetition and loops: repetition such as
'abc'*2is impossible. A binding loop trick (#searchcounter +('%.' + #search + 's') * #text) was shared, but dynamic N was blocked after 1.21.130 and it stops after about 20 repetitions. The string multiplication approach is preferred. Measured: on Windows 1.26.65.1(('%.' + #v + 's') * 'abcdef')(#vis'3') gaveabc, so dynamic N worked (EXP-43, record). The repetition count was not measured. - Character mapping and search: there is a case that built a lowercase mapping per character with a property bag and iterated it with
#iteratorto make a search box case insensitive. It lags when typing long input or erasing. The server form edit box search is case sensitive by default and works only for 1-byte characters. The recommended method is to hide a lowercase copy of each item and compare against it. Detecting the last typed character failed because of repeated characters. - No Unicode arithmetic: Unicode arithmetic such as
+ levelis impossible and only concatenation works. Map numbers to glyphs with property_bag.
Byte width
- Byte counts:
§= 2 bytes (3 was also claimed, but ya_rifat and bakedpotato confirmed 2), one§xpair = 3 bytes, a-z/0-9 = 1, Korean/CJK = 3, emoji/glyph/\eU123= 3 to 4 (UTF-8). Example:§a§№= 2+1+2+3 = 8. So%.Nscutting goes off when glyphs are mixed in. Use 1-byte characters (digits,;) for offset calculation. wiki:json-ui-intro#unicode-character-width.{community confirmed} - Boundary fix: in 1.21.130 the byte/character boundary behavior of
%.Nswas "fixed". Older versions could shift by +/-1, so splits tuned for older versions may need adjusting again. - Length prefix approach: a string packed with lengths in front, like
hover_chat003abc002de001f. The length is in UTF-8 bytes. There was a guess that, since it originally used a dynamic('%.' + #len + 's'), it most likely does not work after 1.21.130. Measured: on Windows 1.26.65.1 a runtime format with N from a binding worked (EXP-43, record). The length prefix approach itself was not measured.
String to number conversion
- Automatic conversion: a string starting with a digit (or
+/-) becomes an integer when used in arithmetic (1asdk= number,test1/§k1200= string).foo123bar - 'foo'becomes 123 (the trailing text is dropped).+ 0gives 0 as the default for empty text. - Number conversion:
* 1does not turn a string into a number. Use(#v - 0)and(0 + #v)(EXP-16, EXP-17). On Windows 1.26.65.1, with input'4',((#v + $zero) + 1)($zerois JSON0.0) was 5, so it became a number, while(#v + 1)concatenated to41. But the content log leftExpected variable not found in ancestor tree: '$zero'(record). - Removing the prefix gives an integer: subtracting a prefix string gives an integer:
((('%.4s' * #text) - ':') * 1). Do not put the numeric conversion multiplication in the same expression as the string operations; do it in a separate binding object. To keep a number as a string, put a character such as:100in front and remove it later. - 1.21.130 aux texture recovery: numeric conversion came back after manipulating the string once, as in
('%.10s' * #title_text)or(#title_text - ']'). - Number to string: wrap in escaped quotes:
('\"' + #num + '\"'). A float cannot be turned into a readable string. - 32-bit limit: integer parsing works only in the range -2,147,483,648 to 2,147,483,647. Entity ids can exceed this range. A string that starts with a number is converted automatically and fails, so pass the original string as is (
§c+ id is also rejected). Another method is to split it in two and join them by binding('\"' + #uuid1 + #uuid2 + '\"')to#entity_id.$max_text_edit_lengthis presumed to follow the 32-bit limit too. Measured: on Windows 1.26.65.12147483647 + 1was-2147483648(record). - Leading zeros / display of digits only: a bossbar name "55555" disappeared while "x55555" showed. ActionForm button text made only of digits is evaluated as a formula in custom JSON UI. Put a non-digit character such as
§zin front. Texture number prefix collisions (compass1vscompass10) are avoided with leading zeros likecompass001.
Floats and division
- Float literals: a float written directly in an expression may be truncated or rounded to an integer (
#text * 0.1). Put them in variables:"$one": 1.0,"$hundred": 100.0,"$fifty": 0.02.(#x / 1.0)crashed and#x / $oneworked. Measured: on Windows 1.26.65.1 a decimal literal with a leading digit was an integer (0.3is 0,1.5is 1,100.0is 100)..3was computed as a decimal (record). - Multiplying bare numbers: bare numbers written in the expression can be multiplied. On Windows 1.26.65.1
((#v - 0) * 2)gave 8 for 4 (record). - Integer division:
(x / 10)on a parsed string gives only integers. Multiply by a decimal held in a variable. Tiny offsets also gave the wanted value only when multiplied by a factor held in a variable. - Sending floats by title: send integer digits (for example
0005) and multiply by 0.01 for#alpha,#size_binding_xand#anchored_offset_value_x. Do not send a float directly such ashp:0.75. - Other calculations: there is a demonstration (ya_rifat) that computes an integer square root in one expression with the Babylonian method. Convert negative to positive with arithmetic, not strings.
Slider values and others
- Showing the slider value:
#slider_valueis a float.property_bag {"#value": 0}+(#value + 1 * (#slider_value > #value) - 1 * (#slider_value < #value))to#value, and then('Slider Value: ' + #value)to#text. - Adding numbers to a global binding: write
"source_property_name": "(#a + #b)"(date counters and so on). localize: the label default is"localize": true(the wiki says false, which is wrong). Text containing%is treated as a translation key, so to show75%give"localize": falseor send%%.
Passing data from script to UI
Channels
- Usable channels: title, subtitle, actionbar (
player.onScreenDisplay.setTitle/updateSubtitle/setActionBar,/title,/titleraw), chat, scoreboard (the sidebar/list display must be on), boss bar (only name and progress), inventory items (name, lore, durability), entity inventory, and the form's title/body/button text. Anything that changes on screen can be a trigger.{community confirmed} - The opposite direction: JSON UI cannot call a script or send an event. A script cannot read key input either. Workarounds are sending a chat message from a UI button and receiving it with
chatSend, a form submit, an item drop (button.drop_one/drop_all), and MCWSS + scriptevent. There is no button that runs/scripteventdirectly (hack-style packs exist). - Screen limits:
#hud_title_text_stringis only for hud_screen (a global binding that can be used anywhere). It cannot be read from other screens such as pause or emote. Scoreboard bindings are legacy and work on other screens too.debug_screen.jsonis drawn above every screen but has no title control.
Preserved title pattern (wiki preserve-title-texts)
- Basic form:
The consumer reads it with"data_control": {"type": "panel", "size": [0, 0],"property_bag": `{ "#preserved_text": "" }`,"bindings": [`{ "binding_name": "#hud_title_text_string" }`,`{ "binding_name": "#hud_title_text_string", "binding_name_override": "#preserved_text", "binding_condition": "visibility_changed" }`,{ "binding_type": "view","source_property_name": "(not (#hud_title_text_string = #preserved_text) and not ((#hud_title_text_string - $update_string) = #hud_title_text_string))","target_property_name": "#visible" }]}
source_control_name: "data_control"and(#preserved_text - $update_string). It was confirmed to still work in 2026-07.{community confirmed} - Placement rule: data_control usually goes directly into
root_panel(orhud_content) withmodificationsinsert_front/insert_back. Put the consumer as a separate control, not as a child of data_control. There is a report that updates stop under a parent whose visibility changes, but on Windows 1.26.65.1 a latch inside a parent hidden via the action bar still recorded a title sent while hidden (record). There is also a report that putting the data panel as a child of the bar image removed flicker. $update_string: declare it directly on the element that uses it (not on a child) and include the delimiter ("overlay:"). That$update_stringis substituted inside the expression also matches this wiki's measurements (BND-33). Do not put quotes in the value. To use#preserved_textin another binding, first re-export it with{source_control_name:"data_control", source_property_name:"#preserved_text", target_property_name:"#preserved_text"}.- Principle (ya_rifat):
#visiblebecomes true for one frame when a new title arrives. Use this as#keyto hold the previous value:#prev_value = (#prev_value * (1 - #key) + #changed_value * #key). - Hide at first: at first
#preserved_textis empty, so an expression such asnot ((x - 'k') = '0')can be true. Put((#preserved_text - $update_string) and not (#preserved_text = ''))on the target element, or check with= '1'. - Several slots: make a
data_control_templateand create an instance per slot such asdata_control0@data_control_template($update_string: "technique_slot_0"). Each name must be unique and there is no count limit. For overlapping images, use a separate data control per prefix such asimage1:andimage2:. - Toggling by command:
/title @s title overlay:textures/ui/xshows it and/title @s title overlay:hides it. Binding((#preserved_text - 'bar:hide') = #preserved_text)to#visible(hidden if that string is present) also works. - Limits: there is only one title at a time, so a new
/titlereplaces the previous one. A single title factory cannot permanently show several at once, so use other factories such as actionbar, subtitle and chat. You cannot stop the preserved title from disappearing when a normal title arrives (use another factory for fake titles). There is a report that/title @s cleardid not clear the preserved value (unresolved). It conflicts with packs such as Blurry's that already use the title. - When a server form opens: the preserved title is cleared when a form opens. Keep it by giving
third_party_server_screen@common.base_screenrender_game_behind: true,force_render_below: true,render_only_when_topmost: falseandcache_screen: false. - Repeating the same value: a new title with the same value is not detected by the
=comparison. Instead the factory is recreated for every title, so for repeated titles using preserved without a factory gives no flicker. - Trim on
#preserved_text: there is a report that cutting worked only on a binding named#preserved_textand failed on a copy of#hud_title_text_string.{single report}
Sending titles and flicker
- Removing the translucent box:
setTitle(text, {fadeInDuration:0, stayDuration:0, fadeOutDuration:0})or/title @s times 0 0 0removes the translucent background flicker. On the other hand there is a report thatstayDuration0 showed nothing and recommends 10 or more (this looks like a difference between display use and data use). The default title background can also be hidden with"hud_title_text/title_frame/title_background": {"texture":"textures/ui/transparent_background"}(this also fixes the black flicker of a progress bar). - Hiding the original title: put a
#visiblebinding((#text - 'hp:') = #text)intohud_title_text/title_frame(andsubtitle_frame) orhud_title_text/title_frame/titlewithmodifications(source_control_name: "title"). With several prefixes, chain-instead ofand, as in(#text - 'bar:' - 'utl:' = #text). To not use it at all, give"root_panel/hud_title_text_area": {"ignored": true}or"hud_title_text": {"ignored": true}.#hud_title_text_stringcan still be used afterward. - Several sends in the same tick: if you send several in one tick, only the last one remains or some are dropped. One user found that updating faster than 20 ticks was unstable. Fixes: keep a queue and send one per tick (
runTimeout(index)), split between title and subtitle, or bundle into one string and split in the UI (playerStats-16|10|7|36|2000). Pad fields to a fixed length (\t,.padEnd(100,"\t"),|) and strip with- '\t'to make extraction easy. - When the HUD is covered: even if the HUD is covered by the inventory, chat, a form or F1, title/actionbar are still processed. If there are heavy bindings, processing falls behind and stalls for a few seconds up to about a minute. Fixes: lengthen the update interval to 2 to 4 ticks, give the screen
render_game_behind/force_render_belowso the HUD keeps rendering, or put data_control inhud_content. - Long title lag: even a 10,000 character title was fine once the user bindings were reduced. The cause of lag is heavy UI bindings.
- Known bug: rendering with
#hud_title_text_string/setTitlehides the mob status effect bar (reproduced by two people, unresolved). There is also a case where the title-based HUD value cache was not refreshed after a dimension change.
Title-based display patterns
- Progress bar: send the title
bar:50,100, read the first value with((#preserved_text - 'bar:') + 0)and the second with((#preserved_text - ('bar:' + #progress + ',')) + 0).#clip_ratio = (max - value)/max, or(1 - (#value * $inverse_max)).clip_ratio0 is full and 1 is empty (the opposite direction). Block a prefixless/title ... 80from changing every bar with('%.3s' * #text = $update_string).$multiplier= 1/max (0.02 for max 50) or$max_value_binding.#progressmust contain only digits (no§zprefix). To empty it, send an empty title. - Clip precision: using
#clip_ratioon a nineslice texture is not pixel exact. For a bar that does not stretch, use$texture_type: "fixed"(fill direction left/right/up/down) and match the bar size to the texture size (20x18 to 40x36). If the texture jitters, set nineslice to 0, givekeep_ratio:false, or conversely give any nonzero nineslice value to stretch-fill. Reducing by 1px (["100%-1px","100%"]) removes the afterimage. Useclip_directionandclip_pixelperfect. - XP bar replacement:
#exp_progressto#clip_ratio, and for a loading bar#loading_bar_percentageto#clip_ratio. - Slot bar (heart row style): to show a value 0~20 as 10 slots, put 10 fixed-size slot panels in a horizontal
stack_paneland stack a background, a full image and a half image in each slot. In slot i (1~10) the full image takes the view binding((#v - 0) > 2i - 1)and the half image((#v - 0) = 2i - 1)as#visible(for slot 3,((#v - 0) > 5)and((#v - 0) = 5)). Pass the threshold as a$variable so one slot template builds all 10 slots. Without a fixed slot size the row shrinks, because a stack panel gives no space to hidden children (LAY-04). Put the background on a lowerlayerthan the full and half images.{single report} - Screen color filter toggled by title: a title such as
/title @s title ui_invertshows agradient_rendererpanel (layer 9998, size [1000,1000],insert_frontintoroot_panel, with(#hud_title_text_string = 'ui_green')bound to#visible). Give the color a low value such as[0, 0.1, 0, 0.7]. Clear the title/subtitle background with"hud_title_text/title_frame/title_background": {"alpha": 0}(for subtitle,subtitle_frame/subtitle_background).{single report} - Images and overlays: put a
#visiblebased on#hud_title_text_stringon the image, wrap it in a panel with"factory": {"name":"hud_title_text_factory","control_ids":{"hud_title_text":"img@hud.img"}}, andinsert_frontit intoroot_panel. One factory is needed per image. Wrap each array value in an object. Example of a conditional overlay:(#hud_title_text_string = 'camera')to#visible. - Full screen image: change the preserved label to
image, bind(#preserved_text - $update_string)to#textureand give"fill": true. Then sendtexture:textures/ui/Blackas the title. You can also build a texture path from text:('textures/ui/compass/' + #hud_title_text_string). Add a range check together:((#x * 1) > 0) and ((#x * 1) < 360). - Moving position: with the format
txt:<anchor_id>,<x>,<y>,<text>(anchor_id 0 top left to 8 bottom right), decide the display and offset per anchor id (confirmed on 1.21.123 stable / 1.21.130.26 preview). To hide, send an unused anchor id (for example 9).(#position_x * $percentage)to#anchored_offset_value_x. - Restarting animations: an animation starts when the element is loaded or created, not when visibility changes. A title factory recreates the element for every title, which restarts the animation. If a second title arrives before the animation ends, the element disappears (no workaround). To keep the element, make a new factory without destroy-at-end. A 3 second display is
{"anim_type":"wait","duration":3,"destroy_at_end":"hud_title_text"}. In this case always put{"binding_name":"#hud_title_text_string"}before the#visibleview binding. - Fade out: attach
{"anim_type":"alpha","from":1,"to":0,"duration":3}as"alpha": "@hud.alpha_out"and give the parent image"propagate_alpha": true. - HUD animation (Totem Forge): made with a sprite sheet
x.png+x.jsonand a hud_screen modification. It is triggered by a JSON payload such as/titleraw @s title {"rawtext":[{"text":"__tf_pop__:[\"ninja_totem_model\",\"pop_1\"]"}]}. A large sheet (x512, 60 FPS) stutters when first displayed. v0.8.2 uses the Script API (entityHurt, offhand first) instead ofplayer.jsondetection. - Using
/titleraw: translate/rawtext also works in the HUD title. Flags such as§h§0§2can be used as display keys. Example of sending several scores to the actionbar:titleraw @a actionbar {"rawtext":[{"text":"..."},{"score":{"name":"*","objective":"health"}}]}. Titleraw scores have no leading zeros, so pad them in the script before sending. On Realms,\nand§codes in/titlewere stripped differently from singleplayer.
Actionbar
$actionbar_text: it can be read only inside the parent the actionbar factory created. Convert it to a binding withproperty_bag: {"#ab_text": "$actionbar_text"}. The actionbar itself has no binding, so it cannot be preserved (it cannot be used together with the preserved template).- Custom elements: connect a custom panel to
hud_actionbar_text_factoryas incontrol_ids: {"hud_actionbar_text": "sidebar@hud.sidebar"}. To hide text with a!prefix, put"visible": "(($var_actionbar_text - '!') = $var_actionbar_text)"onhud_actionbar_text. - Pseudo signal: the script sends
/title @s actionbar a<N>, and a child inside a"$atext": "$actionbar_text"panel gets"visible": "($atext = $tok)"to show the Nth frame. Hide the original actionbar with"visible": "($atext = ($atext - 'a'))". Put thevisibleexpression on the frame element, not on the actionbar.((($atext - 'a') * 1) = $index). Several alpha steps give a fade. - Hive-style scoreboard: send
'§C' + score count + '§S§T' + scoresas the actionbar. Each score is padded to 100 characters with\t. A modified hud_screen.json parses it with'%.Ns' * #text. Keep scores at 10 or fewer (binding lag), and putting a'§r'prefix in the expression makes values that start with an operator display too. It replaces the actionbar entirely and the position is fixed. Doing it by command requires padding bytes by hand for every value combination. - Moving position: the actionbar and title can be moved with JSON UI but their original use must be given up.
\tdoes not work for centering, so align with spaces. There is a report that emoji did not render. One example moves the actionbar to the top right by givinghud_actionbar_textin namespacehudanchor_fromandanchor_totop_rightandoffset[-20, 20].{single report}
Chat
- Hiding chat_screen messages:
insert_fronta binding intomessages_text/text:{"binding_type":"view","source_property_name":"(not('%.7s' * #text = '!addUI:'))","target_property_name":"#visible"}. Or('@' + #text - '!' = '@' + #text). To hide outside the chat screen too, attach the same to hud_screen. There is also an example built with#chat_visible+(#chat_visible and not ('%.12s' * #text = $trigger_text)). - Hiding several phrases: to hide toasts and join/leave messages, subtractions must be nested in order:
((((('§␛' + #text + '§r') - ('§␛' + 'toast.')) - ' joined the game') - ' left the game') = ('§␛' + #text + '§r')). Separately writtenandclauses failed. - Rendering to the HUD: use
control_ids: {chat_item: "x@hud.x"}onchat_item_factory, and bind#chat_text/#textin thechat_text_grid/chat_gridcollection (for example(('%.5s' * #text) = 'clUI.')). You cannot use#textdirectly at the factory root, so put it in a child or wrapper. The containment check is(not (('@' + #text) - '§1' = ('@' + #text))). - Limits: to keep a message visible you must resend it every tick. Hidden messages also count toward the 50 chat message limit and push out real messages. Hiding only the display still counts toward max children, so remove them with the
"destroy_at_end": "chat_grid_item"animation made by the inner factory. There is also a "destroyer" pattern that sends a second message and clears the panel withanim_type: wait+destroy_at_end. - Fixed messages and order: put two factories (normal + flag) inside a stack panel. An example of dynamically pushed notifications is on bedrock-resources.vercel.app ("chat message notifications"). Toast/notification UIs stack factories by offsetting them by their own size (texture first, text later). Chat notification icons use a file path instead of aux, and give hud_screen
render_only_when_topmost: trueso they do not cover other screens. - Flipbook trigger: you can trigger by chat without title or actionbar. Strip the marker from
#chat_text(binding_condition: once) and extract the number with(0 + (('%.8s' * (#string - ('%.0s' * #string))) - '\t')). However, this number cannot be put into an animation property. - "Expected a number" warning: this warning in chat_grid_item comes from a custom chat modification with a broken binding (
§zcharacter corruption).
Scoreboard and boss bar
- Scoreboard: JSON UI cannot read scoreboard values directly and sees them only through the vanilla sidebar/list elements.
/scoreboard objectives setdisplay sidebar <name>is required. Usecollection_name: "scoreboard_scores"on acollection_panel, a childcollection_index: 0, and the label binding#player_score_sidebar(collection), and put this wrapper in the hudroot_panel. Only one scoreboard is visible at a time, so put several values in one objective and pick by index. The sidebar content is the same for all players in vanilla. - Related bindings:
#objective_sidebar_name(sidebar title),#player_list_title(list display. The world name if there are no scores),#list_has_display_objective. These two work only on the HUD/pause screens and not in server forms. Other players' names use acollection_name: players_collectiongrid +#gamertag.scoreboard_sidebar_playeraccepts%keytranslation keys when"localize": trueand does not accept plain text. - Boss bar: only the boss name and progress reach JSON UI, but since they are numeric they are a better data carrier than the scoreboard. Show
$boss_nameof the collectionboss_barswith"text": "$boss_name"(empty on Geyser). Hiding the display:((1 - #progress_percentage) > $limit)($limit0.667). The grid offset is overwritten by root_panel, so apply it with"root_panel/boss_health_panel/boss_hud_panel/boss_health_grid". A custom boss bar is made with json-ui orminecraft:boss. There is no dynamic bossbar API, so it is imitated with a dummy entity that follows the boss health (this also avoids the bug where the bossbar does not update after changing the boss name).
HUD customization
Basics
- Adding elements:
"root_panel": {"modifications": [{"array_name":"controls","operation":"insert_front","value":[{"test1@hud.test1":{}}]}]}. The text element type islabel, nottext.labeldoes not taketexture, so use an image/panel. With a label size of["default","default"]a multiline title is visible, and with["100%","default"]it wraps. wiki:json-ui/add-hud-elements. - Text background: make the image the parent and the label the child, and give the image
"size":["100%cm + 6px","100%cm + 6px"]. - F1 behavior: pressing F1 hides
root_panel. Put overlays that must remain visible when the HUD is hidden outside the toggled hud panel. A button that hides all GUI is made with an F1 button mapping. - Outside the safe zone:
insert_front/insert_backdirectly into the screen element, or usescreen_bg_content, which ignores the safezone. - Keeping the HUD above other screens: give the screen definition
"render_only_when_topmost": false, "load_screen_immediately": true, "low_frequency_rendering": true, "render_game_behind": true, "force_render_below": true, "cache_screen": false. To show the HUD on the pause screen, give thepause_screenelement"force_render_below": trueor give hud_screenrender_only_when_topmost: false. Make the mob effects screen transparent withforce_render_below: trueso the HUD shows. - Control across screens: when another screen opens, HUD element rendering stops (the cause of odd actionbar display during the inventory animation). A toggle that controls an element must be on the same screen as that element. A "control panel" that crosses screens puts its own option panel on each screen. A custom button cannot open a custom screen (button ids are hardcoded).
- HUD input: the HUD takes input only in fixed input areas. HUD buttons can be pressed only on mobile (touch), and on PC/console you must open a form. A key bind cannot be mapped to a custom HUD button.
input_panelneedsprevent_touch_input: trueto be tappable. A mobile custom joystick/jump button example is in a community forum post (link omitted) (it still worked in 2026-02). - HUD interaction menu trick: in
debug_screen, map a key tobutton.access(opens dev_console_screen). Definedev_console_screenas an empty dummy, give itrender_game_behind,absorbs_input: false,always_accepts_input,always_listen_to_inputandforce_render_below, then map the same key tobutton.menu_exit. Give hud_screenalways_accepts_input,render_game_behindandalways_listen_to_inputas well. Then HUD elements can be operated with mouse and keyboard. Caution: when closing, a toggle under the cursor resets, and arrow_left blocks gamepad navigation, so use another button. - Other input workarounds: a button that opens a form from the HUD used the slot bar as an input bridge (alternatives: a form overlay with buttons, an NPC dialogue screen). A spell bar made from hotbar slots (slot 8 selected, slot 9 cast,
startItemUse/stopItemUse) works on all platforms but takes up slots. A pseudo custom keybind can be made with alt+key command shortcuts.
Vanilla HUD elements
- Health/hunger/armor position: edit
centered_gui_elements_at_bottom_middleand its_touchvariant (1.21.100+). For hearts,insert_frontintoroot_panel{"heart_rend@heart_renderer":{"offset":[2,2],"anchor_from":"top_left","anchor_to":"top_left"}}. The hunger renderer draws from the right, so wrap it in atop_middleanchor panel. Icon renderers (armor, hearts) cannot be used withclips_children. The heart direction depends on the UI profile (pocket goes down, classic goes up). - Hiding hearts:
"heart_renderer": {"ignored": true}(namespace hud).#visibleis bound, sovisible:falsedoes not work. Vanilla hearts are a custom renderer, so you cannot read or edit states (poison, freezing). The only way to get custom hearts is to drive an element you built yourself with title/actionbar. - Hotbar: vanilla has 9 to 10 duplicated hotbars (
exp_progress_bar_and_hotbar3 variants,centered_gui_elements_at_bottom_middle,_touch,not_centered_gui_elements,_pocket). To move only the XP bar you offset the nested controls, but rebuilding from scratch is better. Change the slot count withgrid_dimensions([columns, rows]) ofhotbar_gridandinventory_grid, and give the hotbar"bindings": []so the dimension bindings do not overwrite it. The hotbar slot control name isgui_hotbar_grid_itemin hud_screen (nothotbar_panel). Using the safe-screen slider raises the hotbar. - Armor and offhand in the HUD: projecting entity geometry onto
live_player_renderercan show armor and offhand in the HUD with a resource pack alone. The offhand shield durability cannot be obtained with Molang or UI bindings (remaining_durabilityis not possible). - Hiding hotbar slots: changing
centered_gui_elements_at_bottom_middleto leave onlyhotbar@hotbar_chooserremoves health/hunger. Make the end caps and lock textures transparent, and in the script revertplayer.selectedSlotIndexinworld.afterEvents.playerHotbarSelectedSlotChange. To block only slot clicks and keep the ellipsis, use"gui_hotbar_grid_item/hotbar_slot_button": {"ignored": true}. Custom clients can change packs, so block hidden slots with barriers. - Mappings per creative mode: to change button mappings by
#is_creative_mode, remove the mappings from hud_screen and put size [0,0]input_panels underhud_content/$additional_screen_content(somewhere not hidden by F1), each given its mapping and#visible. Changing mappings withmodificationsdid not work (1.21.130). - Inventory items in the HUD: copy the hotbar item code and change
collection_index(0-8 hotbar, higher is inventory. Offhand/armor are not possible). An empty slot has#item_id_aux= -1 (or 0). The hotbar item name is read with#hover_text(#item_textexists only in the item name factory). It goes briefly empty on interaction, and you must strip color codes. - Crosshair: the cursor renderer inverts colors and is hidden in third person. To prevent inversion, fix its material (a pack with a non-inverting crosshair was shared). There is also a case that deleted the existing crosshair texture and drew a new crosshair as a UI element to get a solid, non-inverting crosshair (the method was not made public). Per-item crosshairs are made with JSON UI animations, and to change speed per bow you would have to keep sending titles, so one case used a fixed animation. Attaching a model to the player is not recommended because of screen shake and lighting. There is a case where raising the actionbar element in hud_screen removed the vanilla crosshair and it was replaced with a text "+". The crosshair file moved from
hud_screen.jsontoui/hud_crosshair_overlay.json(first mentioned 2026-05-25, confirmed 2026-10-15). A trick that takes the mobile interaction button that appears when aiming at an entity and uses it as a crosshair indicator works on all platforms. - Mob effects: use type
custom, renderermob_effects_renderer,#status_effects_visibleto#visible, and pixel offset"offset": [0, "40px"]. There is a report that the Y offset does not move well withroot_panel/mob_effects_rendererorreplace. There was a bug where the effect renderer did not draw vanilla effects even without changing the UI (2026-05 to 06, recovered by restart). Hiding effect icons is possible only with JSON UI. - Coordinate text: to push it down,
insert_beforeplayer_positioninto"root_panel/chat_stack"with{"spacer":{"type":"panel","size":[0,10]}}(offset does not work).#player_position_textcan be used in the hud and chat screens. Some packs hide coordinates with the title prefixcoords:. Forcing coordinates to show is in the player geo + render controller domain. - Other HUD bindings:
#gamertag(hud/pause/scoreboard),#show_survival_ui,#hud_text_background_alpha(accessibility text background opacity to#alpha),#hotbar_visible,#hotbar_visible_not_centered.#player_name,#player_healthand#player_max_healthdo not exist. - Other HUD elements: the item name background is
"item_name_text_root/item_text_aligner/item_text_control/item_text_background": {"texture": "..."}. The hotbar ellipsis is thehotbar_elipses_panel_right_art/slottexture. The mobile HUD alpha fade is prevented by fixing the root panel binding. The interaction button cannot be removed, only its texture emptied. The subtitle UI issubtitle_panelin hud_screen (it used to be caption_frame). Related elements aresubtitle_grid_item,subtitle_label,subtitle_direction_labelandsubtitle_container_content. The 1.21.13x subtitles reuse the chat layout, the arrow is hardcoded in the text, and there is no display toggle binding. The health/hunger bars are in bedrock-samples hud_screen.json. A sidebar-style HUD is made with a pack that redraws/titleand/actionbar. - Hardcoded HUD: movement controls and the top right buttons cannot be changed. The debug/F3 screen cannot be modified (only text can be moved with the
special_renderoffset in debug_screen.json). The frost overlay (thefrozen_effecttexture can be replaced but cannot be triggered), spyglass, pumpkin,/camerafade, totem animation, effect rendering, panorama and splash text are not JSON UI either. There was an answer that the dimension change background also cannot be fixed.{single report} - Hiding the HUD (script):
onScreenDisplay.setHudVisibility(HudVisibility.Hide, [HudElement.Health, ...]). There is a case that used hiding hearts while riding a horse to imitate a first-person camera offset.
Layout, controls, textures, fonts, animation
Size
- Size syntax:
"default", a number (px),"0px","0%","0%c"(sum of children),"0%cm"(largest child),"0%sm"(siblings),"0%y"/"0%x"(own height/width), and"fill". Sums also work ("75% + 12px"). The meaning of%cmis mixed between "largest child" and "minimum of the sum of all children". A size expression without units gives the error "Dangling number (no % or px in Size)". - Controls with no size: there is a report that they follow the size of the largest sibling.
{single report} - Meaning of
default:["100%","100%"]for most types, but["100%","100%c"]for stack_panel, the text size for labels, and["100%c","100%c"]for grid. - Auto fit:
"size": ["100%","default"]is better thanmax_size(it fixed scroll text that was being cut off). A popup fitted to a label is100%cm/100%sm + 8px. A button fitted to its child is["100%c + 5px", "100%c + 5px"]. For child size, width100%cmand height100%c. - Size bindings:
#size_binding_x/y(0..1 relative to the parent, 2.5 = 250%) and#size_binding_x/y_absolute(px). The element must have an explicit size placeholder such as"size":[0,0](property_bag alone is not enough), and the value must be a float, otherwise it crashes. Example:size: [0, 6]+(0 + #form_button_text)to#size_binding_x_absolute. The size can change only after reopening the screen. If the parent width is100%cit becomes 0. Pattern:property_bag {"#size_x_true":24,"#size_x_false":18}+('#size_x_' + #is_creative_mode)to#size_binding_x_absolute.{community confirmed} - GUI scale: fixed pixel sizes break at each GUI scale, so use
%. The GUI scale can neither be ignored nor read. The workaround is to send the scale setting through#title_textand put it into#font_scale_factorof every label.
Anchor and offset
- Anchor values: top_left, top_middle, top_right, left_middle (not
middle_left), center, right_middle, bottom_left, bottom_middle, bottom_right. An anchor is relative to the parent. Do not touch the inner anchor; set the anchor on the parent. - Anchored offset bindings:
use_anchored_offset: true+#anchored_offset_value_x/_y(no_z). The value is a ratio of the parent size (1 = 100%). You must setanchor_from/to, and you need a non-center anchor (top left is best) and a parent with a fixed size. With a center anchor it does not move (LAY-49). If the parent size is 0 the offset is also 0, so use 1,1. The_absolutevariant had no effect on Windows 1.26.65.1, so fit with a fixed size parent, anchor and percentages (LAY-49). There is a case where the offset was ignored in a replaced loom screen. - Plain offset bindings: a view binding that copies a
property_bagkey holding an array to#offsetmoves a static control. Putting only#offsetinproperty_bagdoes not move it (LAY-05). The alternative is"offset":"$offset"+variables. Offset also accepts a pixel string ("40px"). There is a case (title) where a vertical offset had to be a number. - Inside a stack panel: controls inside a stack panel ignore anchor and offset. Wrap the child in a
panel(and move or animate the image inside it) or move the stack panel itself. For bottom alignment, put asize: ["100%","fill"]panel as the first child.orientationapplies only to stack_panel. Ause_priorityproperty appeared (purpose unknown). - Layer: a higher
layerdraws on top and is relative to the parent. Without a layer, the one defined later is generally on top but this is not guaranteed.
Buttons and toggles
- Button texture variables:
$default_button_texture,$hover_button_texture,$pressed_button_texture,$locked_button_texture. Borders:$border_visible: false,$default_state_border_visible,$hover_state_border_visible,$pressed_state_border_visible,$locked_state_border_visible,$default_border_visible,$hover_border_visible.light_content_form_fitting_buttonusesnew_ui_form_fitting_button_panel, so these variables do not apply. Global removal: setfocus_borderalpha to 0 incommon_buttonsand remove thebordercontrol fromnew_ui_button_panel. - Button child states: a button uses
default,hoverandpressedchild controls. If you definehoverdirectly oncommon_buttons.light_text_buttonit overrides the other states, so definedefault/pressedtoo and name the hoverhover_text@common.hover_text. Bound textures are not passed to a template button ($default_button_texture), so bind separately on each default/hover/pressed/locked control incommon.button. Change the hover size withhover@$button_state_panelinui_template_buttons.json, and the pressed alpha withbutton_alphaofpressed@$button_state_panel. To place them side by side use anorientation: horizontalstack_panel. - Button sound:
"sound_name": "random.wood_click". There is no binding. A custom toggle rejectssound_name, so put"sound_name": "$sound_name"and"$sound_name|default": "random.click"in the ui_common.json toggle template and set it on each toggle. - Toggle template variables:
$default_texture,$hover_texture,$pressed_texture,$pressed_no_hover_texture(the name is misleading because pressed and hover are swapped).$toggle_default_state: true.$is_enabledpropagates to children. The settings toggle issettings_common.section_toggle_base.common_toggles.light_text_toggle,$toggle_view_binding_name. A toggle is read as a boolean from scripts. To replace whole per-state controls (for example a flipbook on hover), give$unchecked_control,$checked_control,$unchecked_hover_controland$checked_hover_control. - Radio group: the same
$toggle_name,$radio_toggle_group: true, and a unique$toggle_group_forced_index. To bind to vanilla state, use$toggle_binding_type: "global"+$toggle_state_binding_name(#is_recipe_book_layout,#is_survival_layout) and keep the name and index as in vanilla. You cannot deselect by clicking again, so put an invisible third toggle as "none". - Using toggle state:
source_control_name+#toggle_stateto#visible/#enabled. Counter:(1 * #toggle_state + #count)(it rises by 19 per click, so divide). A toggle has no on/off animation event, so substitute a button that uses$pressed_button_nameasplay_event. A toggle can also fire a mapping withbutton_mappings. A toggle that behaves like a button is made by stacking two toggles and hiding the checked one. On touch, buttons that need hover (drop) fail, so use a toggle. - Animation reset:
animation_reset_name: <button_id>resets the animation on click (and release). Put it on the element that has the animation. The pause screen animation plays only once, so reset it withbutton.menu_continue(orscreen_animation_reset). Hover animation: a button mapping that has onlyto_button_idand points to the animation'splay_event. To fire a pressed animation per button, build a per-index button id with"$pressed_element_name|default": "('button.custom_hover_' + $index)"and use it inbutton_mappingsandanimation_reset_name. consume_event: false: lets several elements respond to one input (input duplication).- Buttons that act on release: JSON UI buttons act the moment they are pressed, so on PC the pressed state never gets drawn. If the click is mapped to a fake button id with
"scope": "global", the engine sends that fake button again with its previous state, so press and release swap, and a second mapping turns that fake "press" into the real click. The button then acts like Ore UI: hold and release to activate, move the pointer off to cancel. The report came with a video and only part of the details were shared.{single report}
Images and textures
- Path rules: do not add
.pngto a texture path. A wrong path shows the black/purple missing texture (textures/misc/missing_texture.png, cannot be replaced)."texture": ""is drawn as an empty image, not the missing texture. There is a report thatallow_debug_missing_texture: falserecently broke. Check whether it is loading by comparing#texture_filewith 'loading' or with(#texture = ''). The engine cannot know whether a texture exists. - Background without art: use
textures/ui/White+color(RGBA allowed).textures/ui/whitewith the wrong case showed as a box. Imagecoloris a tint, so the base for a color animation must be a white texture. A rainbow is made by chaining animations ([1,0,0], [1,1,0], [0,1,0], [0,1,1], [0,0,1], [1,0,1], [1,0,0] in order). Color values are RGB 0-1 (divide by 255). The 4th alpha of a labelcolordid not work on a button border, so usealpha. - Stretching:
keep_ratio: falsereleases the ratio lock, andfill: truefills while keeping the ratio. A full screen image usesfill: true/keep_ratio: false+ size 100%, but inside a fixed size parent it cannot be a 100% screen. With"tiled": falsethe whole image shows without tiling at the top left. A ratio-scaling image property was newly added in 1.21.13x.grayscaleseems to have been silently deprecated. - Nineslice: put a
.jsonnext to the texture. Examples:{"base_size":10,"nineslice_size":4},{"nineslice_size":1,"base_size":[4,4]},{"base_size":[x,y],"nineslice_size":[l,t,r,b]}. Setbase_sizeto the actual texture size. The element'snineslice_sizeis effectively deprecated. Corners do not stretch, so a button whose size changes with a label inside a nineslice can be made. Hover texture distortion and full screen overlays are also fixed with nineslice. The default size of a texture cannot be read. - No rotation: image rotation is impossible. Use a pre-rotated texture or a flipbook (nineslice is not possible). 3D is imitated with size and offset. Putting a large image such as 700x700 into a small space can crash. A UV sprite sheet can be used without animation via
uvanduv_size. - Other render effects:
gradient_renderer(color1/color2 are Vec4 RGBA. A transparent fade is from[1,1,1,1]to[1,1,1,0]) is always a rectangle, so stack several 1x1s.color1/color2cannot be changed by binding (neither#color1nor#colortook effect in game, ANI-39). To change colors, lay a white-to-transparent texture as animageand bind#color, or prepare one gradient per color and choose with#visible. Blur is impossible (no frame access). Color inversion filter:"ui_fill_gradient:ui_base": {"blendSrc":"OneMinusDestColor","blendDst":"OneMinusSrcColor"}inmaterials/ui.material+ afill: truegradient_renderer. Only existing UI materials can be modified. A Java-style cooldown bar was made client-side with inverted blending and a single title call.{single report}A full game screen filter (red, fullbright, color inversion, stackable) is made by keeping a custom material entity attached 8 blocks above the player and drawing it with alive_horse_rendererhidden in hud_screen (the entity id is preserved with a raw title. It is also visible in F1). Anti-aliasing must be 1, and on mobile a separate center-aligned renderer is used because of diagonal breakage. Black and white did not work. Example: t17x xFiltersDemo.mcaddon. This filter also works in Vibrant Visuals (VV). For multiplayer, a filter entity per player found by a tag holding the player id was proposed (no multiplayer measurement).{unverified}A similar filter can be made with theserver-graphicsscript module too, but it is VV only. - Clipping problems:
clips_childrencreates subpixel gaps, especially in windowed mode."allow_clipping": falselets it escape the scroll clipper. The thin line in the HUD chat background also appears in windowed mode. Giving the default chat_panelclips_children: truepushes the chat up. There is a problem where an empty bar does not render under a tiled image parent. - Hiding elements:
ignored: truedoes not process the element, so it performs better thanvisible: false(processing continues, FPS cost).modificationsremovedeletes after parsing, so the result is the same. To hide only itself and keep the children, usealpha: 0+propagate_alpha: false. Child alpha is multiplied by the parent alpha.
Text, fonts, translation
- Fonts: only fonts in the font metadata can be used. Register a TTF with
font/font_metadata.json(keep the vanilla entries); it works only in a global resource pack and needs a restart (the png is cached). TTF, including MinecraftTen, gets edge lines that can only be hidden, not fixed. The Noto Sans font type issmooth. There is a binding#font_type. - Font size: use
font_scale_factor(extra_large is about 4x). Use only one offont_sizeandfont_scale_factor, and the factor is recommended (1 = normal). 0.5 to 0.8 looks odd at some resolutions. The glyph size is hardcoded in the glyph sheet. Large glyphs break on Switch. The MinecraftTen line height is about 10px for the first line and 11 to 12px after, and text offsets with small values are unstable.font_scale_factorcannot be animated or given as a vector. Fill characters missing from a thin font by replacingglyph_00.pngwith the normal font. - Glyph color: color codes apply to files below glyph_E0 (E0+ are emoji and take no color). Example: glyph_1A (blank), default8. You can make recolored glyph copies + a character_map with a script. Multi-font (MinecraftTen/Five style) glyphs do not take
§colors, but you can put color into the glyph itself. There is a bug on console where a custom glyph renders as a different emoji. Glyph pngs: github.com/Cermada/missing-bedrock-rp-files. "Input keys" glyphs work in chat but did not render in JSON UI labels. Write a button glyph inside a translation string as:_input_key.xxx:(https://wiki.bedrock.dev/text/input-keys). - Glyph resolution: a glyph sheet is 256x256 with 16x16 glyphs by default, and a 512x512 sheet renders larger 32x32 glyphs (not compressed).
- Shadow: turn on a label shadow with
"shadow": true. The shadow color cannot be changed, so overlap a darker label offset by 1px at layer -1. - Color codes: a new color code such as
§zcannot be created (hardcoded). Vanilla colors are in_global_variables.json. To write the§character as is, use§§. Overlapping colors cannot be extended. Changing the text color of the whole screen with a single/titleworks only with format codes or conditional elements. - Translation: a label can concatenate keys like
%item.diamond_sword.name §7%enchantment.damage.all. Strings made with binding operations are not translated. Keys containing:(custom block names) were not translated. A lang string inside an expression needs a%prefix + surrounding spaces:('§9~/§b ' + '%advMode.previousOutput' + ' .bat'). Using lang keys directly in comparisons lets you build readable multilingual forms without a prefix symbol system. For translations with arguments, one report says a view binding fromtranslate('key', #a, #b, #c)to#textworks, and another says JSON UI has notranslate/witharguments. Measured: on Windows 1.26.65.1(translate('gui.ok', #v))gave an empty result (record). - Label lang trick: attaching a
§code tag to a villager name in the lang file lets you detect the profession in the trading screen (('textures/ui/trading/professions/' + ('%.12s' * #name_label))to#texture). The biome cannot be known. A replacement texture for renamed villagers is handled with the formulas12*(1-#val)/6*#val.
Animation
- Types:
anim_type:size(notscale),offset(percentage values allowed),alpha,color,wait,flip_book,aseprite_flip_book.play_event/end_eventcan fire a button id ("end_event": "button.something").destroy_at_end; delay withwait+next. - No bindings: bindings cannot be used on animation properties (
duration,fps,frame_count). Attach the animation as a property value ("offset": "ns.offset_anim") and keep the binding on the element. Make separate panels with different animations per case and choose by string. Animation progress cannot be read. Animations cannot play sounds (player entity animations can).{community confirmed} - Triggering without a title: you can start an animation chained with
play_event/nextfrom a hotbar item's#item_id_aux/#item_name(changed by give, replaceitem, clear), form title or button text,#chat_textfrom tellraw, andbutton_mappings/toggle events. Example:{"anim_type":"flip_book","initial_uv":[0,0],"frame_count":20,"frame_step":32,"fps":20,"reversible":false}. To animate a whole panel, attach it to the parent and give children percentage sizes. - Size animation: when animating the element
size,from/tomust both be vectors (for example from [112.5,100] to [225,200]). To change only the width,from [0,"100%"]to["100%","100%"]. A typewriter effect is made with a size animation or clips_children + offset. A button sparkle is an offset animation, not a flipbook. - Flipbook:
"anim_type":"flip_book",frame_count,frame_step(pixel width/height of one frame),fps,initial_uv,orientation("horizontal" default, "vertical". Not in the docs). Give the imageuv_size= one frame size anduv: "@ns.anim", anddisable_anim_fast_forward: true. Remove duration/easing/nextso the whole sheet is not shown. The sheet must be one row or one column. To stop, use"looping": false, and to restart, connect the first frame at the end. The referenced namespace must equal the animation file'snamespace. A large sheet (5800x200) is heavy, and it restarts when the element's visibility or alpha keeps changing. The cause of the brief flicker at start is unknown. One opinion is that JSON UI flipbook is limited to about 30 frames. - Aseprite: export the sprite sheet JSON as Array, not Hash, and put it next to the PNG with the same name.
aseprite_flip_bookusesinitial_uvanduv_size.initial_uvgave "unknown property" in thehudnamespace in 1.21.114. Using it with nineslice failed.{unverified}wiki:json-ui/aseprite-animations. - GIF and video: GIF/video is Ore UI only. JSON UI has
animated_gif_rendererfor in-game files (it needs the full texture path). BlockMotion Studio converts MP4/GIF to a menu background mcpack. For a cutscene effect, one suggestion is to pre-render it, export a PNG sequence and play it in the HUD screen UI.{single report}A mouse-driven parallax background is only a hack with many hover-animation buttons and it lags. The loading animation duration is a variable, not a binding, so it cannot be changed dynamically.
| id | Source | License | Commit | Accessed |
|---|---|---|---|---|
private-research | Private research (-) | - | 2026-11-13 |