Difference between revisions of "User:WinX64/Slot Data"
(Removed some Optional types for consistency) |
(→Structured components: More work yet again) |
||
Line 829: | Line 829: | ||
| 36 | | 36 | ||
| <code>minecraft:debug_stick_state</code> | | <code>minecraft:debug_stick_state</code> | ||
− | | | + | | State of the debug stick |
− | | Data | + | | As follows: |
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Decorations | ||
+ | |- | ||
+ | | Data | ||
+ | | {{Type|NBT}} | ||
+ | | States of previously interacted blocks. Always a Compound Tag. | ||
+ | |} | ||
|- | |- | ||
| 37 | | 37 | ||
| <code>minecraft:entity_data</code> | | <code>minecraft:entity_data</code> | ||
− | | | + | | Data for the entity to be created from this item. |
− | | Data | + | | As follows: |
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Decorations | ||
+ | |- | ||
+ | | Data | ||
+ | | {{Type|NBT}} | ||
+ | | Always a Compound Tag. | ||
+ | |} | ||
|- | |- | ||
| 38 | | 38 | ||
| <code>minecraft:bucket_entity_data</code> | | <code>minecraft:bucket_entity_data</code> | ||
− | | | + | | Data of the entity contained in this bucket. |
− | | Data | + | | As follows: |
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Decorations | ||
+ | |- | ||
+ | | Data | ||
+ | | {{Type|NBT}} | ||
+ | | Always a Compound Tag. | ||
+ | |} | ||
|- | |- | ||
| 39 | | 39 | ||
| <code>minecraft:block_entity_data</code> | | <code>minecraft:block_entity_data</code> | ||
− | | | + | | Data of the block entity to be created from this item. |
− | | Data | + | | As follows: |
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Decorations | ||
+ | |- | ||
+ | | Data | ||
+ | | {{Type|NBT}} | ||
+ | | Always a Compound Tag. | ||
+ | |} | ||
|- | |- | ||
| 40 | | 40 | ||
| <code>minecraft:instrument</code> | | <code>minecraft:instrument</code> | ||
− | | Description | + | | The sound played when using a goat horn. |
− | + | | As follows: | |
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | Instrument Type | ||
+ | | {{Type|VarInt}} | ||
+ | | Identifier used to determine the data that follows. It can be either: | ||
+ | * 0 - Directly represents an instrument, with the necessary data following. | ||
+ | * Anything else - References an instrument in its registry, by the ID of <code>Instrument Type - 1</code>. | ||
+ | |- | ||
+ | | Sound Event Type | ||
+ | | {{Type|Optional}} {{Type|VarInt}} | ||
+ | | Identifier used to determine the data that follows. It can be either: | ||
+ | * 0 - Directly represents an instrument, with the necessary data following. | ||
+ | * Anything else - References an instrument in its registry, by the ID of <code>Instrument Type - 1</code>. | ||
+ | Only present if Instrument Type is 0. | ||
+ | |- | ||
+ | | Sound Name | ||
+ | | {{Type|Optional}} {{Type|Identifier}} | ||
+ | | Only present if Instrument Type and Sound Event Type are 0. | ||
+ | |- | ||
+ | | Has Fixed Range | ||
+ | | {{Type|Optional}} {{Type|Boolean}} | ||
+ | | Whether this sound has a fixed range, as opposed to a variable volume based on distance. Only present if Instrument Type and Sound Event Type are 0. | ||
+ | |- | ||
+ | | Fixed Range | ||
+ | | {{Type|Optional}} {{Type|Float}} | ||
+ | | The maximum range of the sound. Only present if Instrument Type and Sound Event Type are 0. | ||
+ | |- | ||
+ | | Use duration | ||
+ | | {{Type|Optional}} {{Type|Float}} | ||
+ | | The maximum range of the sound. Only present if Instrument Type is 0. | ||
+ | |- | ||
+ | | Range | ||
+ | | {{Type|Optional}} {{Type|Float}} | ||
+ | | The range of the instrument. Only present if Instrument Type is 0. | ||
+ | |} | ||
|- | |- | ||
| 41 | | 41 | ||
| <code>minecraft:ominous_bottle_amplifier</code> | | <code>minecraft:ominous_bottle_amplifier</code> | ||
− | | | + | | Amplifier for the effect of an ominous bottle. |
− | | | + | | As follows: |
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | Amplifier | ||
+ | | {{Type|VarInt}} | ||
+ | | Between 0 and 4. | ||
+ | |} | ||
|- | |- | ||
| 42 | | 42 | ||
| <code>minecraft:recipes</code> | | <code>minecraft:recipes</code> | ||
− | | | + | | The recipes this knowledge book unlocks. |
− | | Data | + | | As follows: |
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Decorations | ||
+ | |- | ||
+ | | Data | ||
+ | | {{Type|NBT}} | ||
+ | | Always a Compound Tag. | ||
+ | |} | ||
|- | |- | ||
| 43 | | 43 | ||
| <code>minecraft:lodestone_tracker</code> | | <code>minecraft:lodestone_tracker</code> | ||
− | | Description | + | | The lodestone this compass points to. |
− | + | | As follows: | |
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | Has Global Position | ||
+ | | {{Type|Boolean}} | ||
+ | | Whether this lodestone points to a position, otherwise it spins randomly. | ||
+ | |- | ||
+ | | Dimension | ||
+ | | {{Type|Identifier}} | ||
+ | | The dimension the compass points to. Only present if Has Global Position is true. | ||
+ | |- | ||
+ | | Position | ||
+ | | {{Type|Position}} | ||
+ | | The position the compass points to. Only present if Has Global Position is true. | ||
+ | |- | ||
+ | | Tracked | ||
+ | | {{Type|Boolean}} | ||
+ | | Whether the component is removed when the associated lodestone is broken. | ||
+ | |} | ||
|- | |- | ||
| 44 | | 44 |
Revision as of 03:08, 14 June 2024
The Slot data structure defines how an item is represented when inside an inventory window of any kind, such as a chest or furnace.
This page presents the new Slot data structure, using structured components. You can find the documentation of the old structure, that utilizes raw NBT data, here.
Contents
Format
Some description does here.
Name | Type | Meaning | |||
---|---|---|---|---|---|
Item Count | VarInt | The item count. Every following field is only present if this value is greater than zero. | |||
Item ID | Optional VarInt | The item ID. Item IDs are distinct from block IDs; see Data Generators for more information. | |||
Number of components to add | Optional VarInt | Number of elements present in the first data component array | |||
Number of components to remove | Optional VarInt | Number of elements present in the second data component array. This serve as a way to remove the default component values that are present on some items. | |||
Components to add | Component type | Optional Array | VarInt Enum | The type of component. See Structured components for more detail. | |
Component data | Varies | The component-dependent data. See Structured components for more detail. | |||
Components to remove | Component type | Optional Array | VarInt Enum | The type of component. See Structured components for more detail. |
Structured components
The complete list of available components is described below. Items marked in blue cause no noticeable impact on the client, and mainly concern server-side operations.
For a more in-depth description, and information on how the items below are encoded with the NBT format, check here.
Type | Name | Description | Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | minecraft:custom_data
|
Customizable data that doesn't fit any specific component. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | minecraft:max_stack_size
|
Maximum stack size for the item. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | minecraft:max_damage
|
The maximum damage the item can take before breaking. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 | minecraft:damage
|
The current damage of the item. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 | minecraft:unbreakable
|
Marks the item as unbrekable. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5 | minecraft:custom_name
|
Item's custom name. Normally shown in italic, and changeable at an anvil. |
As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6 | minecraft:item_name
|
Override for the item's default name. Shown when the item has no custom name. |
As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7 | minecraft:lore
|
Item's lore. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8 | minecraft:rarity
|
Item's rarity. This affects the default color of the item's name. |
As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9 | minecraft:enchantments
|
The enchantments of the item. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 | minecraft:can_place_on
|
List of blocks this block can be placed on when in adventure mode. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
11 | minecraft:can_break
|
List of blocks this item can break when in adventure mode. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 | minecraft:attribute_modifiers
|
The attribute modifiers of the item. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
13 | minecraft:custom_model_data
|
Value for the item predicate when using custom item models. More info can be found here. |
As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14 | minecraft:hide_additional_tooltip
|
|
None. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 | minecraft:hide_tooltip
|
Hides the item's tooltip altogether. | None. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
16 | minecraft:repair_cost
|
Accumulated anvil usage cost. The client displays "Too Expensive" if the value is greater than 40 and the player is not in creative mode (more specifically, if they don't have the insta-build flag enabled). This behavior can be overridden by setting the level with the Set Container Property packet. |
As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 | minecraft:creative_slot_lock
|
Marks the item as non-interactive on the creative inventory (the first 5 rows of items). This is used internally by the client on the paper icon in the saved hot-bars tab. |
None. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
18 | minecraft:enchantment_glint_override
|
Overrides the item glint resulted from enchantments | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
19 | minecraft:intangible_projectile
|
Marks the projectile as intangible (cannot be picked-up). |
As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 | minecraft:food
|
Makes the item consumable. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
21 | minecraft:fire_resistant
|
Marks this item as fire resistant. The client won't render the item as being on-fire if this component is present. |
None. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 | minecraft:tool
|
Alters the speed at which this item breaks certain blocks | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
23 | minecraft:stored_enchantments
|
The enchantments stored in this enchanted book. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
24 | minecraft:dyed_color
|
Color of dyed leather armor. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
25 | minecraft:map_color
|
Color of the markings on the map item model. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
26 | minecraft:map_id
|
The ID of the map. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
27 | minecraft:map_decorations
|
Icons present on a map. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
28 | minecraft:map_post_processing
|
Used internally by the client when expanding or locking a map. Display extra information on the item's tooltip when the component is present. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
29 | minecraft:charged_projectiles
|
Projectiles loaded into a charged crossbow. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
30 | minecraft:bundle_contents
|
Contents of a bundle. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
31 | minecraft:potion_contents
|
Visual and effects of a potion item. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
32 | minecraft:suspicious_stew_effects
|
Effects granted by a suspicious stew. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33 | minecraft:writable_book_content
|
Content of a writable book. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
34 | minecraft:written_book_content
|
Content of a written and signed book. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
35 | minecraft:trim
|
Armor's trim pattern and color | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
36 | minecraft:debug_stick_state
|
State of the debug stick | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
37 | minecraft:entity_data
|
Data for the entity to be created from this item. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
38 | minecraft:bucket_entity_data
|
Data of the entity contained in this bucket. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
39 | minecraft:block_entity_data
|
Data of the block entity to be created from this item. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
40 | minecraft:instrument
|
The sound played when using a goat horn. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
41 | minecraft:ominous_bottle_amplifier
|
Amplifier for the effect of an ominous bottle. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
42 | minecraft:recipes
|
The recipes this knowledge book unlocks. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
43 | minecraft:lodestone_tracker
|
The lodestone this compass points to. | As follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44 | minecraft:firework_explosion
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
45 | minecraft:fireworks
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
46 | minecraft:profile
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
47 | minecraft:note_block_sound
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
48 | minecraft:banner_patterns
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
49 | minecraft:base_color
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
50 | minecraft:pot_decorations
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
51 | minecraft:container
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
52 | minecraft:block_state
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
53 | minecraft:bees
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
54 | minecraft:lock
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
55 | minecraft:container_loot
|
Description here. | Data here. |
Other types
Common types used in multiple components are described below.
Block Predicate
Describes a predicate used when block filtering is necessary. It can be parameterized to account for the type of block, the values of specific block state properties, NBT data related to block entities, or any combination of the three.
Name | Type | Description |
---|---|---|
Has Blocks | Boolean | Whether this predicate is tied to specific types of blocks. |
Blocks | Optional Block Set | See Block Set. Only present if Has Blocks is true. |
Has Properties | Boolean | Whether this predicate is tied to specific properties of a block. |
Number of Properties | Optional VarInt | Number of elements in the following array. Only present if Has Properties is true. |
Properties | Optional Array of Property | See Property structure below. Only present if Has Properties is true. |
Has NBT | Boolean | Whether this predicate is tied to specific block entity data. |
NBT | Optional NBT | Only present is Has NBT is true. |
The Property structure is defined as follows:
Name | Type | Description |
---|---|---|
Name | String | Name of the block state property. |
Is Exact Match | Boolean | Whether this is an exact value match, as opposed to ranged. |
Exact Value | Optional String | Value of the block state property. Only present in exact match mode. |
Min Value | Optional String | Minimum value of the block state property range. Only present in ranged match mode. |
Max Value | Optional String | Maximum value of the block state property range. Only present in ranged match mode. |
Block Set
Represents a list of block types, either directly (enumerated IDs) or indirectly (block tag).
Name | Type | Description |
---|---|---|
Type | VarInt | Identifier used to determine the data that follows. It can be either:
|
Tag name | Optional Identifier | A tag representing a set of blocks. Only present if Type is 0. |
Block IDs | Optional Array of VarInt | An array of block IDs. Only present if Type is not 0. The size of the array is equal to Type - 1 .
|
Potion Effect
Describes all the aspects of a potion effect.
Name | Type | Description |
---|---|---|
Type ID | VarInt Enum | The ID of the effect in the potion effect type registry. |
Details | Detail | See Detail structure below. |
The Detail structure is defined as follows:
Name | Type | Description | |||
---|---|---|---|---|---|
Amplifier | VarInt | ||||
Duration | VarInt | -1 for infinite. | |||
Ambient | Boolean | Produces more translucent particle effects if true. | |||
Show Particles | Boolean | Completely hides effect particles if false. | |||
Show Icon | Boolean | Shows the potion icon in the inventory screen if true. | |||
Has Hidden Effect | Boolean | Used to store the state of the previous potion effect when a stronger one is applied. This guarantees that the weaker one will persist, in case it lasts longer.
| |||
Hidden Effect | Optional Detail | Only present if Has Hidden Effect is true. |