[Failed] Inferring numeric item IDs (aux) from the Script API
The JSON UI inventory_item_renderer draws an item from #item_id_aux = numeric item ID * 65536 + data value (ANI-06). Enchant glint adds 32768. Unlike drawing from a texture path, blocks show in 3D and glint shows (research screen section 8.1).
For an icon fixed in the resource pack, write the item identifier in #item_name of the property_bag instead of a number (ANI-51). This applies only to a name written literally in the definition JSON, not to a name set by a variable or a binding. The name-to-number rewrite runs once over the packs' definition JSON when a world is entered, and a UI reload or /reload in the world does not run it again. The renderer does not read #item_name. So it cannot be used for an item a script picks at run time (a form button texture, for example); send the number this page covers instead.
The problem is that a script has no way to know this number. This page covers how the numeric IDs are laid out (section 2), what a behavior pack script can compute from that (section 3), and ways to draw items without computing numbers, by placing the real item in an inventory slot and letting the engine draw it (section 4).
The rules were checked on 1.26.63 mobile with the probe add-on (section 5).
1. The Script API has no numeric ID
The typings of @minecraft/server 2.11.0 (stable), 2.12.0-beta.1.26.63-stable and 2.13.0-beta.1.26.70-preview.24 were checked.
| API | What it gives |
|---|---|
ItemType | id (string), localizationKey |
ItemTypes | get(id), getAll() |
BlockType | id, localizationKey |
BlockTypes | get(id), getAll() |
ItemStack | The constructor is (itemType, amount). There is no data value member |
BlockPermutation.getItemStack(), Block.getItemStack(amount, withData) | Return an ItemStack. withData is block entity data |
- No member returns a numeric ID, runtime ID, legacy ID or aux.
ActionFormData.button(text, iconPath)in@minecraft/server-uitakes only a texture path. There is no overload that draws an icon from an item type.- The only inputs a script has are the lists from
ItemTypes.getAll()andBlockTypes.getAll(). Vanilla numbers must be put into the script as a table per version.
2. Numeric ID layout (1.26.63)
The drawn number is the network runtime ID in the item registry built by whoever opened the world (a dedicated server, or the client hosting the world). The item list of a 1.26.0 world captured with ProxyPass matches the Chest-UI 26.20 table for 1813 of 1824 shared names, and custom items and blocks drew from the runtime IDs * 65536 that a Dragonfly server gave them (Ore UI loading research, 1.26.52 Windows).
| Target | Numeric ID |
|---|---|
| Vanilla items and blocks | The runtime ID in that version's server data. Items at 853 or above add C, the custom item count of all packs |
| Custom items | 853 + k, where k (from 0) is the place after lining up behavior packs in stack order and the item files inside each pack in case-insensitive path order |
| Custom blocks | Behavior packs in stack order take numbers downward from -9745 one by one, earlier pack first. Inside a pack, reverse path order. For one pack with n blocks, the j-th in path order (from 0) is -9745 - (n - 1 - j) |
2.1 Vanilla
- On 1.26.6x the vanilla numbers match
server/world/vanilla_items.nbtthat Dragonfly added in its 1.26.60 support commit (2026-10-28, gophertunnel 1.63.0, 2080 items, -1251 to 884). - The point P where custom items go in is 853 (red shrub). Vanilla numbers before it do not shift.
- 1.26.60 added
frostbite_spawn_eggat 791, so numbers from 792 on are 1 higher than on 26.50. Sending apple by its 26.50 number (882 + 1 custom item = 883) drew a wind charge on 1.26.63. - Vanilla numbers change with each version (diamond is 335 in 26.30 and 306 in 26.40, C-33). A script cannot read the game version, so the vanilla table matches the one version the add-on targets.
- There is a record that C has a cap: past 1569 custom items, nothing shifts further (Bedrock Wiki 26.50, not tested).

2.2 Order of custom items
Inside a pack, item files are sorted by path, ignoring case (the same result as JavaScript localeCompare). Why it is not another order:
- Not identifier order.
z_first.json, whose identifier isaux_probe_a, came last. - Not file name order with subfolders first.
sub/k_sub.jsoncame betweenm_mid.jsonandz_first.json. - Not byte order.
B_upper.jsoncame afteraux_probe_test.json, andm_mid.jsoncame beforem-dash.json(in bytes-comes before_). Only this one pair separates_and-. - Digits are not read as numbers.
n10.jsoncame beforen9.json.

2.3 Several behavior packs
The order between packs is the behavior pack stack order. Items and blocks use the same pack order.
- Paths are not sorted together across packs. By path, the extra pack's
c_extra.jsonwould come right after the probe pack'saux_probe_test.json, but the extra pack's 2 items came as one block before the probe pack. - Swapping the two packs in the active list swaps the blocks of both items and blocks. The order inside each pack and the vanilla shift C stay the same.


