Skip to main content

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.

CodeSlotChange from the base
A10none
A21focus_enabled: true
A32the container_slot_hovered mapping placed before the hotbar mapping with from_button_id: button.menu_select, focus on
A43no container_slot_hovered mapping
A54source button.menu_ok
A65mapping_type: focused, focus on
A76consume_event: true
A87source button.menu_secondary_select
A98vanilla PC slot template (common.container_item, container_slot_button_prototype) with only the mappings changed
A109vanilla pocket slot template (pocket_ui_container_slot) with only the mappings changed
A1110target button.slot_2
A1211target button.slot_0
A1312no collection_details binding
Q113quick move button.container_auto_place
Q214one-at-a-time quick move button.container_auto_place_one (16 items)
C115plain vanilla slot (cursor take)
D116button.drop_one, 1 item, reverted
D217button.drop_one, 16 items, reverted
D318button.drop_one, 16 items, accepted
D419button.drop_one, 16 items without a name, accepted
D520button.drop_all, 16 items, reverted
D621button.drop_one, 16 items with lore, accepted
D722button.drop_one, 1 item, accepted
W23witness slot, not pressed
L24last 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.

SetupInventory 36 slots fullInventory with 9 empty slots
A1, A2, A5, A6, A7, A8, A9, A10went to hotbar 0same
A11went to hotbar 1same
A3, A4, A12, A13no requestno request
Q1, Q2no requestwent to inventory 9
C1went to the cursorsame
D1 to D7droppedsame

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.

SetupResult
A1 to A13no request from any
Q1, Q2went to hotbar 1
C1went to hotbar 1 (tapped several times, logged twice)
D1 to D7dropped

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).

TimePacketContent
0 msInventorySlotchest window (WindowID 2) slot 18, the whole item including its name (NBT display.Name)
0 msItemStackResponsesuccess, slot 18 count 15, CustomName
54 msAddItemActor, InventorySlot, SetActorData, MoveActorDeltathe 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.

ChangeAfter 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 titledisappeared
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 dropstayed
Put this probe window's drop button under a panel that sets #visible from the #hover_text of slot 0, and dropdisappeared
Send that panel's binding to a property other than #visiblestayed
Change that panel's binding_condition to oncestayed
Change that panel's binding_condition to visibledisappeared

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 setupAfter the drop
The button's own #visible set from its slot #hover_textemptied
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 buttonstayed (two presses)
The button's #enabled set from the slot #hover_textstayed
The button's #alpha set from the slot #hover_textstayed

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.

ConditionWindow briefly gone
Drop rejected (status 1) or accepted (status 0)yes, both
Server sends slot content after the drop, or notyes, both
Button inside or outside a scrolling panelyes, both
Click on empty spaceno
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​

Download: [bedrock-research]menu-press-probes_v1.0.0.mcaddon
[bedrock-research]menu-press-probes v1.0.0 · 7.9 KB · Test item bwiki:menu_press_probes
  1. 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.
  2. Take "Menu Press Probes" from the items category of the creative inventory.
  3. Use the item while sneaking to fill every empty slot so the inventory is full (/scriptevent bwiki:menu_press_probes_fill does the same).
  4. 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.
  5. 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.
  6. /scriptevent bwiki:menu_press_probes_room empties inventory slots 9 to 17. To measure with empty slots, run it and press again. /scriptevent bwiki:menu_press_probes_reset puts the chest slots back to the start.

Version history​

VersionChangeMeasured
v1.0.023 slot setups, a witness slot and a log slotWindows 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_N target is blocked on touch is unknown.
  • mapping_type: global was 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.
Sources
idSourceLicenseCommitAccessed
repo-guideJSON UI comprehensive guide (this repository) (guide/)This project's material2026-11-13