Skip to main content

Server-driven Ore UI screen operations notes

Blocked from 26.64

This way of operating relies on a pack replacing the in-game page (hbui/gameplay.html), and that route worked up to 26.63. In 26.64 Mojang blocked resource pack access to Ore UI for a security reason, so the pack's page is no longer used (Source: private research). Facts such as the data store packets and Gameface behavior remain useful as reference.

These are findings from running the experiments in the previous pages as menu screens on a real server. The server sends only a screen name and data, and the layout is decided by the pack's in-game page. (Source: private research)

1. Structure​

  • Page: can be built with React 18 + react-facet (TypeScript). Components are built on ore-ui-react and @react-facet/dom-fiber.
  • Resource pack: replaces the in-game page hbui/gameplay.html. It loads the vanilla bundle and then adds its own CSS and JS. Up to 26.63, an unencrypted pack with an empty content.zipe had its page used (resource pack delivery). From 26.64 neither an encrypted pack nor a content.zipe pack changes the page.
  • Server: opens the DDUI screen, sends the root to the data store and receives presses. The client's DDUI packets are intercepted in a packet hook. If no new screen is shown after a press, closing the screen feels the same as a form button.
  • When a new root for the same form arrives, React patches only what changed, so the window, scroll position, input field text and loaded item images stay as they are. A root for a different form is redrawn from scratch.
  • Gameface does not send click to a plain div, so presses are received with mousedown.

2. Packets and the data store​

DirectionPacketHow to write it
S to CClientBoundDataDrivenUIShowScreenScreenID minecraft:custom_form, FormID is a new number per form, DataInstanceID 1
S to CClientBoundDataStoreWrites the form number, root and settings to custom_form_data_1 of the minecraft store
S to CClientBoundDataDrivenUICloseScreenCloses the screen
C to SServerBoundDataStoreAn event the page wrote to the event path
C to SServerBoundDataDrivenScreenClosedThe screen was closed
  • Instead of value patches, you can send the whole root of the same form anew every time it changes and let the client use the newest one. In that case every write is a Change and UpdateCount is incremented by one across the whole server. To use the path update Update, set PropertyUpdateCount equal to the last Change.UpdateCount of that property and raise only PathUpdateCount (DDUI guide).
  • When a screen is swapped and reopened, the client reports the previous form's close after the new form opens, so handle a close only when its FormID equals the current form.
  • The phone back button can arrive as a key other than Esc (Android KEYCODE_BACK 4, browser back 166, GoBack, BrowserBack). The page also treats these keys as close.
  • A hidden vanilla form (custom_form root) also writes to its own path. If the path contains close, you can receive it with Esc.
  • What a pack cannot do: change the vanilla DDUI layout, open a real container with Ore UI, or change the HUD. Container screens are decorated with JSON UI.

