Input, buttons and toggles
Input controls are the parts of a screen that receive the user's actions. This page covers three things.
- Buttons (
button): connect a press to a button ID withbutton_mappings. Button IDs are split into ones the engine understands (button.form_button_click,button.menu_exit, etc.) and ones the pack names arbitrarily. An ID the engine knows triggers an action (submitting a server form, closing), and an unknown ID does nothing but can still be used for in-UI events such as the animationplay_event. - Toggles (
toggle): buttons with an on/off state. A child control is defined for each of the 8 states (on and off x default, hover, locked, locked hover), and only the one matching the current state is drawn. The toggle state is read by other controls through#toggle_state. - Input boxes and focus: the targets keyboards and controllers point to are set with the
focus_*properties.
The smallest examples
Example 1. Making a close button with a vanilla button template. Reuse the vanilla template (common_buttons.light_text_button) with variables instead of building it yourself. If you give $pressed_button_name a button ID the engine knows, that action happens.
"close_button@common_buttons.light_text_button": {
"size": [ 64, 32 ],
"$button_text": "Close",
"$pressed_button_name": "button.menu_exit"
}
Example 2. Showing and hiding an image by toggle state. The toggle's $toggle_view_binding_name becomes the name of the toggle control, and other controls read its state with source_control_name and #toggle_state.
"my_toggle@common_toggles.light_text_toggle": {
"size": [ 64, 32 ], "$button_text": "Toggle",
"$toggle_name": "my_toggle",
"$toggle_view_binding_name": "my_toggle_state" },
"my_image": { "type": "image", "texture": "textures/items/apple", "size": [16, 16],
"bindings": [ { "binding_type": "view",
"source_control_name": "my_toggle_state",
"source_property_name": "#toggle_state",
"target_property_name": "#visible" } ] }
The Bedrock Wiki explanation (Buttons and Toggles) and button_mappings
Below is the original "Buttons and Toggles" of the Bedrock Wiki (bedrock-wiki 0930b39) (CC BY 4.0). It shows how to make toggles and buttons with vanilla templates, a content button that shows hover text, and playing an animation by button ID.
Excerpt: Buttons and Toggles · docs/json-ui/buttons-and-toggles.md · Bedrock Wiki · License CC BY 4.0 (docs/licenses/CC-BY-4.0.md in the repository) · Commit 0930b39Toggles
In this example, we will reference
ui/ui_template_toggles.json{"our_toggle@common_toggles.light_text_toggle": {"size": [64,32],"$button_text": "Click me!","$toggle_name": "wiki_toggle", // Required, but it has no effect unless a hardcoded toggle name is used."$toggle_view_binding_name": "wiki_toggle_state" // The toggle name that allows us to retrieve data.}}And that's it! You now have a working toggle. You can test it by adding it to any screen.
Additionally, you can utilize toggles to control the visibility of UI elements.
{"our_toggle@common_toggles.light_text_toggle": {"size": [64,32],"$button_text": "Click me!","$toggle_name": "wiki_toggle", // Required, but it has no effect unless a hardcoded toggle name is used."$toggle_view_binding_name": "wiki_toggle_state" // The toggle name that allows us to retrieve data.},"our_image": {"type": "image","texture": "textures/items/apple","size": [16,16],"offset": [0,20],"bindings": [{"binding_type": "view","source_control_name": "wiki_toggle_state", // // The toggle name specified in the $toggle_view_binding_name"source_property_name": "#toggle_state", // The binding data that returns the toggle state as a boolean value"target_property_name": "#visible"}]}}Buttons
Generally, buttons have limited functionality, as they are primarily used in hardcoded instances, such as navigating to a screen or opening a dialog.
In this example, we will reference
ui/ui_template_buttons.json{"our_button@common_buttons.light_text_button": {"size": [64,32],"$button_text": "Click me!","$pressed_button_name": "button.menu_exit" // Required, you can put in any global button names or hardcoded button names.}}And that's it! You now have a working button, clicking on it exits you to the current screen you're in. You can test it by adding it to any screen.
Advanced Buttons and Toggles
Hover Text
In order to make buttons that shows a text when you hover into it, we will need to use Content Buttons.
In this example, we will reference
ui/ui_template_buttons.jsonandui/ui_common.json{"our_button@common_buttons.light_content_button": {"size": [18,18],"$button_content": "namespace.our_button_content_panel", // Reference our content element."$pressed_button_name": "button.menu_exit" // Required, you can put in any global button names or hardcoded button names.},"our_button_content_panel": {"type": "panel","controls": [{"our_image": {"type": "image","texture": "textures/items/apple","size": [16,16]}},{// You can use any element but we'll just use the hover text when you hover an item in-game."our_hover_text@common.hover_text": {"ignored": "$default_state", // Required, this will make the element not visible if the button is in a default state or isn't hovered."property_bag": {"#hover_text": "" // You can put your text here. It doesn't support localizing so if that's what you are looking to do, create a custom hover text.}}}]}}Play Animation
If you want to play an animation when you click a button, you have to use
$pressed_button_namein your animation'splay_eventproperty.For example:
{"example_animation": {"anim_type": "offset","easing": "linear","duration": 2,"from": [0,0],"to": [-50,0],"play_event": "button.example_button_id"},"example_button@common_buttons.light_text_button": {"$pressed_button_name": "button.example_button_id", // use this button id in play_event property of your animation"$button_text": "Play Animation","size": [80,20]},"example_label": {"type": "label","text": "Example Text","anims": ["@namespace.example_animation" // add your animation here],"anchor_from": "top_right","anchor_to": "top_right"}}
The structure of button_mappings (Bedrock Wiki Intro and MS Learn)
button_mappings is an array of objects, and an item has from_button_id (the button ID that comes in as input), to_button_id (the ID to treat as actually pressed), mapping_type and the optional input_mode_condition (the same as the MS Learn ui_element reference table). If from_button_id is omitted, "pressing this control" itself is the input.
mapping_type | Meaning | Vanilla count |
|---|---|---|
pressed | When the control is pressed by click or touch | 599 |
focused | When the control received hover or focus first (for example confirming with Enter) | 145 |
global | When that key is pressed anywhere while the control is on screen | 536 |
double_pressed | When pressed twice | 20 |
"sample_button@common.button": {
"$pressed_button_name": "button_id",
"button_mappings": [
{ "from_button_id": "button.menu_ok", "to_button_id": "$pressed_button_name", "mapping_type": "focused" },
{ "from_button_id": "button.menu_select", "to_button_id": "$pressed_button_name", "mapping_type": "pressed" },
{ "from_button_id": "button.menu_up", "to_button_id": "$pressed_button_name", "mapping_type": "global" }
]
}
The mapping between button IDs and keys is in the INP-21 table (the wiki original). The wiki also lists controller mappings: button.controller_select X/A, button.menu_secondary_select Y, button.menu_exit and button.menu_cancel B, button.menu_up/down/left/right D-pad. It recommends supporting several input methods together. The input_mode_condition table of MS Learn has empty values, so follow INP-02 for values (vanilla tally: gamepad, gamepad_and_not_gaze, not_gamepad).
Buttons
- [INP-01] A button specifies per-state child controls with
default_control,hover_control,pressed_controlandlocked_control. Usually, rather than building one yourself, you reuse a vanilla template (common_buttons.light_text_button, etc.) with variables such as$pressed_button_nameand$button_text.{vanilla}(Source: VN default_control 34, hover_control 42, pressed_control 36, locked_control 18 uses, VN server_form.json:211) - [INP-02] An item of
button_mappingshasfrom_button_id,to_button_id,mapping_type(pressed599,global536,focused145,double_pressed20), and optionallyinput_mode_condition(gamepad,gamepad_and_not_gaze,not_gamepad) andignored.{vanilla}(Source: VN, Appendix B) - [INP-03] The button IDs the engine understands are fixed per screen.
{vanilla, working pack, measured}(Source: VN server_form.json:212 and 321, npc_interact_screen.json:1222, BC-S14)
| Action | to_button_id |
|---|---|
| Pressing an action form entry | button.form_button_click |
| Submitting a modal form | button.submit_custom_form |
| NPC dialogue button | button.student_button |
| Close | button.menu_exit |
| Dropping one from a chest cell | button.drop_one |
- [INP-04] To make a form entry pressable, give the two mappings
button.menu_select -> button.form_button_click(pressed) andbutton.menu_ok -> button.form_button_click(focused), and put acollection_detailsbinding on the button itself (COL-04).{code (source), working pack, vanilla}(Source: BC 4.1-(3), BA chapter 5, VN) - [INP-05] For a button that only detects hover (a tooltip) and does not submit, empty
button_mappingsor set$pressed_button_nameto a value the engine does not know ("unset") and receive only focus withfocus_enabledandfocus_magnet_enabled. To remove the click sound,sound_volume: 0.{working pack}(Source: BA chapter 5, AP 4.8) - [INP-06] The visibility of a button's default, hover and pressed state controls is owned by the button state machine. Put the app's visibility gates inside the state controls or outside the button, and do not let bindings and the state machine touch the same control.
{measured}(Source: BC-rules, BC 4.1-(6)) - [INP-07] For a disabled button, overlay a disabled copy that looks the same as the real (enabled) button and show only one with the same data (
binding_condition: "always"). The disabled copy must keep its disabled look even under the pointer.{code (source), measured}(Source: BC 4.1-(6), BC-rules) - [INP-08] Give the content layers inside state controls a higher value than the background (bedrock-core convention: background 1, caption and icon 12).
{code (source)}(Source: BC 6.5-3, BC-rules) - [INP-09] Inside a button template, button state variables can be used in expressions:
"visible": "($hover_state or $pressed_state)".{working pack}(Source: AP 4.8) - [INP-20] If you use a button ID in an animation event (
play_event,start_event), it plays when that button is pressed: button"$pressed_button_name": "button.my_anim", animation"play_event": "button.my_anim". Vanilla also has"start_event": "button.menu_achievements"once. It is an ID the engine does not know, so nothing goes to the server.{unverified, vanilla}(Source: BW-btn, VN) - [INP-21] Default key mappings (wiki table):
button.menu_selectleft click,button.menu_secondary_selectright click and Y,button.menu_okEnter,button.menu_cancelandbutton.menu_exitEsc and B,button.menu_up/down/left/rightarrow keys and D-pad,button.menu_autocompleteTab,button.controller_selectX/A,button.menu_tab_left/rightthe tab key and bumpers,button.menu_inventory_cancelthe inventory key. There is alsofrom_button_id: "any"(once in vanilla,gamepad_layout_screen.json). Measured in the server form screen (Windows 1.26.65.1 and mobile, 2026-11-19): left click and a mobile tap aremenu_select, right click ismenu_secondary_select, Esc and the mobile back action aremenu_cancel(menu_exitdoes not arrive), Enter ismenu_oktogether withchatandreturn, the arrow keys aremenu_*together witharrow_*,[]aremenu_tab_left/right, and E ismenu_inventory_cancel. Tab did not turn onmenu_autocomplete, andanydid not turn on for any input. Middle click (menu_tertiary_select), numbers 1 to 9 (slot1toslot9), Q (menu_inventory_drop), Ctrl+Q (menu_inventory_drop_all), Shift+click (menu_auto_place), T (chat), Z (mobeffects) and B (key.emote) also arrived (intercepting user input in InvUI).{measured, vanilla}(Source: BW-intro, BW-doc, VN) - [INP-33] There are 31
button.menu_*button IDs in the engine (includingbutton.menu_emote_slot_0to3). Those not in the wiki table of INP-21 arebutton.menu_tertiary_select,button.menu_auto_place,button.menu_inventory_drop,button.menu_inventory_drop_all,button.menu_inventory_cancel,button.menu_alternate_tab_leftand_right,button.menu_autocompleteand_back,button.menu_textcursorleftandright,button.menu_textedit_upanddown,button.menu_clear,button.menu_playandbutton.menu_edu_play. Measured in the server form screen (Windows 1.26.65.1, 2026-11-19),menu_tertiary_selectis the mouse middle click,menu_auto_placeis Shift+click,menu_inventory_dropis Q,menu_inventory_drop_allis Ctrl+Q andmenu_inventory_cancelis E, and Tab did not turn onmenu_autocomplete(intercepting user input in InvUI). Which key the rest correspond to is unknown.{code (binary), measured}(Source: NB chapter 4) - [INP-22] For gamepad and arrow key focus, name targets with
focus_identifierand specify the next target withfocus_change_up/down/left/right. To prevent leaving, useFOCUS_OVERRIDE_STOPas the value (226 uses in vanilla). At the container level, usefocus_container: trueandfocus_container_custom_*(other_focus_container_name,focus_id_inside).{vanilla}(Source: BW-doc Focus table, VN) - [INP-23]
follows_cursor: true(4 uses in vanilla) makes a control follow the cursor, anddraggable(vertical,horizontal,both,verticalonce in vanilla) makes a control draggable when given to a control that receives input (input_panel,button) together with a button mapping.not_draggableis also accepted and is the same as giving nodraggable. In a scroll view on the Windows 1.26.65.1 pause screen, ascrollbar_boxwith"draggable": "vertical"was sized to the content ratio and moved when dragged. A box that inherited it and overrode it withnot_draggable, and a box with nodraggable, both filled the whole track and did not move when dragged. A scroll box needsdraggable, andnot_draggableis only for turning off an inherited value.{vanilla, measured}(Source: BW-doc Layout table, VN) - [INP-47]
text_typeontext_edit_boxtakes three values:ExtendedASCII,IdentifierChars,NumberChars. With keyboard input on Windows 1.26.65.1, none of them filtered characters.Ab_9-x.y:Z /#$!é가went in as typed, and theNumberCharsfield of the vanilla command block also tookAb_9-. For number-only input, do not rely ontext_type; check the value in script after it arrives. Whether it picks the touch keyboard type was not checked.{measured, code (binary)}(Source: 2026-12-03 Windows 1.26.65.1 measurement and decompilation) - On iOS and Android, the on-screen keyboard not closing after submitting a JSON UI text input was fixed in 1.26.30. On earlier mobile versions this is not a pack problem.
{docs}(Source: ms-learn Update 1.26.30) - [INP-24] The
#hyperlinkof a button opens only what is in the engine's allow list (116 URLs that must match literally, INP-34). Custom URLs do not open.{code (binary)}(Source: NB-08, VN#hyperlinkuse) - [INP-34] A
#hyperlinkopens only if it passes the engine's allow list when the button is pressed. The list is 116 URLs that must match literally (87 ofhttps://www.minecraft.net/<language>/terms/r1~r3, 20 ofhttps://aka.ms/…, EULA, copyright notice, account settings, etc.). Only when some condition (appears to be an edition or platform decision) is true, URLs that start withhttps://education.minecraft.net/,https://aka.ms/orms-windows-store:also pass. URLs put in by a pack or server do not open, and even a URL in the list does not open if it differs slightly.{code (binary)}(Source: NB-08) - [INP-31] A server form button can be turned off. If you set the button template's
$pressed_button_nameto a name the engine does not know (button.df_noop), pressing it did not answer the form and the hover tooltip still showed (INP-05 confirmed in a server form). Use it on buttons that merely resend the same screen, such as the chosen tab or chosen cell.{measured}(Source: DF) - [INP-40]
always_listen_to_inputis a boolean read by types that take an input component (button,toggle,input_panel,screen,scroll_viewand others) and defaults to false. When true, the control goes into a separate list when it registers in the screen's input lists, and button input is delivered to the focused control, the normal list and then this list, in that order. The position check of apressedmapping passes when the pointer is inside the control's rectangle even without hover. So even when another control takes the hover (consume_hover_events), this control gets clicks inside its rectangle. Measurement candidate: overlap a panel withconsume_hover_eventstrue on a button with this key on, and see whether the button is pressed (prediction: pressed).{code (binary)}(Source: 2026-11-24 Windows 1.26.65.1 decompilation)
INP-40 was read from a decompilation of the Windows 1.26.65.1 client (2026-11-24) and was not measured in game.
Toggles
The 8 toggle state controls (vanilla names):
checked_control unchecked_control
checked_hover_control unchecked_hover_control
checked_locked_control unchecked_locked_control
checked_locked_hover_control unchecked_locked_hover_control
- [INP-10] A toggle draws only one child, the one the current state points to. If it enters an undefined state (for example hover), the control disappears, so define all 8 states.
{measured, vanilla}(Source: BC-S4, VN each of the 8 names 2 or more times) - [INP-11] For clicking to work, the toggle's own
button_mappings(button.menu_selectandbutton.menu_ok) are needed. Without them it is only drawn and cannot be pressed. On Windows 1.26.65.1 (2026-11-20)toggle_on_buttonandtoggle_off_buttonwere not needed: a toggle with only abutton.menu_selectmapping turned on with a click whether or not it hadtoggle_on_button. In the code,toggle_on_buttonandtoggle_off_buttonare used only whenenable_directional_togglingis true. The bedrock-core measurement (BC-S4, version not recorded) said these two were also needed.{measured, code (binary)}(Source: BC-S4, 2026-11-20 Windows 1.26.65.1 measurement and decompilation) - [INP-12] A radio group is made with
toggle_name(the group name),radio_toggle_group: true,toggle_group_forced_indexandtoggle_group_default_selected.{vanilla, measured}(Source: VN radio_toggle_group 59, toggle_group_forced_index 210, toggle_group_default_selected 24 uses, BC chapter 5) - [INP-13] Tabs that need no script: make a radio toggle group and put the tab content inside each toggle's
checkedstate control. There is no need to observe the state from outside, so nothing is sent to the server. It worked both under an action form and on a chest screen inserted withmodifications.{measured}(Source: BC-S4, BC chapter 5) - [INP-14] Between manual radio peers that share the same forced index, state is not mirrored reliably. Each input reads its own state. A native (modal form) radio shares the group's collection scope, so read values coming from the form with a separate data source and put the radio outside that index collection item.
{measured}(Source: BC 6.7-3 and 4, BC-rules) - [INP-15] Collapse/expand (Disclosure) is made with one toggle and a sibling that shows and hides following that toggle's state. A collapsed row pulling what is below up is thanks to the property that a stack panel gives no space to hidden children (LAY-04).
{code (source)}(Source: BC chapter 5) - [INP-19] In vanilla toggle templates (
common_toggles.light_text_toggle, etc.),$toggle_view_binding_namebecomes the name of the toggle control, so another control reads the state with"source_control_name": "<that name>"and"source_property_name": "#toggle_state"(61 uses in vanilla).$toggle_nameis required but is said to have no effect unless it is a name the engine knows.{vanilla, unverified}(Source: BW-btn, VN) - [INP-32] Vanilla
common.buttonandcommon.togglehavefocus_enabledon, so opening a form on a phone drew the first button in the hover state. Give every button of the form$focus_enabled: false, and radio toggles$toggle_group_default_selected: -1and$toggle_focus_enabled: false. A radio group is bound bytoggle_nameregardless of parent (INP-35). Acommon_buttons.light_content_buttonplaced in a chest screen also took focus, so the first one opened hovered with its name tooltip shown; the same$focus_enabled: falseremoved it.{measured}(Source: DF) - [INP-35] A radio group was bound by
toggle_name, not by parent. Even when 48 toggles of the same name were split into 6 horizontal stack rows, only one was selected at a time. Withtoggle_group_default_selected: -1, nothing is selected at first. Windows 1.26.65.1 gave the same result: with toggles of the sametoggle_namein two different parentstack_panels, clicking one unchecked the toggle in the other parent, and toggles created by a grid were also exclusive (measurement record).{measured}(Source: FFR) - [INP-36] Tabs and list selection inside a server form can be switched with radio toggles without going through the server. If you put that cell's detail panel inside the
checkedstate control of a cell toggle, only the detail changes when the cell is pressed and the form does not close. Only the actions that must be told to the server (the proceed button) are form buttons (button.form_button_click).toggle_group_default_selectedis a static value, so keep a separate layout per tab to open first and choose by title.{measured}(Source: FFR)
Input on the HUD, input on chests
- [INP-16] For a button drawn on the HUD to receive hover and scrolling,
hud_screenneedsalways_accepts_input: true. It was confirmed only with a mouse, and whether hover works with touch or a controller was not confirmed. On mobile, buttons on a HUD withalways_accepts_input: truedid not respond to touch (2026-11-19, measured by the user, intercepting user input in InvUI).{working pack, measured}(Source: AP 3.1) - [INP-17] To use a chest screen cell like a button, map every input (click, right click, shift click, Q, double click, gamepad) to
button.drop_one. Exactly one drops per press and the cursor does not change, and events arrive in the same tick in the orderentitySpawn, thenentityItemDrop(including the player).{measured}(Source: BC-S14) - [INP-18] Do not use the approach of picking up items with the cursor in a chest. An item held by the cursor is drawn directly by the engine and cannot be hidden with JSON UI. The BC record said the press disappears when the inventory is full, but on Windows 1.26.65.1 the cursor take request was sent even with a full inventory. In a setup where the server cancels it, the slot names emptied afterwards (INP-44).
{measured}(Source: BC-S13, BC 4.3-(4), SG, HSB) - [INP-37] In the chest screen, dragging a slider does not reach the server by itself. Put one hidden slot button per step next to the slider, visible only when
(#slider_value = k)(read from the slider withsource_control_name), and give it aglobalmapping frombutton.menu_selecttobutton.container_auto_place(consume_event: false). The current step then reached the server when the finger was released. A global mapping fires on a release anywhere on the screen, so the server ignores a repeated value. With several sliders on one screen the values mixed at times. The attempts and causes are in Building sliders with InvUI.{measured}(Source: IUC) - [INP-38]
consume_event: falseon a position basedpressedmapping did not let a control underneath receive the press (with the hidden step buttons on top the slider did not move, with the slider on top the buttons were not pressed). Withconsume_event: falseon the slider drag mapping, the slot button under the released finger was pressed as well, and even with the vanilla mapping the tap cell under the finger that ended a drag was pressed. The server therefore drops a tap cell press in the tick where the drag value changed{unverified}(mock only).{measured}(Source: IUC) - [INP-39] In chest slots with the vanilla slot mappings (including
button.shape_drawing), tapping an item slot on a phone and then dragging across other slots split the items into each slot crossed, and the server read each newly crossed slot almost every tick in order. Pressing and dragging in one move placed nothing, and crossing a slot again changed nothing. When the server emptied crossed slots, the rest was split into large piles and ran out quickly; refilling the source slot mid drag ended the drag. Use it for input that takes each slot once in first crossed order (a lock pattern). The setup is in Building enhanced components with InvUI.{measured}(Source: IUC) - [INP-41] Quick move
button.container_auto_placesends no request when all 36 slots of the player inventory it would move into are full. So a menu that receives slot presses through quick move (the slider buttons of INP-37, an Esc global mapping on a hidden slot) does nothing for a player with a full inventory.button.container_auto_place_one, which the vanilla pocket slot uses for taps, behaved the same, and with 9 empty inventory slots both sent requests (MPP). To work with a full inventory, use the hotbar swap (INP-42).{measured}(Source: SG, MPP, Windows 1.26.65.1) - [INP-42] Sending
button.menu_selecttobutton.slot_N(N is 1 to 9) from a chest slot button sends a request even with a full inventory. It is a swap of that slot's item with hotbar slot N-1 (destination ContainerID 28, Slot N-1), or a move when that hotbar slot is empty. Give the button acollection_detailsbinding and the mapping{ "to_button_id": "button.container_slot_hovered", "mapping_type": "pressed" }, and put it as a direct child of astack_panelthat hascollection_name(focus_enabled: falseworks). When the server cancels the request, the hotbar stays unchanged and the window's#hover_textsurvives, so the same window can be pressed again (SG). In a pure add-on (local world) the swap is accepted, so a script finds the button item in the hotbar slot and puts it back. The slot names kept reading then too (HSB). If the cursor holds an item, the cursor item becomes the source.{measured}(Source: SG, HSB, Windows 1.26.65.1) - [INP-43] One chest slot can carry nine buttons. Give nine buttons with the same
collection_indexone ofbutton.slot_1tobutton.slot_9each, and each button sends its own hotbar slot (0 to 8) as the destination, so the server or script tells the buttons apart by the destination slot. With the buttons touching each other, 36 real mouse presses sent only 19 requests; with a 6 GUI pixel gap between buttons all 36 went to the right destination. While the button item goes to the hotbar and back, one hotbar item sits in the chest slot for a moment.{measured}(Source: HSB, Windows 1.26.65.1) - [INP-44]
button.drop_oneand the cursor takebutton.container_take_all_place_allsend requests even with a full inventory. In a setup where the server cancels these requests, a few seconds after a drop or take request the client emptied#hover_textof every slot of that window. Number bindings such as#item_id_aux,#inventory_stack_countand durability stayed, the cause is unknown, and the names came back only when a new window (a new entity) opened (SG). In a pure add-on (local world) the slot names of the same window were still there 20 seconds after 13 drops (HSB). In the same local world, seven variants (drop_oneanddrop_all, stacks of 1 and 16, with and without a name, with lore, and the script reverting or accepting the drop so the count went down) all kept every slot name, and the same held with phone touch (MPP). On a custom server (Dragonfly), every slot name emptied within 6 seconds even when the drop was accepted and theItemStackResponseslot info carried the item name (CustomName) (SG). On BDS 1.26.65.1 joined as a remote server, every slot name also stayed after drops (MPP). Conversely, loading that custom server menu's resource pack, window title and slot items onto BDS as they are made the whole menu disappear within 2 seconds of a drop on BDS too (MPP; 12 long slot names were cut to fit the Script API length limit). The cause was the menu's button placement, not the server: an ancestor panel of the buttons set its own#visiblefrom the#hover_textof slot 0 (INP-46). A menu that receives presses on the server side uses the hotbar swap (INP-42) instead of these two buttons.{measured}(Source: SG, HSB, MPP, Windows 1.26.65.1) - [INP-45] Conditions for a hotbar swap button to send a request (PC mouse, full inventory). Sent:
pressedandfocusedmappings, sourcesbutton.menu_select,button.menu_ok(Enter) andbutton.menu_secondary_select(right click),focus_enabledon and off,consume_eventtrue and false, the vanilla PC slot (common.container_itemwithcontainer_slot_button_prototype) and pocket slot (pocket_ui_container_slot) templates with only their mappings changed, and targetsbutton.slot_1andbutton.slot_2. Not sent (the same with empty slots): a button without thebutton.container_slot_hoveredmapping, a button with that mapping placed before the hotbar mapping withfrom_button_id: button.menu_select, a button without thecollection_detailsbinding, and the targetbutton.slot_0. So the button must have thecollection_detailsbinding and acontainer_slot_hoveredmapping without a source, and a hover mapping with a source must not come first. With phone touch (inventory with empty slots) none of the 13 hotbar swap slots sent a request. In the same screen, slots that sendbutton.menu_selectto quick move or tobutton.drop_onedid send requests on touch, so what touch blocks is thebutton.slot_Ntarget. A menu that must take touch does not rely on the hotbar swap alone.{measured}(Source: MPP, Windows 1.26.65.1, phone) - [INP-46] If the
#visibleof abutton.drop_onebutton or one of its ancestor controls is set by a binding, pressing drop with that button turns#hover_textof every slot in the window into an empty value that does not come back. Number bindings such as#item_id_auxstay. The value of the binding did not matter: an ancestor panel set from a collection#hover_text(binding_conditionalwaysorvisible, MPP), the button's own slot#hover_text, a sibling control's property received throughsource_control_name, and the slot#item_id_aux((#item_id_aux > 0)) (SG) all emptied the names. In the same window, a button with no such binding on itself or its ancestors keeps the names, and emptying a slot by script alone does not empty them. Sending the ancestor binding to a property other than#visible, or changing itsbinding_conditiontoonce, kept the names (MPP). A setup that hides only the button's sibling image with a#visiblebinding and puts no#visiblebinding on the button itself, and setups that set the button's#enabledor#alphafrom the slot#hover_text, also kept the names after two drops in the same window (SG). So do not change the#visibleof drop buttons or their ancestors by binding. Hide the button's look with the#visibleof sibling controls, block the button with#enabledor#alpha, and pick pages withignored(FILE-16, FILE-17) instead of#visiblegates. If a#visiblegate must be used, keep the buttons outside it or use theoncecondition.onceis not evaluated again while the window stays open. In a window with all such bound#visibleremoved, every drop press still left the window, frame and background included, undrawn for a moment. A 60 fps recording showed it blank for about 120 ms; a screenshot right after the click (about 4 ms) showed no window in 4 of 4 presses, and the next one (about 230 ms) was normal. Changing all 521 controls that read#hover_textto BND-18 latches gave the same result, so this is not only slot names emptying: the screen itself is not drawn for a moment. It was the same whether the server rejected or accepted the drop, whether or not it sent slot content afterwards, and for buttons inside or outside a scrolling panel; a click on empty space did not blank. With the same button changed tobutton.slot_1(hotbar swap), there was no blank (SG). Only avoiding the drop removes this brief disappearance.{measured}(Source: MPP, SG, Windows 1.26.65.1)
Slot buttons that work for a player with a full inventory, and nine buttons on one slot, are set up in Chest slot buttons with the hotbar swap. A comparison of press methods is in Comparing chest slot press methods.
StarLibV2's client search filter (SLB)
StarLibV2 (jb-starlibv2, GPL-3.0) uses a method that filters server form buttons with the text of an input box. Only the technique is rewritten.
SLB 6. Client search filter [confirmed (structure), unverified (behavior)]
- Search box: inherit vanilla
common.text_edit_boxand give$text_box_nameand$text_edit_text_controlthe same name (defaultsearch_field). The vanilla text input template puts"#property_field": "#item_name"inproperty_bagand writes the input text to its own#item_name(11 uses in vanilla, for exampleui_common.json:1416). - Button side: a view binding
source_control_name: "search_field",source_property_name: "#item_name"to#search. It shows if(#search = '')or if#form_button_text(or a range fragment from chapter 5) contains#search. - Initial value: put
#default_searchinproperty_bagand copy it once into#searchwith abinding_condition: "once"view. Then at first only buttons with that default word show, and when the user types it changes to the typed word [inferred]. - Hidden items give up space in a vertical stack (LAY-04), so the list actually shrinks. With a grid template, empty cells remain (LAY-31).
Proposed rules
The rules below lack evidence or are not adopted yet. Check the evidence before using them.
- [INP-25 proposal] The text of an input box goes into the
#item_nameof that input box control, following theproperty_bag"#property_field": "#item_name"of vanillacommon.text_edit_box. Other controls read it withsource_control_name(the input box name =$text_box_name) andsource_property_name: "#item_name". If you hide action form buttons by a containment check on this value, it becomes a search filter with no server round trip.{vanilla, working pack, unverified}(Source: VN ui_common.json:1416 and 11 other uses, SLB chapter 6). Not measured on Windows 1.26.65.1: the measurement tool's keyboard input did not reach acommon.text_edit_boxinside an ActionForm window, and whether the tool or the screen was the cause was not separated (measurement record).
Measurement needed: whether #item_name read by another control while typing in common.text_edit_box updates per character, and whether it is emptied when the form is reopened.
How evidence is marked and source abbreviations
A rule carries an ID in the form [chapter abbreviation-number], and the {…} at the end is the verification level. The priority of verdicts is measured > vanilla > working pack > code > inferred, and unverified and conflict must be checked before use. C-nn is a number in the conflict table, and the value counts of VN are the tallies in the value dictionary. Rule IDs of other chapters (LAY-, BND-, HOST-, etc.) are on the corresponding pages of the same JSON UI chapter.
| Abbreviation | Material |
|---|---|
VN | Exhaustive search of vanilla resource pack resource_pack/ui v1.26.50.4 (bedrock-samples 46ba6ea). VN file:line is that location |
BC, BC-S1~BC-S14, BC-facts, BC-rules | bedrock-core (@bedrock-core/ui 0.12.1, MIT) and the author's in-game measurement records (aee2bbd) |
BA, BA-original | BedrockAdvancements 2.0.3 (All rights reserved, only techniques carried over) |
AP | AdvancementPack v4.2 (MIT) |
MJ | mcbejsonuimasterAI (no license, only facts rechecked against vanilla) |
BW, BW-intro, BW-dyn, BW-doc, BW-form, BW-btn, BW-type, BW-best, BW-title, BW-ase, BW-ids | Bedrock Wiki JSON UI documents (CC BY 4.0). Respectively Intro to JSON UI, Dynamic Content Generation, JSON UI Documentation, Modifying Server Forms, Buttons and Toggles, Type Conversion, Best Practices, Preserve Title Texts, Aseprite Animations, Numerical Item IDs |
CN, CN-run | Cinnabar (Rust code reconstructing the 26.30 native client) and the results of this project running its evaluator |
NB | Engine behavior analysis of the Android 1.26.52.3 native client library (level code) |
DF | Measurement on Windows 1.26.52 with the research server (a structure that draws several screens with one server form) |
FFR | Mobile measurement of the server form factory and lag test add-on (2026-11-14). The add-on setup is in Server form research screen |
ASJ, SLB | AsaJS analysis, StarLibV2 analysis (both GPL-3.0, only techniques rewritten in English) |
MS | The modal form multiselect survey |
NE | NetEase (China edition) developer documentation |
| id | Source | License | Commit | Accessed |
|---|---|---|---|---|
repo-guide | JSON UI comprehensive guide (this repository) (guide/) | 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 |
bedrock-wiki | Bedrock Wiki | CC BY 4.0 (docs/licenses/CC-BY-4.0.md in the repository) | 0930b39 | 2026-11-13 |
ms-learn | Minecraft Creator documentation (Microsoft Learn) | CC BY 4.0 (documentation), MIT (code) | a9fd1c0 | 2026-11-13 |
private-research | Private research (-) | - | 2026-11-13 | |
bedrock-core | bedrock-core UI (@bedrock-core/ui) | MIT (confirmed in the repository LICENSE, Copyright 2026 bedrock-core) | aee2bbd (analysis baseline, clone HEAD 51d5cf2) | 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 |
starlibv2 | StarLibV2 | GPL-3.0 (confirmed in the repository LICENSE) | 6bf7875 | 2026-11-13 |