UI Elements¶
Since 6.3
Basic Format¶
| Name | Description | Type / Literal |
|---|---|---|
| type | type | string |
| pos | element position optional | number[] |
| size | element size optional | int[2] |
| tooltip | tooltip optional | TextComponent | TextComponent[] |
| on_input | input action name to be posted optional | string |
| opacity | opacity optional | number |
| additional properties... |
Note: Not every element type supports opacity.
Sprite Element¶
Format
| Name | Description | Type / Literal |
|---|---|---|
| type | type | "sprite" |
| id | sprite id | string (ResourceLocation) |
| scale | scale | number |
Text Element¶
Format
| Name | Description | Type / Literal |
|---|---|---|
| type | type | "text" |
| text | text | TextComponent |
| dark_text | dark theme text optional | TextComponent |
| color | default color optional | string (TextColor) |
| dark_color | dark theme color optional | string (TextColor) |
| shadow | draw shadow optional | true | false |
| centered | center text optional | true | false |
Game Element Properties¶
Game element is a special element type that needs to be rendered in 3D space. Currently, it contains two types: block and item.
Format
| Name | Description | Type / Literal |
|---|---|---|
| properties in Basic Format | ||
| local_pos | local position optional | number[] |
| rotation | rotation optional | number[] |
| rotation_offset | rotation offset optional | number[] |
| scale | scale optional | number |
| additional properties... |
Item Element¶
Format
| Name | Description | Type / Literal |
|---|---|---|
| type | type | "item" |
| id | the item resource id | string |
| count | item amount optional | int |
| components | item components optional | dictionary |
Block Element¶
Format
| Name | Description | Type / Literal |
|---|---|---|
| type | type | "block" |
| block | the block being rendered | BlockPredicate |