Skip to main content

Building a research screen with tabs and selection in one server form

The research screen is a window with a grid of item cells on the left, the tabs "Research needed / Research done" on top, and the details of the chosen item on the right (name, state, description, materials, rewards, a proceed button). If the server resends the form every time a tab or item is pressed, the form closes and reopens, flickers, and is delayed by the round trip time. This page lays out a setup that draws this screen with a single Script API ActionFormData, where the client handles tab switching and item selection and only "Start research" goes to the server.

The content is the result (2026-11-14) of measuring the server form factory and lag test add-on (FFR) on mobile. Rule IDs point to the original text in the JSON UI chapter.

Research screen measurement video (mobile, 2026-11-14).

The screen with item 2 chosen on the Research needed tab

The screen with item 112 chosen on the Research done tab

These are two screens from the same form with the tab and item changed. Tab switching and cell selection did not go through the server, the chosen cell gets a yellow border, and the details on the right change to that item. The number of materials, the number of rewards and the description length differ per item. The only thing that goes to the server is the "Start research" button at the bottom.

Conclusions:

  1. The screen is chosen by form title and created by one router (HOST-06, COL-47). The measured test pack placed the router in $screen_content of third_party_server_screen; the example add-on inserts it into main_screen_content with modifications (section 1). The vanilla form content stays on the same screen and is turned off only with #visible.
  2. Tabs and item cells are all radio toggles. If you put that item's details inside the checked state control of a cell toggle, the details change when the cell is pressed and the form does not close (INP-36).
  3. The server sends in advance, as form buttons, all the text and icons the details need. A cell reads one button at a time with a fixed collection_index. All bindings of these cells are binding_condition: "always".
  4. Only the actions that must go to the server (the proceed button, page arrows) are form buttons (button.form_button_click). Pressing one closes the form and the server sends the next form.

1. Screen structure​

There are four resource pack files (as in the example add-on server-form-research-screen).

FileContents
ui/server_form.jsonWidens main_screen_content to the screen size and inserts the router with modifications. When the title starts with the shared prefix §b§w, it hides vanilla long_form and builds no vanilla button list
ui/frs.jsonCommon definitions of the screen router, window, tabs, cells and details
ui/frs_items.jsonThe detail definitions of the 96 item cells of the server pages. collection_index is a static value, so each cell needs a separate definition, and they are made with a script
ui/frs_pages.jsonThe cell and detail definitions of the client pages (section 8)

ui/server_form.json is byte-identical to the other server form examples apart from the one router line (frs_router@frs.screen_router). The full file and the reason for each part are in JSON UI optimization section 9.

  • Vanilla main_screen_content has size: [0, 0], so it is widened to ["100%", "100%"] to give the inserted router a size.
  • If you change the length binding of the vanilla button list to the visible condition, button cells are not created in our form where the list is hidden (BND-32). Vanilla long_form and long_form_scrolling_content/wrapping_panel are hidden with #visible from (not (('%.6s' * #title_text) = '§b§w')).
  • The measured test pack (FFR) placed the router in $screen_content of third_party_server_screen. With the router next to server_form_factory inside main_screen_content, as in the example add-on, the screens also filled as soon as they opened (measured, mobile 1.26.63, 2026-11-15).

1.1 Screen router​

The router is a single collection_panel. It looks up the first 11 bytes of the title (a form like §b§wrs:Fa; §b§w is 6 bytes) as a property_bag key and puts the array of kind names of the screen to create into #collection_length (HOST-06, COL-22, COL-27). If the key is absent, nothing is created. F is the server pages and G the client pages (section 8), and the last letter is the tab to open first.

frs.screen_router
{
"type": "collection_panel",
"size": [ "100%", "100%" ],
"factory": {
"name": "frs_screen",
"control_ids": {
"a": "@frs.research_a",
"b": "@frs.research_b",
"ga": "@frs.research_ga",
"gb": "@frs.research_gb"
}
},
"property_bag": {
"#§b§wrs:Fa": [ "a" ],
"#§b§wrs:Fb": [ "b" ],
"#§b§wrs:Ga": [ "ga" ],
"#§b§wrs:Gb": [ "gb" ]
},
"bindings": [
{ "binding_name": "#title_text" },
{
"binding_type": "view",
"source_property_name": "('#' + ('%.11s' * #title_text))",
"target_property_name": "#collection_length"
}
]
}

