Difference between revisions of "User:WinX64/Slot Data"
Jump to navigation
Jump to search
(→Structured components: Some work) |
(→Structured components: More work done) |
||
Line 116: | Line 116: | ||
| 4 | | 4 | ||
| <code>minecraft:unbreakable</code> | | <code>minecraft:unbreakable</code> | ||
− | | | + | | Marks the item as unbrekable. |
| As follows: | | As follows: | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 158: | Line 158: | ||
| 7 | | 7 | ||
| <code>minecraft:lore</code> | | <code>minecraft:lore</code> | ||
− | | | + | | Item's lore. |
− | | | + | | As follows: |
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | Number of lines | ||
+ | | {{Type|VarInt}} | ||
+ | | Number of elements in the following array. | ||
+ | |- | ||
+ | | Lines | ||
+ | | {{Type|Array}} of {{Type|Text Component}} | ||
+ | | | ||
+ | |} | ||
|- | |- | ||
| 8 | | 8 | ||
| <code>minecraft:rarity</code> | | <code>minecraft:rarity</code> | ||
− | | Description | + | | Item's rarity.<br>This affects the default color of the item's name. |
− | | | + | | As follows: |
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | Rarity | ||
+ | | {{Type|VarInt}} {{Type|Enum}} | ||
+ | | Can be one of the following: | ||
+ | * 0 - Common (white) | ||
+ | * 1 - Uncommon (yellow) | ||
+ | * 2 - Rare (aqua) | ||
+ | * 3 - Epic (pink) | ||
+ | |} | ||
|- | |- | ||
| 9 | | 9 | ||
| <code>minecraft:enchantments</code> | | <code>minecraft:enchantments</code> | ||
− | | Description | + | | The enchantments of the item. |
− | + | | As follows: | |
+ | {| class="wikitable" | ||
+ | ! colspan="2"| Name | ||
+ | ! colspan="2"| Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | colspan="2"| Number of enchantments | ||
+ | | colspan="2"| {{Type|VarInt}} | ||
+ | | Number of elements in the following array. | ||
+ | |- | ||
+ | | rowspan="2"| Enchantment | ||
+ | | Type ID | ||
+ | | rowspan="2"| {{Type|Array}} | ||
+ | | {{Type|VarInt}} {{Type|Enum}} | ||
+ | | The ID of the enchantment in the enchantment registry. | ||
+ | |- | ||
+ | | Level | ||
+ | | {{Type|VarInt}} | ||
+ | | The level of the enchantment. | ||
+ | |- | ||
+ | | colspan="2"| Show in tooltip | ||
+ | | colspan="2"| {{Type|Boolean}} | ||
+ | | Whether the list of enchantments should be shown on the item's tooltip. | ||
+ | |} | ||
|- | |- | ||
| 10 | | 10 | ||
| <code>minecraft:can_place_on</code> | | <code>minecraft:can_place_on</code> | ||
− | | Description | + | | List of blocks this block can be placed on when in adventure mode. |
− | + | | As follows: | |
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | Number of predicates | ||
+ | | {{Type|VarInt}} | ||
+ | | Number of elements in the following array. | ||
+ | |- | ||
+ | | Block predicates | ||
+ | | {{Type|Array}} of [[#Block_Predicate|Block Predicate]] | ||
+ | | | ||
+ | |- | ||
+ | | Show in tooltip | ||
+ | | {{Type|Boolean}} | ||
+ | | Whether the list of blocks should be shown on the item's tooltip. | ||
+ | |} | ||
|- | |- | ||
| 11 | | 11 | ||
| <code>minecraft:can_break</code> | | <code>minecraft:can_break</code> | ||
− | | Description | + | | List of blocks this item can break when in adventure mode. |
− | + | | As follows: | |
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | Number of predicates | ||
+ | | {{Type|VarInt}} | ||
+ | | Number of elements in the following array. | ||
+ | |- | ||
+ | | Block predicates | ||
+ | | {{Type|Array}} of [[#Block_Predicate|Block Predicate]] | ||
+ | | | ||
+ | |- | ||
+ | | Show in tooltip | ||
+ | | {{Type|Boolean}} | ||
+ | | Whether the list of blocks should be shown on the item's tooltip. | ||
+ | |} | ||
|- | |- | ||
| 12 | | 12 | ||
| <code>minecraft:attribute_modifiers</code> | | <code>minecraft:attribute_modifiers</code> | ||
− | | Description | + | | The attribute modifiers of the item. |
− | + | | As follows: | |
+ | {| class="wikitable" | ||
+ | ! colspan="2"| Name | ||
+ | ! colspan="2"| Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | colspan="2"| Number of attributes | ||
+ | | colspan="2"| {{Type|VarInt}} | ||
+ | | Number of elements in the following array. | ||
+ | |- | ||
+ | | rowspan="6"| Attribute | ||
+ | | Type ID | ||
+ | | rowspan="6"| {{Type|Array}} | ||
+ | | {{Type|VarInt}} {{Type|Enum}} | ||
+ | | The ID of the attribute. | ||
+ | |- | ||
+ | | Unique ID | ||
+ | | {{Type|UUID}} | ||
+ | | The attribute's unique ID. | ||
+ | |- | ||
+ | | Name | ||
+ | | {{Type|String}} | ||
+ | | The attribute's name. | ||
+ | |- | ||
+ | | Value | ||
+ | | {{Type|Double}} | ||
+ | | The attribute's value. | ||
+ | |- | ||
+ | | Operation | ||
+ | | {{Type|VarInt}} {{Type|Enum}} | ||
+ | | The operation to be applied upon the value. Can be one of the following: | ||
+ | * 0 - Add | ||
+ | * 1 - Multiply base | ||
+ | * 2 - Multiply total | ||
+ | |- | ||
+ | | Slot | ||
+ | | {{Type|VarInt}} {{Type|Enum}} | ||
+ | | The item slot placement required for the attribute to have effect.<br>Can be one of the following: | ||
+ | * 0 - Any | ||
+ | * 1 - Main hand | ||
+ | * 2 - Off hand | ||
+ | * 3 - Hand | ||
+ | * 4 - Feet | ||
+ | * 5 - Legs | ||
+ | * 6 - Chest | ||
+ | * 7 - Head | ||
+ | * 8 - Armor | ||
+ | * 9 - Body | ||
+ | |- | ||
+ | | colspan="2"| Show in tooltip | ||
+ | | colspan="2"| {{Type|Boolean}} | ||
+ | | Whether the list of attributes should be shown on the item's tooltip. | ||
+ | |} | ||
|- | |- | ||
| 13 | | 13 | ||
| <code>minecraft:custom_model_data</code> | | <code>minecraft:custom_model_data</code> | ||
− | | | + | | Value for the item predicate when using custom item models.<br>More info can be found [https://minecraft.wiki/w/Tutorials/Models#Item_predicates here]. |
− | | | + | | As follows: |
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | Value | ||
+ | | {{Type|VarInt}} | ||
+ | | | ||
+ | |} | ||
|- | |- | ||
| 14 | | 14 | ||
| <code>minecraft:hide_additional_tooltip</code> | | <code>minecraft:hide_additional_tooltip</code> | ||
− | | | + | | {{Need Info|What is considered as "additional"? What exact items does this hide?}} |
| None. | | None. | ||
|- | |- | ||
| 15 | | 15 | ||
| <code>minecraft:hide_tooltip</code> | | <code>minecraft:hide_tooltip</code> | ||
− | | | + | | Hides the item's tooltip altogether. |
| None. | | None. | ||
|- | |- | ||
Line 402: | Line 546: | ||
|} | |} | ||
− | === | + | == Other types == |
+ | |||
+ | Common types used in multiple components are described below. | ||
+ | |||
+ | === Block Predicate === | ||
− | + | Describe the block predicate type here. | |
[[Category:Protocol Details]] | [[Category:Protocol Details]] | ||
[[Category:Minecraft Modern]] | [[Category:Minecraft Modern]] |
Revision as of 00:11, 11 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.
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 | Optional VarInt Enum | The type of component. See Structured components for more detail. | |
Component data | Optional Varies | The component-dependent data. See Structured components for more detail. | |||
Components to remove | Component type | Optional Array | Optional 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
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
17 | minecraft:creative_slot_lock
|
Description here. | None. | |||||||||||||||||||||||||||||||||||
18 | minecraft:enchantment_glint_override
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
19 | minecraft:intangible_projectile
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
20 | minecraft:food
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
21 | minecraft:fire_resistant
|
Description here. | None. | |||||||||||||||||||||||||||||||||||
22 | minecraft:tool
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
23 | minecraft:stored_enchantments
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
24 | minecraft:dyed_color
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
25 | minecraft:map_color
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
26 | minecraft:map_id
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
27 | minecraft:map_decorations
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
28 | minecraft:map_post_processing
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
29 | minecraft:charged_projectiles
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
30 | minecraft:bundle_contents
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
31 | minecraft:potion_contents
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
32 | minecraft:suspicious_stew_effects
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
33 | minecraft:writable_book_content
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
34 | minecraft:written_book_content
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
35 | minecraft:trim
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
36 | minecraft:debug_stick_state
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
37 | minecraft:entity_data
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
38 | minecraft:bucket_entity_data
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
39 | minecraft:block_entity_data
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
40 | minecraft:instrument
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
41 | minecraft:ominous_bottle_amplifier
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
42 | minecraft:recipes
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
43 | minecraft:lodestone_tracker
|
Description here. | Data here. | |||||||||||||||||||||||||||||||||||
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
Describe the block predicate type here.