2.4 Custom blocks
- Custom blocks go downward from -9745 (= -10000 + 255) and draw in 3D. Just below the lowest vanilla number (-1278 to -1252) was empty.
- Inside a pack, reverse path order.
z_first.json, last in path order, got -9745. This differs from identifier order (a, b, c). - Custom blocks do not shift the item range. Their block items are in
ItemTypes.getAll(), but C counts custom items only.

2.5 What getAll() gives
- It gives the right custom item count C. Count the entries that are not
minecraft:and not custom blocks. - Its order cannot be trusted. Two worlds with the same registry order got
ItemTypes.getAll()orders a, d, c, test, b and c, a, d, test, b. - Discord (2026-07-09) has a report that a world with every free Marketplace add-on counted 1518, but the real shift was 1560. C with very many custom items was not checked.


3. What a script can do
| Target | From a script | How |
|---|---|---|
| Vanilla items and blocks | Possible | The target version's vanilla table + C counted with ItemTypes.getAll() (only for 853 and up) |
| The pack's own custom items and blocks | Only when the pack is first | A table built from file paths at build time. When other packs come first, it shifts by their item and block counts |
| Other packs' custom items and blocks | Not possible | A script cannot know which pack an item belongs to, the pack order, or the file paths |
A script can read neither the file paths nor the pack order, and the getAll() order cannot be trusted. So the numbers of custom items and blocks cannot be settled when other packs are in use.
A practical setup:
- Draw vanilla items and blocks from aux numbers (3D, glint).
- Draw the pack's own custom items and blocks from texture paths in its own resource pack. Textures do not depend on the pack order.
- Use a custom number table only where the pack can be fixed to come first.
3.1 Where to use it
Computing numbers in a behavior pack script and sending them to the UI is not recommended for distributed add-ons. An add-on cannot know which game version or which other packs it runs with. The vanilla table goes stale with every game update, and custom numbers shift when another pack comes first. A wrong number draws a different item, not an empty cell.
On a private server it is the best method. The operator fixes the game version, the pack list and the stack order, so a table that matches once keeps matching. It does not touch the player inventory, works in server forms and the HUD alike, and has no limit on the icon count. Rebuild the vanilla table when the server updates, and the custom number table when the pack setup changes. A custom server that sends the item list itself (Dragonfly and others) assigns the numbers, so it needs no inference at all (HUD item icons section 3).
4. Drawing from inventory slots without numbers
When a real item sits in an inventory slot such as the player hotbar or a chest, the client fills #item_id_aux of that slot itself. No number is computed, so vanilla items, custom items and other packs' items all draw correctly, with 3D and glint. The cost is borrowing player slots for a moment, or using a container screen.
| Method | Screen | Slots used | Properties |
|---|---|---|---|
| Back up slots, then fill them | HUD | As many as shown, for as long as shown | It moves player items, so a backup and restore mismatch can lose them. Being measured (section 4.4) |
| Several empty slots + lock-checked freeze (section 4.1) | HUD | As many as shown, for 1 tick | Right even when cleared after 1 tick. The most reliable |
| One slot + count-checked freeze (section 4.2) | HUD | 1 slot, 3 ticks per icon | Right at 3 ticks apart. Stackable items only |
| Entity inventory screen | Container screen | 0 player slots | The engine draws the entity slots, so there is no timing issue. Covered in the InvUI plan |
What does not work:
| Attempt | Why not |
|---|---|
| Reading inventory collections in a server form screen | With an item in slot 17, hotbar_items, combined_hotbar_and_inventory_items and inventory_items all read empty. Borrowing slots works only in the HUD |
| Reading bundle contents in the HUD | For a bundle in the hotbar, #bundle_item_renderer_data and #item_storage_current_amount were empty. Only the bundle icon shows |
Drawing an item entity with live_horse_renderer | The item entity cell was empty. Players and armor stands drew the same way (#entity_id set to the raw button text) |
| Using an entity holding the item as the icon | An invisible armor stand showed only the held item, but the held pose differs per item (on an entity with only a hand bone, flat items show as a side-on line; custom held poses) |
4.1 Several empty slots + lock-checked freeze
- The script puts display items into empty main inventory slots (for example 9 to 14) all at once. Display items get
lockMode = slot,keepOnDeath = trueand a recognizablenameTag. - On the next tick it sends one title. The HUD panel becomes visible with that title.
- The HUD reads
hotbar_itemsatcollection_index9 to 35. A hidden data panel per cell freezes#item_id_auxand#item_lock_in_slotat the moment it becomes visible, withbinding_condition: "visibility_changed". - The icon reads the data panel's values through
source_control_nameandresolve_sibling_scope: true, and shows only when the frozen#item_lock_in_slotis true. - The script clears the slots. The frozen icons stay while the title is up.
"locked": {
"type": "panel", "size": [ 18, 18 ], "collection_index": "$slot",
"controls": [
{
"data": {
"type": "panel", "size": [ 0, 0 ],
"bindings": [
{ "binding_type": "collection", "binding_collection_name": "hotbar_items", "binding_name": "#item_id_aux", "binding_condition": "visibility_changed" },
{ "binding_type": "collection", "binding_collection_name": "hotbar_items", "binding_name": "#item_lock_in_slot", "binding_condition": "visibility_changed" }
]
}
},
{
"icon": {
"type": "custom", "renderer": "inventory_item_renderer", "size": [ 16, 16 ], "layer": 2,
"property_bag": { "#item_id_aux": 0 },
"bindings": [
{ "binding_type": "view", "source_control_name": "data", "resolve_sibling_scope": true, "source_property_name": "#item_id_aux", "target_property_name": "#item_id_aux" },
{ "binding_type": "view", "source_control_name": "data", "resolve_sibling_scope": true, "source_property_name": "#item_lock_in_slot", "target_property_name": "#visible" }
]
}
}
]
}
Put this panel inside a stack panel with collection_name: "hotbar_items". The player's own items are not locked, so if the title arrives late and the slot is already empty or holds another item, the icon just stays hidden and no wrong icon is frozen.
4.2 One slot + count-checked freeze
Items go into one slot in turn, and the icons freeze one at a time. The k-th item (from 0) goes in as k + 2 items, and the k-th frozen cell shows only when the count at that moment is k + 2. The frozen cells take their step from the length of the title text (ixc:a, ixc:aa, ...). The title is sent on the tick after the item goes in.
#inventory_stack_countis the count label text, not a number. Strip the format codes before comparing, as in(((#inventory_stack_count - '§r') - '§f') = 3).- Counts start at 2. In this HUD setup (
hotbar_items), a slot with a count of 1 did not match an empty string even after the format codes were removed. - A chest screen (
container_items) gave a different result.#inventory_stack_countwas an empty string for a count of 1 and for an empty slot, and comparing without removing format codes,(#inventory_stack_count = ''), was true. Counts of 2 and 64 gave2and64and false (measured, mobile, 2026-11-16). Whether the HUD mismatch comes from the screen or from the expression that removes format codes was not isolated{unverified}. On the HUD, do not use a count of 1. - The count check is required. Freezing on the title step alone shifted by one cell at 1 tick apart and froze a different icon. With the count check, the same gap gives an empty cell instead of a wrong icon.
- Items that stack to 1, such as swords and tools, cannot change their count, so they cannot be used.
4.3 Device speed and risks
- With both methods, a late freeze gives an empty cell and never a wrong icon. Only the empty icons need a retry.
- In section 4.1, ticks only decide when the slots may be cleared. Section 4.2 needs a gap per icon, so failures grow on slow devices.
- The borrowed slots must be empty at the start. Display items (told apart by name tag) are cleared on join.
- Both methods are HUD only, and a player who opens the inventory screen while slots are borrowed sees the display items.
4.4 Test add-on
The methods of section 4 and the attempts that do not work are collected in one add-on (Item Icon Slots). The icons are diamond, chest, golden apple, netherite sword and the add-on's 2 custom items (red and blue wool pictures). The one-slot method uses 12 stackable items.
| Menu | What it does |
|---|---|
| HUD: back up slots 9-14 and fill them | Backs up the items in slots 9 to 14, puts display items in, shows them for 5 seconds and restores |
| HUD: 6 empty slots, lock check, clear after 1 tick / 10 ticks | Section 4.1. The top row (Frozen) is the frozen icons, the bottom row (Live) the current slots |
| HUD: 1 slot, count check, 3 ticks apart / 1 tick apart | Section 4.2 |
| HUD: 1 slot, no check, 1 tick apart | Section 4.2 without the count check |
| HUD: bundle contents | Puts a bundle holding a diamond and a red item into the 9th hotbar slot and draws its contents cell and stored amount |
| Form: read inventory slot 17 | Puts a diamond in slot 17 and reads four inventory collection rows in a server form |
| Form: entities holding items | An item entity, an armor stand, an invisible armor stand and an entity with only a hand bone float overhead with a diamond, a chest and a red item. The server form draws them with live_horse_renderer. The last row is the player |
- In a new world, turn on the behavior pack whose name starts with
[bedrock-research]item-icon-slots-bp. The resource pack turns on with it as a dependency. - Take "Item Icon Slots" (bundle picture) from the end of the Items category of the creative inventory.
/give @s bwiki:item_icon_slots_testworks too. - Use the item to open the menu.
/scriptevent bwiki:item_icon_slotsopens it too. HUD menus show at the top middle of the screen after the menu closes.
- Menus that need empty slots say so in chat and do not start when the slots are full. The 6-slot menus use slots 9 to 14 (the left 6 of the first main inventory row), the one-slot and form menus use slot 17, and the bundle menu uses the 9th hotbar slot.
- Only the backup menu uses full slots as they are. The backup is kept in script memory and in a player dynamic property. If the player leaves the world before the restore, the next join restores from the dynamic property, which keeps only the type, amount, name, lore, durability and enchantments.
- The server form part can be turned on in the same world as the other server form examples. Its form titles are
§b§wis:slotand§b§wis:ent, and itsserver_form.jsondiffers only in the router line (JSON UI optimization section 9, measured). - The HUD part hides every HUD title that starts with
ix, whichever pack sent it (hud_screen.json). Do not turn it on together with other packs that use HUD titles starting withix. - The text on screen is English.
5. Probe add-on
The probe registers custom items and blocks and draws 64 numeric IDs with the item renderer, each labeled with its number. The colors show what sits at each number. The menu offers 840 to 903, -1278 to -1215, -9776 to -9713, or a typed start number. The body of the first menu lists the custom items and blocks that ItemTypes.getAll() and BlockTypes.getAll() returned, in that order.
| Pack | File | Picture |
|---|---|---|
| Probe | items/a_last.json | Blue wool |
| Probe | items/aux_probe_test.json | Spyglass (launcher item) |
| Probe | items/B_upper.json | Orange wool |
| Probe | items/m_mid.json | Lime wool |
| Probe | items/m-dash.json | Purple wool |
| Probe | items/n10.json | Magenta wool |
| Probe | items/n9.json | Cyan wool |
| Probe | items/sub/k_sub.json | Yellow wool |
| Probe | items/z_first.json | Red wool |
| Probe | blocks/a_last.json, blocks/m_mid.json, blocks/z_first.json | Diamond, emerald, gold block |
| Extra | items/c_extra.json, items/y_extra.json | Pink, light blue wool |
| Extra | blocks/c_block.json | Lapis block |
File names and identifiers (aux_probe_a to aux_probe_h and so on) are deliberately in different orders.
- 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]item-aux-probe-bp. The resource pack turns on with it as a dependency, and no experimental toggle is needed. - Take "Item Aux Probe" (spyglass) from the end of the Items category of the creative inventory.
/give @s bwiki:aux_probe_testworks too. - Use the item to open the menu.
/scriptevent bwiki:aux_probeopens it too.
- Turn on the extra pack (the one whose name starts with
[bedrock-research]item-aux-probe-extra-bp) together with the probe to see the order with several packs. On its own it has no screen to open. Swapping the two packs in the active list shows the difference in section 2.3. - Custom items of other test add-ons also enter the registry, so turn them off.
- It can be turned on in the same world as the other server form examples. Its form title is
§b§wap:scan, and itsserver_form.jsondiffers only in the router line (JSON UI optimization section 9, measured). Because of the registry issue above, turn other add-ons off when measuring numeric IDs. - The text on screen is English.
Related rules
| ID | Page | Content |
|---|---|---|
| ANI-06 | Images and animation | The item renderer and #item_id_aux |
| EXP-16 | Expressions | (#v - 0) to turn a string into a number |
| HOST-17 | Screen hosts and data | Chest slot numbers and the shifting range |
| C-33 | Conflict table | Stable numeric ID range |
| id | Source | License | Commit | Accessed |
|---|---|---|---|---|
repo-guide | JSON UI comprehensive guide (this repository) (guide/) | This project's material | 2026-11-13 | |
repo-chest-ui | Chest-UI analysis (this repository) (chest-ui/) | This project's material | 2026-11-13 | |
chest-ui | Chest-UI | CC BY 4.0 (confirmed in the repository License file) | 115d95c | 2026-11-13 |
bedrock-wiki | Bedrock Wiki | CC BY 4.0 (docs/licenses/CC-BY-4.0.md in the repository) | 0930b39 | 2026-11-13 |
repo-ore-ui-loading | Ore UI loading research (this repository) (ore-ui-loading/) | This project's material | 2026-11-13 | |
private-research | Private research (-) | - | 2026-11-13 |