3. Gameface input and layout behavior​

  • When the window size changes, Gameface resolves a press to the position before the change. So windows of the same size switch an open screen in place, and windows of a different size open the screen anew.
  • Gameface does not deliver a press to an empty transparent element. A press on an empty spot inside the window is handled in the document's mousedown and touchstart by checking whether the target is inside the window.
  • On touch, a mousedown follows a tap. A mousedown within 700ms after a tap is treated as the same tap and ignored. The order of the tap and the mousedown differs by device (page environment section 2).
  • Gameface subtracts the min-height of a growing box from the height it receives, so do not put min-height on a growing row.
  • Gameface does not stretch an empty flex item, so set the row and cell sizes of a grid in percent.
  • The page has no canvas (getContext). Pixel art (for example an 8x8 skin face) is sent by the server as a pixel list and drawn by laying boxes out as rows and cells. The skin face is the 8x8 front of the head (hat layer included). With a skin geometry (Persona or custom model) it is read from the box UV of the first cube of the head and hat bones, otherwise from the standard skin positions (for a 64px skin, head (8,8) and hat (40,8)), and vanilla textures/ui/icon_steve is drawn when the face is empty. A face read this way came out wrong on some clients, and the cause is not verified {record}.
  • There is no engine command that opens the game chat window from a page. Commands are taken from an input field on the page and sent to the server.
  • To leave a server, the page can call vanilla vanillaGameplayLeaveGameCommandGroup.leaveGame() (the same command as the death screen's title screen button) and let the client leave on its own. Only for a client without this command does the server drop the connection.

4. Inventory click rules the server implements​

Because a real container cannot be opened with Ore UI, drawing an inventory screen with Ore UI means the server has to implement vanilla inventory handling itself. The Bedrock edition rules are as follows.

  • Left click: an empty cursor picks up the whole slot, a held stack is placed into an empty slot or onto the same item as far as it fits, and is swapped with a different item.
  • Right click: an empty cursor picks up half (rounded up), and a held stack places one into an empty slot or onto the same item. Nothing happens over a different item.
  • Double click: a second left click on the same slot within a short time (250ms) with the same shift state is a double click. Only while holding an item, it gathers the same item into the cursor, and with an empty cursor it is a normal click. A shift double click moves every item of the first shift-clicked kind out of the inventory.
  • Drag: a press holding an item places it into that slot right away, and while dragging, each time a new slot is touched, the stack held before the press is redistributed across all touched slots (left spreads evenly with the remainder staying on the cursor, right places one each).
  • Press outside the window: drops the held stack at the feet (one for right click).
  • The server has to hold the cursor item for each player. When the screen closes, it returns it to the inventory, and drops it at the feet if there is no room.
  • Touch screens have no slot tooltip.

5. Client settings​

An Ore UI page can read and change the settings the game's settings screen uses (page environment).

  • The UI profile is video.ui_profile (0 is classic). The UIProfile in the login data tells you the profile of the connected client.
  • The content logs are creator.contentLog.gui.enable, creator.contentLog.gui.showErrors, creator.contentLog.file.enable and creator.scriptDiagnostic.enableClient.
  • A setting is a game option stored on the device, so it remains after leaving the server. The setting id is the name in the settings screen tree. Get the player's consent when the server changes it.

6. Notifications and input​

  • Chat is not visible while a screen is open, so send notifications as toasts.
  • The client shows toasts one at a time in order. Merge a burst of notifications on the server with a gap between them.
  • While the use-item button is held, the client keeps sending use packets repeatedly. If you open a screen on item use, debounce it.

7. GUI scale and safe zone​

The GUI scale arrives as the html font size, so rem sizes follow it. The safe zone comes from the facet core.safeZone and is stored in CSS variables, and that margin is added to the screen and to boxes attached to the edge. On phones and tablets, the camera cutout and system handles can intercept presses at the edge.

8. Things to keep in mind​

  • When the game updates, match the vanilla bundle file names (hashes) written in the pack's hbui/gameplay.html to the install. If they are wrong, the whole in-game Ore UI does not appear. Match the font file names in the CSS @font-face too.
  • Set the screen-size box with vw and vh, not percent (on iPad the body height is 0).
  • Do not depend on the vanilla CSS and JS for a screen (on iOS the pack's hbui folder replaces the game's wholesale). The pack CSS declares fonts directly through ui://hbui/fonts.

9. Testing screens outside the game​

The page layout can be tested in a desktop browser with a stand-in engine {code}.

  • The test HTML loads the pack's hbui CSS, the page bundle and the mock engine script, and sets the html font size to 10px (the same as GUI scale 2, page environment section 8).
  • The mock engine provides on and trigger on window.engine. On trigger("query:subscribe/<name>", id, ...args) it answers on the next tick through the query:subscribed/<id> listeners. For vanilla.ddui.screenId it gives {screenId: "minecraft:custom_form"}, and for vanilla.ddui.string (arguments minecraft, custom_form_data_1) it gives the root JSON the server would send.
  • window.__commands__.vanillaDduiDataStoreSetCommandGroup.setDataStorePathString.callable pushes the arguments it receives onto an array, so the events the page would send to the server can be checked.
  • Server-side test code dumps the root the server would send for each screen to a JSON file.
  • Playwright opens the page in a 1280x720 window, adds *{animation:none!important;transition:none!important} and takes a screenshot. It is compared with a baseline image using pixelmatch (threshold: 0.1), giving the share of changed pixels.
  • This checks only whether the layout changed. A browser is not Gameface, so presses that arrive only as mousedown and the Gameface behavior in section 3 and in page environment sections 2 and 11 do not show in this test. Check those in game.
Sources
idSourceLicenseCommitAccessed
private-researchPrivate research (-)-2026-11-13
repo-ore-ui-loadingOre UI loading research (this repository) (ore-ui-loading/)This project's material2026-11-13