Screen hosts and data channels
Concept: hosts and channels
A resource pack's JSON UI cannot create a new screen. It attaches to a vanilla screen the engine already knows how to open and only changes the look. This screen is called a host, and the values the script sends to the host (a form's title, body and button text, title, actionbar and chat strings, numbers in chest slots) are called data channels. Design starts with "which host gives me the interaction and update method I need".
The most common setup is the server form host. The script opens a form with ActionFormData and puts a prefix in the title.
import { ActionFormData } from "@minecraft/server-ui";
new ActionFormData().title("wiki_form:main").body("Body").button("OK").show(player);
On the pack side (RP/ui/server_form.json, the same structure as the Bedrock Wiki's server form modification tutorial), add to main_screen_content a second factory that borrows vanilla server_form_factory by name, show my panel only when the title has the prefix, and put the negation of the same condition on vanilla long_form to prevent overlap.
{
"main_screen_content": { "modifications": [ { "array_name": "controls", "operation": "insert_back", "value": [
{ "my_factory": { "type": "panel", // The name must differ from server_form_factory
"factory": { "name": "server_form_factory", // Required: the form data is tied to this name
"control_ids": { "long_form": "@server_form.my_panel",
"custom_form": "@server_form.my_custom_panel" } } } } ] } ] },
"long_form": { "modifications": [ { "array_name": "bindings", "operation": "insert_back", "value": [
{ "binding_name": "#title_text" },
{ "binding_type": "view", "source_property_name": "((#title_text - 'wiki_form:') = #title_text)",
"target_property_name": "#visible" } ] } ] }
}
A modal form is called custom_form inside server_form.json, and long_form and custom_form are both put in the factory's control_ids. The wiki recommends putting all your screens inside one my_panel rather than placing the same factory several times. The rules of this chapter widen the host on this skeleton to title detection (HOST-03), hiding (HOST-04), creating only the chosen screen (HOST-06), using entries as a data channel (HOST-07), and then modal forms, chests, NPC dialogue and the HUD. (Source: bedrock-wiki)
A resource pack cannot create a new screen. It attaches to a vanilla screen that already exists (the host), and decides what to draw by the data (the channel) the script sends to that screen. Which host you choose is the first decision of the design.
Choosing a host
| Host | How to open (script) | Data channel | Changing values after opening | Input | Cases |
|---|---|---|---|---|---|
Action form long_form | ActionFormData | Title #title_text, body #form_text, entry strings and textures (form_buttons) | Not possible (must reopen) | Pressing an entry gives selection | BC, BA |
Modal form custom_form | ModalFormData | Title, row labels and defaults (custom_form) | Not possible | Native fields, formValues on submit | BC |
| Chest screen | Custom entity/block inventory | The numbers of slots (item ID, count, durability, color), the title is the nameTag | Possible (immediately when slots change) | Slot actions, button.drop_one | BC |
| NPC dialogue | dialogue open command | Dialogue text #dialogtext, button names (student_buttons_collection) | Not possible | A dialogue button runs a command | AP |
| HUD title | setTitle | #hud_title_text_string, $title_text of the created control | Possible (recreated when sent again) | Mouse hover and scroll with always_accepts_input | BA, AP |
| HUD actionbar | setActionBar | $actionbar_text | Possible | None | VN |
| HUD chat | sendMessage | #chat_text (chat_text_grid) | Possible, a control is created per message | None | AP |
- [HOST-01] Choose the host by the interaction and data update method you need. Menus and lists are an action form, input forms a modal form, a chest screen if values must change while it stays open, and notifications the HUD (title = one, chat = several). If it must follow a 3D position, it is not JSON UI (chapter 12).
{working pack, measured, inferred}(Source: BC chapter 4, BA, AP chapter 6, DI chapter 5)
Action form (server_form.json)
The vanilla structure (1.26.50.4):
third_party_server_screen@common.base_screen ($screen_content = server_form.main_screen_content)
└ main_screen_content (panel, size [0,0])
└ server_form_factory (type: factory, control_ids: long_form / custom_form)
├ long_form@common_dialogs.main_panel_no_buttons ($text_name = #title_text)
│ └ … long_form_dynamic_buttons_panel (factory "buttons", collection form_buttons,
│ #form_button_contents -> #collection_length)
└ custom_form … (factory "buttons", collection custom_form)
- [HOST-02] Every server form opens as the single screen
server_form.third_party_server_screen. A pack cannot route to another screen file, so it branches by title inside this screen.{vanilla, measured}(Source: VN server_form.json:9-33, BC-S8) - [HOST-03] There are two ways to detect the title. Prefix:
(('%.13s' * #title_text) = 'corev0009core'). Containment:(not ((#title_text - 'CUSTOMUI:BA') = #title_text)). A containment check allows metadata (a count, etc.) to be attached after the title. Either way, make the flag long and unique.{code (source), working pack}(Source: BC 4.1-(1), BA chapters 2 and 3.4, BW-form, BW-title) - [HOST-04] There are two ways to hide the vanilla form. Each has pros and cons, so choose to fit the situation.
{code (source), working pack, inferred}(Source: BC 4.1-(1), BA chapters 2 and 10)
| (a) Appending bindings (BC) | (b) Wrapping + replacing control_ids (BA) | |
|---|---|---|
| Method | insert_back a view binding "visible if it is not my title" into the bindings of long_form and custom_form | Wrap long_form in a hiding wrapper and change control_ids.long_form of main_screen_content/server_form_factory to the wrapper |
Another UI pack replaces long_form wholesale | Whether the binding attaches to that pack's definition depends on pack order | The wrapper wraps the final merge result, so it is safe |
| With other add-ons using the same method | It is modifications, so it accumulates | control_ids is a property override so only the later pack remains [inferred] |
- [HOST-05] Make my screen by
insert_back-ing intomain_screen_contenta second factory that borrows vanilla'sserver_form_factoryas is. Both react to the same form data, and by visibility (or length) only one shows.{code (source), working pack}(Source: BC 4.1-(1), BA chapter 2, BW-form, BW-intro) - [HOST-06] If you have several screens, do not attach them all with
visible; create only the chosen screen (COL-10). bedrock-core puts"#route_<title>": ["screen id"]in theproperty_bagof acollection_paneland puts the result of a dictionary-like lookup with('#route_' + #title_text)into#collection_lengthto create only that cell. This dictionary lookup was confirmed in bedrock-core only by code and tests, and a Bedrock Wiki tutorial shows the result of the same mechanism (('#list' + #choice)) with game screenshots (COL-23, third-party record). Creating 0 or 1 cells with a computed length itself was measured.{code (source), measured}(Source: BC 4.1-(2), BC-S11, BW-dyn screenshot) - [HOST-07] Entry = data channel. Carry values in the action form entry string (
#form_button_text). Give a pressable cellcollection_details+ theform_button_clickmapping (COL-04, INP-04), and a cell that only reads values acollectionbinding without a mapping (even withcollection_details, without a mapping it is not pressed). If the pressable cells go first (in document order) and the value channel after, the button numbers do not change even when the text count changes.{measured, code (source)}(Source: BC 4.1-(3) and (4), BC-S1) - [HOST-08] Fixed-width records. If you carry several fields in one entry, fix the byte widths like
[kind 4][tab 2][frame 24]…, and have the encoder (script) and the UI generator read one spec file together. Remove the padding character ($) and reserved characters from the body, and give number fields a letter prefix (EXP-15).{working pack}(Source: BA chapter 3) - [HOST-09] Position-independent tokens. Several booleans are put anywhere in the string as
~+ an uppercase group + a lowercase bit (~Fo,~Xa) and read with a containment check (EXP-07).{working pack}(Source: BA 3.3) #form_textwas not readable from controls inserted undermain_screen_content(a label withtext: "#form_text"was empty) and was readable insidelong_form. Insidelong_form, the body marker check (EXP-07) worked on multi-line text. With the bodyfirst line, a line break, andsecond line ~x,((#form_text - '~x') = #form_text)was false (marker found); two lines without the marker gave true, and one line with the marker gave false (Windows 1.26.65.1, measurement log).{measured}- [HOST-10] If you reopen a form, the scroll returns to the top and there is no way to set the position. Make tab switching and accordions as "submit the form, then reopen in that state", and put the open section at the front of the list to avoid the scroll problem. If it is canceled with
UserBusybecause of another screen (chat, etc.), retry at intervals of a few ticks.{working pack}(Source: BA chapters 4 and 7)
Modal forms
- [HOST-11] The native fields of a modal form (toggle, slider, dropdown, input) are drawn by the engine. The pack takes the place and puts in it a template that has the same bindings as vanilla (
#custom_toggle_state, etc.,collection_details). The pack draws the submit button and maps it tobutton.submit_custom_form.{code (source), vanilla}(Source: BC 4.2, VN server_form.json:283-321) - [HOST-12] A slider must not be placed statically. It validates state at creation, so even if a slider of another screen is created hidden, it raises the
_setCurrentStep/_setPercentageassert. For sliders, have the factory that routescustom_formby row type create one only when a slider row exists.{measured}(Source: BC-S8, BC-S9) - [HOST-13] A pattern of switching pages by the selected value of a hidden dropdown (field 0) inside one modal form,
('%.4s' * #dropdown_option_text), has been introduced. The point is that#custom_dropdownis the open state, not the current selection. There is no record of confirmation in game.{unverified}(Source: MJ chapter 8-5)
Data prefix convention
- [HOST-14] Number of channels. The HUD title channel is one, so when another add-on calls
setTitlemy overlay and toast are overwritten. Chat creates a control per message so several notifications stack. Chat is right for notifications that can overlap, and the title for a status display where only the latest value is needed.{working pack}(Source: BA chapter 6, AP 4.5 and chapter 6) - [HOST-15] When using the title, titles, chat and dialogue text as data channels, attach a unique prefix (
_r4ui:,CUSTOMHUD:ba_toast:,corev0009core) and with that one prefix decide at once "hide the vanilla display, turn on the custom display". All three packs use this convention. If another add-on sends with the same prefix it gets hidden, so make the prefix long enough.{working pack}(Source: AP chapters 3 and 6, BA chapter 6, BC 4.1)
Chest screen (chest_screen.json)
- [HOST-16] Of entity inventories, only
container_type: "container"goes tochest_screen.json, and it opens only ifprivate: false.inventory_size: 54also goes tosmall_chest_screen, not a large chest, and draws only 27 cells, but cells that are not drawn are still read by bindings and updated in real time. Even 200 cells worked.{measured}(Source: BC-facts) - [HOST-52] When an entity is pressed, the client decides whether its container may open from three checks: the player's container-open permission (judged from the order of player abilities); when the inventory component's
restrict_to_owneris true, the entity must have an owner and that owner must be this player; and for a command-block kind of container, an extra permission.privateis not among these checks, so the measuredprivate: falseof HOST-16 appears to be decided in the server-side open handling. The inventory component reads six keys:container_type,inventory_size(default 5),can_be_siphoned_from,private,restrict_to_ownerandadditional_slots_per_strength. Whenrestrict_to_owneris false, the check is the same whoever presses. Keeping one menu entity per player with that player as owner so that others cannot open it is an inference and was not tested (how to set the owner was not checked either). This was read from the Android 1.26.52.3 and Windows 1.26.63 clients.{code (binary), inferred}(Source: NB (no number in the findings index)) - [HOST-17] Slots expose numbers and tooltip text.
#hover_textis read per slot and updates at once in the open screen, and it holds the name, vanilla description lines, lore and the lock notice line in tooltip format. The group name is empty. The screen is identified by the custom item'smax_durability(signed 16 bits, 1..32767), read through#item_durability_total_amount(#item_durability_current_amounthas the same value while unworn).#item_durability_maxis not a slot binding. Vanilla#item_id_auxhas a range that shifts with the number of custom items (the range differs by version: 256 and above up to 26.30, 852~883 in 26.50, measured 853 and above on 1.26.63, ANI-06, item numeric ID plan), and an empty slot or an item with no durability fails every durability gate.{measured, conflict}(Source: BC-facts, BC-S14, BC 4.3-(1), BW-ids, conflict C-33, EML) - [HOST-18] The chest screen content redeclares
small_chest_screeninchest_screen.jsonto change$screen_content(MOD-11), and the vanilla label and grid are hidden with a slot 0 identifier binding (COL-05). Forsmall_chest_panel_top_half, where controls are declared directly,insert_backis safe. Touch screens also go topocket_containers.small_chest_panelin the same file.{measured, code (source)}(Source: BC 4.3-(2), BC-facts) - [HOST-19]
$container_titleis the entity nameTag and can be used in text but not in binding expressions. Do routing with slot values. In the code it receives the actor name for an actor container and the block side name for a block container, so it is not only for entities. The value is not a string but an object with the keys__string,__rawtextandvalue, so a direct comparison does not match (FILE-28). The only place that unwraps the object into itsvaluestring is the property value resolver, and it unwraps only when the whole property value is a single$name. A$container_titlewritten inside an expression is looked up by the expression parser as the object itself, and=with only one side a string is true only when both are falsy (EXP-34), so a direct comparison with a non-empty object is always false whatever the name is. Because__rawtextis true, avaluestarting with(is not computed as a constant expression. On Windows 1.26.65.1,text: "$container_title"(localize: false) was the name for the named chestRE9Box, the chest boatRE9Boatand the donkeyRE9Donkey,container.chestfor an unnamed chest,container.chestDoublefor a large chest, and(1 + 2)for a chest named(1 + 2). The direct comparison was false whether or not there was a name. Workaround:"property_bag": { "#t": "$container_title" }puts the unwrapped string into#t(BND-28), so a binding expression can compare it as a string. In the same measurement(#t = 'container.chest')on the unnamed chest and(#t = 'RE9Box')on the named chest were true, and('T' + #t)gave the name as is, such asTcontainer.chest,TRE9BoxandT(1 + 2).{measured, code (binary)}(Source: BC-facts, 2026-11-23 Windows 1.26.65.1 decompilation, 2026-11-24 decompilation, 2026-11-25 Windows 1.26.65.1) - [HOST-20] A script-side caution: there is no lock mode that makes slots read-only (poll and restore is the only way). If you refill a slot while the player holds the original, it is duplicated. The cursor can be read and cleared with
PlayerCursorInventoryComponentbut is not filled on touch.setDynamicPropertythrows on stackable items, so mark them with lore.{measured}(Source: BC-facts) - [HOST-53] The chest screen cannot read the sidebar and title channels. Even right after a sidebar was sent, the global
#objective_sidebar_name,#player_name_sidebarof thescoreboard_playerscollection and#hud_title_text_stringall read empty. Send the text of an entity chest menu through slot item names (#hover_text, HOST-17).{measured}(Source: SG, Windows 1.26.65.1)
NPC dialogue screen (npc_interact_screen.json)
- [HOST-21] The dialogue text is the screen ID. Compare
#dialogtext(a global binding) to switch between my screen and vanillanpc_screen_contentsby visibility. If you wrap the vanilla content, ordinary NPC dialogue keeps working. Thescene_tagof the dialogue file (the name the command opens) andtext(the value the UI sees) may differ.{working pack}(Source: AP 4.2) - [HOST-22] Use dialogue buttons (
student_buttons_collection) as tabs and menus. If you choose the look by button name (#student_button_text) and not by index, the UI does not break even if you reorder the buttons in the dialogue file. When pressed, the dialogue's command (/scriptevent, etc.) runs throughbutton.student_button.{working pack, vanilla}(Source: AP 4.3, VN npc_interact_screen.json:1180-1261) - [HOST-23] Tell "closed by tab switching" from "closed by the user" with the dialogue's
on_close_commandsand tags (a tab button attaches a tag, and the close command cleans up only when there is no tag).{working pack}(Source: AP 4.3) - [HOST-24] The NPC that opens the dialogue is an invisible entity (scale 0, invulnerable) placed near the player and opened with
dialogue open @e[...] @s <scene>. The claim that scene buttons in a dialogue file are limited to 6, and the claim that NPC structure NBT extends it to 9, were not confirmed.{working pack, unverified}(Source: AP 4.2, MJ chapter 7)
HUD (hud_screen.json)
- [HOST-25] To draw the HUD over another screen, give the screen below
force_render_below: trueandscreen_draws_last: false, and the HUDscreen_draws_last: true(other screens such as the bed screen are sent below the same way).{working pack}(Source: AP 3.1, AP-samples in_bed_screen.json, BW-doc) - [HOST-26] Put a custom HUD layer not inside vanilla
root_panelbut in the background mount slot$screen_bg_contentthatcommon.base_screenprovides. Then even if the whole vanilla HUD (root_panel) is hidden, my layer remains.{working pack, vanilla}(Source: AP 4.4, VN ui_common.json:6349 and 6507) - [HOST-27] HUD title channel: place one more
hud_title_text_factoryin my layer and hide the vanilla title (hud_title_text) when it has my prefix. Put the hiding binding on the wholehud_title_text. If put only ontitle_frame, the sibling subtitle (subtitle_frame) does not hide and text can flash briefly (a known problem of BA 2.0.3, the 2.0.5 fix is unconfirmed).{working pack, inferred}(Source: BA chapter 6, AP-samples hud_screen.json) - [HOST-28] If a control created by the title factory receives
$title_text(and$subtitle_text,$actionbar_text) with|defaultand decides withignoredandvariables.requires, tabs and items that will not show are not created at all, so it is light. When the title is resent, the control is recreated. The Windows 1.26.65.1 code supports this only partly:$title_textand$subtitle_textare plain strings, so they work in any expression.$actionbar_textis an object, so when the whole value is a single variable, as inrequires: "$actionbar_text", it is decided on the unwrapped string, but inside an expression such asrequires: "($actionbar_text = 'x')"it looks always false (thisrequiresverdict is inference and was not measured). To decide with an expression, put it into a copy variable first (HOST-48). Depending on client settings these variables may receive the filtered text sent by the server instead of the original (the table of variables the engine provides in the files and definitions chapter).{working pack, code (binary)}(Source: AP 4.1, 2026-11-24 decompilation) - [HOST-29] Chat channel: if you place one more
chat_item_factorywith the same name as the vanilla HUD chat in my layer, a second list is created from the same chat data. Hide my messages in two places:messages_textof the chat screenchat_screen.json, and the HUD'schat_grid_item(the chat lines over the screen).{working pack}(Source: AP 4.5) - [HOST-30] The HUD actionbar control is created by
hud_actionbar_text_factoryand receives its text through the variable$actionbar_text. If you put inroot_panela second factory namedhud_actionbar_text_factory("control_ids": { "hud_actionbar_text": "hud_actionbar_text@myns.definition" }), when an actionbar is sent my control is created along with the vanilla actionbar, and the label inside receives$actionbar_textas is.{vanilla, measured}(Source: VN hud_screen.json:2143-2160 and 3406, TP) - [HOST-31] In 1.26.50 the HUD subtitle changed to
subtitle_container_factory. Recheck HUD modifications that depended on the subtitle position.{vanilla}(Source: VN hud_screen.json:3340, MJ 4.1)
HUD wrapper and form title exclusion
- [HOST-32] The wiki's standard HUD approach is to
insert_frontone wrapper panel intoroot_panelofhud_screen.json. If you give the wrapper nosize, it receives the parent (screen) size so children's anchors and percentages work relative to the screen. For a layer that must remain even when the vanilla HUD is hidden (F1, hidingroot_panel), put it in$screen_bg_contentof HOST-26.{unverified, working pack}(Source: BW-hud, BW-best, AP) - [HOST-33] To exclude several custom form titles at once, chain subtractions: if
((#title_text - 'formA:' - 'formB:') = #title_text)is true, the vanilla form shows. On Windows 1.26.65.1 this expression was false for the titlesformA:xandformB:yand true forplain(measurement record).{measured}(Source: BW-form)
Server form screen frame and sidebar channel
The DF measurements of the three rules below were taken on Windows 1.26.52 on the research server (a Go server made with Dragonfly), with a structure that draws several screens with one server form.
- [HOST-43] If you give
third_party_server_screen"$screen_animations": []and"$background_animations": [], the form appears immediately without animation. If the next form arrived while the window was moving, the two windows looked overlapped, and a menu that closes and reopens flickered.{measured}(Source: DF) - [HOST-44] To draw a screen frame behind a server form, change
$screen_bg_contentofthird_party_server_screen(outside the safe zone, not pushed during screen transitions). The HUD is not drawn while a form is open, so to make the HUD's frame visible over a form, draw it here too. A#title_textbinding in this place set tooncewas evaluated before the form content arrived and did not show. To draw the HUD together with the form, put"force_render_below": trueonthird_party_server_screen. The HUD was then drawn behind the form, and titles and latch values that arrived while the form was open updated. Adding"screen_draws_last": trueonhud_screendrew the HUD on top of the form.screen_draws_lastalone did not draw it (measurement record).{measured}(Source: DF, 2026-11-18 Windows 1.26.65.1) - [HOST-45] The sidebar scoreboard is a HUD channel that does not overlap with the title: attach a marker to the objective name and partial markers to each line, change
scoreboard.scoreboard_sidebarto a whole-screen panel, and draw each part in a different place with ascoreboard_playerscollection stack (#scoreboard_sidebar_sizeto#collection_length). The client merges lines with the same text, so distinguish them by appending§r, up to 15 lines.{measured}(Source: DF)
The modal form multiselect row
- [HOST-46] If you put
{"type":"multiselect","text":…,"options":[strings…],"default":[numbers…]}in the modal formcontent, the 1.26.52 client draws it with vanilla UI (textis the head button text, and pressing it shows a checkbox list). At that position in the response array comes an array of chosen numbers ([0,2]), andnullif none is chosen. The default checks are given as an array of numbers in the singulardefault, anddefaultswritten in the binary schema is ignored. Even 25 options were all drawn, and even if you put several or mix with other rows, the response positions follow thecontentorder. It cannot be sent with the Script API, so only servers that send a rawModalFormRequest(Dragonfly cannot put it inform.Custom, so as a raw packet) can use it.{measured, code (binary)}(Source: MS, NB-16) - [HOST-47] The 1.26.60 preview vanilla wraps
custom_multiselectinoption_genericto add an upper label (#custom_text) and tooltip, and changes the head button text to#multiselect_option_text. The 1.26.50 version has no place for the upper label and tooltip. A pack that redraws this row or changes thecustom_formfactory should putmultiselectincontrol_idsand recheck per version.{vanilla}(Source: MS, VN server_form.json:294 and 503)
Entity chest screens
The E2048 measurements of the rules below were taken on mobile 1.26.63 with the entity inventory 2048 test pack. The setup is in sections 2.2 and 8 of Building menu screens from an entity inventory.
- [HOST-48]
$container_title(the entity nameTag) cannot be used in binding expressions (HOST-19), but it can be compared inignoredandvisibleproperty expressions. Declare a copy variable such as"$copy": "$container_title"in the definition and compare the copy.ignoredis evaluated in the parent scope (FILE-34), so the copy variable goes on the parent control. When picked withignored, the control is not built for chests with another name. Measuring withvisiblein an unnamed chest on Windows 1.26.65.1 gave the same: the direct comparison was false and the comparison through a copy variable was true.$actionbar_textwas the same: after/title @s actionbar xyz, in a label built by the action bar factory,"text": "$actionbar_text"wasxyz,($actionbar_text = 'xyz')was false and($copy = 'xyz')with"$copy": "$actionbar_text"was true. Why the copy works in the code: each$key of a definition goes through the property read into the local scope, and the object is unwrapped into itsvaluestring at that point. Values in avariablesblock go through the same resolution. On 2026-11-25 the named chest, chest boat and donkey also gave a false direct comparison and a true$copycomparison, and"text": "$copy"was the name as is. The copy is a plain string without the__rawtextprotection, so a name starting with(is computed as an expression. In a chest named(1 + 2),"text": "$copy"was not the3the code predicted but empty, with the warningJSON UI parse failure - expected a string.(FILE-48). Whether the result is the integer 3 cannot be seen with this method. Draw a name that may start with(directly withtext: "$container_title", and in binding expressions receive it with theproperty_bag#t(HOST-19) instead of a copy variable. In the same chest('T' + #t)wasT(1 + 2).{measured, code (binary)}(Source: E2048, 2026-11-23 Windows 1.26.65.1, 2026-11-24 Windows 1.26.65.1, 2026-11-24 decompilation, 2026-11-25 Windows 1.26.65.1) - [HOST-49] To put a window into the chest screen, do not redeclare
small_chest_screen; insert it into thecontrolsof the vanilla chest panels (chest.small_chest_panel,pocket_containers.panel) withmodifications. With two add-ons that redeclared the same screen, only one was used, by pack order (MOD-12, MOD-13). When several packs write the vanilla-hiding properties with byte-identical values, the result is the same whatever the pack order. The wiki examples all write the same values, comparing the shared prefix§b§wwith('%.6s' * $copy), and with the four examples on in one world each entity opened its own window.{measured}(Source: E2048) - [HOST-50] When the vanilla chest cells are hidden with
visible: falseand a window is drawn in their place, at the moment a slot item changes the cells of acontainer_itemsgrid were drawn grey above other controls for one frame. It flickered with no grid and with a grid ofcommon.pocket_ui_container_itemcells. With acontainer_itemsgridof 27 empty panel cells behind the window there was no flicker. The cause is not known. This result is from thevisible: falsehiding setup. With the setup that hides through a#visiblebinding reading a shared marker control, no flicker was seen even without a grid (section 8.3 of Building menu screens from an entity inventory, measured 2026-11-16). A similar-looking flicker can have another cause. On every press of a slot (an empty one too) the client empties#hover_text(the tooltip text) ofcontainer_itemsfor about 50 to 100 ms. Labels that read it directly, the#entity_idof alive_horse_renderer, and empty-slot silhouettes shown with(#hover_text = '')vanish or pop up for 2 to 3 frames on every press, with no packets exchanged with the server. Reading data slots through a BND-18 latch (the last non-empty value) and testing empty slots with(#item_id_aux < 1)removed the flicker. In this setup the grey grid flicker did not reproduce even without the empty-cell grid (InventoryMonitor, measured 2026-11-28 on Windows 1.26.65, about 140 frames captured at about 20 fps).{measured}(Source: E2048, 2026-11-28 Windows 1.26.65)
The shared convention of the server form examples
This is the setup the five server form examples of this wiki share. The full file is in section 9 of JSON UI optimization.
- [HOST-51] To use the server form screens of several packs in one world, do not redeclare
third_party_server_screen; insert your own router into thecontrolsofmain_screen_contentwithmodifications. Vanillamain_screen_contenthassize: [0, 0], so widen it to["100%", "100%"]. The wiki examples start every title with the shared prefix§b§wand write aserver_form.jsonthat hides vanillalong_formwith(not (('%.6s' * #title_text) = '§b§w')), byte-identical apart from the one router line. With the five examples on together in one world, each opened its own screen and worked, and the screens filled as soon as they opened with the router in this place too (COL-47).{vanilla, measured}(Source: VN server_form.json:22, mobile 1.26.63 measurement)
Complete examples
Examples A to D below were not run and confirmed in game by this wiki. They were newly written by combining the basis of the rule sections (HOST-xx) and the vanilla file structure. Recheck binding names, control names and collection names in your own version's vanilla UI files, and open them once on a real client before use. The verification level is {inferred}.
These are examples that bundle the rule sections one set per host. Names are examples. Recipes 1, 8 and 9 (the recipes pages) are the complete files for the action form, HUD title and chat, and here the modal form, chest screen, NPC dialogue and actionbar are added.
Example A. Laying my title line over a modal form (custom_form)
// RP/ui/server_form.json (a vanilla path)
{
"custom_form": { "modifications": [ { "array_name": "bindings", "operation": "insert_back", "value": [
{ "binding_name": "#title_text" },
{ "binding_type": "view", "source_property_name": "((#title_text - 'mymodal:') = #title_text)",
"target_property_name": "#visible" } ] } ] },
"main_screen_content": { "modifications": [ { "array_name": "controls", "operation": "insert_back", "value": [
{ "my_modal_factory": { "type": "panel", "size": [ "100%", "100%" ],
"factory": { "name": "server_form_factory",
"control_ids": { "custom_form": "@server_form.my_modal_panel" } } } } ] } ] },
"my_modal_panel": {
"type": "panel", "size": [ 240, 160 ],
"bindings": [ { "binding_name": "#title_text" },
{ "binding_type": "view", "source_property_name": "(not ((#title_text - 'mymodal:') = #title_text))",
"target_property_name": "#visible" } ],
"controls": [ { "bg": { "type": "image", "texture": "textures/ui/dialog_background_opaque" } },
{ "caption": { "type": "label", "text": "My modal form", "localize": false, "offset": [ 0, 8 ],
"anchor_from": "top_middle", "anchor_to": "top_middle" } } ]
}
}
import { ModalFormData } from "@minecraft/server-ui";
new ModalFormData().title("mymodal:settings").toggle("Sound effects", { defaultValue: true }).show(player);
- Add a "hide if my prefix is present" binding to vanilla
custom_formto prevent overlap (HOST-04 a). The prefix check is a containment check, so metadata may be attached after it (HOST-03). - A modal form is mounted with the
custom_formkey ofcontrol_ids(the same structure as the wiki's modal form modification). - To draw native fields (toggle, slider, dropdown, input) in my panel, put in a template that has the same bindings as vanilla (
#custom_toggle_state, etc.) and map the submit button tobutton.submit_custom_form(HOST-11). Do not place sliders statically; have them created only when a slider row exists (HOST-12).
Example B. Choosing my screen by chest slot 0
// BP/entities/menu_chest.json (gist): minecraft:inventory with container_type "container", private false, inventory_size 27
// Script: put a custom item 'my:menu_marker' with max_durability 777 in slot 0, and items for the cells from slot 1.
// RP/ui/chest_screen.json (a vanilla path)
{
"small_chest_panel_top_half": { "modifications": [ { "array_name": "controls", "operation": "insert_back", "value": [
{ "my_menu": { "type": "panel", "size": [ "100%", "100%" ], "visible": false,
"property_bag": { "#visible": false },
"controls": [ { "hello": { "type": "label", "text": "My menu", "localize": false } } ],
"bindings": [
{ "binding_type": "collection_details", "binding_collection_name": "container_items" },
{ "binding_name": "#item_durability_total_amount", "binding_type": "collection", "binding_collection_name": "container_items" },
{ "binding_type": "view", "source_property_name": "(#item_durability_total_amount = 777)", "target_property_name": "#visible" } ] } } ] } ] }
}
- The chest screen comes to
chest_screen.jsonwhen the entity inventory iscontainer_type: "container"andprivate: false(HOST-16). - Use the custom item's
max_durability(1~32767) as the screen identifier and read it through#item_durability_total_amount(HOST-17).#item_durability_maxis not a slot binding, so a condition on that name is not evaluated. - Hide the vanilla label and grid with a slot 0 identifier binding (HOST-18, COL-05). For
small_chest_panel_top_half, where controls are declared directly,insert_backis safe. - Slot values update immediately if they change while open. There is no lock mode that locks slots read-only (HOST-20).
Example C. Using NPC dialogue text as the screen ID
// BP/dialogue/menu.json : scene_tag "my_menu", text "my_menu:v1", button name "Shop" -> command /scriptevent my:shop
// Script: place an invisible NPC entity near the player and open it with a command
// dialogue open @e[type=my:npc,c=1] @s my_menu
// RP/ui/npc_interact_screen.json (a vanilla path)
{
"npc_screen_contents": { "modifications": [
{ "control_name": "teacher", "array_name": "bindings", "operation": "insert_back", "value": [
{ "binding_name": "#dialogtext", "binding_type": "global" },
{ "binding_type": "view", "source_property_name": "((#dialogtext - 'my_menu:v1') = #dialogtext)",
"target_property_name": "#visible" } ] },
{ "control_name": "student", "array_name": "bindings", "operation": "insert_back", "value": [
{ "binding_name": "#dialogtext", "binding_type": "global" },
{ "binding_type": "view", "source_property_name": "((#dialogtext - 'my_menu:v1') = #dialogtext)",
"target_property_name": "#visible" } ] },
{ "array_name": "controls", "operation": "insert_back", "value": [
{ "my_menu@npc_interact.my_menu_root": { } } ] } ] },
"my_menu_root": { "type": "panel", "size": [ 240, 140 ],
"controls": [ { "title": { "type": "label", "text": "My NPC screen", "localize": false } } ],
"bindings": [ { "binding_name": "#dialogtext", "binding_type": "global" },
{ "binding_type": "view", "source_property_name": "(not ((#dialogtext - 'my_menu:v1') = #dialogtext))",
"target_property_name": "#visible" } ] }
}
- Put the marker
my_menu:v1in the dialogue file'stext(the value the UI sees). Thescene_tag(the name the command opens) may differ (HOST-21). - Vanilla
npc_screen_contentsis apanelthat holdsteacher(the edit screen),student(the dialogue screen) and the close guide. Add a "visible only when the marker is absent" condition to thebindingsofteacherandstudent, and splice my panel in at the end of thecontrolsofnpc_screen_contentsasmy_menu@npc_interact.my_menu_root, shown by the opposite condition. If you hide the whole ofnpc_screen_contents, my panel spliced inside is hidden too, so hide only the two children. When the marker is absent, vanilla shows as is, so ordinary NPC dialogue keeps working. - The look of dialogue buttons is chosen by button name (
#student_button_text), not by index (HOST-22). The splicing step is the third operation in the example above. The namesteacherandstudentare the names ofcontrolsitems of vanillanpc_screen_contents(VNnpc_interact_screen.jsonlines 1486~1531), so recheck when the version changes. - A close by tab switching and a close by the user are told apart with the dialogue's
on_close_commandsand tags (HOST-23).
Example D. Receiving actionbar text with my control too
// RP/ui/hud_screen.json (a vanilla path)
{
"root_panel": { "modifications": [ { "array_name": "controls", "operation": "insert_back", "value": [
{ "hud_actionbar_text_factory": { "type": "panel", "size": [ "100%", "100%" ],
"factory": { "name": "hud_actionbar_text_factory",
"control_ids": { "hud_actionbar_text": "hud_actionbar_text@myhud.bar_label" } } } } ] } ] }
}
// RP/ui/myhud/bar_label.json (registered in _ui_defs.json)
{ "namespace": "myhud",
"bar_label": { "type": "panel", "size": [ "100%", 14 ], "anchor_from": "bottom_middle", "anchor_to": "bottom_middle",
"controls": [ { "t": { "type": "label", "text": "$actionbar_text", "color": [ 1, 0.8, 0.2 ] } } ] } }
player.onScreenDisplay.setActionBar("Score 120");
- If you put in
root_panela second factory namedhud_actionbar_text_factory, the same name as vanilla's, my control is created together with the vanilla control when an actionbar is sent (HOST-30). - Inside the control the factory created, the variable
$actionbar_textreceives the sent text as is. This example also draws the vanilla actionbar, so to hide it add the prefix convention (HOST-15) and a binding.
Proposed rules
Proposed rules
The rules below lack evidence or are not adopted yet. Check the evidence before using them.
- [HOST-34] (proposal) If you make the title flag by attaching
§to every character (§c§h§e§s§t§5§4§r), every character is consumed as a formatting code, so the flag does not show in the title even when there is no resource pack or the vanilla look is shown. The containment check (EXP-07) still works. Attach§rat the end to undo formatting for the following title.{working pack}(Source: Chest-UI constants.js, upgrader protocol.js) - [HOST-35] (proposal) When a title is detected by the exact match
(#title_text = 'exact value')rather than a containment check (for example, comparing whether the title is§r), it does not match if formatting codes or metadata are attached before or after the title (HOST-03).{working pack}(Source: merge report TLM, EasyUIBuilder) - [HOST-36] (proposal) Meaning of screen properties:
render_only_when_topmost(if false, draws even when covered),always_accepts_input(if true, input even when not on top),absorbs_input(if false, input goes to the game),is_showing_menu(if false, a resident UI like the HUD),should_steal_mouse(if true, hides the cursor),render_game_behind,low_frequency_rendering(low-frequency rendering),cache_screen(faster to reopen),close_on_player_hurt(closes on damage),load_screen_immediately,send_telemetry. Vanilla mostly uses the opposite of the default for these (HUD:is_showing_menu: false,should_steal_mouse: true,absorbs_input: false,low_frequency_rendering: true). Butshould_steal_mouse(false 3 / true 1) andlow_frequency_rendering(true 3 / false 1) show both values.{vanilla, unverified}(Source: NetEase documentation, VN hud_screen.json:3574, debug_screen.json:44, toast_screen.json:1775) - [HOST-37] (proposal) When putting my HUD layer outside vanilla
root_panel($screen_bg_content, etc.), if you attach to the layer root the same three global bindings as vanillaroot_panel(#hud_visibleto#visible,#hud_alphato#alpha,#hud_propagate_alphato#propagateAlpha), it follows the F1 hiding and the HUD opacity setting.{vanilla}(Source: VN hud_screen.json:3555, NetEase documentation) - [HOST-38] (proposal) The
$screen_contentofcommon.base_screenattaches inside the safezone matrix (variables_button_mappings_and_controls/safezone_screen_matrix/inner_matrix/safezone_screen_panel/root_screen_panel) to respect the screen safe zone, and$screen_bg_contentattaches outside it. The open and close animations are changed with$screen_animations: the default is 8 of offset+fade,[]means none, and"$background_animations"is alpha only (the HUD has 4 fades). HOST-43 has the measurement of the same variable.{vanilla}(Source: VN ui_common.json:6350 and 6747, hud_screen.json:3580, debug_screen.json:54) - [HOST-39] (proposal) In case there is no resource pack, put a fallback notice in the server form
body("The resource pack is off, so the default screen is shown") and do not draw the body in the custom screen. Hide the title flag by attaching§to every character (HOST-34). Map data-only buttons to no action (kind: none) so that pressing them on the default screen is harmless.{working pack}(Source: upgrader protocol.js) - [HOST-40] (proposal) For a multi-stage screen (choose, effect, result), open a new form with a changed title suffix code per stage (
MARKER + '§1'/'§2'/'§3'), and the UI picks the stage panel with an exact match(#title_text = MARKER§N). The script closes withuiManager.closeAllForms(player)after the effect time and opens the next form. The game screen can show for one frame between forms, so make player-visible state changes (inventory, etc.) a few ticks after the next form opens.{working pack, unverified}(Source: upgrader session.js) - [HOST-41] (proposal) If you redeclare
hud_title_textat the same path and overridealphawith a constant, the fade anddestroy_at_endchain is cut and the title stays until the next title (a fixed sidebar, a 2023 pack). On Windows 1.26.65.1, a constantalphaonhud_title_textalone let the title disappear when it ended, and only overridingalphato 1.0 onhud_title_text,hud_title_text/title_frame/title_backgroundandhud_title_text/subtitle_frame/subtitle_backgroundkept it until the next title (measurement record). It loses the vanilla title display, so prefer the HOST-27 method (one more factory).{working pack, measured}(Source: SP, VN hud_screen.json:2267-2273, 2026-11-18 Windows 1.26.65.1) - [HOST-42] (proposal) The display name of a scoreboard sidebar objective (
#objective_sidebar_name) can be used as a channel from the server to the UI: if the name is a set value, the sidebar look changes. The global binding#hud_title_text_stringcan also be read inside the sidebar. It is a pack based on 1.20.71.{working pack, unverified}(Source: SP)
The fixed-width fields of HOST-08 can also use a tab (\t) instead of $ as the padding character. A tab almost never overlaps with the body, and after taking it out you erase it with (piece - '\t') (Source: SLB).
| id | Source | License | Commit | Accessed |
|---|---|---|---|---|
repo-guide | JSON UI comprehensive guide (this repository) (guide/) | This project's material | 2026-11-13 | |
repo-bedrock-core | bedrock-core UI analysis (this repository) (bedrock-core/) | This project's material | 2026-11-13 | |
private-research | Private research (-) | - | 2026-11-13 | |
advancementpack | AdvancementPack (r4isen1920) | MIT (confirmed in the repository LICENSE, Copyright 2024 r4isen1920) | 0a79929 (analyzed v4.2, researched 2026-10-20) | 2026-11-13 |
repo-damage-indicator | Premium Damage Indicator analysis (this repository) (damage-indicator/) | This project's material (the analyzed add-on is third-party work; facts only, rewritten) | 2026-11-13 | |
mcbejsonuimasterai | mcbejsonuimasterAI | No LICENSE at the repository root (NOTICE.md contains only third-party MIT notices). Facts only, rewritten | 527276c | 2026-11-13 |
repo-testpack | JSON UI test pack and Windows 1.26.52 measurements (this repository) [source abbreviation TP] (guide/_testpack/) | This project's material | 2026-11-13 | |
bedrock-samples | Mojang bedrock-samples | Minecraft EULA applies, (c) Mojang AB. All rights reserved | 15701fa9 (guide baseline 46ba6ea) | 2026-11-13 |
repo-multiselect | Modal form multiselect research (this repository) (server-form-multiselect/) | This project's material | 2026-11-13 | |
netease-mcdocs | NetEase developer documentation (mc.163.com) | NetEase's work. No redistribution, facts only, rewritten | 2026-11-13 | |
bedrock-wiki | Bedrock Wiki | CC BY 4.0 (docs/licenses/CC-BY-4.0.md in the repository) | 0930b39 | 2026-11-13 |
repo-survey | JSON UI material survey (this repository) (survey/) | This project's material | 2026-11-13 |