Difference between revisions of "User:WinX64/Slot Data"

From wiki.vg
Jump to navigation Jump to search
(→‎Format: Small corrections)
Line 48: Line 48:
 
== Structured components ==
 
== Structured components ==
  
Blah.
+
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 [https://minecraft.wiki/w/Data_component_format here].
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 58: Line 60:
 
  | 0
 
  | 0
 
  | <code>minecraft:custom_data</code>
 
  | <code>minecraft:custom_data</code>
  | Description here.
+
  | Customizable data that doesn't fit any specific component.
  | Data here.
+
  | As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Data
 +
    | {{Type|NBT}}
 +
    | Always a Compound Tag.
 +
    |}
 
  |-
 
  |-
 
  | 1
 
  | 1
 
  | <code>minecraft:max_stack_size</code>
 
  | <code>minecraft:max_stack_size</code>
  | Description here.
+
  | Maximum stack size for the item.
  | Data here.
+
  | As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Max stack size
 +
    | {{Type|VarInt}}
 +
    | Ranges from 1 to 99.
 +
    |}
 
  |-
 
  |-
 
  | 2
 
  | 2
 
  | <code>minecraft:max_damage</code>
 
  | <code>minecraft:max_damage</code>
  | Description here.
+
  | The maximum damage the item can take before breaking.
  | Data here.
+
  | As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Max damage
 +
    | {{Type|VarInt}}
 +
    |
 +
    |}
 
  |-
 
  |-
 
  | 3
 
  | 3
 
  | <code>minecraft:damage</code>
 
  | <code>minecraft:damage</code>
  | Description here.
+
  | The current damage of the item.
  | Data here.
+
  | As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Damage
 +
    | {{Type|VarInt}}
 +
    |
 +
    |}
 
  |-
 
  |-
 
  | 4
 
  | 4
 
  | <code>minecraft:unbreakable</code>
 
  | <code>minecraft:unbreakable</code>
 
  | Description here.
 
  | Description here.
  | Data here.
+
  | As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Show in tooltip
 +
    | {{Type|Boolean}}
 +
    | Whether the Unbreakable indicator should be shown on the item's tooltip.
 +
    |}
 
  |-
 
  |-
 
  | 5
 
  | 5
 
  | <code>minecraft:custom_name</code>
 
  | <code>minecraft:custom_name</code>
  | Description here.
+
  | Item's custom name.<br>Normally shown in italic, and changeable at an anvil.
  | Data here.
+
  | As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Name
 +
    | {{Type|Text Component}}
 +
    |
 +
    |}
 
  |-
 
  |-
 
  | 6
 
  | 6
 
  | <code>minecraft:item_name</code>
 
  | <code>minecraft:item_name</code>
  | Description here.
+
  | Override for the item's default name.<br>Shown when the item has no custom name.
  | Data here.
+
  | As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Name
 +
    | {{Type|Text Component}}
 +
    |
 +
    |}
 
  |-
 
  |-
 
  | 7
 
  | 7
Line 129: Line 194:
 
  | <code>minecraft:hide_additional_tooltip</code>
 
  | <code>minecraft:hide_additional_tooltip</code>
 
  | Description here.
 
  | Description here.
  | Data here.
+
  | None.
 
  |-
 
  |-
 
  | 15
 
  | 15
 
  | <code>minecraft:hide_tooltip</code>
 
  | <code>minecraft:hide_tooltip</code>
 
  | Description here.
 
  | Description here.
  | Data here.
+
  | None.
 
  |-
 
  |-
 
  | 16
 
  | 16
Line 144: Line 209:
 
  | <code>minecraft:creative_slot_lock</code>
 
  | <code>minecraft:creative_slot_lock</code>
 
  | Description here.
 
  | Description here.
  | Data here.
+
  | None.
 
  |-
 
  |-
 
  | 18
 
  | 18
Line 164: Line 229:
 
  | <code>minecraft:fire_resistant</code>
 
  | <code>minecraft:fire_resistant</code>
 
  | Description here.
 
  | Description here.
  | Data here.
+
  | None.
 
  |-
 
  |-
 
  | 22
 
  | 22

Revision as of 02:52, 10 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:
Name Type Description
Data NBT Always a Compound Tag.
1 minecraft:max_stack_size Maximum stack size for the item. As follows:
Name Type Description
Max stack size VarInt Ranges from 1 to 99.
2 minecraft:max_damage The maximum damage the item can take before breaking. As follows:
Name Type Description
Max damage VarInt
3 minecraft:damage The current damage of the item. As follows:
Name Type Description
Damage VarInt
4 minecraft:unbreakable Description here. As follows:
Name Type Description
Show in tooltip Boolean Whether the Unbreakable indicator should be shown on the item's tooltip.
5 minecraft:custom_name Item's custom name.
Normally shown in italic, and changeable at an anvil.
As follows:
Name Type Description
Name Text Component
6 minecraft:item_name Override for the item's default name.
Shown when the item has no custom name.
As follows:
Name Type Description
Name Text Component
7 minecraft:lore Description here. Data here.
8 minecraft:rarity Description here. Data here.
9 minecraft:enchantments Description here. Data here.
10 minecraft:can_place_on Description here. Data here.
11 minecraft:can_break Description here. Data here.
12 minecraft:attribute_modifiers Description here. Data here.
13 minecraft:custom_model_data Description here. Data here.
14 minecraft:hide_additional_tooltip Description here. None.
15 minecraft:hide_tooltip Description here. 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 can be described here.