Rules: Input, buttons, and toggles
scripts/gen-rules.mjs builds this page from rules/*.json. Do not edit it by hand; edit the JSON and run npm run gen-rules. The rule bullets on topic pages (- **[ID]**) are filled from the same source.
Explanations and examples are on the topic page Input, buttons, and toggles.
| ID | Rule | Level | Evidence environment | Source |
|---|---|---|---|---|
| INP-01 | A button specifies per-state child controls with default_control, hover_control, pressed_control and locked_control. Usually, rather than building one yourself, you reuse a vanilla template (common_buttons.light_text_button, etc.) with variables such as $pressed_button_name and $button_text. | vanilla | - | 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_mappings has from_button_id, to_button_id, mapping_type (pressed 599, global 536, focused 145, double_pressed 20), and optionally input_mode_condition (gamepad, gamepad_and_not_gaze, not_gamepad) and ignored. | vanilla | - | VN, Appendix B |
| INP-03 | The button IDs the engine understands are fixed per screen. | vanilla, working pack, measured | unknown | VN server_form.json:212 and 321, npc_interact_screen.json:1222, BC-S14 |
| INP-04 | To make a form entry pressable, give the two mappings button.menu_select -> button.form_button_click (pressed) and button.menu_ok -> button.form_button_click (focused), and put a collection_details binding on the button itself (COL-04). | code (source), working pack, vanilla | - | 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_mappings or set $pressed_button_name to a value the engine does not know ("unset") and receive only focus with focus_enabled and focus_magnet_enabled. To remove the click sound, sound_volume: 0. | working pack | - | 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 | unknown | 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 | unknown | 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) | - | 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 | - | AP 4.8 |
| 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 | unknown | 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_select and button.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_button and toggle_off_button were not needed: a toggle with only a button.menu_select mapping turned on with a click whether or not it had toggle_on_button. In the code, toggle_on_button and toggle_off_button are used only when enable_directional_toggling is true. The bedrock-core measurement (BC-S4, version not recorded) said these two were also needed. | measured, code (binary) | Windows 1.26.65.1 | 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_index and toggle_group_default_selected. | vanilla, measured | unknown | 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 checked state 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 with modifications. | measured | unknown | 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 | unknown | 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) | - | BC chapter 5 |
| INP-16 | For a button drawn on the HUD to receive hover and scrolling, hud_screen needs always_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 with always_accepts_input: true did not respond to touch (2026-11-19, measured by the user, intercepting user input in InvUI). | working pack, measured | unknown | 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 order entitySpawn, then entityItemDrop (including the player). | measured | unknown | 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 | Windows 1.26.65.1 | BC-S13, BC 4.3-(4), SG, HSB |
| INP-19 | In vanilla toggle templates (common_toggles.light_text_toggle, etc.), $toggle_view_binding_name becomes 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_name is required but is said to have no effect unless it is a name the engine knows. | vanilla, unverified | - | BW-btn, VN |
| 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 | - | BW-btn, VN |
| INP-21 | Default key mappings (wiki table): button.menu_select left click, button.menu_secondary_select right click and Y, button.menu_ok Enter, button.menu_cancel and button.menu_exit Esc and B, button.menu_up/down/left/right arrow keys and D-pad, button.menu_autocomplete Tab, button.controller_select X/A, button.menu_tab_left/right the tab key and bumpers, button.menu_inventory_cancel the inventory key. There is also from_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 are menu_select, right click is menu_secondary_select, Esc and the mobile back action are menu_cancel (menu_exit does not arrive), Enter is menu_ok together with chat and return, the arrow keys are menu_* together with arrow_*, [ ] are menu_tab_left/right, and E is menu_inventory_cancel. Tab did not turn on menu_autocomplete, and any did not turn on for any input. Middle click (menu_tertiary_select), numbers 1 to 9 (slot1 to slot9), 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 | Windows 1.26.65.1 | BW-intro, BW-doc, VN |
| INP-22 | For gamepad and arrow key focus, name targets with focus_identifier and specify the next target with focus_change_up/down/left/right. To prevent leaving, use FOCUS_OVERRIDE_STOP as the value (226 uses in vanilla). At the container level, use focus_container: true and focus_container_custom_* (other_focus_container_name, focus_id_inside). | vanilla | - | BW-doc Focus table, VN |
| INP-23 | follows_cursor: true (4 uses in vanilla) makes a control follow the cursor, and draggable (vertical, horizontal, both, vertical once in vanilla) makes a control draggable when given to a control that receives input (input_panel, button) together with a button mapping. not_draggable is also accepted and is the same as giving no draggable. In a scroll view on the Windows 1.26.65.1 pause screen, a scrollbar_box with "draggable": "vertical" was sized to the content ratio and moved when dragged. A box that inherited it and overrode it with not_draggable, and a box with no draggable, both filled the whole track and did not move when dragged. A scroll box needs draggable, and not_draggable is only for turning off an inherited value. | vanilla, measured | Windows 1.26.65.1 | BW-doc Layout table, VN |
| INP-47 | text_type on text_edit_box takes 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 the NumberChars field of the vanilla command block also took Ab_9-. For number-only input, do not rely on text_type; check the value in script after it arrives. Whether it picks the touch keyboard type was not checked. | measured, code (binary) | Windows 1.26.65.1 | 2026-12-03 Windows 1.26.65.1 measurement and decompilation |
| INP-24 | The #hyperlink of 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) | unknown | NB-08, VN #hyperlink use |
| INP-31 | A server form button can be turned off. If you set the button template's $pressed_button_name to 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 | Windows 1.26.52 | DF |
| INP-32 | Vanilla common.button and common.toggle have focus_enabled on, 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: -1 and $toggle_focus_enabled: false. A radio group is bound by toggle_name regardless of parent (INP-35). A common_buttons.light_content_button placed in a chest screen also took focus, so the first one opened hovered with its name tooltip shown; the same $focus_enabled: false removed it. | measured | Windows 1.26.52 | DF |
| INP-33 | There are 31 button.menu_* button IDs in the engine (including button.menu_emote_slot_0 to 3). Those not in the wiki table of INP-21 are button.menu_tertiary_select, button.menu_auto_place, button.menu_inventory_drop, button.menu_inventory_drop_all, button.menu_inventory_cancel, button.menu_alternate_tab_left and _right, button.menu_autocomplete and _back, button.menu_textcursorleft and right, button.menu_textedit_up and down, button.menu_clear, button.menu_play and button.menu_edu_play. Measured in the server form screen (Windows 1.26.65.1, 2026-11-19), menu_tertiary_select is the mouse middle click, menu_auto_place is Shift+click, menu_inventory_drop is Q, menu_inventory_drop_all is Ctrl+Q and menu_inventory_cancel is E, and Tab did not turn on menu_autocomplete (intercepting user input in InvUI). Which key the rest correspond to is unknown. | code (binary), measured | Windows 1.26.65.1, Android 1.26.52.3 | NB chapter 4 |
| INP-34 | A #hyperlink opens only if it passes the engine's allow list when the button is pressed. The list is 116 URLs that must match literally (87 of https://www.minecraft.net/<language>/terms/r1~r3, 20 of https://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 with https://education.minecraft.net/, https://aka.ms/ or ms-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) | unknown | NB-08 |
| 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. With toggle_group_default_selected: -1, nothing is selected at first. Windows 1.26.65.1 gave the same result: with toggles of the same toggle_name in two different parent stack_panels, clicking one unchecked the toggle in the other parent, and toggles created by a grid were also exclusive (measurement record). | measured | Windows 1.26.65.1 | 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 checked state 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_selected is a static value, so keep a separate layout per tab to open first and choose by title. | measured | unknown | FFR |
| 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 with source_control_name), and give it a global mapping from button.menu_select to button.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 | mobile 1.26.63 | IUC |
| INP-38 | consume_event: false on a position based pressed mapping 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). With consume_event: false on 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 | mobile 1.26.63 | 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 | mobile 1.26.63 | IUC |
| INP-40 | always_listen_to_input is a boolean read by types that take an input component (button, toggle, input_panel, screen, scroll_view and 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 a pressed mapping 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 with consume_hover_events true on a button with this key on, and see whether the button is pressed (prediction: pressed). | code (binary) | Windows 1.26.65.1 | 2026-11-24 Windows 1.26.65.1 decompilation |
| INP-41 | Quick move button.container_auto_place sends 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 | Windows 1.26.65.1 | SG, MPP, Windows 1.26.65.1 |
| INP-42 | Sending button.menu_select to button.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 a collection_details binding and the mapping { "to_button_id": "button.container_slot_hovered", "mapping_type": "pressed" }, and put it as a direct child of a stack_panel that has collection_name (focus_enabled: false works). When the server cancels the request, the hotbar stays unchanged and the window's #hover_text survives, 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 | Windows 1.26.65.1 | SG, HSB, Windows 1.26.65.1 |
| INP-43 | One chest slot can carry nine buttons. Give nine buttons with the same collection_index one of button.slot_1 to button.slot_9 each, 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 | Windows 1.26.65.1 | HSB, Windows 1.26.65.1 |
| INP-44 | button.drop_one and the cursor take button.container_take_all_place_all send 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_text of every slot of that window. Number bindings such as #item_id_aux, #inventory_stack_count and 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_one and drop_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 the ItemStackResponse slot 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 #visible from the #hover_text of 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 | Windows 1.26.65.1 | 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: pressed and focused mappings, sources button.menu_select, button.menu_ok (Enter) and button.menu_secondary_select (right click), focus_enabled on and off, consume_event true and false, the vanilla PC slot (common.container_item with container_slot_button_prototype) and pocket slot (pocket_ui_container_slot) templates with only their mappings changed, and targets button.slot_1 and button.slot_2. Not sent (the same with empty slots): a button without the button.container_slot_hovered mapping, a button with that mapping placed before the hotbar mapping with from_button_id: button.menu_select, a button without the collection_details binding, and the target button.slot_0. So the button must have the collection_details binding and a container_slot_hovered mapping 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 send button.menu_select to quick move or to button.drop_one did send requests on touch, so what touch blocks is the button.slot_N target. A menu that must take touch does not rely on the hotbar swap alone. | measured | Windows 1.26.65.1 | MPP, Windows 1.26.65.1, phone |
| INP-46 | If the #visible of a button.drop_one button or one of its ancestor controls is set by a binding, pressing drop with that button turns #hover_text of every slot in the window into an empty value that does not come back. Number bindings such as #item_id_aux stay. The value of the binding did not matter: an ancestor panel set from a collection #hover_text (binding_condition always or visible, MPP), the button's own slot #hover_text, a sibling control's property received through source_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 its binding_condition to once, kept the names (MPP). A setup that hides only the button's sibling image with a #visible binding and puts no #visible binding on the button itself, and setups that set the button's #enabled or #alpha from the slot #hover_text, also kept the names after two drops in the same window (SG). So do not change the #visible of drop buttons or their ancestors by binding. Hide the button's look with the #visible of sibling controls, block the button with #enabled or #alpha, and pick pages with ignored (FILE-16, FILE-17) instead of #visible gates. If a #visible gate must be used, keep the buttons outside it or use the once condition. once is not evaluated again while the window stays open. In a window with all such bound #visible removed, 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_text to 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 to button.slot_1 (hotbar swap), there was no blank (SG). Only avoiding the drop removes this brief disappearance. | measured | Windows 1.26.65.1 | MPP, SG, Windows 1.26.65.1 |
Proposed rules
These proposals are not merged into the adopted rules yet. Check the evidence before using them.
| ID | Rule | Level | Evidence environment | Source |
|---|---|---|---|---|
| INP-25 | The text of an input box goes into the #item_name of that input box control, following the property_bag "#property_field": "#item_name" of vanilla common.text_edit_box. Other controls read it with source_control_name (the input box name = $text_box_name) and source_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. Not checked: the behavior in game. In the Windows 1.26.65.1 measurement, the measurement tool's keyboard input did not reach a common.text_edit_box inside an ActionForm window, and whether the tool or the screen was the cause was not separated (measurement record). | vanilla, working pack, unverified | - | VN ui_common.json:1416 and 11 other uses, SLB chapter 6 |
| INP-26 | modal: true on an input_panel confines input to this control and its children (10 vanilla popups). contained together with draggable limits the drag range to the parent. | unverified | - | NE |
| INP-27 | The properties of selection_wheel are slice_count, inner_radius, outer_radius, state_controls and initial_button_slice. | unverified | - | NE |
| INP-28 | Make a tooltip that follows the cursor by putting {"type": "custom", "renderer": "hover_text_renderer", "allow_clipping": false, "layer": 30} inside the hover control and binding the tooltip text to #hover_text. It is created only in the hover state. Vanilla uses the same renderer. | unverified | - | CU |
| INP-29 | Setting button_mappings of third_party_server_screen to [] and giving $show_close_button: false makes a server form that cannot be closed. It cuts the mapping from menu_cancel to menu_exit. It redeclares the whole mapping array, so it competes with other packs, and the server must keep a way to close it with closeAllForms. Not checked: whether it blocks Esc, B and back all together. | unverified | - | LG |
| INP-30 | "prevent_touch_input": true (3 uses in vanilla) skips hover in touch mode. Not checked: whether it stops the touch display of HUD buttons. | unverified | - | LG |
| id | Source | License | Commit | Accessed |
|---|---|---|---|---|
repo-guide | JSON UI comprehensive guide (this repository) (guide/) | This project's material | 2026-11-13 | |
private-research | Private research (-) | - | 2026-11-13 |