Skip to main content

Items, progress displays, and slots

These controls render items already present in the machine helper entity's container_items collection. They do not create an inventory, move items, or choose an IO mode. The script and entity definition own that behavior; JSON UI only displays the corresponding collection index.

Item display controls

ElementCell / renderer sizeHoverIntended use
uc.button_item_display18 / 16Button behaviorSmall collection-backed button icon.
uc.item_display18 / 16NoSmall read-only item or state frame.
uc.item_display_medium34 / 32NoMedium read-only item.
uc.item_display_large50 / 48NoLarge read-only resource fill or illustration.
uc.item_display_hover18 / 16YesSmall item with item tooltip and focus navigation.
uc.item_display_hover_medium34 / 32YesMedium item with tooltip.
uc.item_display_hover_large50 / 48YesLarge item with tooltip; used by resource bars.
uc.progress_display34 / 32NoAnimated progress-frame item. Focus navigation is disabled.
uc.output_item26 / 26Native slotLarge output item primitive.
uc.input_item18 / 18Native slotStandard container item primitive.
Display a script-updated progress frame
{
"progress@uc.progress_display": {
"collection_index": 2,
"offset": [28, 23]
}
}

progress_display does not calculate progress. The machine script updates the item at index 2 to the correct frame identifier, and the UI renders that item.

Common item-renderer variables

The display controls expose the variables below. A wrapper may fix some values to its documented size.

VariableTypeDefaultPurpose
$cell_image_size[number, number]Depends on controlOverall cell image size.
$cell_overlay_refcontrol reference"common.cell_overlay"Overlay used for stack count, durability, and storage indicators.
$stack_count_requiredbooleantrueEnables the stack-count overlay.
$durability_bar_requiredbooleantrueEnables the durability overlay when applicable.
$storage_bar_requiredbooleantrueEnables the storage overlay when applicable.
$item_renderercontrol reference"common.item_renderer"Minecraft item-renderer control.
$item_renderer_panel_size[number, number]Depends on controlPanel containing the rendered item.
$item_renderer_size[number, number]Depends on controlRendered item size.
$item_renderer_offset[number, number][0, 0]Item offset inside its renderer panel.

Hover variants additionally accept:

VariableTypeDefaultPurpose
$button_refcontrol reference"uc.slot_button"Button/tooltip implementation placed over the item.
$focus_idstring""Controller focus identifier.
$focus_override_upstring""Explicit focus destination when moving up.
$focus_override_downstring""Explicit focus destination when moving down.
$focus_override_leftstring""Explicit focus destination when moving left.
$focus_override_rightstring""Explicit focus destination when moving right.

Internal item primitives

uc._slot_visual and uc._slot_visual_hover implement the renderer, overlay, count, durability/storage bars, and focus bindings used by the public controls. _slot_visual_hover also accepts $button_ref. Their remaining variables are the common item-renderer and focus variables listed above.

Prefer a public item_display* wrapper unless you are building a new shared UI abstraction and need full control over the renderer internals.

Machine slots

ElementSizeVariablesWhat it displays
uc.input_slot18x18$slot_background_texture = textures/ui/slots/input_1_slotInteractive container item with an input outline.
uc.fuel_slot18x18NoneInteractive container item with the fuel outline.
uc.upgrade_slot18x18$show_slot_background = trueInteractive upgrade slot; its outline can be hidden.
uc.output_slot26x26$slot_background_texture = textures/ui/slots/output_1_slotLarger interactive container item with an output outline.
Input, progress, and output
{
"input@uc.input_slot": {
"collection_index": 3,
"offset": [0, 30]
}
},
{
"progress@uc.progress_display": {
"collection_index": 2,
"offset": [28, 23]
}
},
{
"output@uc.output_slot": {
"collection_index": 4,
"offset": [56, 26]
}
}
Slot names are exact

The recognized numbered controls are input_1_slot through input_9_slot and output_1_slot through output_9_slot. Names such as input_1, input_2, or output_1 are not UI Core controls.

Numbered input aliases

uc.input_1_slot through uc.input_9_slot inherit uc.input_slot and set the matching outline texture. Use the number assigned by the machine's IO definition.

{
"secondary_input@uc.input_2_slot": {
"collection_index": 4,
"offset": [18, 30]
}
}

Numbered output aliases

uc.output_1_slot through uc.output_9_slot inherit uc.output_slot and select the matching output outline.

IO state outline textures

These textures are also consumed by uc.io_face_outline to explain the state encoded by an IO button item.