Unlike the approach of creating every visible-hidden screen in every form, this setup creates only the one chosen screen (section 2 of JSON UI optimization).

1.2 Window​

The window has a fixed pixel size equal to the vanilla inventory size (326x166). Phones draw the UI large, so a window bigger than this does not fit on screen (LAY-53). The tabs go outside the top edge of the window (offset [8, -22]), and the left panel (152x136) and right panel (158x136) go inside a panel with offset relative to the top left (LAY-52).

2. Button order​

The server sends every value the screen needs as individual form buttons. The button count is fixed at 2022 no matter how many items there are.

NumberContents
0~47The 48 items of the first tab's current page (text §r, icon texture)
48~95The 48 items of the second tab's current page
96, 97The two tabs (count in the text, icon)
98, 99The previous and next page arrows of the first tab
100, 101The previous and next page arrows of the second tab
102 + 20k ~ 121 + 20kThe 20 detail cells of item cell k (0~95): name (icon), state, description, 8 materials, 8 rewards, proceed button
  • The number of material kinds, description length and number of rewards differ per research, so the detail cells are fixed at the maximum. For unused material and reward cells, the invisible formatting code §0§e§r is sent as the text, and a cell hides itself if it contains that marker. The containment check compares the subtraction result with the original (EXP-07): ((#form_button_text - '§0§e§r') = #form_button_text).
  • Send material counts so that they start with a character, like §f16. A string containing only digits is converted to a number in expressions (EXP-15).
  • Do not put * or @ in marker strings. Even a * inside quotes breaks the expression (EXP-36).
  • The server tells actions apart by the chosen button number. 98~101 are page moves, and 102 + 20k + 19 is the proceed action of item k.
Server script (summary)
form.show(player).then((res) => {
if (res.canceled || res.selection === undefined) return;
const s = res.selection;
if (s >= 98 && s <= 101) movePage(s);
else if (s >= 102 && (s - 102) % 20 === 19) startResearch(itemAt(Math.floor((s - 102) / 20)));
reopen(player);
});

The tabs are form buttons (96, 97) but are drawn as radio toggles, not pressable buttons, so they do not go to the server (section 3). The last character of the title (a, b) is the tab to open first. toggle_group_default_selected is a static value, so each tab gets its own layout and the router chooses by title.

3. Comparing tab switching methods​

Tab switching was built four ways and compared. In all of them the cells, tabs and details were drawn correctly as soon as the form opened (with all collection bindings always).

MethodSetupDoes the form close
ATabs are form buttons. When pressed, the server resends the form with another tabCloses
BTabs are radio toggles, and the tab content is inside the toggle's checked state control (INP-13)Does not close
CTabs are radio toggles, both tab contents are created, and the #toggle_state read with source_control_name is attached to #visibleDoes not close
DSame as C, but only the first opened tab is created in advance and the other tab is created by a factory when that tab is first pressedDoes not close
  • In D, if even the first opened tab was made with a factory whose length is decided by #toggle_state, that tab was empty on first open. Create the first tab in advance.
  • Open time and tab switching time were not measured. The only differences among the four methods are "does the form close" and "is the hidden tab created in advance".

The tab toggles are defined as a raw toggle instead of the vanilla template. All 8 state controls are filled in (INP-10), and toggle_on_button and button_mappings are given (INP-11).

frs.tab_toggle (excerpt)
{
"type": "toggle",
"size": [96, 22],
"toggle_name": "frs_tabs",
"radio_toggle_group": true,
"toggle_group_forced_index": "$tab_index",
"toggle_group_default_selected": "$tab",
"toggle_on_button": "toggle.toggle_on",
"toggle_off_button": "toggle.toggle_off",
"button_mappings": [
{ "from_button_id": "button.menu_select", "to_button_id": "button.menu_select", "mapping_type": "pressed" },
{ "from_button_id": "button.menu_ok", "to_button_id": "button.menu_ok", "mapping_type": "focused" }
],
"checked_control": "on", "checked_hover_control": "on",
"checked_locked_control": "on", "checked_locked_hover_control": "on",
"unchecked_control": "off", "unchecked_hover_control": "off_hover",
"unchecked_locked_control": "off", "unchecked_locked_hover_control": "off",
"controls": [ { "on@frs.tab_face_on": {} }, { "off@frs.tab_face": {} }, { "off_hover@frs.tab_face_hover": {} } ]
}

The two tab toggles are placed as direct children of a horizontal stack_panel that has collection_name: "form_buttons" and are given collection_index 96 and 97. That is how the tab text and icon are read from the buttons (COL-38).

4. Item selection on the client too​

The 96 item cells are also radio toggles (group frs_items, toggle_group_default_selected: -1 so that nothing is chosen at first). The on state control of a cell toggle holds both the selection border and that item's detail panel. The detail panel is moved from the cell position to the right panel position by computing offset, and is drawn above the other cells with a high layer. When nothing is chosen, the right panel has only the text "Choose a research."

frs.item_chosen (the on state of a cell toggle)
{
"type": "panel",
"size": ["100%", "100%"],
"controls": [
{ "face@frs.item_face": { "$slot_bg": "textures/ui/ffr/slot_chosen" } },
{ "sel": { "type": "image", "layer": 4, "texture": "textures/ui/focus_border_white",
"size": ["100%", "100%"], "color": [1, 0.85, 0.1] } },
{ "detail@$detail_def": { "layer": 20, "anchor_from": "top_left", "anchor_to": "top_left",
"offset": "$detail_offset" } }
]
}

4.1 Cell layout: row stacks​

For a cell to read its own button, it must be a direct child of a stack_panel that has collection_name (COL-38). So each tab has 6 horizontal stack rows inside a vertical stack, and each row has 8 cell toggles (COL-50).

Cell grid of tab 0 (first row only)
{
"grid0": {
"type": "stack_panel", "orientation": "vertical", "size": [144, 108],
"bindings": [
{ "binding_type": "view", "binding_condition": "always",
"source_control_name": "frs_t0", "source_property_name": "#toggle_state",
"target_property_name": "#visible" }
],
"controls": [
{ "r0": {
"type": "stack_panel", "orientation": "horizontal", "size": [144, 18],
"collection_name": "form_buttons",
"controls": [
{ "i0@frs.item_toggle": { "collection_index": 0, "$k": 0,
"$detail_offset": [152, -4], "$detail_def": "frsi.detail_0" } },
{ "i1@frs.item_toggle": { "collection_index": 1, "$k": 1,
"$detail_offset": [134, -4], "$detail_def": "frsi.detail_1" } }
] } }
]
}
}

What got stuck before finding this layout:

AttemptResultRule
Make the cell parent a panel and place cells with offsetEven with a different index per cell, all showed the icon of button 0COL-38, COL-50
On top of that, a collection_details binding on the cells and toggle_grid_collection_nameStill button 0COL-50
Put 48 cells in one horizontal stack and fold per row with offsetThe icons were right but they ran in one line out of the windowLAY-56
6 horizontal stack rows inside a vertical stackWorks. Only one cell is selected even across different rowsINP-35

4.2 Create the details in advance, or when chosen​

MethodSetupResult
ECreate the details of all 96 cells at the startWorks
FWrap the details in a factory and create them when that cell is first chosenWorks

The factory in F sets the length with #form_button_length > 0 and the binding condition to visible. The on state control is visible only when the cell is selected, so the length becomes 1 for the first time then and the details are created (BND-32).

frs.lazy_detail
{
"type": "stack_panel",
"size": [158, 136],
"bindings": [
{ "binding_name": "#form_button_length", "binding_condition": "visible" },
{ "binding_type": "view", "binding_condition": "visible",
"source_property_name": "((#form_button_length > 0) * 1)",
"target_property_name": "#collection_length" }
]
}

It is used by attaching factory: { "name": "frs_lazy_<k>", "control_name": "frsi.detail_<k>" } to each item. The difference in open time between the two methods was not measured.

4.3 Detail panel​

The details read 20 fixed cells with collection_index. The description length differs, so it goes in a small scroll area inside the details, and the proceed button is fixed at the bottom of the panel. Text labels draw the button text as is without an expression (text: "#form_button_text"), and a label must be placed in a reference definition that receives collection_index (name@frs.text_item). An index given directly to a label is ignored (COL-02).

The proceed button is a button that has $pressed_button_name: "button.form_button_click" and a collection_details binding (always) like a vanilla button. When pressed, that cell's button number goes to the server.

5. Pitfalls​

SymptomCauseFixRule
On first open, cell icons and text are empty and fill in after switching the tab onceThe collection bindings of the cells in the window the router created have the default conditionMake the collection, collection_details and body bindings all alwaysCOL-47
Text in a scroll list is empty until something touches itThe label is on the same layer as the background imageIcon layer: 2, label layer: 3LAY-55
The buttons and the close button of menu forms cannot be pressed and only scrollA whole-screen scroll area is always present in every formCreate the scroll area only in that formLAY-57
The first opened tab was emptyThat tab was made with a #toggle_state length factoryCreate the first tab in advanceSection 3 D
The research name and description were emptyA '*' inside an expression, a string converted to a number, a collection_index given directly to a labelA plain label, a character marker, an index in a reference definitionEXP-36, EXP-15, COL-02
All page number cells disappearedPage numbers were sent as digits only ("1"), which broke the hiding expression that subtracts the empty markerStart page numbers with a format code too, like §f1EXP-15
On first open the current page number had no selection mark, the look differed before and after a press, and a hidden empty number appeared after a pressA #visible binding on each state face of the toggle (on, off, the hover face) fought with the toggle turning its state faces on and offPut the hiding binding on a slot panel around the toggle, and keep bindings off the state facesSection 8
All item cells show the same iconThe cell parent is a panelRow stacksCOL-38, COL-50
The research screen layout was drawn in other forms tooThe title gate used an or expression or alwaysThe router uses a property_bag dictionary lookup, and the top gate of the screen uses the default conditionCOL-39

6. Button count test​

A mode that draws only a button list was placed in the same pack to see behavior by button count. One button consists of a background, icon, name, description and progress bar.

ModeSetup
SThe vanilla button list
JThe screen router creates the window, scroll area and a 2-column grid together
KThe window is present from the start but hidden with #visible, and a router inside the scroll creates the grid
LThe same window as J, and the list is a one-column vertical stack factory with the length of #form_button_contents
Button countJ, K (2-column grid)L (1-column stack)
100~2000WorksDraws but lags heavily
3000 or moreOnly the scroll range is long and the cells overlap in the top 200px or soNot tested (excluded because of lag)
  • Whether the limit of the 2-column grid is the button count or the content height (about 45000px at 3000) was not settled (COL-49).
  • Lists of more than 3000 are rare so this was not pursued further. If needed, split into pages on the server.
  • The research screen has a fixed button count of 2022 and only creates 96 cells and the details on screen, so it does not depend on the item count (the same screen even in the 10,000-item test).

7. What remains​

  • A way to show the item list with scrolling instead of pages while keeping selection on the client was not built. Details placed inside a cell get clipped by the scroll area, a grid always draws from button 0 so two per-tab lists cannot be put in one form, and details with a fixed index per item cannot be placed.
  • The open time and tab switching time of methods A to F were not measured.
  • Whether the radio toggles inside cells made by a grid or a factory are exclusive was not examined in this test (INP-35).
  • The configuration that also changes pages on the client ("Client pages" in section 8) was checked on mobile, but its opening time and page switching time were not measured.
  • There is no numeric item ID table for 1.26.63. The apple of the item renderer version (section 8.1) shows as another item, so the numbers of the range from ID 852 need to be checked again in the game.

8. Example add-on​

Two add-ons are provided that differ only in how icons are drawn. The rest of the screen and its behavior are the same.

Add-onIconsTest item, script event
Research Screen Test v1.5.0The item renderer draws them from numeric item IDs (section 8.1). Blocks in 3D, enchanted items with glint. The ID table must match each game versionbwiki:research_screen_test, bwiki:research_screen
Research Screen Texture Test v1.4.0Images from texture paths (textures/items/diamond and so on). Blocks are flat pictures and there is no glint, but it keeps working when the game version changesbwiki:research_screen_texture_test, bwiki:research_screen_texture
Download: [bedrock-research]server-form-research-screen_v1.5.0.mcaddon
[bedrock-research]server-form-research-screen v1.5.0 · 53.7 KB · Test item bwiki:research_screen_test
Download: [bedrock-research]server-form-research-screen-texture_v1.4.0.mcaddon
[bedrock-research]server-form-research-screen-texture v1.4.0 · 53.5 KB · Test item bwiki:research_screen_texture_test

These add-ons hold only the final configuration of this page. Tabs and item selection are handled on the client, and each detail is built when its cell is first picked (F in section 4). The other modes of the FFR final test pack used for the measurements are removed.

  1. Open the file to import it (on mobile, tap the file and open it with Minecraft). In a new world, turn on the behavior pack whose name starts with [bedrock-research]server-form-research-screen-bp (for the texture version, [bedrock-research]server-form-research-screen-texture-bp). The resource pack turns on with it as a dependency, and no experimental toggle is needed.
  2. Take "Research Screen Test" (for the texture version, "Research Screen Texture Test") from the end of the Items category of the creative inventory. You can also type the name in the search box or run /give @s with the item ID from the table above.
  3. Use the item to open a menu that picks how pages change. The script event in the table above (/scriptevent bwiki:research_screen) opens it too. Both choices open the research screen with 200 items (several pages per tab).
  4. Pressing tabs and item cells does not close the form. Pressing "Start research" makes the server send the form again, and the research request appears in chat.
MenuConfiguration
Server pagesThe final configuration of this page. Page arrows are form buttons, so pressing one makes the server send the form again with the next page. 2022 buttons
Client pagesPages change on the client like tabs. The cells and details of up to 3 pages per tab are all sent in one form (6056 buttons), and page number radio toggles under the cells switch pages. The first page is built up front, and the other pages are built by a factory when their number is first pressed (the same method as D in section 3). Numbers of pages that do not exist are hidden with the empty marker. The number of the page on screen gets the same yellow border as the picked item cell. After "Start research", the form opens again on the first page of the same tab

Test video (mobile, 1.26.63, 2026-11-14, v1.4.0). It opens Server pages, then Client pages.

Server pages. The item renderer draws the icons of cells, details and materials, and the chest and crafting table show in 3D

Page 2 of the Done tab in Client pages. Diamond, gold ingot, coal, redstone and grass block. Only numbers 1 and 2, with a yellow border on 2

Client pages results (mobile, v1.3.3, the same in v1.4.0):

  • Page number 1 has a yellow border from the first open, and pressing a number moves the border to it. The picked item cell uses the same yellow border.
  • The To do tab (133 items) shows numbers 1~3 and the Done tab (67 items) only 1~2. No empty third cell appears on the Done tab after a number is pressed.
  • Pressing a number changes the page without closing the form. Pages opened for the first time (page 2 of Done with 19 cells, page 3 of To do with 37 cells) filled with the right icons at once.
  • Picking a cell on another page shows its detail (name, status, description, materials, rewards, progress button) correctly.

Each page needs its own cell and detail definitions (collection_index is a static value), so the maximum page count is fixed in the UI, and more items than that must go to server pages. Opening time with 6056 buttons was not measured.

8.1 Item icons (item renderer version)​

Research Screen Test draws the icons of cells, details and tabs with the item renderer instead of texture paths. This is the only on-screen difference from the texture version. The two versions have different namespaces (frs, frsi, frsg and frt, frti, frtg), files and texture folders, so their definitions do not mix when both are on.

  • The script sends aux: + numeric item ID * 65536 (+32768 when enchanted) in the button texture field (ANI-06, ANI-23). Diamond is aux:20054016.
  • The icon control is an inventory_item_renderer and puts ((#form_button_texture - 'aux:') - 0) into #item_id_aux (EXP-16). It is hidden on buttons whose texture does not start with the 4 bytes aux: (empty cells).
  • Numeric IDs change with each game version. The add-on uses the 26.50 table from the Bedrock Wiki (no table for 26.60 or later exists yet).
  • In 26.50, IDs 852 to 883 (32 items such as apple, spears and bundles) shift by the number of custom items. The script counts the items in ItemTypes.getAll() that are not minecraft: and are not custom blocks, adds that count, and shows it in the body of the first menu.

Results (mobile, 1.26.63, v1.4.0):

  • The item renderer drew in the cells and details built by factories and in the scroll area inside the details (materials, rewards), in both Server pages and Client pages.

  • The chest, crafting table and grass block showed in 3D, and the rest as item pictures. All items below ID 852 in the 26.50 table (diamond, iron ingot, gold ingot, emerald, bread, redstone, book and quill, book, hopper, coal, chest, crafting table, grass block, golden apple, diamond sword) were right on 1.26.63.

  • The apple cells showed a wind charge instead of an apple. The menu showed 1 custom item, so the ID sent was 882 + 1 = 883, while the 26.50 table has the wind charge at 881 (882 with 1 custom item). On 1.26.63 the numbers of the shifting range differ from the 26.50 table. Where and by how much they changed is covered in inferring numeric item IDs.

  • The tab icons (book and quill, emerald) were drawn by the item renderer too.

  • The golden apple with +32768 showed a purple glint on its edges. The glint of the diamond sword could not be told apart at the video quality.

  • The two versions and the other server form examples (the add-ons of JSON UI optimization and item numeric IDs) can be turned on in the same world. Every title starts with the shared prefix §b§w and an add-on code, and server_form.json differs only in the router line (JSON UI optimization section 9, measured). Titles of the texture version start with rt:, as in §b§wrt:Fa. Test items and script event names differ per add-on and do not collide.

  • The add-on version is in the pack names, the descriptions and the file name. When a fixed version comes out, the link above points to the new file; remove the old version and import the new one.

  • The screen text is in English, so the screen looks the same whatever the game language or font. ui/frs_items.json (server pages) and ui/frs_pages.json (client pages), which build the research screen layouts, are generated by addons/server-form-research-screen/tools/gen-items.mjs in the wiki repository, and ui/frt_items.json and ui/frt_pages.json of the texture version by addons/server-form-research-screen-texture/tools/gen-items.mjs.

IDPageContents
COL-02, COL-38, COL-47 ~ COL-50Collections and factoriesFixed index cells, data inside a router window, row stacks, grid limits
LAY-52, LAY-53, LAY-55 ~ LAY-57Controls and layoutWindow size, text layers, offset inside stacks, touch of scroll areas
INP-10, INP-11, INP-13, INP-35, INP-36Input, buttons and togglesToggle states, radio groups, client tabs and selection
BND-32BindingsA factory that creates when visible
HOST-06, HOST-51Screen hosts and data channelsScreen routing, the shared convention of the server form examples
EXP-07, EXP-15, EXP-36Expressions and operatorsContainment check, number conversion, characters that break expressions
HOST-06Screen hosts and data channelsDictionary lookup routing
Sources
idSourceLicenseCommitAccessed
repo-guideJSON UI comprehensive guide (this repository) (guide/)This project's material2026-11-13
private-researchPrivate research (-)-2026-11-13
bedrock-samplesMojang bedrock-samplesMinecraft EULA applies, (c) Mojang AB. All rights reserved15701fa9 (guide baseline 46ba6ea)2026-11-13