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

From wiki.vg
Jump to navigation Jump to search
(Content moved to the page on the main namespace)
Tag: Blanking
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
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, [[Special:Permalink/18899|here]].
 
 
= Format =
 
 
Some description does here.
 
 
{| class="wikitable"
 
! colspan="2"| Name
 
! colspan="2"| Type
 
! Meaning
 
|-
 
| colspan="2"| Item Count
 
| colspan="2"| {{Type|VarInt}}
 
| The item count. Every following field is only present if this value is greater than zero.
 
|-
 
| colspan="2"| Item ID
 
| colspan="2"| {{Type|Optional}} {{Type|VarInt}}
 
| The {{Minecraft Wiki|Java Edition data values#Blocks|item ID}}. Item IDs are distinct from block IDs; see [[Data Generators]] for more information.
 
|-
 
| colspan="2"| Number of components to add
 
| colspan="2"| {{Type|Optional}} {{Type|VarInt}}
 
| Number of elements present in the first data component array
 
|-
 
| colspan="2"| Number of components to remove
 
| colspan="2"| {{Type|Optional}} {{Type|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.
 
|-
 
| rowspan="2"| Components to add
 
| Component type
 
| rowspan="2"| {{Type|Optional}} {{Type|Array}}
 
| {{Type|Optional}} {{Type|VarInt}} {{Type|Enum}}
 
| colspan="2"| The type of component. See [[#Structured_components|Structured components]] for more detail.
 
|-
 
| Component data
 
| {{Type|Optional}} Varies
 
| colspan="1"| The component-dependent data. See [[#Structured_components|Structured components]] for more detail.
 
|-
 
| rowspan="1"| Components to remove
 
| Component type
 
| rowspan="1"| {{Type|Optional}} {{Type|Array}}
 
| {{Type|Optional}} {{Type|VarInt}} {{Type|Enum}}
 
| colspan="2"| The type of component. See [[#Structured_components|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 [https://minecraft.wiki/w/Data_component_format here].
 
 
{| class="wikitable"
 
! Type
 
! Name
 
! Description
 
! style="width: 50%" | Data
 
|-
 
| 0
 
| <code>minecraft:custom_data</code>
 
| Customizable data that doesn't fit any specific component.
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | Data
 
    | {{Type|NBT}}
 
    | Always a Compound Tag.
 
    |}
 
|-
 
| 1
 
| <code>minecraft:max_stack_size</code>
 
| Maximum stack size for the item.
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | Max Stack Size
 
    | {{Type|VarInt}}
 
    | Ranges from 1 to 99.
 
    |}
 
|-
 
| 2
 
| <code>minecraft:max_damage</code>
 
| The maximum damage the item can take before breaking.
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | Max Damage
 
    | {{Type|VarInt}}
 
    |
 
    |}
 
|-
 
| 3
 
| <code>minecraft:damage</code>
 
| The current damage of the item.
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | Damage
 
    | {{Type|VarInt}}
 
    |
 
    |}
 
|-
 
| 4
 
| <code>minecraft:unbreakable</code>
 
| Marks the item as unbrekable.
 
| 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
 
| <code>minecraft:custom_name</code>
 
| Item's custom name.<br>Normally shown in italic, and changeable at an anvil.
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | Name
 
    | {{Type|Text Component}}
 
    |
 
    |}
 
|-
 
| 6
 
| <code>minecraft:item_name</code>
 
| Override for the item's default name.<br>Shown when the item has no custom name.
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | Name
 
    | {{Type|Text Component}}
 
    |
 
    |}
 
|-
 
| 7
 
| <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
 
| <code>minecraft:rarity</code>
 
| 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
 
| <code>minecraft:enchantments</code>
 
| 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
 
| <code>minecraft:can_place_on</code>
 
| 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]]
 
    | See [[#Block_Predicate|Block Predicate]].
 
    |-
 
    | Show In Tooltip
 
    | {{Type|Boolean}}
 
    | Whether the Unbreakable indicator should be shown on the item's tooltip.
 
    |}
 
|-
 
| 11
 
| <code>minecraft:can_break</code>
 
| 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]]
 
    | See [[#Block_Predicate|Block Predicate]].
 
    |-
 
    | Show In Tooltip
 
    | {{Type|Boolean}}
 
    | Whether the Unbreakable indicator should be shown on the item's tooltip.
 
    |}
 
|-
 
| 12
 
| <code>minecraft:attribute_modifiers</code>
 
| 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
 
| <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
 
| <code>minecraft:hide_additional_tooltip</code>
 
| {{Need Info|What is considered as "additional"? What exact items does this hide?}}
 
| None.
 
|-
 
| 15
 
| <code>minecraft:hide_tooltip</code>
 
| Hides the item's tooltip altogether.
 
| None.
 
|-
 
| 16
 
| <code>minecraft:repair_cost</code>
 
| 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 [[Protocol#Player_Abilities_(clientbound)|insta-build flag enabled]]).<br>This behavior can be overridden by setting the level with the [[Protocol#Set_Container_Property|Set Container Property]] packet.
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | Cost
 
    | {{Type|VarInt}}
 
    |
 
    |}
 
|-
 
| 17
 
| <code>minecraft:creative_slot_lock</code>
 
| Marks the item as non-interactive on the creative inventory (the first 5 rows of items).<br>This is used internally by the client on the paper icon in the saved hot-bars tab.
 
| None.
 
|-
 
| 18
 
| <code>minecraft:enchantment_glint_override</code>
 
| Overrides the item glint resulted from enchantments
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | Has Glint
 
    | {{Type|VarInt}}
 
    |
 
    |}
 
|-
 
| 19
 
| <code>minecraft:intangible_projectile</code>
 
| Marks the projectile as intangible (cannot be picked-up).<br>{{Warning2|The Notchian client utilizes the codec meant for chat parsing (and NBT in general) when handling this component, even though it contains no data. This causes an empty Compound Tag to be written, which is likely an unintended bug.}}
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | Value
 
    | {{Type|NBT}}
 
    | Always a Compound Tag, and always empty.
 
    |}
 
|-
 
| 20
 
| <code>minecraft:food</code>
 
| Makes the item consumable.
 
| As follows:
 
  {| class="wikitable"
 
    ! colspan="2"| Name
 
    ! colspan="2"| Type
 
    ! Description
 
    |-
 
    | colspan="2"| Nutrition
 
    | colspan="2"| {{Type|VarInt}}
 
    | Non-negative
 
    |-
 
    | colspan="2"| Saturation
 
    | colspan="2"| {{Type|Boolean}}
 
    |
 
    |-
 
    | colspan="2"| Can Always Eat
 
    | colspan="2"| {{Type|Boolean}}
 
    | Whether the item can always be eaten, even at full hunger.
 
    |-
 
    | colspan="2"| Seconds To Eat
 
    | colspan="2"| {{Type|Float}}
 
    | How long it takes to consume the item.
 
    |-
 
    | colspan="2"| Number of effects
 
    | colspan="2"| {{Type|VarInt}}
 
    | Number of elements in the following array.
 
    |-
 
    | rowspan="2"| Effect
 
    | Type ID
 
    | rowspan="2"| {{Type|Array}}
 
    | [[#Potion_Effect|Potion Effect]]
 
    | The potion effect. See [[#Potion_Effect|Potion Effect]].
 
    |-
 
    | Probability
 
    | {{Type|Float}}
 
    | The probability for this effect to be chosen.
 
    |}
 
|-
 
| 21
 
| <code>minecraft:fire_resistant</code>
 
| Marks this item as fire resistant.<br>The client won't render the item as being on-fire if this component is present.
 
| None.
 
|-
 
| 22
 
| <code>minecraft:tool</code>
 
| Alters the speed at which this item breaks certain blocks
 
| As follows:
 
  {| class="wikitable"
 
    ! colspan="2"| Name
 
    ! colspan="2"| Type
 
    ! Description
 
    |-
 
    | colspan="2"| Number of Rules
 
    | colspan="2"| {{Type|VarInt}}
 
    | The number of elements in the following array.
 
    |-
 
    | rowspan="5"| Rule
 
    | Blocks
 
    | rowspan="5"| {{Type|Array}}
 
    | [[#Block_Set|Block Set]]
 
    | The block this rule applies to. See [[#Block_Set|Block Set]].
 
    |-
 
    | Has Speed
 
    | {{Type|Boolean}}
 
    |
 
    |-
 
    | Speed
 
    | {{Type|Optional}} {{Type|Float}}
 
    | The speed at which the tool breaks this rules' blocks. Only present if Has Speed is true.
 
    |-
 
    | Has Correct Drop For Blocks
 
    | {{Type|Boolean}}
 
    |
 
    |-
 
    | Correct Drop For Blocks
 
    | {{Type|Optional}} {{Type|Boolean}}
 
    | Whether items should drop only if this is the correct tool. Only present if Has Correct Drop For Blocks is true.
 
    |-
 
    | colspan="2"| Default Mining Speed
 
    | colspan="2"| {{Type|Float}}
 
    | The mining speed in case none of the previous rule were matched.
 
    |-
 
    | colspan="2"| Damage Per Block
 
    | colspan="2"| {{Type|VarInt}}
 
    | The amount of damage the item takes per block break.
 
    |}
 
|-
 
| 23
 
| <code>minecraft:stored_enchantments</code>
 
| The enchantments stored in this enchanted book.
 
| 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.
 
    |}
 
|-
 
| 24
 
| <code>minecraft:dyed_color</code>
 
| Color of dyed leather armor.
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | Color
 
    | {{Type|Int}}
 
    | The RGB components of the color, encoded as an integer.
 
    |-
 
    | Show In Tooltip
 
    | {{Type|Boolean}}
 
    | Whether the armor's color should be shown on the item's tooltip.
 
    |}
 
|-
 
| 25
 
| <code>minecraft:map_color</code>
 
| Color of the markings on the map item model.
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | Color
 
    | {{Type|Int}}
 
    | The RGB components of the color, encoded as an integer.
 
    |}
 
|-
 
| 26
 
| <code>minecraft:map_id</code>
 
| The ID of the map.
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | ID
 
    | {{Type|VarInt}}
 
    |
 
    |}
 
|-
 
| 27
 
| <code>minecraft:map_decorations</code>
 
| Icons present on a map.
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Decorations
 
    |-
 
    | Data
 
    | {{Type|NBT}}
 
    | Always a Compound Tag.
 
    |}
 
|-
 
| 28
 
| <code>minecraft:map_post_processing</code>
 
| 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:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Decorations
 
    |-
 
    | Type
 
    | {{Type|VarInt}} {{Type|Enum}}
 
    | Type of post processing. Can be either:
 
* 0 - Lock
 
* 1 - Scale
 
    |}
 
|-
 
| 29
 
| <code>minecraft:charged_projectiles</code>
 
| Projectiles loaded into a charged crossbow.
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Decorations
 
    |-
 
    | Number Of Projectiles
 
    | {{Type|VarInt}}
 
    | The number of elements in the following array.
 
    |-
 
    | Projectiles
 
    | {{Type|Array}} of {{Type|Slot}}
 
    | The projectiles.
 
    |}
 
|-
 
| 30
 
| <code>minecraft:bundle_contents</code>
 
| Contents of a bundle.
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Decorations
 
    |-
 
    | Number Of Items
 
    | {{Type|VarInt}}
 
    | The number of elements in the following array.
 
    |-
 
    | Items
 
    | {{Type|Array}} of {{Type|Slot}}
 
    | The projectiles.
 
    |}
 
|-
 
| 31
 
| <code>minecraft:potion_contents</code>
 
| Visual and effects of a potion item.
 
| As follows:
 
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Decorations
 
    |-
 
    | Potion ID
 
    | {{Type|VarInt}}
 
    | The ID of the potion type in the potion registry.
 
    |-
 
    | Has Custom Color
 
    | {{Type|Boolean}}
 
    | Whether this potion has a custom color. If false, it uses the default color associated with the potion type.
 
    |-
 
    | Custom Color
 
    | {{Type|Int}}
 
    | The RGB components of the color, encoded as an integer.
 
    |-
 
    | Number Of Custom Effects
 
    | {{Type|VarInt}}
 
    | The number of elements in the following array.
 
    |-
 
    | Custom Effects
 
    | {{Type|Array}} of [[#Potion_Effect|Potion Effect]]
 
    | Any custom effects the potion might have. See [[#Potion_Effect|Potion Effect]].
 
    |}
 
|-
 
| 32
 
| <code>minecraft:suspicious_stew_effects</code>
 
| Effects granted by a suspicious stew.
 
| As follows:
 
  {| class="wikitable"
 
    ! colspan="2"| Name
 
    ! colspan="2"| Type
 
    ! Description
 
    |-
 
    | colspan="2"| Number Of Effects
 
    | colspan="2"| {{Type|VarInt}}
 
    | Number of elements in the following array.
 
    |-
 
    | rowspan="2"| Effect
 
    | Type ID
 
    | rowspan="2"| {{Type|Array}}
 
    | {{Type|VarInt}} {{Type|Enum}}
 
    | The ID of the effect in the potion effect type registry.
 
    |-
 
    | Duration
 
    | {{Type|VarInt}}
 
    | The duration of the effect.
 
    |}
 
|-
 
| 33
 
| <code>minecraft:writable_book_content</code>
 
| Description here.
 
| Data here.
 
|-
 
| 34
 
| <code>minecraft:written_book_content</code>
 
| Description here.
 
| Data here.
 
|-
 
| 35
 
| <code>minecraft:trim</code>
 
| Description here.
 
| Data here.
 
|-
 
| 36
 
| <code>minecraft:debug_stick_state</code>
 
| Description here.
 
| Data here.
 
|-
 
| 37
 
| <code>minecraft:entity_data</code>
 
| Description here.
 
| Data here.
 
|-
 
| 38
 
| <code>minecraft:bucket_entity_data</code>
 
| Description here.
 
| Data here.
 
|-
 
| 39
 
| <code>minecraft:block_entity_data</code>
 
| Description here.
 
| Data here.
 
|-
 
| 40
 
| <code>minecraft:instrument</code>
 
| Description here.
 
| Data here.
 
|-
 
| 41
 
| <code>minecraft:ominous_bottle_amplifier</code>
 
| Description here.
 
| Data here.
 
|-
 
| 42
 
| <code>minecraft:recipes</code>
 
| Description here.
 
| Data here.
 
|-
 
| 43
 
| <code>minecraft:lodestone_tracker</code>
 
| Description here.
 
| Data here.
 
|-
 
| 44
 
| <code>minecraft:firework_explosion</code>
 
| Description here.
 
| Data here.
 
|-
 
| 45
 
| <code>minecraft:fireworks</code>
 
| Description here.
 
| Data here.
 
|-
 
| 46
 
| <code>minecraft:profile</code>
 
| Description here.
 
| Data here.
 
|-
 
| 47
 
| <code>minecraft:note_block_sound</code>
 
| Description here.
 
| Data here.
 
|-
 
| 48
 
| <code>minecraft:banner_patterns</code>
 
| Description here.
 
| Data here.
 
|-
 
| 49
 
| <code>minecraft:base_color</code>
 
| Description here.
 
| Data here.
 
|-
 
| 50
 
| <code>minecraft:pot_decorations</code>
 
| Description here.
 
| Data here.
 
|-
 
| 51
 
| <code>minecraft:container</code>
 
| Description here.
 
| Data here.
 
|-
 
| 52
 
| <code>minecraft:block_state</code>
 
| Description here.
 
| Data here.
 
|-
 
| 53
 
| <code>minecraft:bees</code>
 
| Description here.
 
| Data here.
 
|-
 
| 54
 
| <code>minecraft:lock</code>
 
| Description here.
 
| Data here.
 
|-
 
| 55
 
| <code>minecraft:container_loot</code>
 
| 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.
 
 
{| class="wikitable"
 
! Name
 
! Type
 
! Description
 
|-
 
| Has Blocks
 
| {{Type|Boolean}}
 
| Whether this predicate is tied to specific types of blocks.
 
|-
 
| Blocks
 
| {{Type|Optional}} [[#Block_Set|Block Set]]
 
| See [[#Block_Set|Block Set]]. Only present if Has Blocks is true.
 
|-
 
| Has Properties
 
| {{Type|Boolean}}
 
| Whether this predicate is tied to specific properties of a block.
 
|-
 
| Number of Properties
 
| {{Type|Optional}} {{Type|VarInt}}
 
| Number of elements in the following array. Only present if Has Properties is true.
 
|-
 
| Properties
 
| {{Type|Optional}} {{Type|Array}} of Property
 
| See Property structure below. Only present if Has Properties is true.
 
|-
 
| Has NBT
 
| {{Type|Boolean}}
 
| Whether this predicate is tied to specific block entity data.
 
|-
 
| NBT
 
| {{Type|Optional}} {{Type|NBT}}
 
| Only present is Has NBT is true.
 
|}
 
 
The Property structure is defined as follows:
 
 
{| class="wikitable"
 
! Name
 
! Type
 
! Description
 
|-
 
| Name
 
| {{Type|String}}
 
| Name of the block state property.
 
|-
 
| Is Exact Match
 
| {{Type|Boolean}}
 
| Whether this is an exact value match, as opposed to ranged.
 
|-
 
| Exact Value
 
| {{Type|Optional }} {{Type|String}}
 
| Value of the block state property. Only present in exact match mode.
 
|-
 
| Min Value
 
| {{Type|Optional}} {{Type|String}}
 
| Minimum value of the block state property range. Only present in ranged match mode.
 
|-
 
| Max Value
 
| {{Type|Optional}} {{Type|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).
 
 
{| class="wikitable"
 
! Name
 
! Type
 
! Description
 
|-
 
| Type
 
| {{Type|VarInt}}
 
| Identifier used to determine the data that follows. It can be either:
 
* 0 - Represents a named set of blocks, defined by a tag.
 
* Anything else - Represents an enumerated set of blocks, defined by block IDs.
 
|-
 
| Tag name
 
| {{Type|Optional}} {{Type|Identifier}}
 
| A tag representing a set of blocks. Only present if Type is 0.
 
|-
 
| Block IDs
 
| {{Type|Optional}} {{Type|Array}} of {{Type|VarInt}}
 
| An array of block IDs. Only present if Type is not 0.<br>The size of the array is equal to <code>Type - 1</code>.
 
|}
 
 
=== Potion Effect ===
 
 
Describes all the aspects of a potion effect.
 
 
{| class="wikitable"
 
! Name
 
! Type
 
! Description
 
|-
 
| Type ID
 
| {{Type|VarInt}} {{Type|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:
 
 
{| class="wikitable"
 
! Name
 
! Type
 
! Description
 
|-
 
| Amplifier
 
| {{Type|VarInt}}
 
|
 
|-
 
| Duration
 
| {{Type|VarInt}}
 
| -1 for infinite.
 
|-
 
| Ambient
 
| {{Type|Boolean}}
 
| Produces more translucent particle effects if true.
 
|-
 
| Show Particles
 
| {{Type|Boolean}}
 
| Completely hides effect particles if false.
 
|-
 
| Show Icon
 
| {{Type|Boolean}}
 
| Shows the potion icon in the inventory screen if true.
 
|-
 
| Has Hidden Effect
 
| {{Type|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.
 
{{Need Info|This behavior seems to be entirely server-sided. Does the presence of this field actually has any noticeable impact on the client?}}
 
|-
 
| Hidden Effect
 
| {{Type|Optional}} Detail
 
| Only present if Has Hidden Effect is true.
 
|}
 
 
[[Category:Protocol Details]]
 
[[Category:Minecraft Modern]]
 

Latest revision as of 13:53, 14 June 2024