Comparing chest slot press methods
Chest slot buttons with the hotbar swap checked a single button setup. In a custom server menu (SG), hotbar swap presses went missing on touch, and slot names (#hover_text) emptied after a drop. This design puts 24 slots in one screen, each changing one thing in the button setup, and measures which setups send a request and whether slot names stay after a drop.
1. Slot setups
Each chest slot gets one setup. The base setup (A1) is the same as the hotbar swap button: a collection_details binding, a pressed mapping from button.menu_select to button.slot_1 (consume_event: false), and a button.container_slot_hovered mapping without a source.
| Code | Slot | Change from the base |
|---|---|---|
| A1 | 0 | none |
| A2 | 1 | focus_enabled: true |
| A3 | 2 | the container_slot_hovered mapping placed before the hotbar mapping with from_button_id: button.menu_select, focus on |
| A4 | 3 | no container_slot_hovered mapping |
| A5 | 4 | source button.menu_ok |
| A6 | 5 | mapping_type: focused, focus on |
| A7 | 6 | consume_event: true |
| A8 | 7 | source button.menu_secondary_select |
| A9 | 8 | vanilla PC slot template (common.container_item, container_slot_button_prototype) with only the mappings changed |
| A10 | 9 | vanilla pocket slot template (pocket_ui_container_slot) with only the mappings changed |
| A11 | 10 | target button.slot_2 |
| A12 | 11 | target button.slot_0 |
| A13 | 12 | no collection_details binding |
| Q1 | 13 | quick move button.container_auto_place |
| Q2 | 14 | one-at-a-time quick move button.container_auto_place_one (16 items) |
| C1 | 15 | plain vanilla slot (cursor take) |
| D1 | 16 | button.drop_one, 1 item, reverted |
| D2 | 17 | button.drop_one, 16 items, reverted |
| D3 | 18 | button.drop_one, 16 items, accepted |
| D4 | 19 | button.drop_one, 16 items without a name, accepted |
| D5 | 20 | button.drop_all, 16 items, reverted |
| D6 | 21 | button.drop_one, 16 items with lore, accepted |
| D7 | 22 | button.drop_one, 1 item, accepted |
| W | 23 | witness slot, not pressed |
| L | 24 | last log line |
The script (@minecraft/server 2.0.0) compares the chest slots every tick. When a slot changes, it finds where the item went (hotbar, inventory, cursor, dropped) and writes <code> <where> <slot> left <remaining amount> #<count> to chat and to the name of slot L. "Reverted" slots put the item back; "accepted" slots keep the change. Slot labels are drawn from #hover_text, so an emptied name makes the label disappear.
2. PC results
Windows 1.26.65.1 local world, each slot pressed once with bedrock MCP mouse input (press, 0.15 s, release, DBG-35). A5 is Enter over the slot, A8 is a right click.
| Setup | Inventory 36 slots full | Inventory with 9 empty slots |
|---|---|---|
| A1, A2, A5, A6, A7, A8, A9, A10 | went to hotbar 0 | same |
| A11 | went to hotbar 1 | same |
| A3, A4, A12, A13 | no request | no request |
| Q1, Q2 | no request | went to inventory 9 |
| C1 | went to the cursor | same |
| D1 to D7 | dropped | same |
After pressing all of D1 to D7, every slot label in the screen stayed. None of reverted or accepted, 1 or 16 items, with or without a name or lore, drop_one or drop_all emptied the slot names.
The rules are INP-41, INP-44 and INP-45. A hotbar swap button needs the collection_details binding and a container_slot_hovered mapping without a source, and targets start at slot_1.
3. Phone touch results
The user tapped each slot with a finger on a phone. The inventory was not filled; only hotbar slot 0 held an item. The game version was not recorded.
| Setup | Result |
|---|---|
| A1 to A13 | no request from any |
| Q1, Q2 | went to hotbar 1 |
| C1 | went to hotbar 1 (tapped several times, logged twice) |
| D1 to D7 | dropped |
None of the hotbar swap slots that sent requests on PC (A1, A2, A5 to A11) sent a request on touch. In the same screen, slots that send button.menu_select to quick move (Q1, Q2) or drop (D1 to D7) did send requests, so what touch blocks is the button.slot_N target, not the mapping source. Tapping C1, a plain vanilla slot, moved the item to an empty hotbar slot instead of the cursor. Every slot label stayed after several drops.
So the hotbar swap is usable only for mouse menus. A menu that must take touch receives presses through quick move or drop while the inventory has empty slots.
4. When slot names empty
The same drops kept names in a local world and emptied them on a custom server that cancels requests (SG). So emptied slot names do not seem tied to the client button setup.
In a local world the item move response (ItemStackResponse) carries CustomName for every changed slot, and Dragonfly sends that value empty. Dragonfly was changed to fill in the item name in the response and to accept drops, but within 6 seconds of a drop every slot name in that window emptied the same way (SG). Rejected drops, accepted drops and accepted drops with the name filled in all emptied the names, so the response CustomName is not the cause.
In a local world, the in-game server sent these packets around one accepted drop (D3), in this order (8 seconds, item, inventory, entity and chat packets only).
| Time | Packet | Content |
|---|---|---|
| 0 ms | InventorySlot | chest window (WindowID 2) slot 18, the whole item including its name (NBT display.Name) |
| 0 ms | ItemStackResponse | success, slot 18 count 15, CustomName |
| 54 ms | AddItemActor, InventorySlot, SetActorData, MoveActorDelta | the dropped item entity, and the same slot sent once more |
There was no InventoryContent and no packet closing or opening the window. The local server sends the changed slot twice as an InventorySlot carrying the name. The item network ID (StackNetworkID) of both InventorySlot packets matched the request and the response.
On BDS 1.26.65.1 joined as a remote server, pressing D1, D2, D3, D5 and D7 of the same add-on also kept every slot name. The packets BDS sent around D3 matched the table above in order and content. When opening the chest window, BDS sent ContainerOpen (a new window number, ContainerType 0, the entity's block position and entity ID), then an InventoryContent with names and item network IDs twice, about 44 ms apart. With the chest entity's inventory_size raised to 243 on BDS (entity metadata 45 = 243), every slot name also stayed after D3.
When Dragonfly (SG) rejected a drop, it sent only an ItemStackResponse (Status 1, no slot info), no inventory packet in the next 8 seconds, and the menu disappeared. Sending the whole window again before the response, or accepting the drop and sending an InventorySlot with the name before the response as the local world does, still emptied the names. Setting the container type (metadata 44) to 0, using a vanilla chest minecart entity, not riding the entity on the player, or sending that slot twice more after the reject still emptied the names (SG).
Finally, that menu's four resource packs, its window title, 243 slots and 41 slot items were loaded onto BDS as they are. With the same packs turned on next to this probe window, names stayed after D3, but the screen opened with that menu's window title lost the whole menu within 2 seconds of dropping the Help slot. The server packets were the same as in the case where names stayed. So the names emptying is that menu's resource pack screen reacting to the drop, not the server. Twelve slot names longer than 220 characters hit the Script API name length limit and were cut to 120 characters.
The same setup reproduced in a local world, so the cause was narrowed down by editing the resource pack and reloading it.
| Change | After the drop |
|---|---|
Remove the hidden sync grid, show the vanilla chest slots, turn off modal, remove the click sound and focus_magnet_enabled, remove the size prefix from the window title | disappeared |
| Rename or empty the Help slot by script (no press) | stayed |
| Put this probe window's drop button into that screen and drop the Help slot (up to three nested collections) | stayed |
| Put one of that menu's button templates outside its home page and drop | stayed |
Put this probe window's drop button under a panel that sets #visible from the #hover_text of slot 0, and drop | disappeared |
Send that panel's binding to a property other than #visible | stayed |
Change that panel's binding_condition to once | stayed |
Change that panel's binding_condition to visible | disappeared |
That menu puts a screen key in the name of slot 0 and places the whole page under a gate panel that shows or hides it by that name. Pressing drop with a button under it turned #hover_text of every slot in the window into an empty value, so the gates and the slot name labels all went off. Item pictures that do not read slot names (#item_id_aux) stayed. The rule is INP-46.
Next, on Dragonfly (SG, drop rejected), a window with only a label reading the name of slot 0 and drop buttons was used to measure ways other than #visible.
| Button setup | After the drop |
|---|---|
The button's own #visible set from its slot #hover_text | emptied |
The button's #visible received from a sibling control's property (source_control_name) | emptied |
The button's #visible set from (#item_id_aux > 0) | emptied (button stayed visible) |
Only a sibling image hidden by #visible, no #visible binding on the button | stayed (two presses) |
The button's #enabled set from the slot #hover_text | stayed |
The button's #alpha set from the slot #hover_text | stayed |
So a menu that uses drop buttons hides the button's look with the #visible of sibling controls, blocks the button with #enabled or #alpha, and picks pages with ignored. ignored does not create the control but is evaluated only once at creation (FILE-16, FILE-17), so use it only for pages that can be chosen from variables such as the window title.
After that menu moved its gates to #enabled and #alpha, so no control at or above a slot button had a bound #visible, names no longer stayed empty. But a 60 fps recording of the game window showed that every drop press still left the window, frame and background included, undrawn for about 120 ms before it came back (SG, Dragonfly). A screenshot right after the click (about 4 ms) showed only the world behind, with no window, in 4 of 4 presses, and the next screenshot (about 230 ms) was normal. Changing all 521 controls of the menu that read #hover_text to BND-18 latches, so names never emptied, gave the same result.
| Condition | Window briefly gone |
|---|---|
| Drop rejected (status 1) or accepted (status 0) | yes, both |
| Server sends slot content after the drop, or not | yes, both |
| Button inside or outside a scrolling panel | yes, both |
| Click on empty space | no |
Same button with the press sent to button.slot_1 (3 clicks, 10 to 16 screenshots each, about 150 ms apart) | no |
So removing bound #visible ends the lasting name loss, but the screen still goes undrawn for a moment, and only avoiding the drop removes that. On touch, button.slot_N sends nothing (section 3), so a touch menu that takes presses through drop keeps this blank.
5. Example add-on
- Open the file to import it. In a new world, turn on the behavior pack whose name starts with
[bedrock-research]menu-press-probes-bp. The resource pack turns on with it as a dependency. - Take "Menu Press Probes" from the items category of the creative inventory.
- Use the item while sneaking to fill every empty slot so the inventory is full (
/scriptevent bwiki:menu_press_probes_filldoes the same). - Use it normally to spawn an invisible chest entity in front of you (
/scriptevent bwiki:menu_press_probes). Tap or right click that spot to open it. - Press each slot with a code once. The result shows in chat and in the label of slot L. The number at the end of a slot label is how many presses that slot received.
/scriptevent bwiki:menu_press_probes_roomempties inventory slots 9 to 17. To measure with empty slots, run it and press again./scriptevent bwiki:menu_press_probes_resetputs the chest slots back to the start.
Version history
| Version | Change | Measured |
|---|---|---|
| v1.0.0 | 23 slot setups, a witness slot and a log slot | Windows 1.26.65.1 local world, PC mouse: results in section 2. Phone touch: results in section 3 (2026-12-01) |
6. Remaining work
- A full inventory was not measured on a phone.
- Why the
button.slot_Ntarget is blocked on touch is unknown. mapping_type: globalwas not measured on its own.- Whether presses other than drop (cursor take, quick move, hotbar swap) also empty the names under the same gate was not measured.
- Why the engine behaves this way is unknown.
- Whether the window also goes briefly undrawn on a drop in a vanilla chest screen or in this add-on's window was not measured.
| id | Source | License | Commit | Accessed |
|---|---|---|---|---|
repo-guide | JSON UI comprehensive guide (this repository) (guide/) | This project's material | 2026-11-13 |