Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
(→‎Global palette: 18w15a -> 18w22c)
(Add Slot Display to data types.)
 
(651 intermediate revisions by 46 users not shown)
Line 1: Line 1:
This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently [[Protocol version numbers|1.12.2, protocol 340]]) to the current pre-release (currently [[Protocol version numbers|18w22c, protocol 382]]). Note that this page contains bleeding-edge information that may not be completely or correctly documented.
+
This page documents the changes from release 1.21.1 (protocol 767) to the current release (1.21.3, protocol 768). The stable protocol documentation is currently lagging behind, and the changes documented here will be merged soon, once they are complete. The current pre-release (snapshot 24w44a) is not yet documented.
  
 
One who wishes to commandeer the merging of this into [[Protocol]] when an update is made must be sure to respect any changes that may have occurred to the respective packets there.
 
One who wishes to commandeer the merging of this into [[Protocol]] when an update is made must be sure to respect any changes that may have occurred to the respective packets there.
Line 9: Line 9:
 
=== Data types ===
 
=== Data types ===
  
==== Other definitions ====
+
{| class="wikitable"
 +
|-
 +
! Name
 +
! Size (bytes)
 +
! Encodes
 +
! Notes
 +
|- {{added}}
 +
! id=Type:Teleport_Flags | {{Type|Teleport Flags}}
 +
| 4
 +
| See [[#Teleport Flags]]
 +
| Bit field specifying how a teleportation is to be applied on each axis.
 +
|- {{added}}
 +
! id=Type:Recipe_Display | {{Type|Recipe Display}}
 +
| Varies
 +
| See [[Recipes#Recipe Display structure]]
 +
| Description of a recipe for use for use by the client.
 +
|- {{added}}
 +
! id=Type:Slot_Display | {{Type|Slot Display}}
 +
| Varies
 +
| See [[Recipes#Slot Display structure]]
 +
| Description of a recipe ingredient slot for use for use by the client.
 +
|}
 +
 
 +
==== Teleport Flags ====
 +
 
 +
A bit field represented as an {{Type|Int}}, specifying how a teleportation is to be applied on each axis.
  
===== Global palette =====
+
In the lower 8 bits of the bit field, a set bit means the teleportation on the corresponding axis is relative, and an unset bit that it is absolute.
A table/dictionary/palette mapping nonnegative integers to block states. {{change|The block state IDs can be constructed from this table by multiplying what the Minecraft Wiki calls “block IDs” by 16 and adding the metadata/damage value (or in most programming languages block_id << 4 {{!}} metadata).|Block state IDs are created in a linear fashion based off of order of assignment.  One block state ID allocated for each unique block state for a block; if a block has multiple properties then the number of allocated states is the product of the number of values for each property.  A current list of properties and state ID ranges is found on [http://pokechu22.github.io/Burger/18w22c.html burger].}}
 
  
{{Change||Alternatively, the vanilla server now includes an option to export the current block state ID mapping, by running <code>java -cp minecraft_server.18w22c.jar net.minecraft.data.Main --reports</code> (use <code>--help</code> for a list of other options). One can parse the generated <code>blocks.json</code> to convert known block states to and from ids.}}
+
{| class="wikitable"
 +
|-
 +
! Hex Mask
 +
! Field
 +
|-
 +
| 0x0001
 +
| Relative X
 +
|-
 +
| 0x0002
 +
| Relative Y
 +
|-
 +
| 0x0004
 +
| Relative Z
 +
|-
 +
| 0x0008
 +
| Relative Yaw
 +
|-
 +
| 0x0010
 +
| Relative Pitch
 +
|- {{added}}
 +
| 0x0020
 +
| Relative Velocity X
 +
|- {{added}}
 +
| 0x0040
 +
| Relative Velocity Y
 +
|- {{added}}
 +
| 0x0080
 +
| Relative Velocity Z
 +
|- {{added}}
 +
| 0x0100
 +
  | Rotate velocity according to the change in rotation, ''before'' applying the velocity change in this packet. Combining this with absolute rotation works as expected&mdash;the difference in rotation is still used.
 +
|}
  
 
=== Packets ===
 
=== Packets ===
Line 23: Line 78:
 
  !colspan="2"| Documentation
 
  !colspan="2"| Documentation
 
  |-
 
  |-
!colspan="4"| Handshaking serverbound
+
!colspan="4"| Play clientbound
{{PacketList|0x00|Handshake}}
+
{{PacketList|0x12|Close Container}}
 +
{{PacketList|0x13|Set Container Content}}
 +
{{PacketList|0x14|Set Container Property}}
 +
{{PacketList|0x15|Set Container Slot}}
 +
{{PacketList|0x17|Set Cooldown}}
 +
{{PacketList|{{change|0x70|0x20}}|Teleport Entity}}
 +
{{PacketList|{{change|0x20|0x21}}|Explosion}}
 +
{{PacketList|{{change|0x23|0x24}}|Open Horse Screen}}
 +
{{PacketList|{{change|0x2B|0x2C}}|Login (play)}}
 +
{{PacketList|0x31|Move Minecart Along Track|rel=added}}
 +
{{PacketList|{{change|0x37|0x39}}|Place Ghost Recipe}}
 +
{{PacketList|{{change|0x3E|0x40}}|Player Info Update}}
 +
{{PacketList|{{change|0x40|0x42}}|Synchronize Player Position}}
 +
{{PacketList|0x41|Update Recipe Book|pre=removed}}
 +
{{PacketList|0x43|Player Rotation|rel=added}}
 +
{{PacketList|0x44|Recipe Book Add|rel=added}}
 +
{{PacketList|0x45|Recipe Book Remove|rel=added}}
 +
{{PacketList|0x46|Recipe Book Settings|rel=added}}
 +
{{PacketList|{{change|0x47|0x4C}}|Respawn}}
 +
{{PacketList|0x5a|Set Cursor Item|rel=added}}
 +
{{PacketList|{{change|0x53|0x63}}|Set Held Item|pre=unchanged}}
 +
{{PacketList|0x66|Set Player Inventory Slot|rel=added}}
 +
{{PacketList|{{change|0x64|0x6b}}|Update Time}}
 +
{{PacketList|0x77|Synchronize Vehicle Position|rel=added}}
 +
{{PacketList|{{change|0x77|0x7e}}|Update Recipes}}
 
  |-
 
  |-
!colspan="4"| Play clientbound
+
!colspan="4"| Play serverbound
{{PacketList|0x04|Spawn Painting}}
+
{{PacketList|0x02|Bundle Item Selected|rel=added}}
{{PacketList|0x07|Statistics}}
+
{{PacketList|0x0b|Client Tick End|rel=added}}
{{PacketList|0x09|Update Block Entity}}
+
{{PacketList|{{change|0x0E|0x10}}|Click Container}}
{{PacketList|0x0B|Block Change}}
+
{{PacketList|{{change|0x0F|0x11}}|Close Container}}
{{PacketList|{{change|0x0F|0x0E}}|Chat Message (clientbound)|pre=unchanged}}
+
{{PacketList|{{change|0x14|0x16}}|Edit Book}}
{{PacketList|{{change|0x10|0x0F}}|Multi Block Change}}
+
{{PacketList|{{change|0x1A|0x1C}}|Set Player Position}}
{{PacketList|{{change|0x0E|0x10}}|Tab-Complete (clientbound)}}
+
{{PacketList|{{change|0x1B|0x1D}}|Set Player Position and Rotation}}
{{PacketList|0x11|Declare Commands|rel=added}}
+
{{PacketList|{{change|0x1C|0x1E}}|Set Player Rotation}}
{{PacketList|{{change|0x11|0x12}}|Confirm Transaction (clientbound)|pre=unchanged}}
+
{{PacketList|0x1D|Set Player On Ground|pre=removed}}
{{PacketList|{{change|0x12|0x13}}|Close Window (clientbound)|pre=unchanged}}
+
{{PacketList|0x1F|Set Player Movement Flags|rel=added}}
{{PacketList|{{change|0x13|0x14}}|Open Window|pre=unchanged}}
+
{{PacketList|{{change|0x22|0x24}}|Place Recipe}}
{{PacketList|{{change|0x14|0x15}}|Window Items|pre=unchanged}}
+
{{PacketList|{{change|0x26|0x28}}|Player Input}}
{{PacketList|{{change|0x15|0x16}}|Window Property|pre=unchanged}}
+
{{PacketList|{{change|0x29|0x2B}}|Set Seen Recipe}}
{{PacketList|{{change|0x16|0x17}}|Set Slot|pre=unchanged}}
+
{{PacketList|{{change|0x38|0x3A}}|Use Item On}}
{{PacketList|{{change|0x17|0x18}}|Set Cooldown|pre=unchanged}}
 
{{PacketList|{{change|0x18|0x19}}|Plugin Message (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x19|0x1A}}|Named Sound Effect}}
 
{{PacketList|{{change|0x1A|0x1B}}|Disconnect (play)|pre=unchanged}}
 
{{PacketList|{{change|0x1B|0x1C}}|Entity Status|pre=unchanged}}
 
{{PacketList|{{change|0x1C|0x1D}}|Explosion|pre=unchanged}}
 
{{PacketList|{{change|0x1D|0x1E}}|Unload Chunk|pre=unchanged}}
 
{{PacketList|{{change|0x1E|0x1F}}|Change Game State|pre=unchanged}}
 
{{PacketList|{{change|0x1F|0x20}}|Keep Alive (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x20|0x21}}|Chunk Data}}
 
{{PacketList|{{change|0x21|0x22}}|Effect|pre=unchanged}}
 
{{PacketList|{{change|0x22|0x23}}|Spawn Particle}}
 
{{PacketList|{{change|0x23|0x24}}|Join Game|pre=unchanged}}
 
{{PacketList|{{change|0x24|0x25}}|Map}}
 
{{PacketList|{{change|0x25|0x26}}|Entity|pre=unchanged}}
 
{{PacketList|{{change|0x26|0x27}}|Entity Relative Move|pre=unchanged}}
 
{{PacketList|{{change|0x27|0x28}}|Entity Look And Relative Move|pre=unchanged}}
 
{{PacketList|{{change|0x28|0x29}}|Entity Look|pre=unchanged}}
 
{{PacketList|{{change|0x29|0x2A}}|Vehicle Move (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x2A|0x2B}}|Open Sign Editor|pre=unchanged}}
 
{{PacketList|{{change|0x2B|0x2C}}|Craft Recipe Response}}
 
{{PacketList|{{change|0x2C|0x2D}}|Player Abilities (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x2D|0x2E}}|Combat Event|pre=unchanged}}
 
{{PacketList|{{change|0x2E|0x2F}}|Player List Item|pre=unchanged}}
 
{{PacketList|0x30|Face Player|rel=added}}
 
{{PacketList|{{change|0x2F|0x31}}|Player Position And Look (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x30|0x32}}|Use Bed|pre=unchanged}}
 
{{PacketList|{{change|0x31|0x33}}|Unlock Recipes}}
 
{{PacketList|{{change|0x32|0x34}}|Destroy Entities|pre=unchanged}}
 
{{PacketList|{{change|0x33|0x35}}|Remove Entity Effect|pre=unchanged}}
 
{{PacketList|{{change|0x34|0x36}}|Resource Pack Send|pre=unchanged}}
 
{{PacketList|{{change|0x35|0x37}}|Respawn|pre=unchanged}}
 
{{PacketList|{{change|0x36|0x38}}|Entity Head Look|pre=unchanged}}
 
{{PacketList|{{change|0x37|0x39}}|Select Advancement Tab|pre=unchanged}}
 
{{PacketList|{{change|0x38|0x3A}}|World Border|pre=unchanged}}
 
{{PacketList|{{change|0x39|0x3B}}|Camera|pre=unchanged}}
 
{{PacketList|{{change|0x3A|0x3C}}|Held Item Change (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x3B|0x3D}}|Display Scoreboard|pre=unchanged}}
 
{{PacketList|{{change|0x3C|0x3E}}|Entity Metadata|pre=unchanged}}
 
{{PacketList|{{change|0x3D|0x3F}}|Attach Entity|pre=unchanged}}
 
{{PacketList|{{change|0x3E|0x40}}|Entity Velocity|pre=unchanged}}
 
{{PacketList|{{change|0x3F|0x41}}|Entity Equipment|pre=unchanged}}
 
{{PacketList|{{change|0x40|0x42}}|Set Experience|pre=unchanged}}
 
{{PacketList|{{change|0x41|0x43}}|Update Health|pre=unchanged}}
 
{{PacketList|{{change|0x42|0x44}}|Scoreboard Objective}}
 
{{PacketList|{{change|0x43|0x45}}|Set Passengers|pre=unchanged}}
 
{{PacketList|{{change|0x44|0x46}}|Teams}}
 
{{PacketList|{{change|0x45|0x47}}|Update Score|pre=unchanged}}
 
{{PacketList|{{change|0x46|0x48}}|Spawn Position|pre=unchanged}}
 
{{PacketList|{{change|0x47|0x49}}|Time Update|pre=unchanged}}
 
{{PacketList|{{change|0x48|0x4A}}|Title|pre=unchanged}}
 
{{PacketList|0x4B|Stop Sound|rel=added}}
 
{{PacketList|{{change|0x49|0x4C}}|Sound Effect|pre=unchanged}}
 
{{PacketList|{{change|0x4A|0x4D}}|Player List Header And Footer|pre=unchanged}}
 
{{PacketList|{{change|0x4B|0x4E}}|Collect Item|pre=unchanged}}
 
{{PacketList|{{change|0x4C|0x4F}}|Entity Teleport|pre=unchanged}}
 
{{PacketList|{{change|0x4D|0x50}}|Advancements|pre=unchanged}}
 
{{PacketList|{{change|0x4E|0x51}}|Entity Properties|pre=unchanged}}
 
{{PacketList|{{change|0x4F|0x52}}|Entity Effect|pre=unchanged}}
 
{{PacketList|0x53|Declare Recipes|rel=added}}
 
{{PacketList|0x54|Tags|rel=added}}
 
|-
 
!colspan="4"| Play serverbound
 
{{PacketList|{{change|0x02|0x01}}|Chat Message (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x03|0x02}}|Client Status|pre=unchanged}}
 
{{PacketList|{{change|0x04|0x03}}|Client Settings|pre=unchanged}}
 
{{PacketList|{{change|0x01|0x04}}|Tab-Complete (serverbound)}}
 
{{PacketList|0x12|Craft Recipe Request}}
 
{{PacketList|0x17|Recipe Book Data}}
 
 
  |}
 
  |}
  
== New/modified data types ==
+
== Entity Metadata ==
  
=== [[Slot]] ===
+
=== Entity Metadata Format ===
 +
 
 +
==== Painting Variant ====
 +
 
 +
{{See also|Registry Data#Painting Variant}}
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 121: Line 135:
 
  ! Meaning
 
  ! Meaning
 
  |-
 
  |-
  | {{Change|Block ID|Item ID}}
+
| Width
| Short
+
  | {{Type|Int}}
  | The {{Minecraft Wiki|Data values#Block IDs|item{{change|/block}} ID}}. A value of <code>-1</code> signifies that the slot is empty, and no further data follows. {{Change||Item IDs are now uniquely defined and are completely independent of block IDs.}}
+
  | The width of the painting, in blocks.  
 
  |-
 
  |-
  | Item Count
+
  | Height
  | Optional Byte
+
  | {{Type|Int}}
| Not present if Block ID is <code>-1</code>.
+
  | The height of the painting, in blocks.  
|- style="background-color: #f4cccc; text-decoration: line-through;"
 
| Item Damage
 
| Optional Short
 
  | Not present if Block ID is <code>-1</code>.
 
 
  |-
 
  |-
  | NBT
+
  | Asset ID
  | Optional NBT
+
  | {{Type|Identifier}}
  | Not present if Block ID is <code>-1</code>. If 0, there is no NBT data, and no further data follows. Otherwise the byte is the start of an NBT blob as shown below:
+
  | The texture for the painting.
 +
The Notchian client uses the corresponding asset located at
 +
<code>textures/painting</code>.
 +
|- {{added}}
 +
| Has title
 +
| {{Type|Boolean}}
 +
|
 +
|- {{added}}
 +
| Title
 +
| {{Type|Optional}} {{Type|Text Component}}
 +
| The displayed title of the painting. Only present if Has title is true.
 +
|- {{added}}
 +
| Has author
 +
| {{Type|Boolean}}
 +
|
 +
|- {{added}}
 +
| Author
 +
| {{Type|Optional}} {{Type|Text Component}}
 +
| The displayed author of the painting. Only present if Has author is true.
 
  |}
 
  |}
  
=== Particle ===
+
== Registry Data ==
 +
 
 +
=== Painting Variant ===
 +
 
 +
The <code>minecraft:painting_variant</code> registry. It defines the textures and dimensions for the game's paintings.
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Field Name
+
  ! Name
  ! Field Type
+
  ! Type
 
  ! Meaning
 
  ! Meaning
 +
! Values
 
  |-
 
  |-
  | ID
+
  | asset_id
  | VarInt
+
  | [[NBT#Specification:string_tag|String Tag]]
  | The ID of the particle type, see below.
+
  | The texture for the painting.
 +
The Notchian client uses the corresponding asset located at
 +
<code>textures/painting</code>.
 +
| Example: "minecraft:backyard".
 
  |-
 
  |-
  | Data
+
  | height
  | Varies
+
  | [[NBT#Specification:int_tag|Int Tag]]
  | Varies based on the particle type, see below.
+
| The height of the painting, in blocks.
 +
| Example: <code>2</code>
 +
|-
 +
| width
 +
| [[NBT#Specification:int_tag|Int Tag]]
 +
  | The width of the painting, in blocks.
 +
|
 +
|- {{added}}
 +
| title
 +
| [[NBT#Specification:compound_tag|Compound Tag]] or [[NBT#Specification:string_tag|String Tag]]
 +
| The displayed title of the painting. See [[Text formatting]].
 +
| Example: <code>{"color": "gray", "translate": "painting.minecraft.skeleton.title"}</code>
 +
|- {{added}}
 +
| author
 +
| [[NBT#Specification:compound_tag|Compound Tag]] or [[NBT#Specification:string_tag|String Tag]]
 +
| The displayed author of the painting. See [[Text formatting]].
 +
| Example: <code>{"color": "gray", "translate": "painting.minecraft.skeleton.author"}</code>
 
  |}
 
  |}
 +
 +
== Slot Data ==
 +
 +
=== Structured components ===
  
 
{| class="wikitable"
 
{| class="wikitable"
 +
! Type
 +
! Name
 +
! Description
 +
! style="width: 50%" | Data
 +
|- {{added}}
 +
| 6
 +
| <code>minecraft:item_model</code>
 +
| Item's model.
 +
| As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Model
 +
    | {{Type|Identifier}}
 +
    |
 +
    |}
 
  |-
 
  |-
  ! Particle Name
+
  | {{change|20|21}}
! Particle ID
+
| <code>minecraft:food</code>
! Data
+
| Makes the item {{change|consumable|restore the player's hunger bar when consumed}}.
  |-
+
| As follows:
  | <code>minecraft:ambient_entity_effect</code>
+
  {| class="wikitable"
  | 0
+
    ! colspan="2"| Name
  | None
+
    ! colspan="2"| Type
|-
+
    ! Description
| <code>minecraft:angry_villager</code>
+
    |-
| 1
+
    | colspan="2"| Nutrition
  | None
+
    | colspan="2"| {{Type|VarInt}}
  |-
+
    | Non-negative
  | <code>minecraft:barrier</code>
+
    |-
  | 2
+
    | colspan="2"| Saturation Modifier
  | None
+
    | colspan="2"| {{Type|Float}}
  |-
+
    | How much saturation will be given after consuming the item.
  | <code>minecraft:block</code>
+
    |-
  | 3
+
    | colspan="2"| Can Always Eat
  |
+
    | colspan="2"| {{Type|Boolean}}
{| class="wikitable"
+
    | Whether the item can always be eaten, even at full hunger.
  ! Field Name
+
    |- {{removed}}
  ! Field Type
+
    | colspan="2"| Seconds To Eat
  ! Meaning
+
    | colspan="2"| {{Type|Float}}
  |-
+
    | How long it takes to consume the item.
  | BlockState
+
    |- {{removed}}
  | VarInt
+
    | colspan="2"| Using converts to
  | The ID of the block state.
+
    | colspan="2"| {{Type|Slot Data}}
  |}
+
    | This specifies the item produced after consuming the current item. In the Notchian server, this is used for stews, which turn into bowls. Set this to Air if the item should be consumed normally without leaving any other item after.
 +
    |- {{removed}}
 +
    | colspan="2"| Number of effects
 +
    | colspan="2"| {{Type|VarInt}}
 +
    | Number of elements in the following array.
 +
    |- {{removed}}
 +
    | rowspan="2"| Effect
 +
    | Type ID
 +
    | rowspan="2"| {{Type|Array}}
 +
    | [[#Potion_Effect|Potion Effect]]
 +
    | The potion effect. See [[#Potion_Effect|Potion Effect]].
 +
    |- {{removed}}
 +
    | Probability
 +
    | {{Type|Float}}
 +
    | The probability for this effect to be chosen.
 +
    |}
 +
  |- {{added}}
 +
| 22
 +
  | <code>minecraft:consumable</code>
 +
  | Makes the item consumable.
 +
  | As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Consume seconds
 +
    | {{Type|Float}}
 +
    | How long it takes to consume the item.
 +
    |-
 +
    | Animation
 +
    | {{Type|VarInt}} {{Type|Enum}}
 +
    | 0: none, 1: eat, 2: drink, 3: block, 4: bow, 5: spear, 6: crossbow, 7: spyglass, 8: toot_horn, 9: brush
 +
    |-
 +
    | Sound
 +
    | {{Type|ID or}} {{Type|Sound Event}}
 +
    | ID in the <code>minecraft:sound_event</code> registry, or an inline definition.
 +
    |-
 +
    | Has consume particles
 +
    | {{Type|Boolean}}
 +
    |
 +
    |-
 +
    | Number of effects
 +
    | {{Type|VarInt}}
 +
    | Number of elements in the following array.
 +
    |-
 +
    | Effects
 +
    | {{Type|Array}} of [[#Consume Effect|Consume Effect]]
 +
    | Effects to apply on consumption. See [[#Consume Effect|Consume Effect]].
 +
    |}
 +
  |- {{added}}
 +
  | 23
 +
  | <code>minecraft:use_remainder</code>
 +
  | This specifies the item produced after using the current item. In the Notchian server, this is used for stews, which turn into bowls.
 +
  | As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Remainder
 +
    | {{Type|Slot}}
 +
    |
 +
    |}
 +
  |- {{added}}
 +
| 24
 +
  | <code>minecraft:use_cooldown</code>
 +
  | Cooldown to apply on use of the item.
 +
  | As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Seconds
 +
    | {{Type|Float}}
 +
    |
 +
    |-
 +
    | Cooldown group
 +
    | {{Type|Optional}} {{Type|Identifier}}
 +
    | Group of items to apply the cooldown to. Only present if Has cooldown group is true; otherwise defaults to the item's identifier.
 +
    |}
 
  |-
 
  |-
  | <code>minecraft:bubble</code>
+
| {{change|21|25}}
  | 4
+
  | <code>minecraft:{{change|fire|damage}}_resistant</code>
  | None
+
  | Marks this item as {{change|fire|damage}} resistant.<br>The client won't render the item as being on-fire if this component is present.
|-
+
  | {{change|None.|As follows:}}
| <code>minecraft:cloud</code>
+
  {| class="wikitable" {{added}}
| 5
+
    ! Name
  | None
+
    ! Type
  |-
+
    ! Description
  | <code>minecraft:crit</code>
+
    |-
  | 6
+
    | Types
  | None
+
    | {{Type|Identifier}}
|-
+
    | Tag specifying damage types the item is immune to. Not prefixed by '#'!.
| <code>minecraft:damage_indicator</code>
+
    |}
| 7
+
  |- {{added}}
  | None
+
  | 27
  |-
+
  | <code>minecraft:enchantable</code>
  | <code>minecraft:dragon_breath</code>
+
  | Allows the item to be enchanted by an enchanting table.
  | 8
+
  | As follows:
  | None
+
  {| class="wikitable" {{added}}
|-
+
    ! Name
| <code>minecraft:dripping_lava</code>
+
    ! Type
| 9
+
    ! Description
| None
+
    |-
|-
+
    | Value
| <code>minecraft:dripping_water</code>
+
    | {{Type|VarInt}}
| 10
+
    | Opaque internal value controlling how expensive enchantments may be offered.
| None
+
    |}
|-
+
  |- {{added}}
| <code>minecraft:dust</code>
+
  | 28
| 11
+
  | <code>minecraft:equippable</code>
|  
+
  | Allows the item to be equipped by the player.
{| class="wikitable"
+
  | As follows:
  ! Field Name
+
  {| class="wikitable" {{added}}
  ! Field Type
+
    ! Name
  ! Meaning
+
    ! Type
  |-
+
    ! Description
  | Red
+
    |-
  | Float
+
    | Slot
  | Red value, 0-1
+
    | {{Type|VarInt}} {{Type|Enum}}
  |-
+
    | 0: mainhand, 1: feet, 2: legs, 3: chest, 4: head, 5: offhand, 6: body
  | Green
+
    |-
  | Float
+
    | Equip sound
  | Green value, 0-1
+
    | {{Type|ID or}} {{Type|Sound Event}}
  |-
+
    | ID in the <code>minecraft:sound_event</code> registry, or an inline definition.
  | Blue
+
    |-
  | Float
+
    | Has model
  | Blue value, 0-1
+
    | {{Type|Boolean}}
  |-
+
    |
  | Scale
+
    |-
  | Float
+
    | Model
  | The scale, will be clamped between 0.01 and 4.
+
    | {{Type|Optional}} {{Type|Identifier}}
  |}
+
    | Only present if Has model is true.
  |-
+
    |-
  | <code>minecraft:effect</code>
+
    | Has camera overlay
  | 12
+
    | {{Type|Boolean}}
  | None
+
    |
|-
+
    |-
| <code>minecraft:elder_guardian</code>
+
    | Camera overlay
| 13
+
    | {{Type|Optional}} {{Type|Identifier}}
  | None
+
    | Only present if Has camera overlay is true.
  |-
+
    |-
  | <code>minecraft:enchanted_hit</code>
+
    | Has allowed entities
  | 14
+
    | {{Type|Boolean}}
  | None
+
    |-
  |-
+
    | Allowed entities
  | <code>minecraft:enchant</code>
+
    | {{Type|Optional}} {{Type|ID Set}}
  | 15
+
    | IDs in the <code>minecraft:entity_type</code> registry. Only present if Has allowed entities is true.
  | None
+
    |-
  |-
+
    | Dispensable
  | <code>minecraft:end_rod</code>
+
    | {{Type|Boolean}}
  | 16
+
    |
  | None
+
    |-
 +
    | Swappable
 +
    | {{Type|Boolean}}
 +
    |
 +
    |-
 +
    | Damage on hurt
 +
    | {{Type|Boolean}}
 +
    |
 +
    |}
 +
  |- {{added}}
 +
| 29
 +
  | <code>minecraft:repairable</code>
 +
  | Items that can be combined with this item in an anvil to repair it.
 +
  | As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Items
 +
    | {{Type|ID Set}}
 +
    | IDs in the <code>minecraft:item</code> registry.
 +
    |}
 +
  |- {{added}}
 +
  | 30
 +
  | <code>minecraft:glider</code>
 +
  | Makes the item function like elytra.
 +
  | None.
 +
  |- {{added}}
 +
| 31
 +
  | <code>minecraft:tooltip_style</code>
 +
  | Custom textures for the item tooltip.
 +
  | As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Style
 +
    | {{Type|Identifier}}
 +
    |
 +
    |}
 +
  |- {{added}}
 +
| 32
 +
  | <code>minecraft:death_protection</code>
 +
  | Makes the item function like a totem of undying.
 +
  | As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Number of effects
 +
    | {{Type|VarInt}}
 +
    | Number of elements in the following array.
 +
    |-
 +
    | Effects
 +
    | {{Type|Array}} of [[#Consume Effect|Consume Effect]]
 +
    | Effects to apply on consumption. See [[#Consume Effect|Consume Effect]].
 +
    |}
 
  |-
 
  |-
  | <code>minecraft:entity_effect</code>
+
| {{change|31|41}}
  | 17
+
  | <code>minecraft:potion_contents</code>
  | None
+
  | Visual and effects of a potion item.
  |-
+
  | As follows:
  | <code>minecraft:explosion_emitter</code>
+
  {| class="wikitable"
  | 18
+
    ! Name
  | None
+
    ! Type
  |-
+
    ! Description
  | <code>minecraft:explosion</code>
+
    |-
  | 19
+
    | Has Potion ID
  | None
+
    | {{Type|Boolean}}
 +
    | Whether this potion has an ID in the potion registry. If true, it has the default effects associated with the potion type.
 +
    |-
 +
    | Potion ID
 +
    | {{Type|Optional}} {{Type|VarInt}}
 +
    | The ID of the potion type in the potion registry. Only present if Has Potion ID is true.
 +
    |-
 +
    | 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|Optional}} {{Type|Int}}
 +
    | The RGB components of the color, encoded as an integer. Only present if Has Custom Color is true.
 +
    |-
 +
    | 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]].
 +
    |- {{added}}
 +
    | Custom Name
 +
    | {{Type|String}}
 +
    |
 +
    |}
 +
|}
 +
 
 +
=== Other types ===
 +
 
 +
==== Consume Effect ====
 +
 
 +
WIP
 +
 
 +
==== Instrument ====
 +
 
 +
{| class="wikitable"
 +
! Name
 +
! Type
 +
! Description
 +
  |-
 +
  | Sound Event
 +
  | {{Type|Id or}} {{Type|Sound Event}}
 +
  | The sound to be played.
 +
  |-
 +
  | Use duration
 +
  | {{change|{{Type|VarInt}}|{{Type|Float}}}}
 +
  | The maximum range of the sound.
 
  |-
 
  |-
  | <code>minecraft:falling_dust</code>
+
  | Range
  | 20
+
  | {{Type|Float}}
  |
+
  | The range of the instrument.
  {| class="wikitable"
+
  |- {{added}}
  ! Field Name
+
| Description
  ! Field Type
+
| {{Type|Text Component}}
  ! Meaning
+
| Description shown in the item tooltip.
  |-
+
|}
  | BlockState
+
 
  | VarInt
+
== Particles ==
  | The ID of the block state.
+
 
  |}
+
{| class="wikitable"
 
  |-
 
  |-
  | <code>minecraft:firework</code>
+
  ! Particle Name
  | 21
+
  ! Particle ID
  | None
+
  ! Data
 
  |-
 
  |-
  | <code>minecraft:fishing</code>
+
  | <code>minecraft:dust</code>
  | 22
+
  | 13
| None
 
|-
 
| <code>minecraft:flame</code>
 
| 23
 
| None
 
|-
 
| <code>minecraft:happy_villager</code>
 
| 24
 
| None
 
|-
 
| <code>minecraft:heart</code>
 
| 25
 
| None
 
|-
 
| <code>minecraft:instant_effect</code>
 
| 26
 
| None
 
|-
 
| <code>minecraft:item</code>
 
| 27
 
 
  |
 
  |
 
  {| class="wikitable"
 
  {| class="wikitable"
Line 314: Line 556:
 
   ! Field Type
 
   ! Field Type
 
   ! Meaning
 
   ! Meaning
 +
  |- {{removed}}
 +
  | Red
 +
  | {{Type|Float}}
 +
  | The red RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{removed}}
 +
  | Green
 +
  | {{Type|Float}}
 +
  | The green RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{removed}}
 +
  | Blue
 +
  | {{Type|Float}}
 +
  | The blue RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{added}}
 +
  | Color
 +
  | {{Type|Int}}
 +
  | The color, encoded as 0xRRGGBB; top bits are ignored.
 
   |-
 
   |-
   | Item
+
   | Scale
   | [[Slot]]
+
   | {{Type|Float}}
   | The item that will be used.
+
   | The scale, will be clamped between 0.01 and 4.
 
   |}
 
   |}
 
  |-
 
  |-
  | <code>minecraft:item_slime</code>
+
  | <code>minecraft:dust_color_transition</code>
  | 28
+
  | 14
  | None
+
  |
 +
{| class="wikitable"
 +
  ! Field Name
 +
  ! Field Type
 +
  ! Meaning
 +
  |- {{removed}}
 +
  | From Red
 +
  | {{Type|Float}}
 +
  | The start red RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{removed}}
 +
  | From Green
 +
  | {{Type|Float}}
 +
  | The start green RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{removed}}
 +
  | From Blue
 +
  | {{Type|Float}}
 +
  | The start blue RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{added}}
 +
  | From Color
 +
  | {{Type|Int}}
 +
  | The start color, encoded as 0xRRGGBB; top bits are ignored.
 +
  |- {{removed}}
 +
  | To Red
 +
  | {{Type|Float}}
 +
  | The end red RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{removed}}
 +
  | To Green
 +
  | {{Type|Float}}
 +
  | The end green RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{removed}}
 +
  | To Blue
 +
  | {{Type|Float}}
 +
  | The end blue RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{added}}
 +
  | To Color
 +
  | {{Type|Int}}
 +
  | The end color, encoded as 0xRRGGBB; top bits are ignored.
 +
  |-
 +
  | Scale
 +
  | {{Type|Float}}
 +
  | The scale, will be clamped between 0.01 and 4.
 +
  |}
 +
|}
 +
 
 +
== Recipes ==
 +
 
 +
(this is meant to become a new page.)
 +
 
 +
=== Recipe Display structure ===
 +
 
 +
{| class="wikitable"
 +
! Name
 +
! Type
 +
! Description
 
  |-
 
  |-
  | <code>minecraft:item_snowball</code>
+
  | Recipe Display Type
| 29
+
| {{Type|VarInt}}
| None
+
| ID in the <code>minecraft:recipe_display</code> registry.
 
  |-
 
  |-
  | <code>minecraft:large_smoke</code>
+
  | Data
  | 30
+
  | Varies
  | None
+
  | See [[#Recipe Display types]] below.
 +
|}
 +
 
 +
==== Recipe Display types ====
 +
 
 +
{| class="wikitable"
 +
! ID
 +
! Name
 +
! Data
 
  |-
 
  |-
  | <code>minecraft:lava</code>
+
| 0
  | 31
+
  | <code>minecraft:crafting_shapeless</code>
| None
+
  | [[#minecraft:crafting_shapeless|data]]
 
  |-
 
  |-
  | <code>minecraft:mycelium</code>
+
| 1
  | 32
+
  | <code>minecraft:crafting_shaped</code>
| None
+
  | [[#minecraft:crafting_shaped|data]]
 
  |-
 
  |-
  | <code>minecraft:note</code>
+
| 2
  | 33
+
  | <code>minecraft:furnace</code>
| None
+
  | [[#minecraft:furnace|data]]
 
  |-
 
  |-
  | <code>minecraft:poof</code>
+
| 3
  | 34
+
  | <code>minecraft:stonecutter</code>
| None
+
  | [[#minecraft:stonecutter|data]]
 
  |-
 
  |-
  | <code>minecraft:portal</code>
+
| 4
  | 35
+
  | <code>minecraft:smithing</code>
  | None
+
  | [[#minecraft:smithing|data]]
 +
  |}
 +
 
 +
===== <code>minecraft:crafting_shapeless</code> =====
 +
 
 +
{| class="wikitable"
 +
! Name
 +
! Type
 +
! Description
 
  |-
 
  |-
  | <code>minecraft:rain</code>
+
  | Ingredient Count
  | 36
+
  | {{Type|VarInt}}
  | None
+
  | Number of elements in the following array.
 
  |-
 
  |-
  | <code>minecraft:smoke</code>
+
  | Ingredients
  | 37
+
  | {{Type|Array}} of {{Type|Slot Display}}
  | None
+
  |
 
  |-
 
  |-
  | <code>minecraft:spit</code>
+
  | Result
  | 38
+
  | {{Type|Slot Display}}
  | None
+
  |
 
  |-
 
  |-
  | <code>minecraft:squid_ink</code>
+
  | Crafting Station
  | 39
+
| {{Type|Slot Display}}
  | None
+
| Crafting station icon to display in the recipe notification.
 +
|}
 +
 
 +
===== <code>minecraft:crafting_shaped</code> =====
 +
 
 +
{| class="wikitable"
 +
  ! Name
 +
! Type
 +
  ! Description
 
  |-
 
  |-
  | <code>minecraft:sweep_attack</code>
+
  | Width
  | 40
+
  | {{Type|VarInt}}
  | None
+
  |
 
  |-
 
  |-
  | <code>minecraft:totem_of_undying</code>
+
  | Height
  | 41
+
  | {{Type|VarInt}}
  | None
+
  |
 
  |-
 
  |-
  | <code>minecraft:underwater</code>
+
  | Ingredient Count
  | 42
+
  | {{Type|VarInt}}
  | None
+
  | Number of elements in the following array. Always equal to Width * Height.
 
  |-
 
  |-
  | <code>minecraft:splash</code>
+
  | Ingredients
  | 43
+
  | {{Type|Array}} of {{Type|Slot Display}}
  | None
+
  |
 
  |-
 
  |-
  | <code>minecraft:witch</code>
+
  | Result
  | 44
+
  | {{Type|Slot Display}}
  | None
+
  |
 
  |-
 
  |-
  | <code>minecraft:bubble_pop</code>
+
  | Crafting Station
  | 45
+
  | {{Type|Slot Display}}
| None
+
  | Crafting station icon to display in the recipe notification.
|-
 
| <code>minecraft:current_down</code>
 
| 46
 
| None
 
|-
 
| <code>minecraft:bubble_column_up</code>
 
| 47
 
| None
 
|-
 
| <code>minecraft:nautilus</code>
 
| 48
 
| None
 
|-
 
| <code>minecraft:dolphin</code>
 
| 49
 
  | None
 
 
  |}
 
  |}
  
== Entity Metadata Format ==
+
===== <code>minecraft:furnace</code> =====
 
 
Note that entity metadata is a totally distinct concept from block metadata.  It is not required to send all metadata fields, or even any metadata fields, so long as the terminating entry is correctly sent.
 
 
 
Entity Metadata is an array of entries, each of which looks like the following:
 
  
 
{| class="wikitable"
 
{| class="wikitable"
 
  ! Name
 
  ! Name
 
  ! Type
 
  ! Type
  ! Meaning
+
  ! Description
 +
|-
 +
| Ingredient
 +
|{{Type|Slot Display}}
 +
|
 +
|-
 +
| Fuel
 +
| {{Type|Slot Display}}
 +
|
 +
|-
 +
| Result
 +
| {{Type|Slot Display}}
 +
|
 
  |-
 
  |-
  | Index
+
  | Crafting Station
  | Unsigned Byte
+
  | {{Type|Slot Display}}
  | Unique index key determining the meaning of the following value, see the table below. If this is <code>0xff</code> then the it is the end of the Entity Metadata array and no more is read.
+
  | Crafting station icon to display in the recipe notification.
 
  |-
 
  |-
  | Type
+
  | Cooking Time
  | Optional Byte Enum
+
  | {{Type|VarInt}}
  | Only if Index is not <code>0xff</code>; the type of the index, see the table below
+
  | Time to smelt in a regular furnace, in ticks.
 
  |-
 
  |-
  | Value
+
  | Experience
  | Optional ''value of Type''
+
  | {{Type|Float}}
  | Only if Index is not <code>0xff</code>: the value of the metadata field
+
  |
 
  |}
 
  |}
 +
 +
===== <code>minecraft:stonecutter</code> =====
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Value of Type field
+
  ! Name
  ! [[Data types|Type]] of Value field
+
  ! Type
  ! Notes
+
  ! Description
 
  |-
 
  |-
  | 0
+
  | Ingredient
  | Byte
+
  | {{Type|Slot Display}}
  |  
+
  |
 
  |-
 
  |-
  | 1
+
  | Result
  | VarInt
+
  | {{Type|Slot Display}}
  |  
+
  |
 
  |-
 
  |-
  | 2
+
  | Crafting Station
  | Float
+
  | {{Type|Slot Display}}
  |  
+
  | Crafting station icon to display in the recipe notification.
  |-
+
  |}
  | 3
+
 
  | String
+
===== <code>minecraft:smithing</code> =====
  |
+
 
 +
{| class="wikitable"
 +
  ! Name
 +
  ! Type
 +
  ! Description
 
  |-
 
  |-
  | 4
+
  | Template
  | [[Chat]]
+
  | {{Type|Slot Display}}
|
+
  |
|- style="background-color: #d9ead3;"
 
| 5
 
| OptChat (Boolean + Optional [[Chat]])
 
  | [[Chat]] is present if the Boolean is set to true
 
 
  |-
 
  |-
  | {{change|5|6}}
+
| Base
| [[Slot]]
+
  | {{Type|Slot Display}}
  |  
+
  |
 
  |-
 
  |-
  | {{change|6|7}}
+
| Addition
| Boolean
+
  | {{Type|Slot Display}}
  |  
+
  |
 
  |-
 
  |-
  | {{change|7|8}}
+
  | Result
| Rotation
+
  | {{Type|Slot Display}}
| 3 floats: rotation on x, rotation on y, rotation on z
+
  |
|-
 
  | {{change|8|9}}
 
| [[Data Types#Position|Position]]
 
  |  
 
 
  |-
 
  |-
  | {{change|9|10}}
+
  | Crafting Station
| OptPosition (Boolean + Optional Position)
+
  | {{Type|Slot Display}}
| Position is present if the Boolean is set to true
+
  | Crafting station icon to display in the recipe notification.
|-
 
  | {{change|10|11}}
 
  | Direction (VarInt)
 
| (Down = 0, Up = 1, North = 2, South = 3, West = 4, East = 5)
 
|-
 
| {{change|11|12}}
 
| OptUUID (Boolean + Optional UUID)
 
| UUID is present if the Boolean is set to true
 
|-
 
| {{change|12|13}}
 
| OptBlockID (VarInt)
 
| 0 for absent, otherwise index into the global palette. (Air is treated as absent)
 
|-
 
| {{change|13|14}}
 
| [[NBT|NBT Tag]]
 
|
 
|- style="background-color: #d9ead3;"
 
| 15
 
| [[#Particle]]
 
|
 
 
  |}
 
  |}
  
=== Entity ===
+
=== Slot Display structure ===
 
 
The base class.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Index
+
  ! Name
 
  ! Type
 
  ! Type
  !style="width: 250px;" colspan="2"| Meaning
+
  ! Description
! Default
 
 
  |-
 
  |-
  |rowspan="9"| 0
+
  | Slot Display Type
  |rowspan="9"| Byte
+
  | {{Type|VarInt}}
! Bit mask
+
  | ID in the <code>minecraft:slot_display</code> registry.
! Meaning
 
  |rowspan="9"| 0
 
 
  |-
 
  |-
  | 0x01
+
  | Data
  | On Fire
+
  | Varies
 +
| See [[#Slot Display types]] below.
 +
|}
 +
 
 +
==== Slot Display types ====
 +
 
 +
{| class="wikitable"
 +
! ID
 +
! Name
 +
! Data
 
  |-
 
  |-
  | 0x02
+
  | 0
  | Crouched
+
  | <code>minecraft:empty</code>
 +
| no data
 
  |-
 
  |-
  | 0x04
+
  | 1
  | Unused (previously riding)
+
  | <code>minecraft:any_fuel</code>
 +
| no data
 
  |-
 
  |-
  | 0x08
+
  | 2
  | Sprinting
+
  | <code>minecraft:item</code>
 +
| [[#minecraft:item|data]]
 
  |-
 
  |-
  | 0x10
+
  | 3
  | Unused (previously eating/drinking/blocking; use hand state now)
+
  | <code>minecraft:item_stack</code>
 +
| [[#minecraft:item_stack|data]]
 
  |-
 
  |-
  | 0x20
+
  | 4
  | Invisible
+
  | <code>minecraft:tag</code>
 +
| [[#minecraft:tag|data]]
 
  |-
 
  |-
  | 0x40
+
  | 5
  | Glowing effect
+
  | <code>minecraft:smithing_trim</code>
 +
| [[#minecraft:smithing_trim|data]]
 
  |-
 
  |-
  | 0x80
+
  | 6
  | Flying with {{Minecraft Wiki|elytra}}
+
  | <code>minecraft:with_remainder</code>
 +
| [[#minecraft:with_remainder|data]]
 
  |-
 
  |-
  | 1
+
  | 7
  | VarInt
+
  | <code>minecraft:composite</code>
  |colspan="2"| Air
+
  | [[#minecraft:composite|data]]
| 300
 
|-
 
| 2
 
| {{change|String|OptChat}}
 
|colspan="2"| Custom name
 
| empty
 
|-
 
| 3
 
| Boolean
 
|colspan="2"| Is custom name visible
 
| false
 
|-
 
| 4
 
| Boolean
 
|colspan="2"| Is silent
 
| false
 
|-
 
| 5
 
| Boolean
 
|colspan="2"| No gravity
 
| false
 
 
  |}
 
  |}
  
=== AreaEffectCloud ===
+
===== <code>minecraft:item</code> =====
  
Extends [[#Entity|Entity]].
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Index
+
  ! Name
 
  ! Type
 
  ! Type
  !style="width: 250px;" colspan="2"| Meaning
+
  ! Description
! Default
 
|-
 
| 6
 
| Float
 
|colspan="2"| Radius
 
| 0.5
 
 
  |-
 
  |-
  | 7
+
  | Item Type
  | VarInt
+
  | {{Type|VarInt}}
  |colspan="2"| Color (only for mob spell particle)
+
  | ID in the <code>minecraft:item</code> registry.
| 0
 
|-
 
| 8
 
| Boolean
 
|colspan="2"| Ignore radius and show effect as single point, not area
 
| false
 
|- style="background-color: #d9ead3;"
 
| 9
 
| Particle
 
| colspan="2"| The [[#Particle]]
 
| <code>effect</code>
 
|- style="background-color: #f4cccc; text-decoration: line-through;"
 
| 9
 
| VarInt
 
|colspan="2"| Particle ID
 
| 15 (mobSpell)
 
|- style="background-color: #f4cccc; text-decoration: line-through;"
 
| 10
 
| VarInt
 
|colspan="2"| Particle parameter 1
 
| 0
 
|- style="background-color: #f4cccc; text-decoration: line-through;"
 
| 11
 
| VarInt
 
|colspan="2"| Particle parameter 2
 
| 0
 
 
  |}
 
  |}
  
=== Trident ===
+
===== <code>minecraft:item_stack</code> =====
  
Extends [[#Arrow|Arrow]].
+
{| class="wikitable"
 +
! Name
 +
! Type
 +
! Description
 +
|-
 +
| Item Stack
 +
| {{Type|Slot}}
 +
|
 +
|}
  
{| class="wikitable" style="background-color: #d9ead3;"
+
===== <code>minecraft:tag</code> =====
  ! Index
+
 
 +
{| class="wikitable"
 +
  ! Name
 
  ! Type
 
  ! Type
  !style="width: 250px;" colspan="2"| Meaning
+
  ! Description
! Default
 
 
  |-
 
  |-
  | 7
+
  | Tag
  | VarInt
+
  | {{Type|Identifier}}
|colspan="2"| Loyalty level (enchantment)
+
  | Tag in the <code>minecraft:item</code> registry. Not prefixed by '#'!.
  | 0
 
 
  |}
 
  |}
  
=== Boat ===
+
===== <code>minecraft:smithing_trim</code> =====
 
 
Extends [[#Entity|Entity]].
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Index
+
  ! Name
 
  ! Type
 
  ! Type
  !style="width: 250px;" colspan="2"| Meaning
+
  ! Description
! Default
 
 
  |-
 
  |-
  | 6
+
  | Base
  | VarInt
+
  | {{Type|Slot Display}}
|colspan="2"| Time since last hit
+
  |
  | 0
 
 
  |-
 
  |-
  | 7
+
  | Material
  | VarInt
+
  | {{Type|Slot Display}}
|colspan="2"| Forward direction
+
  |
  | 1
 
 
  |-
 
  |-
  | 8
+
  | Pattern
  | Float
+
  | {{Type|Slot Display}}
|colspan="2"| Damage taken
+
  |
  | 0.0
+
  |}
  |-
+
 
| 9
+
===== <code>minecraft:with_remainder</code> =====
| VarInt
+
 
|colspan="2"| Type (0=oak, 1=spruce, 2=birch, 3=jungle, 4=acacia, 5=dark oak)
+
{| class="wikitable"
  | 0
+
! Name
 +
! Type
 +
  ! Description
 
  |-
 
  |-
  | 10
+
  | Ingredient
  | Boolean
+
  | {{Type|Slot Display}}
|colspan="2"| Right paddle turning
+
  |
  | false
 
 
  |-
 
  |-
  | 11
+
  | Remainder
  | Boolean
+
  | {{Type|Slot Display}}
|colspan="2"| Left paddle turning
+
  |
| false
 
|- style="background-color: #d9ead3;"
 
| 12
 
| VarInt
 
|colspan="2"| Splash timer (?)
 
  | 0
 
 
  |}
 
  |}
  
=== Phantom ===
+
===== <code>minecraft:composite</code> =====
  
Extends [[#Flying|Flying]].
+
{| class="wikitable"
 
+
  ! Name
{| class="wikitable" style="background-color: #d9ead3;"
 
  ! Index
 
 
  ! Type
 
  ! Type
  !style="width: 250px;" colspan="2"| Meaning
+
  ! Description
! Default
 
 
  |-
 
  |-
  | 12
+
  | Option Count
  | VarInt
+
  | {{Type|VarInt}}
  |colspan="2"| Size
+
| Number of elements in the following array.
  | 0
+
  |-
 +
| Options
 +
| {{Type|Array}} of {{Type|Slot Display}}
 +
  |
 
  |}
 
  |}
  
Hitbox size is determined by horizontal=0.9 + 0.2*size and vertical=0.5 + 0.1 * i
+
== Handshake ==
  
=== Dolphin ===
+
No changes so far.
  
Extends [[#Creature|Creature]].
+
== Status ==
  
No additional metadata.
+
No changes so far.
  
=== WaterMob ===
+
== Login ==
  
Extends {{Change|[[#Insentient|Insentient]]|[[#Creature|Creature]]}}.
+
No changes so far.
  
No additional metadata.
+
== Configuration ==
  
=== Abstract fish ===
+
No changes so far.
  
Extends [[#WaterMob|WaterMob]].
+
== Play ==
  
{| class="wikitable" style="background-color: #d9ead3;"
+
=== Clientbound ===
! Index
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
|-
 
| 12
 
| Boolean
 
|colspan="2"| From bucket
 
| False
 
|}
 
  
=== Cod ===
+
==== Close Container ====
  
Extends [[#AbstractFish|AbstractFish]].
+
This packet is sent from the server to the client when a window is forcibly closed, such as when a chest is destroyed while it's open. The notchian client disregards the provided window ID and closes any active window.
  
No additional metadata.
+
{| class="wikitable"
 
+
  ! Packet ID
=== Puffer fish ===
+
! State
 
+
! Bound To
Extends [[#AbstractFish|AbstractFish]].
+
  ! Field Name
 
+
  ! Field Type
{| class="wikitable" style="background-color: #d9ead3;"
+
  ! Notes
  ! Index
 
  ! Type
 
  !style="width: 250px;" colspan="2"| Meaning
 
  ! Default
 
 
  |-
 
  |-
  | 13
+
  | ''protocol:''<br/><code>0x12</code><br/><br/>''resource:''<br/><code>container_close</code>
  | VarInt
+
  | Play
  |colspan="2"| PuffState (varies from 0 to 2)
+
| Client
  | 0
+
| Window ID
 +
  | {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
 +
  | This is the ID of the window that was closed. 0 for inventory.
 
  |}
 
  |}
  
=== Salmon ===
+
==== Set Container Content ====
 +
[[File:Inventory-slots.png|thumb|The inventory slots]]
  
Extends [[#AbstractFish|AbstractFish]].
+
Replaces the contents of a container window. Sent by the server upon initialization of a container window or the player's inventory, and in response to state ID mismatches (see [[#Click Container]]).
  
No additional metadata.
+
{| class="wikitable"
 
+
  ! Packet ID
=== Tropical fish ===
+
! State
 
+
! Bound To
Extends [[#AbstractFish|AbstractFish]].
+
  ! Field Name
 
+
  ! Field Type
{| class="wikitable" style="background-color: #d9ead3;"
+
  ! Notes
  ! Index
 
  ! Type
 
  !style="width: 250px;" colspan="2"| Meaning
 
  ! Default
 
 
  |-
 
  |-
  | 13
+
  | rowspan="5"| ''protocol:''<br/><code>0x13</code><br/><br/>''resource:''<br/><code>container_set_content</code>
  | VarInt
+
  | rowspan="5"| Play
  |colspan="2"| Variant
+
  | rowspan="5"| Client
  | 0
+
  | Window ID
  |}
+
  | {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
 
+
  | The ID of window which items are being sent for. 0 for player inventory. The client ignores any packets targeting a Window ID other than the current one. However, an exception is made for the player inventory, which may be targeted at any time. (The Notchian server does not appear to utilize this special case.)
=== Turtle ===
 
 
 
Extends [[#Animal|Animal]].
 
 
 
{| class="wikitable" style="background-color: #d9ead3;"
 
! Index
 
  ! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
 
  |-
 
  |-
  | 13
+
  | State ID
  | BlockPos
+
  | {{Type|VarInt}}
|colspan="2"| Home pos
+
  | A server-managed sequence number used to avoid desynchronization; see [[#Click Container]].
  | (0, 0, 0)
 
 
  |-
 
  |-
  | 14
+
  | Count
  | Boolean
+
  | {{Type|VarInt}}
|colspan="2"| Has egg
+
  | Number of elements in the following array.
  | false
 
 
  |-
 
  |-
  | 15
+
  | Slot Data
  | Boolean
+
  | {{Type|Array}} of [[Slot Data|Slot]]
|colspan="2"| Laying egg (?)
 
| false
 
 
  |-
 
  |-
  | 16
+
  | Carried Item
  | BlockPos
+
  | {{Type|Slot}}
|colspan="2"| Travel pos
+
  | Item being dragged with the mouse.
| (0, 0, 0)
 
|-
 
| 17
 
| Boolean
 
|colspan="2"| Going home
 
| false
 
|-
 
| 18
 
| Boolean
 
|colspan="2"| Traveling
 
  | false
 
 
  |}
 
  |}
  
=== Drowned ===
+
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.
 +
Use [[#Open Screen|Open Screen]] to open the container on the client.
 +
 
 +
==== Set Container Property ====
  
Extends [[#Drowned|Drowned]].
+
This packet is used to inform the client that part of a GUI window should be updated.
  
{| class="wikitable" style="background-color: #d9ead3;"
+
{| class="wikitable"
  ! Index
+
  ! Packet ID
  ! Type
+
  ! State
!style="width: 250px;" colspan="2"| Meaning
+
  ! Bound To
  ! Default
+
  ! Field Name
|-
+
  ! Field Type
| 15
 
| Boolean
 
|colspan="2"| Has target (?)
 
| false
 
|}
 
 
 
== Block Actions ==
 
 
 
No changes so far.
 
 
 
== Plugin Channels ==
 
 
 
=== <code>MC|StopSound</code> ===
 
 
 
{{Change|''Server to client''}}
 
 
 
{{Change|Used to implement {{Minecraft Wiki|Commands#StopSound|the <code>/stopsound</code> command}}.  Stops a sound that is currently playing on the client.}}
 
 
 
{| class="wikitable" style="background-color: #f4cccc; text-decoration: line-through;"
 
  ! Field name
 
  ! Field type
 
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  | Sound category
+
  | rowspan="3"| ''protocol:''<br/><code>0x14</code><br/><br/>''resource:''<br/><code>container_set_data</code>
  | String
+
| rowspan="3"| Play
  | Should be one of the sound categories used in [[Protocol#Named Sound Effect|Named Sound Effect]], but if it's invalid or empty then it is (intentionally) treated as ''all'' sound categories.
+
| rowspan="3"| Client
 +
  | Window ID
 +
  | {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
 +
|
 
  |-
 
  |-
  | Sound name
+
  | Property
  | String
+
  | {{Type|Short}}
  | A [http://pokechu22.github.io/Burger/1.11.html#sounds sound effect name]If left empty, ''all'' sounds are stopped.
+
  | The property to be updated, see below.
 +
|-
 +
| Value
 +
| {{Type|Short}}
 +
  | The new value for the property, see below.
 
  |}
 
  |}
  
{{Change|Emptiness of sound category or sound name can be combined, IE a empty sound name but a set sound category will stop all sounds in the given category.}}
+
The meaning of the Property field depends on the type of the window. The following table shows the known combinations of window type and property, and how the value is to be interpreted.
  
{{Change||This plugin channel has been replaced by the [[#Stop sound|stop sound]] packet.}}
+
{| class="wikitable"
 
 
=== <code>MC|DebugCaves</code> ===
 
 
 
Never sent, but (presumably) used to debug caves.  Does not render without modifying the client.
 
 
 
{| class="wikitable" style="background-color: #d9ead3;"
 
!colspan="2"| Field name
 
!colspan="2"| Field type
 
! Notes
 
 
  |-
 
  |-
  |colspan="2"| Unknown 1
+
  ! Window type
  |colspan="2"| Position
+
  ! Property
  |
+
  ! Value
 
  |-
 
  |-
  |colspan="2"| Count
+
  | rowspan="4"| Furnace
  |colspan="2"| Int
+
  | 0: Fire icon (fuel left)
  | Number of elements in the following array
+
  | counting from fuel burn time down to 0 (in-game ticks)
 
  |-
 
  |-
  |rowspan="2"| Data
+
  | 1: Maximum fuel burn time
| Unknown 2
+
  | fuel burn time or 0 (in-game ticks)
|rowspan="2"| Array
 
| Position
 
  |
 
 
  |-
 
  |-
  | Unknown 3
+
  | 2: Progress arrow
  | Float
+
  | counting from 0 to maximum progress (in-game ticks)
|
 
|}
 
 
 
=== <code>MC|DebugStructures</code> ===
 
 
 
Never sent, but (presumably) used to debug structures.  Does not render without modifying the client.
 
 
 
{| class="wikitable" style="background-color: #d9ead3;"
 
!colspan="2"| Field name
 
!colspan="2"| Field type
 
! Notes
 
 
  |-
 
  |-
  |colspan="2"| Unknown 1
+
  | 3: Maximum progress
|colspan="2"| Int
+
  | always 200 on the notchian server
  |
 
 
  |-
 
  |-
  |colspan="2"| Bounding box minX
+
  | rowspan="10"| Enchantment Table
  |colspan="2"| Int
+
  | 0: Level requirement for top enchantment slot
  |rowspan="6"| min must be less than max
+
  | rowspan="3"| The enchantment's xp level requirement
 
  |-
 
  |-
  |colspan="2"| Bounding box minY
+
  | 1: Level requirement for middle enchantment slot
|colspan="2"| Int
 
 
  |-
 
  |-
  |colspan="2"| Bounding box minZ
+
  | 2: Level requirement for bottom enchantment slot
|colspan="2"| Int
 
 
  |-
 
  |-
  |colspan="2"| Bounding box maxX
+
  | 3: The enchantment seed
  |colspan="2"| Int
+
  | Used for drawing the enchantment names (in [[Wikipedia:Standard Galactic Alphabet|SGA]]) clientside.  The same seed ''is'' used to calculate enchantments, but some of the data isn't sent to the client to prevent easily guessing the entire list (the seed value here is the regular seed bitwise and <code>0xFFFFFFF0</code>).
 
  |-
 
  |-
  |colspan="2"| Bounding box maxY
+
  | 4: Enchantment ID shown on mouse hover over top enchantment slot
  |colspan="2"| Int
+
  | rowspan="3"| The enchantment id (set to -1 to hide it), see below for values
 
  |-
 
  |-
  |colspan="2"| Bounding box maxZ
+
  | 5: Enchantment ID shown on mouse hover over middle enchantment slot
|colspan="2"| Int
 
 
  |-
 
  |-
  |colspan="2"| Count
+
  | 6: Enchantment ID shown on mouse hover over bottom enchantment slot
|colspan="2"| Int
 
| Number of elements in the following array
 
 
  |-
 
  |-
  |rowspan="7"| Unknown
+
  | 7: Enchantment level shown on mouse hover over the top slot
| Bounding box minX
+
  | rowspan="3"| The enchantment level (1 = I, 2 = II, 6 = VI, etc.), or -1 if no enchant
  |rowspan="7"| Array
 
| Int
 
|rowspan="6"| min must be less than max
 
 
  |-
 
  |-
  | Bounding box minY
+
  | 8: Enchantment level shown on mouse hover over the middle slot
| Int
 
 
  |-
 
  |-
  | Bounding box minZ
+
  | 9: Enchantment level shown on mouse hover over the bottom slot
| Int
 
 
  |-
 
  |-
  | Bounding box maxX
+
  | rowspan="3"| Beacon
  | Int
+
| 0: Power level
 +
  | 0-4, controls what effect buttons are enabled
 
  |-
 
  |-
  | Bounding box maxY
+
  | 1: First potion effect
  | Int
+
  | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the first effect, or -1 if no effect
 
  |-
 
  |-
  | Bounding box maxZ
+
  | 2: Second potion effect
  | Int
+
  | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the second effect, or -1 if no effect
|-
 
| Unknown
 
| Boolean
 
|
 
|}
 
 
 
=== <code>MC|DebugWorldGenAttempt</code> ===
 
 
 
Never sent, but (presumably) used to debug something with world generation.  Does not render without modifying the client.
 
 
 
{{warning|This channel is invalid, as its name is longer than the max length (23 > 20).}}
 
 
 
{| class="wikitable" style="background-color: #d9ead3;"
 
! Field name
 
! Field type
 
! Notes
 
 
  |-
 
  |-
  | Unknown 1
+
  | Anvil
  | Position
+
  | 0: Repair cost
  |
+
  | The repair's cost in xp levels
 
  |-
 
  |-
  | Unknown 2
+
  | rowspan="2"| Brewing Stand
  | Float
+
  | 0: Brew time
  |
+
  | 0 – 400, with 400 making the arrow empty, and 0 making the arrow full
 
  |-
 
  |-
  | Unknown 3
+
  | 1: Fuel time
| Float
+
  | 0 - 20, with 0 making the arrow empty, and 20 making the arrow full
  |
 
 
  |-
 
  |-
  | Unknown 4
+
  | Stonecutter
  | Float
+
  | 0: Selected recipe
  |
+
  | The index of the selected recipe. -1 means none is selected.
 
  |-
 
  |-
  | Unknown 5
+
  | Loom
  | Float
+
  | 0: Selected pattern
  |
+
  | The index of the selected pattern. 0 means none is selected, 0 is also the internal id of the "base" pattern.
 
  |-
 
  |-
  | Unknown 6
+
  | Lectern
  | Float
+
  | 0: Page number
  |
+
  | The current page number, starting from 0.
 
  |}
 
  |}
  
== Play ==
+
For an enchanting table, the following numerical IDs are used:
 
 
=== Clientbound ===
 
 
 
==== Spawn Painting ====
 
 
 
This packet shows location, name, and type of painting.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  ! Numerical ID
  ! State
+
  ! Enchantment ID
  ! Bound To
+
  ! Enchantment Name
  ! Field Name
+
|-
  ! Field Type
+
  | 0
  ! Notes
+
  | minecraft:protection
 +
  | Protection
 
  |-
 
  |-
  |rowspan="5"| 0x04
+
  | 1
|rowspan="5"| Play
+
  | minecraft:fire_protection
|rowspan="5"| Client
+
  | Fire Protection
| Entity ID
 
  | VarInt
 
  |  
 
 
  |-
 
  |-
  | Entity UUID
+
  | 2
  | UUID
+
  | minecraft:feather_falling
  |  
+
  | Feather Falling
 
  |-
 
  |-
  | Motive
+
  | 3
  | {{Change|String (13)|VarInt}}
+
  | minecraft:blast_protection
  | {{Change|Name of the painting. Max length 13|Panting's ID, see below}}
+
  | Blast Protection
 
  |-
 
  |-
  | Location
+
  | 4
  | Position
+
  | minecraft:projectile_protection
  | Center coordinates (see below)
+
  | Projectile Protection
 
  |-
 
  |-
  | Direction
+
  | 5
  | Byte Enum
+
  | minecraft:respiration
| Direction the painting faces (North = 2, South = 0, West = 1, East = 3)
+
  | Respiration
|}
 
 
 
Calculating the center of an image: given a (width × height) grid of cells, with <code>(0, 0)</code> being the top left corner, the center is <code>(max(0, width / 2 - 1), height / 2)</code>. E.g. <code>(1, 0)</code> for a 2×1 painting, or <code>(1, 2)</code> for a 4×4 painting.
 
 
 
List of paintings by coordinates in <code>paintings_kristoffer_zetterstrand.png</code> (where x and y are in pixels from the top left and width and height are in pixels or 16ths of a block):
 
 
 
{| class="wikitable"
 
! Name
 
  !style="background-color: #d9ead3;"| ID
 
! x
 
! y
 
! width
 
! height
 
 
  |-
 
  |-
  | {{Change|<code>Kebab</code>|<code>minecraft:kebab</code>}}
+
  | 6
| 0
+
| minecraft:aqua_affinity
| 0
+
  | Aqua Affinity
| 0
 
| 16
 
  | 16
 
 
  |-
 
  |-
  | {{Change|<code>Aztec</code>|<code>minecraft:aztec</code>}}
+
  | 7
| 1
+
| minecraft:thorns
| 16
+
  | Thorns
| 0
 
| 16
 
  | 16
 
 
  |-
 
  |-
  | {{change|<code>Alban</code>|<code>minecraft:alban</code>}}
+
  | 8
| 2
+
| minecraft:depth_strider
| 32
+
  | Depth Strider
| 0
 
| 16
 
  | 16
 
 
  |-
 
  |-
  | {{change|<code>Aztec2</code>|<code>minecraft:aztec2</code>}}
+
  | 9
| 3
+
| minecraft:frost_walker
| 48
+
  | Frost Walker
| 0
 
| 16
 
  | 16
 
 
  |-
 
  |-
  | {{change|<code>Bomb</code>|<code>minecraft:bomb</code>}}
+
  | 10
| 4
+
| minecraft:binding_curse
| 64
+
  | Curse of Binding
| 0
 
| 16
 
  | 16
 
 
  |-
 
  |-
  | {{change|<code>Plant</code>|<code>minecraft:plant</code>}}
+
  | 11
  | 5
+
| minecraft:soul_speed
  | 80
+
| Soul Speed
  | 0
+
|-
  | 16
+
| 12
  | 16
+
| minecraft:swift_sneak
 +
  | Swift Sneak
 +
  |-
 +
  | 13
 +
  | minecraft:sharpness
 +
  | Sharpness
 
  |-
 
  |-
  | {{change|<code>Wasteland</code>|<code>minecraft:wasteland</code>}}
+
  | 14
| 6
+
| minecraft:smite
| 96
+
  | Smite
| 0
 
| 16
 
  | 16
 
 
  |-
 
  |-
  | {{change|<code>Pool</code>|<code>minecraft:pool</code>}}
+
  | 15
| 7
+
| minecraft:bane_of_arthropods
| 0
+
  | Bane of Arthropods
| 32
 
| 32
 
  | 16
 
 
  |-
 
  |-
| {{change|<code>Courbet</code>|<code>minecraft:courbet</code>}}
 
| 8
 
| 32
 
| 32
 
| 32
 
 
  | 16
 
  | 16
 +
| minecraft:knockback
 +
| Knockback
 
  |-
 
  |-
  | {{change|<code>Sea</code>|<code>minecraft:sea</code>}}
+
  | 17
  | 9
+
| minecraft:fire_aspect
  | 64
+
  | Fire Aspect
  | 32
+
  |-
  | 32
+
  | 18
  | 16
+
  | minecraft:looting
 +
  | Looting
 
  |-
 
  |-
  | {{change|<code>Sunset</code>|<code>minecraft:sunset</code>}}
+
  | 19
| 10
+
| minecraft:sweeping_edge
| 96
+
  | Sweeping Edge
| 32
 
| 32
 
  | 16
 
 
  |-
 
  |-
  | {{change|<code>Creebet</code>|<code>minecraft:creebet</code>}}
+
  | 20
| 11
+
| minecraft:efficiency
| 128
+
  | Efficiency
| 32
 
| 32
 
  | 16
 
 
  |-
 
  |-
  | {{change|<code>Wanderer</code>|<code>minecraft:wanderer</code>}}
+
  | 21
| 12
+
| minecraft:silk_touch
| 0
+
  | Silk Touch
| 64
 
| 16
 
  | 32
 
 
  |-
 
  |-
  | {{change|<code>Graham</code>|<code>minecraft:graham</code>}}
+
  | 22
| 13
+
| minecraft:unbreaking
| 16
+
  | Unbreaking
| 64
 
| 16
 
  | 32
 
 
  |-
 
  |-
  | {{change|<code>Match</code>|<code>minecraft:match</code>}}
+
  | 23
| 14
+
| minecraft:fortune
| 0
+
  | Fortune
| 128
 
| 32
 
  | 32
 
 
  |-
 
  |-
  | {{change|<code>Bust</code>|<code>minecraft:bust</code>}}
+
  | 24
| 15
+
| minecraft:power
| 32
+
  | Power
| 128
 
| 32
 
  | 32
 
 
  |-
 
  |-
  | {{change|<code>Stage</code>|<code>minecraft:stage</code>}}
+
  | 25
| 16
+
| minecraft:punch
| 64
+
  | Punch
| 128
 
| 32
 
  | 32
 
 
  |-
 
  |-
  | {{change|<code>Void</code>|<code>minecraft:void</code>}}
+
  | 26
| 17
+
| minecraft:flame
| 96
+
  | Flame
| 128
 
| 32
 
  | 32
 
 
  |-
 
  |-
  | {{change|<code>SkullAndRoses</code>|<code>skull_and_roses</code>}}
+
  | 27
| 18
+
  | minecraft:infinity
| 128
+
  | Infinity
| 128
 
  | 32
 
  | 32
 
 
  |-
 
  |-
  | {{change|<code>Wither</code>|<code>minecraft:wither</code>}}
+
  | 28
  | 19
+
| minecraft:luck_of_the_sea
  | 160
+
| Luck of the Sea
  | 128
+
|-
  | 32
+
| 29
  | 32
+
| minecraft:lure
 +
  | Lure
 +
  |-
 +
  | 30
 +
  | minecraft:loyalty
 +
| Loyalty
 +
|-
 +
| 31
 +
| minecraft:impaling
 +
  | Impaling
 
  |-
 
  |-
| {{change|<code>Fighters</code>|<code>minecraft:fighters</code>}}
 
| 20
 
| 0
 
| 96
 
| 64
 
 
  | 32
 
  | 32
 +
| minecraft:riptide
 +
| Riptide
 +
|-
 +
| 33
 +
| minecraft:channeling
 +
| Channeling
 +
|-
 +
| 34
 +
| minecraft:multishot
 +
| Multishot
 +
|-
 +
| 35
 +
| minecraft:quick_charge
 +
| Quick Charge
 +
|-
 +
| 36
 +
| minecraft:piercing
 +
| Piercing
 
  |-
 
  |-
  | {{change|<code>Pointer</code>|<code>minecraft:pointer</code>}}
+
  | 37
| 21
+
| minecraft:density
| 0
+
  | Density
| 192
 
| 64
 
  | 64
 
 
  |-
 
  |-
  | {{change|<code>Pigscene</code>|<code>minecraft:pigscene</code>}}
+
  | 38
| 22
+
| minecraft:breach
| 64
+
  | Breach
| 192
 
| 64
 
  | 64
 
 
  |-
 
  |-
  | {{change|<code>BurningSkull</code>|<code>minecraft:burning_skull</code>}}
+
  | 39
| 23
+
| minecraft:wind_burst
| 128
+
  | Wind Burst
| 192
 
| 64
 
  | 64
 
 
  |-
 
  |-
  | {{change|<code>Skeleton</code>|<code>minecraft:skeleton</code>}}
+
  | 40
| 24
+
| minecraft:mending
| 192
+
  | Mending
| 64
 
| 64
 
  | 48
 
 
  |-
 
  |-
  | {{change|<code>DonkeyKong</code>|<code>minecraft:donkey_kong</code>}}
+
  | 41
| 25
+
| minecraft:vanishing_curse
| 192
+
  | Curse of Vanishing
| 112
 
| 64
 
  | 48
 
 
  |}
 
  |}
  
The {{Minecraft Wiki|Painting#Canvases|Minecraft Wiki article on paintings}} also provides a list of painting names to the actual images.
+
==== Set Container Slot ====
  
==== Statistics ====
+
Sent by the server when an item in a slot (in a window) is added/removed.
 
 
Sent as a response to [[#Client_Status|Client Status]] (id 1).
 
  
 
{| class="wikitable"
 
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
  ! Bound To  
+
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
  !colspan="2"| Field Type
+
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="6"| 0x07
+
  | rowspan="4"| ''protocol:''<br/><code>0x15</code><br/><br/>''resource:''<br/><code>container_set_slot</code>
  |rowspan="6"| Play
+
  | rowspan="4"| Play
  |rowspan="6"| Client
+
  | rowspan="4"| Client
  |colspan="2"| Count
+
  | Window ID
  |colspan="2"| VarInt
+
  | {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
  | Number of elements in the following array
+
  | The window which is being updated. 0 for player inventory. The client ignores any packets targeting a Window ID other than the current one{{change|; see below for exceptions|, unless it is 0 (see below)}}.
 
  |-
 
  |-
  |rowspan="4"| Statistic
+
  | State ID
|style="background-color: #f4cccc; text-decoration: line-through;"| Name
+
  | {{Type|VarInt}}
  |rowspan="4"| Array
+
  | A server-managed sequence number used to avoid desynchronization; see [[#Click Container]].
  |style="background-color: #f4cccc; text-decoration: line-through;"| String (32767)
+
  |-
|style="background-color: #f4cccc; text-decoration: line-through;"| [https://gist.github.com/Alvin-LB/8d0d13db00b3c00fd0e822a562025eff https://gist.github.com/Alvin-LB/8d0d13db00b3c00fd0e822a562025eff]
+
  | Slot
  |- style="background-color: #d9ead3;"
+
  | {{Type|Short}}
  | Category ID
+
  | The slot that should be updated.
  | VarInt
 
| See below
 
  |- style="background-color: #d9ead3;"
 
| Statistic ID
 
| VarInt
 
| See below
 
 
  |-
 
  |-
  | Value
+
  | Slot Data
  | VarInt
+
  | {{Type|Slot}}
  | The amount to set it to
+
  |
 
  |}
 
  |}
  
Categories (these are namespaced, but with <code>:</code>. replaced with <code>.</code>):
+
If Window ID is 0, the hotbar and offhand slots (slots 36 through 45) may be updated even when a different container window is open. (The Notchian server does not appear to utilize this special case.) Updates are also restricted to those slots when the player is looking at a creative inventory tab other than the survival inventory. (The Notchian server does ''not'' handle this restriction in any way, leading to [https://bugs.mojang.com/browse/MC-242392 MC-242392].)
 +
 
 +
{{change|If Window ID is -1, the item being dragged with the mouse is set. In this case, State ID and Slot are ignored.|}}
 +
 
 +
{{change|If Window ID is -2, any slot in the player's inventory can be updated irrespective of the current container window. In this case, State ID is ignored, and the Notchian server uses a bogus value of 0. Used by the Notchian server to implement the [[#Pick Item]] functionality.|}}
 +
 
 +
When a container window is open, the server never sends updates targeting Window ID 0&mdash;all of the [[Inventory|window types]] include slots for the player inventory. The client must automatically apply changes targeting the inventory portion of a container window to the main inventory; the server does not resend them for ID 0 when the window is closed. However, since the armor and offhand slots are only present on ID 0, updates to those slots occurring while a window is open must be deferred by the server until the window's closure.
 +
 
 +
==== Set Cooldown ====
 +
 
 +
Applies a cooldown period to all items with the given type.  Used by the Notchian server with enderpearls.  This packet should be sent when the cooldown starts and also when the cooldown ends (to compensate for lag), although the client will end the cooldown automatically. Can be applied to any item, note that interactions still get sent to the server with the item but the client does not play the animation nor attempt to predict results (i.e block placing).
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Name
+
  ! Packet ID
  ! ID
+
! State
  ! Registry
+
! Bound To
 +
! Field Name
 +
  ! Field Type
 +
! Notes
 +
|-
 +
| rowspan="2"| ''protocol:''<br/><code>0x17</code><br/><br/>''resource:''<br/><code>cooldown</code>
 +
| rowspan="2"| Play
 +
| rowspan="2"| Client
 +
| {{change|Item ID|Cooldown Group}}
 +
| {{change|{{Type|VarInt}}|{{Type|Identifier}}}}
 +
  | {{change|Numeric ID of the item|Group of items}} to apply a cooldown to.
 
  |-
 
  |-
  | <code>minecraft.mined</code>
+
  | Cooldown Ticks
  | 0
+
| {{Type|VarInt}}
  | Blocks
+
| Number of ticks to apply a cooldown for, or 0 to clear the cooldown.
 +
|}
 +
 
 +
==== Teleport Entity ====
 +
 
 +
{{Warning2|{{change||The Mojang-specified name of this packet was changed in 1.21.2 from <code>teleport_entity</code> to <code>entity_position_sync</code>. There is a new <code>teleport_entity</code>, which this document more appropriately calls [[#Synchronize Vehicle Position|Synchronize Vehicle Position]]. That packet has a different function and will lead to confusing results if used in place of this one.}}}}
 +
 
 +
This packet is sent by the server when an entity moves more than 8 blocks.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
  ! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | <code>minecraft.crafted</code>
+
  | rowspan="10"| ''protocol:''<br/><code>{{change|0x70|0x20}}</code><br/><br/>''resource:''<br/><code>{{change|teleport_entity|entity_position_sync}}</code>
  | 1
+
  | rowspan="10"| Play
  | Items
+
| rowspan="10"| Client
 +
| Entity ID
 +
| {{Type|VarInt}}
 +
  |
 
  |-
 
  |-
  | <code>minecraft.used</code>
+
  | X
  | 2
+
  | {{Type|Double}}
  | Items
+
  |  
 
  |-
 
  |-
  | <code>minecraft.broken</code>
+
  | Y
  | 3
+
  | {{Type|Double}}
| Items
+
  |
|-
 
| <code>minecraft.picked_up</code>
 
| 4
 
  | Items
 
 
  |-
 
  |-
  | <code>minecraft.dropped</code>
+
  | Z
  | 5
+
  | {{Type|Double}}
  | Items
+
|
 +
|- {{added}}
 +
| Velocity X
 +
| {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity Y
 +
| {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity Z
 +
| {{Type|Double}}
 +
  |
 
  |-
 
  |-
  | <code>minecraft.killed</code>
+
  | Yaw
  | 6
+
  | {{change|{{Type|Angle}}|{{Type|Float}}}}
  | Entities
+
  | Rotation on the X axis, in degrees.
 
  |-
 
  |-
  | <code>minecraft.killed_by</code>
+
  | Pitch
  | 7
+
  | {{change|{{Type|Angle}}|{{Type|Float}}}}
  | Entities
+
  | Rotation on the Y axis, in degrees.
 
  |-
 
  |-
  | <code>minecraft.custom</code>
+
  | On Ground
  | 8
+
  | {{Type|Boolean}}
  | Custom
+
  |
|}
+
|}
 +
 
 +
==== Explosion ====
  
Blocks, Items, and Entities use block (not block state), item, and entity ids.
+
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).
  
Custom has the following (unit only matters for clients):
+
{{change|Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x|}}
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Name
+
  ! Packet ID
  ! ID
+
! State
  ! Unit
+
! Bound To
 +
! colspan="2" | Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | <code>minecraft.leave_game</code>
+
  | rowspan="16"| ''protocol:''<br/><code>{{change|0x20|0x21}}</code><br/><br/>''resource:''<br/><code>explode</code>
  | 0
+
  | rowspan="16"| Play
  | None
+
| rowspan="16"| Client
 +
| X
 +
| {{Type|Double}}
 +
  |
 
  |-
 
  |-
  | <code>minecraft.play_one_minute</code>
+
  | Y
  | 1
+
  | {{Type|Double}}
  | Time
+
  |
 
  |-
 
  |-
  | <code>minecraft.time_since_death</code>
+
  | Z
  | 2
+
| {{Type|Double}}
  | Time
+
|
 +
|- {{removed}}
 +
| Strength
 +
| {{Type|Float}}
 +
| If the strength is greater or equal to 2.0, or the block interaction is not 0 (keep), large explosion particles are used. Otherwise, small explosion particles are used.
 +
|- {{removed}}
 +
| Record Count
 +
| {{Type|VarInt}}
 +
| Number of elements in the following array.
 +
  |- {{removed}}
 +
| Records
 +
| {{Type|Array}} of ({{Type|Byte}}, {{Type|Byte}}, {{Type|Byte}})
 +
| Each record is 3 signed bytes long; the 3 bytes are the XYZ (respectively) signed offsets of affected blocks.
 +
|- {{added}}
 +
| Has Player Motion
 +
| {{Type|Boolean}}
 +
  |
 
  |-
 
  |-
  | <code>minecraft.sneak_Time</code>
+
  | Player Motion X
  | 3
+
  | {{change|{{Type|Float}}|{{Type|Optional}} {{Type|Double}}}}
  | Time
+
  | X velocity of the player being pushed by the explosion.{{change|| Only present if Has Player Motion is true.}}
 
  |-
 
  |-
  | <code>minecraft.walk_one_cm</code>
+
  | Player Motion Y
  | 4
+
  | {{change|{{Type|Float}}|{{Type|Optional}} {{Type|Double}}}}
  | Distance
+
  | Y velocity of the player being pushed by the explosion.{{change|| Only present if Has Player Motion is true.}}
 
  |-
 
  |-
  | <code>minecraft.crouch_one_cm</code>
+
  | Player Motion Z
  | 5
+
| {{change|{{Type|Float}}|{{Type|Optional}} {{Type|Double}}}}
  | Distance
+
| Z velocity of the player being pushed by the explosion.{{change|| Only present if Has Player Motion is true.}}
 +
|- {{removed}}
 +
  | Block Interaction
 +
  | {{Type|VarInt}} {{Type|Enum}}
 +
| 0 = keep, 1 = destroy, 2 = destroy_with_decay, 3 = trigger_block.
 
  |-
 
  |-
  | <code>minecraft.sprint_one_cm</code>
+
  | {{change|Small |}}Explosion Particle ID
  | 6
+
  | {{Type|VarInt}}
  | Distance
+
  | The particle ID listed in [[Particles]].
 
  |-
 
  |-
  | <code>minecraft.swim_one_cm</code>
+
  | {{change|Small |}}Explosion Particle Data
  | 7
+
| Varies
  | Distance
+
| Particle data as specified in [[Particles]].
 +
  |- {{removed}}
 +
  | Large Explosion Particle ID
 +
| {{Type|VarInt}}
 +
| The particle ID listed in [[Particles]].
 +
|- {{removed}}
 +
| Large Explosion Particle Data
 +
| Varies
 +
| Particle data as specified in [[Particles]].
 
  |-
 
  |-
  | <code>minecraft.fall_one_cm</code>
+
  | Explosion Sound
  | 8
+
| {{Type|ID or}} {{Type|Sound Event}}
  | Distance
+
| ID in the <code>minecraft:sound_event</code> registry, or an inline definition.
 +
  |}
 +
 
 +
==== Open Horse Screen ====
 +
 
 +
This packet is used exclusively for opening the horse GUI. [[#Open Screen|Open Screen]] is used for all other GUIs. The client will not open the inventory if the Entity ID does not point to an horse-like animal.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | <code>minecraft.climb_one_cm</code>
+
  | rowspan="3"| ''protocol:''<br/><code>0x23</code><br/><br/>''resource:''<br/><code>horse_screen_open</code>
  | 9
+
  | rowspan="3"| Play
  | Distance
+
| rowspan="3"| Client
 +
| Window ID
 +
| {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
 +
  |
 
  |-
 
  |-
  | <code>minecraft.fly_one_cm</code>
+
  | Slot count
  | 10
+
  | {{Type|VarInt}}
  | Distance
+
  |
 
  |-
 
  |-
  | <code>minecraft.dive_one_cm</code>
+
  | Entity ID
  | 11
+
| {{Type|Int}}
  | Distance
+
  |
 +
  |}
 +
 
 +
==== Login (play) ====
 +
 
 +
{{Need Info|Although the number of portal cooldown ticks is included in this packet, the whole portal usage process is still dictated entirely by the server. What kind of effect does this value have on the client, if any?}}
 +
 
 +
See [[Protocol Encryption]] for information on logging in.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | <code>minecraft.minecart_one_cm</code>
+
  | rowspan="23"| ''protocol:''<br/><code>{{change|0x2B|0x2C}}</code><br/><br/>''resource:''<br/><code>login</code>
  | 12
+
  | rowspan="23"| Play
  | Distance
+
| rowspan="23"| Client
 +
  | Entity ID
 +
| {{Type|Int}}
 +
| The player's Entity ID (EID).
 
  |-
 
  |-
  | <code>minecraft.boat_one_cm</code>
+
  | Is hardcore
  | 13
+
  | {{Type|Boolean}}
  | Distance
+
  |
 
  |-
 
  |-
  | <code>minecraft.pig_one_cm</code>
+
  | Dimension Count
  | 14
+
  | {{Type|VarInt}}
  | Distance
+
  | Size of the following array.
 
  |-
 
  |-
  | <code>minecraft.horse_one_cm</code>
+
  | Dimension Names
  | 15
+
  | {{Type|Array}} of {{Type|Identifier}}
  | Distance
+
  | Identifiers for all dimensions on the server.
 
  |-
 
  |-
  | <code>minecraft.aviate_one_cm</code>
+
  | Max Players
  | 16
+
  | {{Type|VarInt}}
  | Distance
+
  | Was once used by the client to draw the player list, but now is ignored.
 
  |-
 
  |-
  | <code>minecraft.jump</code>
+
  | View Distance
  | 17
+
  | {{Type|VarInt}}
  | None
+
  | Render distance (2-32).
 
  |-
 
  |-
  | <code>minecraft.drop</code>
+
  | Simulation Distance
  | 18
+
  | {{Type|VarInt}}
  | None
+
  | The distance that the client will process specific things, such as entities.
 
  |-
 
  |-
  | <code>minecraft.damage_dealt</code>
+
  | Reduced Debug Info
  | 19
+
  | {{Type|Boolean}}
  | Damage
+
  | If true, a Notchian client shows reduced information on the {{Minecraft Wiki|debug screen}}.  For servers in development, this should almost always be false.
 
  |-
 
  |-
  | <code>minecraft.damage_taken</code>
+
  | Enable respawn screen
  | 20
+
  | {{Type|Boolean}}
  | Damage
+
  | Set to false when the doImmediateRespawn gamerule is true.
 
  |-
 
  |-
  | <code>minecraft.deaths</code>
+
  | Do limited crafting
  | 21
+
  | {{Type|Boolean}}
  | None
+
  | Whether players can only craft recipes they have already unlocked. Currently unused by the client.
 
  |-
 
  |-
  | <code>minecraft.mob_kills</code>
+
  | Dimension Type
| 22
+
| {{Type|VarInt}}
| None
+
| The ID of the type of dimension in the <code>minecraft:dimension_type</code> registry, defined by the Registry Data packet.
 
  |-
 
  |-
  | <code>minecraft.animals_bred</code>
+
  | Dimension Name
  | 23
+
  | {{Type|Identifier}}
  | None
+
  | Name of the dimension being spawned into.
 
  |-
 
  |-
  | <code>minecraft.player_kills</code>
+
  | Hashed seed
  | 24
+
  | {{Type|Long}}
  | None
+
  | First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
 
  |-
 
  |-
  | <code>minecraft.fish_caught</code>
+
  | Game mode
  | 25
+
  | {{Type|Unsigned Byte}}
  | None
+
  | 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 
  |-
 
  |-
  | <code>minecraft.talked_to_villager</code>
+
  | Previous Game mode
  | 26
+
  | {{Type|Byte}}
  | None
+
  | -1: Undefined (null), 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. The previous game mode. Vanilla client uses this for the debug (F3 + N & F3 + F4) game mode switch. (More information needed)
 
  |-
 
  |-
  | <code>minecraft.traded_with_villager</code>
+
  | Is Debug
  | 27
+
  | {{Type|Boolean}}
  | None
+
  | True if the world is a {{Minecraft Wiki|debug mode}} world; debug mode worlds cannot be modified and have predefined blocks.
 
  |-
 
  |-
  | <code>minecraft.eat_cake_slice</code>
+
  | Is Flat
  | 28
+
  | {{Type|Boolean}}
  | None
+
  | True if the world is a {{Minecraft Wiki|superflat}} world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
 
  |-
 
  |-
  | <code>minecraft.fill_cauldron</code>
+
  | Has death location
  | 29
+
  | {{Type|Boolean}}
  | None
+
  | If true, then the next two fields are present.
 
  |-
 
  |-
  | <code>minecraft.use_cauldron</code>
+
  | Death dimension name
  | 30
+
  | {{Type|Optional}} {{Type|Identifier}}
  | None
+
  | Name of the dimension the player died in.
 
  |-
 
  |-
  | <code>minecraft.clean_armor</code>
+
  | Death location
  | 31
+
  | {{Type|Optional}} {{Type|Position}}
  | None
+
  | The location that the player died at.
 
  |-
 
  |-
  | <code>minecraft.clean_banner</code>
+
  | Portal cooldown
  | 32
+
| {{Type|VarInt}}
  | None
+
| The number of ticks until the player can use the portal again.
 +
  |- {{added}}
 +
| Sea level
 +
| {{Type|VarInt}}
 +
  |
 
  |-
 
  |-
  | <code>minecraft.interact_with_brewingstand</code>
+
  | Enforces Secure Chat
  | 33
+
  | {{Type|Boolean}}
  | None
+
|
 +
|}
 +
 
 +
==== Move Minecart Along Track ====
 +
 
 +
{| class="wikitable" {{added}}
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! colspan="2"| Field Name
 +
! colspan="2"| Field Type
 +
  ! colspan="2"| Notes
 
  |-
 
  |-
  | <code>minecraft.interact_with_beacon</code>
+
  | rowspan="11"| ''protocol:''<br/><code>0x31</code><br/><br/>''resource:''<br/><code>move_minecart_along_track</code>
  | 34
+
  | rowspan="11"| Play
  | None
+
| rowspan="11"| Client
 +
| colspan="2"| Entity ID
 +
| colspan="2"| {{Type|VarInt}}
 +
  |
 
  |-
 
  |-
  | <code>minecraft.inspect_dropper</code>
+
  | colspan="2"| Step Count
  | 35
+
  | colspan="2"| {{Type|VarInt}}
  | None
+
  | Number of elements in the following array.
 
  |-
 
  |-
  | <code>minecraft.inspect_hopper</code>
+
  | rowspan="9"| Steps
  | 36
+
| X
  | None
+
| rowspan="9"| {{Type|Array}}
 +
  | {{Type|Double}}
 +
  |  
 
  |-
 
  |-
  | <code>minecraft.inspect_dispenser</code>
+
  | Y
  | 37
+
  | {{Type|Double}}
  | None
+
  |  
 
  |-
 
  |-
  | <code>minecraft.play_noteblock</code>
+
  | Z
  | 38
+
  | {{Type|Double}}
  | None
+
  |  
 
  |-
 
  |-
  | <code>minecraft.tune_noteblock</code>
+
  | Velocity X
  | 39
+
  | {{Type|Double}}
  | None
+
  |
 
  |-
 
  |-
  | <code>minecraft.pot_flower</code>
+
  | Velocity Y
  | 40
+
  | {{Type|Double}}
  | None
+
  |
 
  |-
 
  |-
  | <code>minecraft.trigger_trapped_chest</code>
+
  | Velocity Z
  | 41
+
  | {{Type|Double}}
  | None
+
  |
 
  |-
 
  |-
  | <code>minecraft.open_enderchest</code>
+
  | Yaw
  | 42
+
  | {{Type|Angle}}
  | None
+
  |
 
  |-
 
  |-
  | <code>minecraft.enchant_item</code>
+
  | Pitch
  | 43
+
  | {{Type|Angle}}
  | None
+
  |
 
  |-
 
  |-
  | <code>minecraft.play_record</code>
+
  | Weight
  | 44
+
| {{Type|Float}}
  | None
+
|}
 +
 
 +
==== Player Info Update ====
 +
 
 +
Sent by the server to update the user list (<tab> in the client).
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
  ! colspan="2"| Field Name
 +
  ! colspan="2"| Field Type
 +
! Notes
 
  |-
 
  |-
  | <code>minecraft.interact_with_furnace</code>
+
  | rowspan="4"| ''protocol:''<br/><code>{{change|0x3E|0x40}}</code><br/><br/>''resource:''<br/><code>player_info_update</code>
  | 45
+
  | rowspan="4"| Play
  | None
+
| rowspan="4"| Client
 +
  | colspan="2"| Actions
 +
| colspan="2"| {{Type|Byte}}
 +
| Determines what actions are present.
 
  |-
 
  |-
  | <code>minecraft.interact_with_crafting_table</code>
+
  | colspan="2"| Number Of Players
  | 46
+
  | colspan="2"| {{Type|VarInt}}
  | None
+
  | Number of elements in the following array.
 
  |-
 
  |-
  | <code>minecraft.open_chest</code>
+
  | rowspan="2" | Players
  | 47
+
| UUID
  | None
+
| rowspan="2" | {{Type|Array}}
 +
  | {{Type|UUID}}
 +
  | The player UUID
 
  |-
 
  |-
  | <code>minecraft.sleep_in_bed</code>
+
  | Player Actions
  | 48
+
  | {{Type|Array}} of [[#player-info:player-actions|Player&nbsp;Actions]]
| None
+
  | The length of this array is determined by the number of [[#player-info:player-actions|Player Actions]] that give a non-zero value when applying its mask to the actions flag. For example given the decimal number 5, binary 00000101. The masks 0x01 and 0x04 would return a non-zero value, meaning the Player Actions array would include two actions: Add Player and Update Game Mode.
  |-
 
| <code>minecraft.open_shulker_box</code>
 
| 49
 
| None
 
 
  |}
 
  |}
 
Units:
 
 
* None: just a normal number (formatted with 0 decimal places)
 
* Damage: value is 10 times the normal amount
 
* Distance: a distance in centimeters (hundredths of blocks)
 
* Time: a time span in ticks
 
 
==== Update Block Entity ====
 
 
Sets tile entity associated with the block at the given location.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  |+ id="player-info:player-actions" | Player Actions
  ! State
+
  ! Action
  ! Bound To
+
  ! Mask
  ! Field Name
+
  ! colspan="2" | Field Name
  ! Field Type
+
  ! colspan="2" | Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x09
+
  | rowspan="6" | Add Player
  |rowspan="3"| Play
+
  | rowspan="6" | 0x01
  |rowspan="3"| Client
+
| colspan="2" | Name
  | Location
+
| colspan="2" | {{Type|String}} (16)
  | Position
+
|-
  |  
+
| colspan="2" | Number Of Properties
 +
| colspan="2" | {{Type|VarInt}}
 +
| Number of elements in the following array.
 +
|-
 +
  | rowspan="4" | Property
 +
| Name
 +
  | rowspan="4"| {{Type|Array}}
 +
  | {{Type|String}} (32767)
 +
  |
 
  |-
 
  |-
  | Action
+
  | Value
  | Unsigned Byte
+
  | {{Type|String}} (32767)
  | The type of update to perform, see below
+
  |
 
  |-
 
  |-
  | NBT Data
+
  | Is Signed
  | [[NBT|NBT Tag]]
+
  | {{Type|Boolean}}
  | Data to set. May be a TAG_END (0), in which case the block entity at the given location is removed (though this is not required since the client will remove the block entity automatically on chunk unload or block removal)
+
  |
  |}
+
  |-
 
+
  | Signature
''Action'' field:
+
| {{Type|Optional}} {{Type|String}} (32767)
 
+
| Only if Is Signed is true.
* '''1''': Set data of a mob spawner (everything except for SpawnPotentials: current delay, min/max delay, mob to be spawned, spawn count, spawn range, etc.)
+
|-
* '''2''': Set command block text (command and last execution status)
+
  | rowspan="7" | Initialize Chat
* '''3''': Set the level, primary, and secondary powers of a beacon
+
  | rowspan="7" | 0x02
* '''4''': Set rotation and skin of mob head
+
  | colspan="2" | Has Signature Data
* {{Change|'''5''': Set type of flower in flower pot}}
+
  | colspan="2" | {{Type|Boolean}}
* {{Change||'''5''': Declare a conduit}}
 
* '''6''': Set base color and patterns on a banner
 
* '''7''': Set the data for a Structure tile entity
 
* '''8''': Set the destination for a end gateway
 
* '''9''': Set the text on a sign
 
* '''10''': Declare a shulker box, no data appears to be sent and the client seems to do fine without this packet. Perhaps it is a leftover from earlier versions?
 
* '''11''': {{change|Set the color of a bed|Declare a bed}}
 
 
 
==== Block Change ====
 
 
 
Fired whenever a block is changed within the render distance.
 
 
 
{{Warning2|Changing a block in a chunk that is not loaded is not a stable action. The Notchian client currently uses a ''shared'' empty chunk which is modified for all block changes in unloaded chunks; while in 1.9 this chunk never renders in older versions the changed block will appear in all copies of the empty chunk.  Servers should avoid sending block changes in unloaded chunks and clients should ignore such packets.}}
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
  ! State
 
  ! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x0B
+
  | colspan="2" | Chat session ID
  |rowspan="2"| Play
+
  | colspan="2" | {{Type|UUID}}
|rowspan="2"| Client
+
  | Only sent if Has Signature Data is true.
| Location
 
| Position
 
  | Block Coordinates
 
 
  |-
 
  |-
  | Block ID
+
  | colspan="2" | Public key expiry time
| VarInt
+
  | colspan="2" | {{Type|Long}}
| The new block state ID for the block as given in the [[#global palette|global palette]].  {{change|(When reading data: <code>type {{=}} id >> 4</code>, <code>meta {{=}} id & 15</code>, when writing data: <code>id {{=}} type << 4 {{!}} (meta & 15)</code>)|See that section for more information.}}
+
  | Key expiry time, as a UNIX timestamp in milliseconds. Only sent if Has Signature Data is true.
|}
 
 
 
==== Multi Block Change ====
 
 
 
Fired whenever 2 or more blocks are changed within the same chunk on the same tick.
 
 
 
{{Warning|Changing blocks in chunks not loaded by the client is unsafe (see note on [[#Block Change|Block Change]]).}}
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
!colspan="2"| Field Name
 
  !colspan="2"| Field Type
 
  ! Notes
 
 
  |-
 
  |-
|rowspan="6"| {{Change|0x10|0x0F}}
+
  | colspan="2" | Encoded public key size
|rowspan="6"| Play
+
  | colspan="2" | {{Type|VarInt}}
|rowspan="6"| Client
+
  | Size of the following array. Only sent if Has Signature Data is true. Maximum length is 512 bytes.
  |colspan="2"| Chunk X
 
  |colspan="2"| Int
 
  | Chunk X coordinate
 
 
  |-
 
  |-
  |colspan="2"| Chunk Z
+
  | colspan="2" | Encoded public key
  |colspan="2"| Int
+
  | colspan="2" | {{Type|Byte Array}} (512)
  | Chunk Z coordinate
+
  | The player's public key, in bytes. Only sent if Has Signature Data is true.
 
  |-
 
  |-
  |colspan="2"| Record Count
+
  | colspan="2" | Public key signature size
  |colspan="2"| VarInt
+
  | colspan="2" | {{Type|VarInt}}
  | Number of elements in the following array, i.e. the number of blocks affected
+
  | Size of the following array. Only sent if Has Signature Data is true. Maximum length is 4096 bytes.
 
  |-
 
  |-
  |rowspan="3"| Record
+
  | colspan="2" | Public key signature
  | Horizontal Position
+
  | colspan="2" | {{Type|Byte Array}} (4096)
|rowspan="3"| Array
+
  | The public key's digital signature. Only sent if Has Signature Data is true.
| Unsigned Byte
 
  | The 4 most significant bits (<code>0xF0</code>) encode the X coordinate, relative to the chunk. The 4 least significant bits (<code>0x0F</code>) encode the Z coordinate, relative to the chunk.
 
 
  |-
 
  |-
  | Y Coordinate
+
  | Update Game Mode
  | Unsigned Byte
+
  | 0x04
  | Y coordinate of the block
+
  | colspan="2" | Game Mode
 +
| colspan="2" | {{Type|VarInt}}
 
  |-
 
  |-
  | Block ID
+
  | Update Listed
  | VarInt
+
  | 0x08
  | The new block state ID for the block as given in the [[#global palette|global palette]].  {{change|(When reading data: <code>type {{=}} id >> 4</code>, <code>meta {{=}} id & 15</code>, when writing data: <code>id {{=}} type << 4 {{!}} (meta & 15)</code>)|See that section for more information.}}
+
  | colspan="2" | Listed
|}
+
  | colspan="2" | {{Type|Boolean}}
 
+
  | Whether the player should be listed on the player list.
To decode the position into a world position:
 
 
 
<syntaxhighlight lang="java">
 
worldX = (horizPos >> 4 & 15) + (chunkX * 16);
 
worldY = vertPos;
 
worldZ = (horizPos & 15) + (chunkZ * 16);
 
</syntaxhighlight>
 
 
 
 
 
==== Tab-Complete (clientbound) ====
 
 
 
Used to respond to the client's previous tab complete request.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
!colspan="2"| Field Name
 
  !colspan="2"| Field Type
 
  ! Notes
 
 
  |-
 
  |-
  |rowspan="7"| {{Change|0x0E|0x10}}
+
  | Update Latency
  |rowspan="7"| Play
+
  | 0x10
|rowspan="7"| Client
+
  | colspan="2" | Ping
  |colspan="2" style="background-color: #d9ead3;"| Transaction Id
+
  | colspan="2" | {{Type|VarInt}}
  |colspan="2" style="background-color: #d9ead3;"| VarInt
+
  | Measured in milliseconds.
  |style="background-color: #d9ead3;"| This id should also be used in the tab completion response packet, or it will be ignored.
 
|- style="background-color: #d9ead3;"
 
|colspan="2"|  Start
 
|colspan="2"|  VarInt
 
| Start of the text to replace
 
|- style="background-color: #d9ead3;"
 
|colspan="2"|  Length
 
|colspan="2"|  VarInt
 
| Length of the text to replace
 
 
  |-
 
  |-
  |colspan="2"|  Count
+
  | rowspan="2" | Update Display Name
  |colspan="2"| VarInt
+
  | rowspan="2" | 0x20
  | Number of elements in the following array
+
  | colspan="2" | Has Display Name
 +
  | colspan="2" | {{Type|Boolean}}
 
  |-
 
  |-
  |rowspan="3"| Matches
+
  | colspan="2" | Display Name
  | Match
+
  | colspan="2" | {{Type|Optional}} {{Type|Text Component}}
|rowspan="3"| Array
+
  | Only sent if Has Display Name is true.
| String (32767)
+
  |- {{added}}
| One eligible {{change|command|value to insert}}, note that each command is sent separately instead of in a single string, hence the need for Count.  {{change||Note that for instance this doesn't include a leading <code>/</code> on commands.}}
+
  | Update List Priority
  |-
+
  | 0x40
|style="background-color: #d9ead3;"| Has tooltip
+
  | colspan="2" | Priority
  |style="background-color: #d9ead3;"| Boolean
+
  | colspan="2" | {{Type|VarInt}}
  |style="background-color: #d9ead3;"| True if the following is present
+
  | See below.
  |-
 
  |style="background-color: #d9ead3;"| Tooltip
 
  |style="background-color: #d9ead3;"| Optional [[Chat]]
 
  |style="background-color: #d9ead3;"| Tooltip to display; only present if previous Boolean is true
 
 
  |}
 
  |}
  
==== Declare Commands ====
+
The properties included in this packet are the same as in [[#Login Success|Login Success]], for the current player.
 +
 
 +
Ping values correspond with icons in the following way:
 +
* A ping that negative (i.e. not known to the server yet) will result in the no connection icon.
 +
* A ping under 150 milliseconds will result in 5 bars
 +
* A ping under 300 milliseconds will result in 4 bars
 +
* A ping under 600 milliseconds will result in 3 bars
 +
* A ping under 1000 milliseconds (1 second) will result in 2 bars
 +
* A ping greater than or equal to 1 second will result in 1 bar.
 +
 
 +
The order of players in the player list is determined as follows:
 +
* {{change||Players with higher priorities are sorted before those with lower priorities.}}
 +
* {{change||Among players of equal priorities, }}spectators are sorted after non-spectators.
 +
* Within each of those groups, players are sorted into teams. The teams are ordered case-sensitively by team name in ascending order. Players with no team are listed first.
 +
* The players of each team (and non-team) are sorted case-insensitively by name in ascending order.
 +
 
 +
==== Synchronize Player Position ====
 +
 
 +
Teleports the client, e.g. during login, when using an ender pearl, in response to invalid move packets, etc.
  
Lists all of the commands on the server, and how they are parsed.
+
Due to latency, the server may receive outdated movement packets sent before the client was aware of the teleport. To account for this, the server ignores all movement packets from the client until a [[#Confirm Teleportation|Confirm Teleportation]] packet with an ID matching the one sent in the teleport packet is received.
  
This is a tree, with one root node. Each redirect or child node must refer only to nodes that have already been declared.
+
Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0, -1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360 (see [https://bugs.mojang.com/browse/MC-90097 MC-90097]).
 +
 
 +
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,698: Line 1,881:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x11
+
  | rowspan="11"| ''protocol:''<br/><code>{{change|0x40|0x42}}</code><br/><br/>''resource:''<br/><code>player_position</code>
  |rowspan="3"| Play
+
  | rowspan="11"| Play
  |rowspan="3"| Client
+
  | rowspan="11"| Client
  | Count
+
  | {{added}} | Teleport ID
  | VarInt
+
  | {{added}} | {{Type|VarInt}}
  | Number of elements in the following array
+
  | {{added}} | Client should confirm this packet with [[#Confirm Teleportation|Confirm Teleportation]] containing the same Teleport ID.
 
  |-
 
  |-
  | Nodes
+
  | X
  | Array of Node
+
  | {{Type|Double}}
  | A array of <code>CommandNode</code>s
+
  | Absolute or relative position, depending on Flags.
 
  |-
 
  |-
  | Root index
+
  | Y
  | VarInt
+
  | {{Type|Double}}
  | Index of the <code>RootCommandNode</code> in the previous array
+
  | Absolute or relative position, depending on Flags.
  |}
+
  |-
 
+
| Z
Node:
+
| {{Type|Double}}
 
+
| Absolute or relative position, depending on Flags.
{| class="wikitable"
+
|- {{added}}
  ! Field Name
+
| Velocity X
  ! Field Type
+
| {{Type|Double}}
  ! Notes
+
  |
  |-
+
  |- {{added}}
  | Flags
+
| Velocity Y
  | Byte
+
| {{Type|Double}}
 +
  |
 +
  |- {{added}}
 +
  | Velocity Z
 +
  | {{Type|Double}}
 
  |
 
  |
  {| class="wikitable"
 
  ! Bit mask
 
  !colspan="2"| Meaning
 
  |-
 
  |rowspan="4"| 0x03
 
  |colspan="2"| Type of the <code>CommandNode</code>
 
  |-
 
  |0
 
  |<code>RootCommandNode</code>
 
  |-
 
  |1
 
  |<code>LiteralCommandNode</code>
 
  |-
 
  |2
 
  |<code>ArgumentCommandNode</code>
 
  |-
 
  |0x04
 
  |colspan="2"| Is executable (i.e. does not need more arguments to be valid; for instance <code>/gamerule</code> is not executable but <code>/gamerule keepInventory</code> (queries the value of <code>keepInventory</code>) and <code>/gamerule keepInventory true</code> (sets <code>keepInventory</code> to true) are; the command may still have additional arguments after but they are optional)
 
  |-
 
  |0x08
 
  |colspan="2"| Has redirect node
 
  |-
 
  |0x10
 
  |colspan="2"| Has custom suggestions, currently only present if the type is a <code>ArgumentCommandNode</code>
 
  |}
 
 
  |-
 
  |-
  | Children Count
+
  | Yaw
  | VarInt
+
  | {{Type|Float}}
  | Number of elements in the following array
+
  | Absolute or relative rotation on the X axis, in degrees.
 
  |-
 
  |-
  | Children
+
  | Pitch
  | Array of VarInt
+
  | {{Type|Float}}
  | The indexes of the children <code>CommandNode</code>s within the <code>Nodes</code> array
+
  | Absolute or relative rotation on the Y axis, in degrees.
 
  |-
 
  |-
  | Redirect node
+
  | Flags
  | Optional VarInt
+
  | {{change|{{Type|Byte}}|{{Type|Teleport Flags}}}}
  | Only if flags & 0x08. Points to the redirect <code>CommandNode</code> within the <code>Nodes</code> array
+
  | {{change|Reference the Flags table below. When the value of the this byte masked is zero the field is absolute, otherwise relative.|}}
  |-
+
  |- {{removed}}
  | Extra node data
+
  | Teleport ID
  | Extra node data
+
  | {{Type|VarInt}}
  | Type depends on the <code>CommandNode</code> type, see below.
+
  | Client should confirm this packet with [[#Confirm Teleportation|Confirm Teleportation]] containing the same Teleport ID.
 
  |}
 
  |}
  
Extra node data:
+
==== Player Rotation ====
{| class="wikitable"
+
 
  ! Type
+
{| class="wikitable" {{added}}
 +
! Packet ID
 +
! State
 +
  ! Bound To
 
  ! Field Name
 
  ! Field Name
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  | <code>RootCommandNode</code>
+
  | rowspan="2"| ''protocol:''<br/><code>0x43</code><br/><br/>''resource:''<br/><code>player_rotation</code>
  | Empty
+
| rowspan="2"| Play
  | Empty
+
  | rowspan="2"| Client
  |  
+
  | Yaw
 +
| {{Type|Float}}
 +
  | Rotation on the X axis, in degrees.
 
  |-
 
  |-
  | <code>LiteralCommandNode</code>
+
  | Pitch
  | Literal
+
  | {{Type|Float}}
| String (32767)
+
  | Rotation on the Y axis, in degrees.
  | The text
 
|-
 
|rowspan="4"| <code>ArgumentCommandNode</code>
 
| Name
 
| String (32767)
 
| The name of the argument
 
|-
 
| Parser
 
| Identifier
 
| One of several known to the client, listed below.  If the client does not know the parser, reading this RequiredArgumentBuilder stops immediately (following fields are not read)
 
|-
 
| Properties
 
| Optional, varies
 
| See below.  Varies depending on the parser.
 
|-
 
| Suggests
 
| Optional Identifier
 
| Only present if (flags & 0x10) != 0. See below for the available types.
 
 
  |}
 
  |}
  
Parsers:
+
==== Place Ghost Recipe ====
 +
 
 +
Response to the serverbound packet ([[#Place Recipe|Place Recipe]]), with the same recipe ID. Appears to be used to notify the UI.
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Identifier
+
  ! Packet ID
  ! Description
+
  ! State
  ! Properties
+
  ! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | <code>brigadier:bool</code>
+
  | rowspan="4"| ''protocol:''<br/><code>{{change|0x37|0x39}}</code><br/><br/>''resource:''<br/><code>place_ghost_recipe</code>
| Boolean value (<code>true</code> or <code>false</code>, case-sensitive)
+
| rowspan="4"| Play
  | None
+
| rowspan="4"| Client
 +
| Window ID
 +
| {{change|{{Type|Byte}}|{{Type|VarInt}}}}
 +
|
 +
|- {{removed}}
 +
| Recipe
 +
| {{Type|Identifier}}
 +
| A recipe ID.
 +
|- {{added}}
 +
| Recipe Display
 +
| {{Type|Recipe Display}}
 +
|
 +
|}
 +
 
 +
==== Recipe Book Add ====
 +
 
 +
{| class="wikitable" {{added}}
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! colspan="2"| Field Name
 +
! colspan="2"| Field Type
 +
  ! colspan="2"| Notes
 
  |-
 
  |-
  | <code>brigadier:double</code>
+
  | rowspan="10"| ''protocol:''<br/><code>0x44</code><br/><br/>''resource:''<br/><code>recipe_book_add</code>
  | Double
+
  | rowspan="10"| Play
  | Specifies min and max values:
+
  | rowspan="10"| Client
  {| class="wikitable"
+
| colspan="2"| Recipe Count
  ! Name
+
| colspan="2"| {{Type|VarInt}}
  ! Type
+
  | Number of elements in the following array.
  ! Description
 
  |-
 
  | Flags
 
  | Byte
 
  |
 
  |-
 
  | Min
 
  | Optional double
 
  | Only if flags & 0x01. If not specified, defaults to <code>-Double.MAX_VALUE</code> (≈ -1.7976931348623157E307)
 
  |-
 
  | Max
 
  | Optional double
 
  | Only if flags & 0x02. If not specified, defaults to <code>Double.MAX_VALUE</code> (≈ 1.7976931348623157E307)
 
  |}
 
 
  |-
 
  |-
  | <code>brigadier:float</code>
+
  | rowspan="8"| Recipes
  | Float
+
  | Recipe ID
  | Specifies min and max values:
+
  | rowspan="8"| {{Type|Array}}
  {| class="wikitable"
+
| {{Type|VarInt}}
  ! Name
+
| ID to assign to the recipe.
  ! Type
 
  ! Description
 
  |-
 
  | Flags
 
  | Byte
 
  |
 
  |-
 
  | Min
 
  | Optional float
 
  | Only if flags & 0x01.  If not specified, defaults to <code>-Float.MAX_VALUE</code> (≈ -3.4028235E38)
 
  |-
 
  | Max
 
  | Optional float
 
  | Only if flags & 0x02.  If not specified, defaults to <code>Float.MAX_VALUE</code> (≈ 3.4028235E38)
 
  |}
 
 
  |-
 
  |-
  | <code>brigadier:integer</code>
+
  | Display
  | Integer
+
  | {{Type|Recipe Display}}
| Specifies min and max values:
+
  |
  {| class="wikitable"
 
  ! Name
 
  ! Type
 
  ! Description
 
  |-
 
  | Flags
 
  | Byte
 
  |
 
  |-
 
  | Min
 
  | Optional integer
 
  | Only if flags & 0x01.  If not specified, defaults to <code>Integer.MIN_VALUE</code> (-2147483648)
 
  |-
 
  | Max
 
  | Optional integer
 
  | Only if flags & 0x02. If not specified, defaults to <code>Integer.MAX_VALUE</code> (2147483647)
 
  |}
 
 
  |-
 
  |-
  | <code>brigadier:string</code>
+
  | Group ID
  | A string
+
  | {{Type|VarInt}}
| A VarInt enum:
+
  |
  {| class="wikitable"
 
  ! Value
 
  ! Name
 
  ! Description
 
  |-
 
  | 0
 
  | <code>SINGLE_WORD</code>
 
  | Reads a single word
 
  |-
 
  | 1
 
  | <code>QUOTABLE_PHRASE</code>
 
  | If it starts with a <code>"</code>, keeps reading until another <code>"</code> (allowing escaping with <code>\</code>). Otherwise behaves the same as <code>SINGLE_WORD</code>
 
  |-
 
  | 2
 
  | <code>GREEDY_PHRASE</code>
 
  | Reads the rest of the content after the cursor.  Quotes will not be removed.
 
  |}
 
 
  |-
 
  |-
  | <code>minecraft:entity</code>
+
  | Category ID
| A selector, player name, or UUID.
+
| {{Type|VarInt}}
| Has a single flags byte:
+
| ID in the <code>minecraft:recipe_book_category</code> registry.
  {| class="wikitable"
 
  ! Bit mask
 
  ! Meaning
 
  |-
 
  | 0x01
 
  | If set, only allows a single entity/player
 
  |-
 
  | 0x02
 
  | If set, only allows players
 
  |}
 
 
  |-
 
  |-
  | <code>minecraft:game_profile</code>
+
  | Has Ingredients
  | A player, online or not.  Can also use a selector, which may match one or more players (but not entities).
+
  | {{Type|Boolean}}
  | None
+
  |
 
  |-
 
  |-
  | <code>minecraft:block_pos</code>
+
  | Ingredient Count
  | A location, represented as 3 numbers (which must be integers).  May use relative locations with <code>~</code>.
+
  | {{Type|Optional}} {{Type|VarInt}}
  | None
+
  | Number of elements in the following array. Only present if Has Ingredients is true.
 
  |-
 
  |-
  | <code>minecraft:vec3</code>
+
  | Ingredients
| A location, represented as 3 numbers (which may have a decimal point, but will be moved to the center of a block if none is specified). May use relative locations with <code>~</code>.
+
| {{Type|Optional}} {{Type|Array}} of {{Type|ID Set}}
| None
+
| IDs in the <code>minecraft:item</code> registry, or an inline definition. Only present if Has Ingredients is true.
 
  |-
 
  |-
  | <code>minecraft:vec2</code>
+
  | Flags
  | A location, represented as 2 numbers (which may have a decimal point, but will be moved to the center of a block if none is specified).  May use relative locations with <code>~</code>.
+
  | {{Type|Byte}}
  | None
+
  | 0x01: show notification; 0x02: highlight as new
 
  |-
 
  |-
  | <code>minecraft:block_state</code>
+
  | colspan="2"| Replace
  | A block state, optionally including NBT and state information.
+
  | colspan="2"| {{Type|Boolean}}
  | None
+
  | Replace or Add to known recipes
  |-
+
  |}
| <code>minecraft:block_predicate</code>
+
 
  | A block, or a block tag.
+
==== Recipe Book Remove ====
  | None
+
 
  |-
+
{| class="wikitable" {{added}}
  | <code>minecraft:item_stack</code>
+
  ! Packet ID
  | An item, optionally including NBT.
+
  ! State
  | None
+
  ! Bound To
 +
  ! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | <code>minecraft:item_predicate</code>
+
  | rowspan="2"| ''protocol:''<br/><code>0x45</code><br/><br/>''resource:''<br/><code>recipe_book_remove</code>
  | An item, or an item tag.
+
  | rowspan="2"| Play
  | None
+
| rowspan="2"| Client
 +
| Recipe Count
 +
| {{Type|VarInt}}
 +
  | Number of elements in the following array.
 
  |-
 
  |-
  | <code>minecraft:color</code>
+
  | Recipes
  | A chat color. One of the names from [[Chat#Colors]], or <code>reset</code>Case-insensitive.
+
  | {{Type|Array}} of {{Type|VarInt}}
  | None
+
  | IDs of recipes to remove.
 +
  |}
 +
 
 +
==== Recipe Book Settings ====
 +
 
 +
{| class="wikitable" {{added}}
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | <code>minecraft:component</code>
+
  | rowspan="8"| ''protocol:''<br/><code>0x46</code><br/><br/>''resource:''<br/><code>recipe_book_settings</code>
  | A JSON [[Chat]] component.
+
  | rowspan="8"| Play
  | None
+
| rowspan="8"| Client
 +
| Crafting Recipe Book Open
 +
| {{Type|Boolean}}
 +
  | If true, then the crafting recipe book will be open when the player opens its inventory.
 
  |-
 
  |-
  | <code>minecraft:message</code>
+
  | Crafting Recipe Book Filter Active
  | A regular message, potentially including selectors.
+
  | {{Type|Boolean}}
  | None
+
  | If true, then the filtering option is active when the players opens its inventory.
 
  |-
 
  |-
  | <code>minecraft:nbt</code>
+
  | Smelting Recipe Book Open
  | An NBT value, parsed using JSON-NBT rules.
+
  | {{Type|Boolean}}
  | None
+
  | If true, then the smelting recipe book will be open when the player opens its inventory.
 
  |-
 
  |-
  | <code>minecraft:nbt_path</code>
+
  | Smelting Recipe Book Filter Active
  | A path within an NBT value, allowing for array and member accesses.
+
  | {{Type|Boolean}}
  | None
+
  | If true, then the filtering option is active when the players opens its inventory.
 
  |-
 
  |-
  | <code>minecraft:objective</code>
+
  | Blast Furnace Recipe Book Open
  | A scoreboard objective.
+
  | {{Type|Boolean}}
  | None
+
  | If true, then the blast furnace recipe book will be open when the player opens its inventory.
 
  |-
 
  |-
  | <code>minecraft:objective_criteria</code>
+
  | Blast Furnace Recipe Book Filter Active
  | A single score criterion.
+
  | {{Type|Boolean}}
  | None
+
  | If true, then the filtering option is active when the players opens its inventory.
 
  |-
 
  |-
  | <code>minecraft:operation</code>
+
  | Smoker Recipe Book Open
  | A scoreboard operator.
+
  | {{Type|Boolean}}
  | None
+
  | If true, then the smoker recipe book will be open when the player opens its inventory.
 
  |-
 
  |-
  | <code>minecraft:particle</code>
+
  | Smoker Recipe Book Filter Active
  | A particle effect (an identifier with extra information following it for specific particles, mirroring the [[#Particle|Particle]] packet)
+
| {{Type|Boolean}}
  | None
+
| If true, then the filtering option is active when the players opens its inventory.
  |-
+
  |}
  | <code>minecraft:rotation</code>
+
 
  | An angle, represented as 2 numbers (which may have a decimal point, but will be moved to the center of a block if none is specified).  May use relative locations with <code>~</code>.
+
==== Respawn ====
| None
+
 
 +
{{Need Info|Although the number of portal cooldown ticks is included in this packet, the whole portal usage process is still dictated entirely by the server. What kind of effect does this value have on the client, if any?}}
 +
 
 +
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
  ! Notes
 +
  |-
 +
  | rowspan="13"| ''protocol:''<br/><code>{{change|0x47|0x4C}}</code><br/><br/>''resource:''<br/><code>respawn</code>
 +
| rowspan="13"| Play
 +
| rowspan="13"| Client
 +
| Dimension Type
 +
| {{Type|VarInt}}
 +
  | The ID of type of dimension in the <code>minecraft:dimension_type</code> registry, defined by the [[Protocol#Registry_Data|Registry Data]] packet.
 
  |-
 
  |-
  | <code>minecraft:scoreboard_slot</code>
+
  | Dimension Name
  | A scoreboard display position slot.  <code>list</code>, <code>sidebar</code>, <code>belowName</code>, and <code>sidebar.team.${color}</code> for all chat colors (<code>reset</code> is not included)
+
  | {{Type|Identifier}}
  | None
+
  | Name of the dimension being spawned into.
 
  |-
 
  |-
  | <code>minecraft:score_holder</code>
+
  | Hashed seed
  | Something that can join a team.  Allows selectors and <code>*</code>.
+
  | {{Type|Long}}
| Has a single flags byte:
+
| First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
  {| class="wikitable"
 
  ! Bit mask
 
  ! Meaning
 
  |-
 
  | 0x01
 
  | If set, allows multiple.
 
  |}
 
 
  |-
 
  |-
  | <code>minecraft:swizzle</code>
+
  | Game mode
  | A collection of up to 3 axes.
+
  | {{Type|Unsigned Byte}}
  | None
+
  | 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 
  |-
 
  |-
  | <code>minecraft:team</code>
+
  | Previous Game mode
  | The name of a team. Parsed as an unquoted string.
+
| {{Type|Byte}}
| None
+
  | -1: Undefined (null), 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. The previous game mode. Vanilla client uses this for the debug (F3 + N & F3 + F4) game mode switch. (More information needed)
 
  |-
 
  |-
  | <code>minecraft:item_slot</code>
+
  | Is Debug
  | A name for an inventory slot.
+
  | {{Type|Boolean}}
  | None
+
  | True if the world is a {{Minecraft Wiki|debug mode}} world; debug mode worlds cannot be modified and have predefined blocks.
 
  |-
 
  |-
  | <code>minecraft:resource_location</code>
+
  | Is Flat
  | An Identifier.
+
  | {{Type|Boolean}}
  | None
+
  | True if the world is a {{Minecraft Wiki|superflat}} world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
 
  |-
 
  |-
  | <code>minecraft:mob_effect</code>
+
  | Has death location
  | A potion effect.
+
  | {{Type|Boolean}}
  | None
+
  | If true, then the next two fields are present.
 
  |-
 
  |-
  | <code>minecraft:function</code>
+
  | Death dimension Name
  | A function.
+
  | {{Type|Optional}} {{Type|Identifier}}
  | None
+
  | Name of the dimension the player died in.
 
  |-
 
  |-
  | <code>minecraft:entity_anchor</code>
+
  | Death location
  | The entity anchor related to the facing argument in the teleport command, is feet or eyes.
+
| {{Type|Optional}} {{Type|Position}}
| None
+
  | The location that the player died at.
 
  |-
 
  |-
  | <code>minecraft:range</code>
+
  | Portal cooldown
  | A range of values with a min and a max.
+
  | {{Type|VarInt}}
 +
| The number of ticks until the player can use the portal again.
 +
|- {{added}}
 +
| Sea level
 +
| {{Type|VarInt}}
 
  |
 
  |
  {| class="wikitable"
 
  ! Name
 
  ! Type
 
  ! Description
 
  |-
 
  | Decimals
 
  | Boolean
 
  | Whether decimal values are allowed.
 
  |}
 
 
  |-
 
  |-
  | <code>minecraft:item_enchantment</code>
+
  | Data kept
  | Represents a item enchantment.
+
  | {{Type|Byte}}
  | None
+
  | Bit mask. 0x01: Keep attributes, 0x02: Keep metadata. Tells which data should be kept on the client side once the player has respawned.
 +
In the Notchian implementation, this is context dependent:
 +
* normal respawns (after death) keep no data;
 +
* exiting the end poem/credits keeps the attributes;
 +
* other dimension changes (portals or teleports) keep all data.
 
  |}
 
  |}
  
Suggestion types:
+
{{Warning2|Avoid changing player's dimension to same dimension they were already in unless they are dead. If you change the dimension to one they are already in, weird bugs can occur, such as the player being unable to attack other players in new world (until they die and respawn).
 
 
{| class="wikitable"
 
  ! Identifier
 
  ! Description
 
  |-
 
  | <code>minecraft:ask_server</code>
 
  | Sends the <code>Tab-Complete</code> packet to the server to request tab completions.
 
  |-
 
  | <code>minecraft:all_recipes</code>
 
  | Suggests all the available recipes.
 
  |-
 
  | <code>minecraft:available_sounds</code>
 
  | Suggests all the available sounds.
 
  |-
 
  | <code>minecraft:summonable_entities</code>
 
  | Suggests all the summonable entities.
 
  |}
 
  
==== Named Sound Effect ====
+
Before 1.16, if you must respawn a player in the same dimension without killing them, send two respawn packets, one to a different world and then another to the world you want. You do not need to complete the first respawn; it only matters that you send two packets.}}
{{See also|#Sound Effect}}
 
  
Used to play a sound effect on the client. Custom sounds may be added by resource packs.
+
==== Set Cursor Item ====
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,076: Line 2,191:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="7"| {{Change|0x19|0x1A}}
+
  | 0x5A
  |rowspan="7"| Play
+
  | Play
  |rowspan="7"| Client
+
  | Client
  | Sound Name
+
  | Slot Data
  | {{Change|String (256)|Identifier}}
+
  | {{Type|Slot}}
  | All sound effect names as of 1.12.2 can be seen [http://pokechu22.github.io/Burger/1.12.2.html#sounds here].
+
  |
|-
 
| Sound Category
 
| VarInt Enum
 
| The category that this sound will be played from ([https://gist.github.com/konwboj/7c0c380d3923443e9d55 current categories])
 
|-
 
| Effect Position X
 
| Int
 
| Effect X multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
 
|-
 
| Effect Position Y
 
| Int
 
| Effect Y multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
 
|-
 
| Effect Position Z
 
| Int
 
| Effect Z multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
 
|-
 
| Volume
 
| Float
 
| 1 is 100%, can be more
 
|-
 
| Pitch
 
| Float
 
| Float between 0.5 and 2.0 by Notchian clients
 
 
  |}
 
  |}
  
==== Chunk Data ====
+
==== Update Time ====
{{Main|Chunk Format}}
 
{{See also|#Unload Chunk}}
 
  
The server only sends skylight information for chunk pillars in the {{Minecraft Wiki|Overworld}}, it's up to the client to know in which dimenison the player is currently located. You can also infer this information from the primary bitmask and the amount of uncompressed bytes sent. This packet also sends all block entities in the chunk (though sending them is not required; it is still legal to send them with [[#Update Block Entity|Update Block Entity]] later).
+
Time is based on ticks, where 20 ticks happen every second. There are 24000 ticks in a day, making Minecraft days exactly 20 minutes long.
  
{{Change||Indexes into the global palette are still used, but since the global palette has changed, behavior is different.}}
+
The time of day is based on the timestamp modulo 24000. 0 is sunrise, 6000 is noon, 12000 is sunset, and 18000 is midnight.
  
The bits per block value used to index in the global palette is {{change|13|14}}, which is determined by taking the base 2 logarithm of the highest state ID and then rounding up (or alternatively, simply checking how many bits are needed to represent the highest state ID).
+
The default SMP server increments the time by <code>20</code> every second.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,126: Line 2,215:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="9"| {{Change|0x20|0x21}}
+
  | rowspan="3"| ''protocol:''<br/><code>{{change|0x64|0x6B}}</code><br/><br/>''resource:''<br/><code>set_time</code>
  |rowspan="9"| Play
+
  | rowspan="3"| Play
  |rowspan="9"| Client
+
  | rowspan="3"| Client
  | Chunk X
+
  | World Age
  | Int
+
  | {{Type|Long}}
  | Chunk coordinate (block coordinate divided by 16, rounded down)
+
  | In ticks; not changed by server commands.
 
  |-
 
  |-
  | Chunk Z
+
  | Time of day
  | Int
+
  | {{Type|Long}}
  | Chunk coordinate (block coordinate divided by 16, rounded down)
+
  | The world (or region) time, in ticks. {{change|If negative the sun will stop moving at the Math.abs of the time.|}}
|-
+
  |- {{added}}
| Ground-Up Continuous
+
  | Time of day increasing
| Boolean
+
  | {{Type|Boolean}}
| See [[Chunk Format#Ground-up continuous|Chunk Format]]
+
  | If true, the client should automatically advance the time of day according to its ticking rate.
|-
+
  |}
| Primary Bit Mask
 
| VarInt
 
| Bitmask with bits set to 1 for every 16×16×16 chunk section whose data is included in Data. The least significant bit represents the chunk section at the bottom of the chunk column (from y=0 to y=15).
 
|-
 
| Size
 
| VarInt
 
| Size of Data in bytes
 
  |-
 
  | Data
 
| Byte array
 
| See [[Chunk Format#Data structure|data structure]] in Chunk Format
 
|-
 
| Number of block entities
 
  | VarInt
 
| Number of elements in the following array
 
  |-
 
| Block entities
 
| Array of [[NBT|NBT Tag]]
 
| All block entities in the chunk.  Use the x, y, and z tags in the NBT to determine their positions.
 
  |}
 
  
===== Data structure =====
+
==== Set Player Inventory Slot ====
  
The data section of the packet contains most of the useful data for the chunk.
+
{| class="wikitable" {{added}}
 
+
  ! Packet ID
{| class="wikitable"
+
! State
  |-
+
! Bound To
 
  ! Field Name
 
  ! Field Name
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  | Data
+
  | rowspan="2"| ''protocol:''<br/><code>0x66</code><br/><br/>''resource:''<br/><code>set_player_inventory</code>
  | Array of [[Chunk Format#Chunk Section structure|Chunk Section]]
+
  | rowspan="2"| Play
  | The number of elements is equal to the number of bits set in Primary Bit Mask. Sections are sent bottom-to-top, i.e. the first section, if sent, extends from Y=0 to Y=15.
+
  | rowspan="2"| Client
 +
| Slot
 +
| {{Type|VarInt}}
 +
|
 
  |-
 
  |-
  | Biomes
+
  | Slot Data
  | Optional {{Change|Byte|Int}} Array
+
  | {{Type|Slot}}
  | Only sent if Ground-Up Continuous is true; 256 {{change|bytes|entries}} if present
+
  |
 
  |}
 
  |}
  
==== Spawn Particle ====
+
==== Synchronize Vehicle Position ====
  
Displays the named particle
+
Teleports the entity on the client without changing the reference point of movement deltas in future [[#Update Entity Position|Update Entity Position]] packets. Seems to be used to make relative adjustments to vehicle positions; more information needed.
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,193: Line 2,265:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="11"| {{Change|0x22|0x23}}
+
  | rowspan="11"| ''protocol:''<br/><code>0x77</code><br/><br/>''resource:''<br/><code>teleport_entity</code>
  |rowspan="11"| Play
+
  | rowspan="11"| Play
  |rowspan="11"| Client
+
  | rowspan="11"| Client
  | Particle ID
+
  | Entity ID
  | Int
+
  | {{Type|VarInt}}
| The particle ID listed in [[#Particle]].
+
  |
|-
 
| Long Distance
 
| Boolean
 
  | If true, particle distance increases from 256 to 65536
 
 
  |-
 
  |-
 
  | X
 
  | X
  | Float
+
  | {{Type|Double}}
  | X position of the particle
+
  |
 
  |-
 
  |-
 
  | Y
 
  | Y
  | Float
+
  | {{Type|Double}}
  | Y position of the particle
+
  |
 
  |-
 
  |-
 
  | Z
 
  | Z
  | Float
+
  | {{Type|Double}}
  | Z position of the particle
+
  |
 
  |-
 
  |-
  | Offset X
+
  | Velocity X
  | Float
+
  | {{Type|Double}}
  | This is added to the X position after being multiplied by random.nextGaussian()
+
  |
 
  |-
 
  |-
  | Offset Y
+
  | Velocity Y
  | Float
+
  | {{Type|Double}}
  | This is added to the Y position after being multiplied by random.nextGaussian()
+
  |
 
  |-
 
  |-
  | Offset Z
+
  | Velocity Z
  | Float
+
  | {{Type|Double}}
  | This is added to the Z position after being multiplied by random.nextGaussian()
+
  |
 
  |-
 
  |-
  | Particle Data
+
  | Yaw
  | Float
+
  | {{Type|Float}}
  | The data of each particle
+
  | Rotation on the Y axis, in degrees.
 
  |-
 
  |-
  | Particle Count
+
  | Pitch
  | Int
+
  | {{Type|Float}}
  | The number of particles to create
+
| Rotation on the Y axis, in degrees.
 +
|- {{added}}
 +
| Flags
 +
| {{Type|Teleport Flags}}
 +
  |
 
  |-
 
  |-
  | Data
+
  | On Ground
  | {{Change|Array of VarInt|Varies}}
+
  | {{Type|Boolean}}
  | {{Change|Length depends on particle. "iconcrack" has length of 2, "blockcrack", "blockdust", and "fallingdust" have lengths of 1, the rest have 0.|The variable data listed in [[#Particle]]}}
+
  |
 
  |}
 
  |}
  
==== Map ====
+
==== Update Recipes ====
 
 
Updates a rectangular area on a {{Minecraft Wiki|map}} item.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,249: Line 2,319:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! colspan="2"| Field Name
  !colspan="2"| Field Type
+
  ! colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="16"| {{Change|0x24|0x25}}
+
  | rowspan="11"| ''protocol:''<br/><code>{{change|0x77|0x7e}}</code><br/><br/>''resource:''<br/><code>update_recipes</code>
  |rowspan="16"| Play
+
  | rowspan="11"| Play
  |rowspan="16"| Client
+
  | rowspan="11"| Client
  |colspan="2"| Item Damage
+
  | {{removed}} colspan="2"| Num Recipes
  |colspan="2"| VarInt
+
  | {{removed}} colspan="2"| {{Type|VarInt}}
  | The damage value (map ID) of the map being modified
+
  | {{removed}}| Number of elements in the following array.
  |-
+
  |- {{removed}}
  |colspan="2"| Scale
+
  | rowspan="3"| Recipe
  |colspan="2"| Byte
+
  | Recipe ID
  | From 0 for a fully zoomed-in map (1 block per pixel) to 4 for a fully zoomed-out map (16 blocks per pixel)
+
| rowspan="3"| {{Type|Array}}
  |-
+
| {{Type|Identifier}}
  |colspan="2"| Tracking Position
+
|
  |colspan="2"| Boolean
+
  |- {{removed}}
  | Specifies whether the icons are shown
+
| Type ID
  |-  
+
  | {{Type|VarInt}} {{Type|Enum}}
  |colspan="2"| Icon Count
+
  | The recipe type, see below.
  |colspan="2"| VarInt
+
|- {{removed}}
  | Number of elements in the following array
+
  | Data
  |-
+
| Varies
  |rowspan="6"| Icon
+
  | Additional data for the recipe.
  | {{Change|Direction And Type|Type}}
+
  |- {{added}}
  |rowspan="6"| Array
+
  | colspan="2"| Property Set Count
  | {{Change|Byte|VarInt enum}}
+
  | colspan="2"| {{Type|VarInt}}
  | {{Change|0xF0 {{=}} Type, 0x0F {{=}} Direction|Type (see below)}}
+
  | Number of elements in the following array.
  |-
+
  |- {{added}}
  | X
+
  | rowspan="3"| Property Sets
  | Byte
+
  | Property Set ID
  |  
+
| rowspan="3"| {{Type|Array}}
  |-
+
| {{Type|Identifier}}
  | Z
+
  |
| Byte
+
|- {{added}}
  |  
+
| Item Count
  |- style="background-color: #d9ead3;"
+
  | {{Type|VarInt}}
  | Direction
+
  | Number of elements in the following array.
| Byte
+
|- {{added}}
  | 0-15
+
| Items
  |- style="background-color: #d9ead3;"
+
| {{Type|Array}} of {{Type|VarInt}}
  | Has Display Name
+
| IDs in the <code>minecraft:item</code> registry.
  | Boolean
+
  |- {{added}}
 +
  | colspan="2"| Stonecutter Recipe Count
 +
  | colspan="2"| {{Type|VarInt}}
 +
  | colspan="2"| Number of elements in the following array.
 +
  |- {{added}}
 +
  | rowspan="2"| Stonecutter Recipes
 +
  | Ingredients
 +
  | rowspan="2"| {{Type|Array}}
 +
  | {{Type|ID Set}}
 +
  |
 +
  |- {{added}}
 +
  | Slot Display
 +
  | {{Type|Slot Display}}
 
  |
 
  |
|- style="background-color: #d9ead3;"
 
| Display Name
 
| Optional [[Chat]]
 
| Only present if previous Boolean is true
 
|-
 
|colspan="2"| Columns
 
|colspan="2"| Byte
 
| Number of columns updated
 
|-
 
|colspan="2"| Rows
 
|colspan="2"| Optional Byte
 
| Only if Columns is more than 0; number of rows updated
 
|-
 
|colspan="2"| X
 
|colspan="2"| Optional Byte
 
| Only if Columns is more than 0; x offset of the westernmost column
 
|-
 
|colspan="2"| Z
 
|colspan="2"| Optional Byte
 
| Only if Columns is more than 0; z offset of the northernmost row
 
|-
 
|colspan="2"| Length
 
|colspan="2"| Optional VarInt
 
| Only if Columns is more than 0; length of the following array
 
|-
 
|colspan="2"| Data
 
|colspan="2"| Optional Array of Unsigned Byte
 
| Only if Columns is more than 0; see {{Minecraft Wiki|Map item format}}
 
 
  |}
 
  |}
  
For icons, a direction of 0 is a vertical icon and increments by 22.5&deg; (360/16).
+
{{change|Recipe types:|}}
  
Types are based off of rows and columns in <code>map_icons.png</code>:
+
{| class="wikitable" {{removed}}
 
+
  ! ID
{| class="wikitable"
+
! Type
  |-
+
  ! Description
  ! Icon type
+
  ! Data
  ! Result
 
 
  |-
 
  |-
 
  | 0
 
  | 0
  | White arrow (players)
+
  | <code>minecraft:crafting_shaped</code>
  |-
+
| Shaped crafting recipe. All items must be present in the same pattern (which may be flipped horizontally or translated).
| 1
+
  | As follows:
| Green arrow (item frames)
+
  {| class="wikitable" {{removed}}
|-
+
    ! Name
| 2
+
    ! Type
| Red arrow
+
    ! Description
|-
+
    |-
| 3
+
    | Group
| Blue arrow
+
    | {{Type|String}} (32767)
|-
+
    | Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
| 4
+
    |-
| White cross
+
    |Category
 +
    |{{Type|VarInt}} {{Type|Enum}}
 +
    |Building = 0, Redstone = 1, Equipment = 2, Misc = 3
 +
    |-
 +
    | Width
 +
    | {{Type|VarInt}}
 +
    |
 +
    |-
 +
    | Height
 +
    | {{Type|VarInt}}
 +
    |
 +
    |-
 +
    | Ingredients
 +
    | {{Type|Array}} of Ingredient
 +
    | Length is <code>width * height</code>. Indexed by <code>x + (y * width)</code>.
 +
    |-
 +
    | Result
 +
    | {{Type|Slot}}
 +
    |-
 +
    | Show notification
 +
    | {{Type|Boolean}}
 +
    | Show a toast when the recipe is [[Protocol#Update_Recipe_Book|added]].
 +
    |}
 
  |-
 
  |-
  | 5
+
  | 1
  | Red pointer
+
  | <code>minecraft:crafting_shapeless</code>
  |-
+
  | Shapeless crafting recipe. All items in the ingredient list must be present, but in any order/slot.
| 6
+
| As follows:
| White circle (off-map players)
+
  {| class="wikitable" {{removed}}
|-
+
    ! Name
| 7
+
    ! Type
| Small white circle (far-off-map players)
+
    ! Description
  |-
+
    |-
  | 8
+
    | Group
  | Mansion
+
    | {{Type|String}} (32767)
 +
    | Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
 +
    |-
 +
    |Category
 +
    |{{Type|VarInt}} {{Type|Enum}}
 +
    |Building = 0, Redstone = 1, Equipment = 2, Misc = 3
 +
    |-
 +
    | Ingredient count
 +
    | {{Type|VarInt}}
 +
    | Number of elements in the following array.
 +
    |-
 +
    | Ingredients
 +
    | {{Type|Array}} of Ingredient.
 +
    |
 +
    |-
 +
    | Result
 +
    | {{Type|Slot}}
 +
    |
 +
    |}
 +
  |-
 +
  | 2
 +
| <code>minecraft:crafting_special_armordye</code>
 +
| Recipe for dying leather armor
 +
  | rowspan="14" | As follows:
 +
  {| class="wikitable" {{removed}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    |Category
 +
    |{{Type|VarInt}} {{Type|Enum}}
 +
    |Building = 0, Redstone = 1, Equipment = 2, Misc = 3
 +
    |}
 
  |-
 
  |-
  | 9
+
  | 3
  | Temple
+
  | <code>minecraft:crafting_special_bookcloning</code>
|- style="background-color: #d9ead3;"
+
  | Recipe for copying contents of written books
| 10
 
| White Banner
 
|- style="background-color: #d9ead3;"
 
| 11
 
| Orange Banner
 
|- style="background-color: #d9ead3;"
 
| 12
 
| Magenta Banner
 
|- style="background-color: #d9ead3;"
 
| 13
 
| Light Blue Banner
 
|- style="background-color: #d9ead3;"
 
| 14
 
| Yellow Banner
 
|- style="background-color: #d9ead3;"
 
| 15
 
| Lime Banner
 
|- style="background-color: #d9ead3;"
 
| 16
 
| Pink Banner
 
|- style="background-color: #d9ead3;"
 
| 17
 
| Gray Banner
 
|- style="background-color: #d9ead3;"
 
| 18
 
| Light Gray Banner
 
|- style="background-color: #d9ead3;"
 
| 19
 
| Cyan Banner
 
|- style="background-color: #d9ead3;"
 
| 20
 
| Purple Banner
 
|- style="background-color: #d9ead3;"
 
| 21
 
| Blue Banner
 
|- style="background-color: #d9ead3;"
 
| 22
 
| Brown Banner
 
|- style="background-color: #d9ead3;"
 
| 23
 
| Green Banner
 
|- style="background-color: #d9ead3;"
 
| 24
 
| Red Banner
 
|- style="background-color: #d9ead3;"
 
| 25
 
| Black Banner
 
|- style="background-color: #d9ead3;"
 
| 26
 
| Treasure marker
 
  |}
 
 
 
==== Craft Recipe Response ====
 
 
 
Response to the serverbound packet ([[#Craft Recipe Request|Craft Recipe Request]]), with the same recipe ID.  Appears to be used to notify the UI.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| {{Change|0x2B|0x2C}}
+
  | 4
|rowspan="2"| Play
+
  | <code>minecraft:crafting_special_mapcloning</code>
|rowspan="2"| Client
+
  | Recipe for copying maps
| Window ID
 
  | Byte
 
  |
 
 
  |-
 
  |-
  | Recipe
+
  | 5
| {{Change|VarInt|Identifer}}
+
  | <code>minecraft:crafting_special_mapextending</code>
  | A recipe ID
+
| Recipe for adding paper to maps
|}
 
 
 
==== Face Player ====
 
 
 
Used to rotate the client player to face the given location or entity (for <code>/teleport [<targets>] <x> <y> <z> facing</code>).
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="8"| 0x30
+
  | 6
  |rowspan="8"| Play
+
  | <code>minecraft:crafting_special_firework_rocket</code>
  |rowspan="8"| Client
+
  | Recipe for making firework rockets
 
  |-
 
  |-
  | Feet/eyes
+
  | 7
  | VarInt enum
+
  | <code>minecraft:crafting_special_firework_star</code>
  | Values are feet=0, eyes=1.  If set to eyes, aims using the head position; otherwise aims using the feet position.
+
  | Recipe for making firework stars
 
  |-
 
  |-
  | Target x
+
  | 8
  | Double
+
  | <code>minecraft:crafting_special_firework_star_fade</code>
  | x coordinate of the point to face towards
+
  | Recipe for making firework stars fade between multiple colors
 
  |-
 
  |-
  | Target y
+
  | 9
  | Double
+
  | <code>minecraft:crafting_special_tippedarrow</code>
  | y coordinate of the point to face towards
+
  | Recipe for crafting tipped arrows
 
  |-
 
  |-
  | Target z
+
  | 10
  | Double
+
  | <code>minecraft:crafting_special_bannerduplicate</code>
  | z coordinate of the point to face towards
+
  | Recipe for copying banner patterns
 
  |-
 
  |-
  | Is entity
+
  | 11
  | Boolean
+
  | <code>minecraft:crafting_special_shielddecoration</code>
  | If true, additional information about an entity is provided.
+
  | Recipe for applying a banner's pattern to a shield
 
  |-
 
  |-
  | Entity ID
+
  | 12
  | Optional VarInt
+
  | <code>minecraft:crafting_special_shulkerboxcoloring</code>
  | Only if is entity is true &mdash; the entity to face towards
+
  | Recipe for recoloring a shulker box
 
  |-
 
  |-
  | Entity feet/eyes
+
  | 13
  | Optional VarInt enum
+
  | <code>minecraft:crafting_special_suspiciousstew</code>
  | Whether to look at the entity's eyes or feet.  Same values and meanings as before, just for the entity's head/feet.
+
  | Recipe for crafting suspicious stews
|}
 
 
 
If the entity given by entity ID cannot be found, this packet should be treated as if is entity was false.
 
 
 
==== Unlock Recipes ====
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="10"| {{Change|0x31|0x33}}
+
  | 14
  |rowspan="10"| Play
+
  | <code>minecraft:crafting_special_repairitem</code>
  |rowspan="10"| Client
+
  | Recipe for repairing items via crafting
 
  |-
 
  |-
  | Action
+
  | 22
  | VarInt
+
  | <code>minecraft:crafting_decorated_pot</code>
  | 0: init, 1: add, 2: remove
+
  | Recipe for crafting decorated pots
 
  |-
 
  |-
  | Crafting Recipe Book Open
+
  | 15
  | Boolean
+
  | <code>minecraft:smelting</code>
  | If true, then the crafting recipe book will be open when the player opens its inventory.
+
  | Smelting recipe
|-
+
| rowspan="4"| As follows:
| Crafting Recipe Book Filter Active
+
  {| class="wikitable" {{removed}}
| Boolean
+
    ! Name
| If true, then the filtering option is active when the players opens its inventory.
+
    ! Type
 +
    ! Description
 +
    |-
 +
    | Group
 +
    | {{Type|String}} (32767)
 +
    | Used to group similar recipes together in the recipe book.
 +
    |-
 +
    |Category
 +
    |{{Type|VarInt}} {{Type|Enum}}
 +
    |Food = 0, Blocks = 1, Misc = 2
 +
    |-
 +
    | Ingredient
 +
    | Ingredient
 +
    |
 +
    |-
 +
    | Result
 +
    | {{Type|Slot}}
 +
    |
 +
    |-
 +
    | Experience
 +
    | {{Type|Float}}
 +
    |
 +
    |-
 +
    | Cooking time
 +
    | {{Type|VarInt}}
 +
    |
 +
    |}
 
  |-
 
  |-
  |style="background-color: #d9ead3;"| Smelting Recipe Book Open
+
  | 16
  | Boolean
+
  | <code>minecraft:blasting</code>
  | If true, then the smelting recipe book will be open when the player opens its inventory.
+
  | Blast furnace recipe
 
  |-
 
  |-
  |style="background-color: #d9ead3;"| Smelting Recipe Book Filter Active
+
  | 17
  | Boolean
+
  | <code>minecraft:smoking</code>
  | If true, then the filtering option is active when the players opens its inventory.
+
  | Smoker recipe
 
  |-
 
  |-
  | Array size 1
+
  | 18
  | VarInt
+
  | <code>minecraft:campfire_cooking</code>
  | Number of elements in the following array
+
  | Campfire recipe
 
  |-
 
  |-
  | Recipe IDs
+
  | 19
  | Array of {{Change|VarInt|Identifier}}
+
  | <code>minecraft:stonecutting</code>
  |
+
  | Stonecutter recipe
  |-
+
  | As follows:
| Array size 2
+
  {| class="wikitable" {{removed}}
| Optional VarInt
+
    ! Name
| Number of elements in the following array, only present if mode is 0 (init)
+
    ! Type
|-
+
    ! Description
| Recipe IDs
+
    |-
| Optional Array of {{Change|VarInt|Identifier}}, only present if mode is 0 (init)
+
    | Group
|
+
    | {{Type|String}} (32767)
|}
+
    | Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
Action:
+
    |-
* 0 (init) = All the recipes in the list 2 will added to the recipe book. All the recipes in list 1 will be tagged as displayed, recipes that aren't tagged will be shown in the notification. VERIFY LIST ORDER?
+
    | Ingredient
* 1 (add) = All the recipes in the list are added and their icon will be shown in the notification.
+
    | Ingredient
* 2 (remove) = Remove all the recipes in the list. This allows them to re-displayed when they are readded.
+
    |
 
+
    |-
==== Scoreboard Objective ====
+
    | Result
 
+
    | {{Type|Slot}}
This is sent to the client when it should create a new {{Minecraft Wiki|scoreboard}} objective or remove one.
+
    |
 
+
    |}
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="4"| {{Change|0x42|0x44}}
+
  | 20
|rowspan="4"| Play
+
| <code>minecraft:smithing_transform</code>
|rowspan="4"| Client
+
| Recipe for smithing netherite gear
| Objective Name
+
| As follows:
| String (16)
+
  {| class="wikitable" {{removed}}
| An unique name for the objective
+
    ! Name
|-
+
    ! Type
| Mode
+
    ! Description
| Byte
+
    |-
| 0 to create the scoreboard. 1 to remove the scoreboard. 2 to update the display text.
+
    | Template
 +
    | Ingredient
 +
    | The smithing template.
 +
    |-
 +
    | Base
 +
    | Ingredient
 +
    | The base item.
 +
    |-
 +
    | Addition
 +
    | Ingredient
 +
    | The additional ingredient.
 +
    |-
 +
    | Result
 +
    | {{Type|Slot}}
 +
    |
 +
    |}
 
  |-
 
  |-
  | Objective Value
+
  | 21
  | Optional String (32)
+
  | <code>minecraft:smithing_trim</code>
  | Only if mode is 0 or 2. The text to be displayed for the score
+
  | Recipe for applying armor trims
  |-
+
  | As follows:
| Type
+
  {| class="wikitable" {{removed}}
| Optional {{change|String|VarInt Enum}}
+
    ! Name
| Only if mode is 0 or 2. {{change|“integer” or “hearts”|0 = "integer", 1 = "hearts"}}
+
    ! Type
 +
    ! Description
 +
    |-
 +
    | Template
 +
    | Ingredient
 +
    | The smithing template.
 +
    |-
 +
    | Base
 +
    | Ingredient
 +
    | The base item.
 +
    |-
 +
    | Addition
 +
    | Ingredient
 +
    | The additional ingredient.
 +
    |}
 
  |}
 
  |}
  
==== Teams ====
+
{{change|Ingredient is defined as:|}}
  
Creates and updates teams.
+
{| class="wikitable" {{removed}}
 
+
! Name
{| class="wikitable"
+
! Type
  ! Packet ID
+
! Description
 +
|-
 +
| Count
 +
| {{Type|VarInt}}
 +
| Number of elements in the following array.
 +
|-
 +
| Items
 +
| {{Type|Array}} of {{Type|Slot}}
 +
| Any item in this array may be used for the recipe.  The count of each item should be 1.
 +
|}
 +
 
 +
=== Serverbound ===
 +
 
 +
==== Bundle Item Selected ====
 +
 
 +
{| class="wikitable" {{added}}
 +
  ! Packet ID
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="27"| {{Change|0x44|0x46}}
+
  | rowspan="2"| ''protocol:''<br/><code>0x02</code><br/><br/>''resource:''<br/><code>bundle_item_selected</code>
  |rowspan="27"| Play
+
  | rowspan="2"| Play
  |rowspan="27"| Client
+
  | rowspan="2"| Server
  |colspan="2"| Team Name
+
  | Slot of Bundle
  | String (16)
+
  | {{Type|VarInt}}
  | A unique name for the team. (Shared with scoreboard).
+
  |
 
  |-
 
  |-
  |colspan="2"| Mode
+
  | Slot in Bundle
  | Byte
+
| {{Type|VarInt}}
  | Determines the layout of the remaining packet
+
|
 +
|}
 +
 
 +
==== Client Tick End ====
 +
 
 +
{| class="wikitable" {{added}}
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  |rowspan="11"| 0: create team
+
  | ''protocol:''<br/><code>0x0B</code><br/><br/>''resource:''<br/><code>client_tick_end</code>
  | Team Display Name
+
  | Play
  | String (32)
+
  | Server
  |  
+
  | colspan="3"| ''no fields''
  |- style="background-color: #f4cccc; text-decoration: line-through;"  
+
  |}
  | Team Prefix
+
 
  | String (16)
+
==== Click Container ====
  | Displayed before the names of players that are part of this team
+
 
  |- style="background-color: #f4cccc; text-decoration: line-through;"  
+
This packet is sent by the client when the player clicks on a slot in a window.
| Team Suffix
+
 
  | String (16)
+
{| class="wikitable"
  | Displayed after the names of players that are part of this team
+
  ! Packet ID
 +
  ! State
 +
  ! Bound To
 +
  ! colspan="2"| Field Name
 +
  ! colspan="2"| Field Type
 +
  ! Notes
 
  |-
 
  |-
  | Friendly Flags
+
  | rowspan="9"| ''protocol:''<br/><code>{{change|0x0E|0x10}}</code><br/><br/>''resource:''<br/><code>container_click</code>
  | Byte
+
| rowspan="9"| Play
  | Bit mask. 0x01: Allow friendly fire, 0x02: can see invisible players on same team
+
  | rowspan="9"| Server
 +
| colspan="2"| Window ID
 +
| colspan="2"| {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
 +
  | colspan="2"| The ID of the window which was clicked. 0 for player inventory. The server ignores any packets targeting a Window ID other than the current one, including ignoring 0 when any other window is open.
 
  |-
 
  |-
  | Name Tag Visibility
+
  | colspan="2"| State ID
  | String Enum (32)
+
  | colspan="2"| {{Type|VarInt}}
  | <code>always</code>, <code>hideForOtherTeams</code>, <code>hideForOwnTeam</code>, <code>never</code>
+
  | colspan="2"| The last received State ID from either a [[#Set Container Slot|Set Container Slot]] or a [[#Set Container Content|Set Container Content]] packet.
 
  |-
 
  |-
  | Collision Rule
+
  | colspan="2"| Slot
  | String Enum (32)
+
  | colspan="2"| {{Type|Short}}
  | <code>always</code>, <code>pushOtherTeams</code>, <code>pushOwnTeam</code>, <code>never</code>
+
  | colspan="2"| The clicked slot number, see below.
 
  |-
 
  |-
  | {{change|Color|Formatting}}
+
  | colspan="2"| Button
  | {{Change|Byte|VarInt enum}}
+
  | colspan="2"| {{Type|Byte}}
| {{change|For colors, the same [[Chat]] colors (0-15). -1 indicates RESET/no color.|See below for more info.}}
+
  | colspan="2"| The button used in the click, see below.
  |- style="background-color: #d9ead3;"
 
| Team Prefix
 
| Chat
 
| Displayed before the names of players that are part of this team
 
|- style="background-color: #d9ead3;"
 
| Team Suffix
 
| Chat
 
| Displayed after the names of players that are part of this team
 
 
  |-
 
  |-
  | Entity Count
+
  | colspan="2"| Mode
  | VarInt
+
  | colspan="2"| {{Type|VarInt}} {{Type|Enum}}
  | Number of elements in the following array
+
  | colspan="2"| Inventory operation mode, see below.
 
  |-
 
  |-
  | Entities
+
  | colspan="2"| Length of the array
  | Array of String (40)
+
  | colspan="2"| {{Type|VarInt}}
  | Identifiers for the entities in this team.  For players, this is their username; for other entities, it is their UUID.
+
  | colspan="2"| Maximum value for Notchian server is 128 slots.
 
  |-
 
  |-
| 1: remove team
+
  | rowspan="2"| Array of changed slots
| ''no fields''
+
  | Slot number
| ''no fields''
+
  | rowspan="2"| {{Type|Array}} (128)
|
+
  | {{Type|Short}}
|-
+
  |
  |rowspan="9"| 2: update team info
 
| Team Display Name
 
| String (32)
 
|
 
|- style="background-color: #f4cccc; text-decoration: line-through;"
 
| Team Prefix
 
  | String (16)
 
  | Displayed before the names of entities that are part of this team
 
|- style="background-color: #f4cccc; text-decoration: line-through;"  
 
| Team Suffix
 
| String (16)
 
| Displayed after the names of entities that are part of this team
 
|-
 
| Friendly Flags
 
| Byte
 
| Bit mask. 0x01: Allow friendly fire, 0x02: can see invisible entities on same team
 
|-
 
| Name Tag Visibility
 
| String Enum (32)
 
| <code>always</code>, <code>hideForOtherTeams</code>, <code>hideForOwnTeam</code>, <code>never</code>
 
|-
 
| Collision Rule
 
| String Enum (32)
 
| <code>always</code>, <code>pushOtherTeams</code>, <code>pushOwnTeam</code>, <code>never</code>
 
|-
 
| {{change|Color|Formatting}}
 
  | {{Change|Byte|VarInt enum}}
 
  | {{change|For colors, the same [[Chat]] colors (0-15). -1 indicates RESET/no color.|See below for more info.}}
 
|- style="background-color: #d9ead3;"
 
| Team Prefix
 
| Chat
 
| Displayed before the names of players that are part of this team
 
|- style="background-color: #d9ead3;"
 
| Team Suffix
 
| Chat
 
| Displayed after the names of players that are part of this team
 
|-
 
|rowspan="2"| 3: add players to team
 
| Entity Count
 
| VarInt
 
| Number of elements in the following array
 
 
  |-
 
  |-
  | Entities
+
  | Slot data
  | Array of String (40)
+
  | {{Type|Slot}}
  | Identifiers for the entities added.  For players, this is their username; for other entities, it is their UUID.
+
  | New data for this slot, in the client's opinion; see below.
 
  |-
 
  |-
  |rowspan="2"| 4: remove players from team
+
  | colspan="2"| Carried item
  | Entity Count
+
  | colspan="2"| [[Slot Data|Slot]]
| VarInt
+
  | colspan="2"| Item carried by the cursor. Has to be empty (item ID = -1) for drop mode, otherwise nothing will happen.
| Number of elements in the following array
 
  |-
 
| Entities
 
| Array of String (40)
 
| Identifiers for the entities removed.  For players, this is their username; for other entities, it is their UUID.
 
 
  |}
 
  |}
  
Formatting: The formatting of a team defines how the names of the team members are visualized. The following table lists all the possible formattings.
+
See [[Inventory]] for further information about how slots are indexed.
 +
 
 +
After performing the action, the server compares the results to the slot change information included in the packet, as applied on top of the server's view of the container's state prior to the action. For any slots that do not match, it sends [[#Set Container Slot|Set Container Slot]] packets containing the correct results. If State ID does not match the last ID sent by the server, it will instead send a full [[#Set Container Content|Set Container Content]] to resynchronize the client.
 +
 
 +
When right-clicking on a stack of items, half the stack will be picked up and half left in the slot. If the stack is an odd number, the half left in the slot will be smaller of the amounts.
 +
 
 +
The distinct type of click performed by the client is determined by the combination of the Mode and Button fields.
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! ID
+
  ! Mode
  ! Formatting
+
  ! Button
 +
! Slot
 +
! Trigger
 
  |-
 
  |-
  | 0-15
+
  ! rowspan="4"| 0
  | Color formatting, same values as [[Chat]] colors.
+
  | 0
 +
| Normal
 +
| Left mouse click
 
  |-
 
  |-
  | 16
+
  | 1
  | Obfuscated
+
  | Normal
 +
| Right mouse click
 
  |-
 
  |-
  | 17
+
  | 0
  | Bold
+
  | -999
 +
| Left click outside inventory (drop cursor stack)
 
  |-
 
  |-
  | 18
+
  | 1
  | Strikethrough
+
  | -999
 +
| Right click outside inventory (drop cursor single item)
 
  |-
 
  |-
  | 19
+
  ! rowspan="2"| 1
  | Underlined
+
  | 0
 +
| Normal
 +
| Shift + left mouse click
 
  |-
 
  |-
  | 20
+
  | 1
  | Italic
+
  | Normal
 +
| Shift + right mouse click ''(identical behavior)''
 
  |-
 
  |-
  | 21
+
  ! rowspan="7"| 2
  | Reset
+
  | 0
  |}
+
  | Normal
 
+
| Number key 1
==== Stop Sound ====
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="7"| 0x4B
+
  | 1
|rowspan="7"| Play
+
  | Normal
|rowspan="7"| Client
+
  | Number key 2
| Flags
 
  | Byte
 
  | Controls which fields are present.
 
 
  |-
 
  |-
  | Source
+
  | 2
  | Optional VarInt enum
+
  | Normal
  | Only if flags is 3 or 1 (bit mask 0x1).  See below.  If not present, then sounds from all sources are cleared.
+
  | Number key 3
 
  |-
 
  |-
  | Sound
+
  |
  | Optional Identifier
+
  |
  | Only if flags is 2 or 3 (bit mask 0x2).  A sound effect name, see [[#Named Sound Effect|Named Sound Effect]].  If not present, then all sounds are cleared.
+
  |
|}
 
 
 
Categories:
 
 
 
{| class="wikitable"
 
! Name !! Value
 
 
  |-
 
  |-
  | master || 0
+
  | 8
 +
| Normal
 +
| Number key 9
 
  |-
 
  |-
  | music || 1
+
  |
 +
|
 +
| Button is used as the slot index (impossible in vanilla clients)
 
  |-
 
  |-
  | record || 2
+
  | 40
 +
| Normal
 +
| Offhand swap key F
 
  |-
 
  |-
  | weather || 3
+
! 3
 +
  | 2
 +
| Normal
 +
| Middle click, only defined for creative players in non-player inventories.
 
  |-
 
  |-
  | block || 4
+
  ! rowspan="2"| 4
 +
| 0
 +
| Normal*
 +
| Drop key (Q) (* Clicked item is always empty)
 
  |-
 
  |-
  | hostile || 5
+
  | 1
 +
| Normal*
 +
| Control + Drop key (Q) (* Clicked item is always empty)
 
  |-
 
  |-
  | neutral || 6
+
  ! rowspan="9"| 5
 +
| 0
 +
| -999
 +
| Starting left mouse drag
 
  |-
 
  |-
  | player || 7
+
  | 4
 +
| -999
 +
| Starting right mouse drag
 
  |-
 
  |-
  | ambient || 8
+
  | 8
 +
| -999
 +
| Starting middle mouse drag, only defined for creative players in non-player inventories.
 
  |-
 
  |-
  | voice || 9
+
  | 1
  |}
+
  | Normal
 
+
| Add slot for left-mouse drag
==== Declare Recipes ====
+
  |-
 
+
  | 5
{| class="wikitable"
+
  | Normal
  ! Packet ID
+
  | Add slot for right-mouse drag
  ! State
 
! Bound To
 
  !colspan="2"| Field Name
 
  !colspan="2"| Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="4"| 0x53
+
  | 9
|rowspan="4"| Play
+
  | Normal
|rowspan="4"| Client
+
  | Add slot for middle-mouse drag, only defined for creative players in non-player inventories.
  |colspan="2"| Num Recipes
 
|colspan="2"| VarInt
 
  | Number of elements in the following array
 
 
  |-
 
  |-
  |rowspan="3"| Recipe
+
  | 2
| Recipe ID
+
  | -999
|rowspan="3"| Array
+
  | Ending left mouse drag
  | Identifier
 
  |
 
 
  |-
 
  |-
  | Type
+
  | 6
  | String
+
  | -999
  | The recipe type, see below
+
  | Ending right mouse drag
 
  |-
 
  |-
  | Data
+
  | 10
  | Optional, varies
+
  | -999
  | Additional data for the recipeFor some types, there will be no data.
+
  | Ending middle mouse drag, only defined for creative players in non-player inventories.
  |}
+
|-
 +
! rowspan="2"| 6
 +
| 0
 +
| Normal
 +
| Double click
 +
|-
 +
  | 1
 +
| Normal
 +
| Pickup all but check items in reverse order (impossible in vanilla clients)
 +
  |}
  
Recipe types:
+
Starting from version 1.5, “painting mode” is available for use in inventory windows. It is done by picking up stack of something (more than 1 item), then holding mouse button (left, right or middle) and dragging held stack over empty (or same type in case of right button) slots. In that case client sends the following to server after mouse button release (omitting first pickup packet which is sent as usual):
 +
 
 +
# packet with mode 5, slot -999, button (0 for left | 4 for right);
 +
# packet for every slot painted on, mode is still 5, button (1 | 5);
 +
# packet with mode 5, slot -999, button (2 | 6);
 +
 
 +
If any of the painting packets other than the “progress” ones are sent out of order (for example, a start, some slots, then another start; or a left-click in the middle) the painting status will be reset.
 +
 
 +
==== Close Container ====
 +
 
 +
This packet is sent by the client when closing a window.
 +
 
 +
Notchian clients send a Close Window packet with Window ID 0 to close their inventory even though there is never an [[#Open Screen|Open Screen]] packet for the inventory.
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Type
+
  ! Packet ID
  ! Description
+
! State
  ! Data
+
! Bound To
 +
! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | <code>crafting_shapeless</code>
+
  | ''protocol:''<br/><code>{{change|0x0F|0x11}}</code><br/><br/>''resource:''<br/><code>container_close</code>
  | Shapeless crafting recipe. All items in the ingredient list must be present, but in any order/slot.
+
| Play
  | As follows:
+
  | Server
  {| class="wikitable"
+
| Window ID
    ! Name
+
| {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
    ! Type
+
  | This is the ID of the window that was closed. 0 for player inventory.
    ! Description
+
  |}
    |-
+
 
    | Group
+
==== Edit Book ====
    | String
+
 
    | Used to group similar recipes together in the recipe book.  Tag is present in recipe JSON.
+
{| class="wikitable"
    |-
+
! Packet ID
    | Ingredient count
+
! State
    | VarInt
+
! Bound To
    | Number of elements in the following array
+
! Field Name
    |-
+
! Field Type
    | Ingredients
+
! Notes
    | Array of Ingredient
+
|-
    |
+
| rowspan="5"| ''protocol:''<br/><code>{{change|0x14|0x16}}</code><br/><br/>''resource:''<br/><code>edit_book</code>
    |-
+
| rowspan="5"| Play
    | Result
+
| rowspan="5"| Server
    | [[Slot]]
+
| Slot
    |
+
| {{Type|VarInt}}
    |}
+
| The hotbar slot where the written book is located
 +
|-
 +
| Count
 +
| {{Type|VarInt}}
 +
| Number of elements in the following array. Maximum array size is {{change|200|100}}.
 
  |-
 
  |-
  | <code>crafting_shaped</code>
+
  | Entries
  | Shaped crafting recipe.  All items must be present in the same pattern (which may be flipped horizontally or translated)
+
  | {{Type|Array}} ({{change|200|100}}) of {{Type|String}} ({{change|8192|1024}})
| As follows:
+
| Text from each page. Maximum string length is {{change|8192|1024}} chars.
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | Width
 
    | VarInt
 
    |
 
    |-
 
    | Height
 
    | VarInt
 
    |
 
    |-
 
    | Group
 
    | String
 
    | Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
 
    |-
 
    | Ingredients
 
    | Array of Ingredient
 
    | Length is width * height. Indexed by x + (y * width).
 
    |-
 
    | Result
 
    | [[Slot]]
 
    |
 
    |}
 
 
  |-
 
  |-
  | <code>crafting_special_armordye</code>
+
  | Has title
  | Recipe for dying leather armor
+
  | {{Type|Boolean}}
  | None
+
  | If true, the next field is present. true if book is being signed, false if book is being edited.
 
  |-
 
  |-
  | <code>crafting_special_bookcloning</code>
+
  | Title
  | Recipe for copying contents of written books
+
| {{Type|Optional}} {{Type|String}} ({{change|128|32}})
| None
+
| Title of book.
|-
+
|}
| <code>crafting_special_mapcloning</code>
+
 
  | Recipe for copying maps
+
==== Set Player Position ====
  | None
+
 
 +
Updates the player's XYZ position on the server.
 +
 
 +
If the player is in a vehicle, the position is ignored (but in case of [[#Set Player Position and Rotation|Set Player Position and Rotation]], the rotation is still used as normal). No validation steps other than value range clamping are performed in this case.
 +
 
 +
If the player is sleeping, the position (or rotation) is not changed, and a [[#Synchronize Player Position|Synchronize Player Position]] is sent if the received position deviated from the server's view by more than a meter.
 +
 
 +
The Notchian server silently clamps the x and z coordinates between -30,000,000 and 30,000,000, and the y coordinate between -20,000,000 and 20,000,000. A similar condition has historically caused a kick for "Illegal position"; this is no longer the case. However, infinite or NaN coordinates (or angles) still result in a kick for <code>multiplayer.disconnect.invalid_player_movement</code>.
 +
 
 +
As of 1.20.6, checking for moving too fast is achieved like this (sic):
 +
 
 +
* Each server tick, the player's current position is stored.
 +
* When the player moves, the offset from the stored position to the requested position is computed (&Delta;x, &Delta;y, &Delta;z).
 +
* The requested movement distance squared is computed as &Delta;x&sup2; + &Delta;y&sup2; + &Delta;z&sup2;.
 +
* The baseline expected movement distance squared is computed based on the player's server-side velocity as Vx&sup2; + Vy&sup2; + Vz&sup2;. The player's server-side velocity is a somewhat ill-defined quantity that includes among other things gravity, jump velocity and knockback, but ''not'' regular horizontal movement. A proper description would bring much of Minecraft's physics engine with it. It is accessible as the <code>Motion</code> NBT tag on the player entity.
 +
* The maximum permitted movement distance squared is computed as 100 (300 if the player is using an elytra), multiplied by the number of movement packets received since the last tick, including this one, unless that value is greater than 5, in which case no multiplier is applied.
 +
* If the requested movement distance squared minus the baseline distance squared is more than the maximum squared, the player is moving too fast.
 +
 
 +
If the player is moving too fast, it is logged that "<player> moved too quickly! " followed by the change in x, y, and z, and the player is teleported back to their current (before this packet) server-side position.
 +
 
 +
Checking for block collisions is achieved like this:
 +
 
 +
* A temporary collision-checked move of the player is attempted from its current position to the requested one.
 +
* The offset from the resulting position to the requested position is computed. If the absolute value of the offset on the y axis is less than 0.5, it (only the y component) is rounded down to 0.
 +
* If the magnitude of the offset is greater than 0.25 and the player isn't in creative or spectator mode, it is logged that "<player> moved wrongly!", and the player is teleported back to their current (before this packet) server-side position.
 +
* In addition, if the player's hitbox stationary at the requested position would intersect with a block, and they aren't in spectator mode, they are teleported back without a log message.
 +
 
 +
Checking for illegal flight is achieved like this:
 +
 
 +
* When a movement packet is received, a flag indicating whether or not the player is floating mid-air is updated. The flag is set if the move test described above detected no collision below the player ''and'' the y component of the offset from the player's current position to the requested one is greater than -0.5, unless any of various conditions permitting flight (creative mode, elytra, levitation effect, etc., but not jumping) are met.
 +
* Each server tick, it is checked if the flag has been set for more than 80 consecutive ticks. If so, and the player isn't currently sleeping, dead or riding a vehicle, they are kicked for <code>multiplayer.disconnect.flying</code>.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | <code>crafting_special_mapextending</code>
+
  | rowspan="5"| ''protocol:''<br/><code>{{change|0x1A|0x1C}}</code><br/><br/>''resource:''<br/><code>move_player_pos</code>
  | Recipe for adding paper to maps
+
  | rowspan="5"| Play
  | None
+
| rowspan="5"| Server
 +
| X
 +
| {{Type|Double}}
 +
  | Absolute position.
 
  |-
 
  |-
  | <code>crafting_special_firework_rocket</code>
+
  | Feet Y
  | Recipe for making firework rockets
+
  | {{Type|Double}}
  | None
+
  | Absolute feet position, normally Head Y - 1.62.
 
  |-
 
  |-
  | <code>crafting_special_firework_star</code>
+
  | Z
  | Recipe for making firework stars
+
  | {{Type|Double}}
| None
+
  | Absolute position.
|-
+
  |- {{removed}}
| <code>crafting_special_firework_star_fade</code>
+
  | On Ground
| Recipe for making firework stars fade between multiple colors
+
  | {{Type|Boolean}}
| None
+
  | True if the client is on the ground, false otherwise.
|-
+
  |- {{added}}
| <code>crafting_special_repairitem</code>
+
  | Flags
| Recipe for repairing items via crafting
+
  | {{Type|Byte}}
| None
+
  | Bit field: 0x01: on ground, 0x02: pushing against wall.
|-
+
  |}
| <code>crafting_special_tippedarrow</code>
 
| Recipe for crafting tipped arrows
 
  | None
 
  |-
 
  | <code>crafting_special_bannerduplicate</code>
 
| Recipe for copying banner patterns
 
| None
 
  |-
 
| <code>crafting_special_banneraddpattern</code>
 
  | Recipe for adding patterns to banners
 
| None
 
  |-
 
  | <code>crafting_special_shielddecoration</code>
 
| Recipe for applying a banner's pattern to a shield
 
  | None
 
|-
 
| <code>crafting_special_shulkerboxcoloring</code>
 
| Recipe for recoloring a shulker box
 
  | None
 
  |}
 
  
Ingredient is defined as:
+
==== Set Player Position and Rotation ====
  
{| class="wikitable"
+
A combination of [[#Set Player Rotation|Move Player Rotation]] and [[#Set Player Position|Move Player Position]].
! Name
 
! Type
 
! Description
 
|-
 
| Count
 
| VarInt
 
| Number of elements in the following array
 
|-
 
| Items
 
| Array of [[Slot]]
 
| Any item in this array may be used for the recipe.  The count of each item should be 1.
 
|}
 
 
 
==== Tags ====
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,953: Line 3,016:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x54
+
  | rowspan="7"| ''protocol:''<br/><code>{{change|0x1B|0x1D}}</code><br/><br/>''resource:''<br/><code>move_player_pos_rot</code>
  |rowspan="3"| Play
+
  | rowspan="7"| Play
  |rowspan="3"| Client
+
  | rowspan="7"| Server
  | Block Tags
+
  | X
  | (See below)
+
  | {{Type|Double}}
  | IDs are block IDs
+
  | Absolute position.
 
  |-
 
  |-
  | Item Tags
+
  | Feet Y
  | (See below)
+
  | {{Type|Double}}
  | IDs are item IDs
+
  | Absolute feet position, normally Head Y - 1.62.
 
  |-
 
  |-
  | Fluid Tags
+
  | Z
  | (See below)
+
  | {{Type|Double}}
  | IDs are fluid IDs
+
| Absolute position.
 +
|-
 +
| Yaw
 +
| {{Type|Float}}
 +
| Absolute rotation on the X Axis, in degrees.
 +
|-
 +
| Pitch
 +
| {{Type|Float}}
 +
| Absolute rotation on the Y Axis, in degrees.
 +
|- {{removed}}
 +
| On Ground
 +
| {{Type|Boolean}}
 +
| True if the client is on the ground, false otherwise.
 +
|- {{added}}
 +
| Flags
 +
| {{Type|Byte}}
 +
  | Bit field: 0x01: on ground, 0x02: pushing against wall.
 
  |}
 
  |}
  
Tags look like:
+
==== Set Player Rotation ====
 +
[[File:Minecraft-trig-yaw.png|thumb|The unit circle for yaw]]
 +
[[File:Yaw.png|thumb|The unit circle of yaw, redrawn]]
  
{| class="wikitable"
+
Updates the direction the player is looking in.
!colspan="2"| Field Name
+
 
!colspan="2"| Field Type
+
Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0,-1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.
! Notes
+
 
|-
+
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.
|colspan="2"| Length
+
 
|colspan="2"| VarInt
+
The yaw and pitch of player (in degrees), standing at point (x0, y0, z0) and looking towards point (x, y, z) can be calculated with:
| Number of elements in the following array
 
|-
 
|rowspan="3"| Tags
 
| Tag name
 
|rowspan="3"| Array
 
| Identifier
 
|
 
|-
 
| Count
 
| VarInt
 
| Number of elements in the following array
 
|-
 
| Entries
 
| Array of VarInt
 
| Numeric ID of the block/item.
 
|}
 
  
=== Serverbound ===
+
dx = x-x0
 +
dy = y-y0
 +
dz = z-z0
 +
r = sqrt( dx*dx + dy*dy + dz*dz )
 +
yaw = -atan2(dx,dz)/PI*180
 +
if yaw < 0 then
 +
    yaw = 360 + yaw
 +
pitch = -arcsin(dy/r)/PI*180
  
==== Tab-Complete (serverbound) ====
+
You can get a unit vector from a given yaw/pitch via:
  
Sent when the client needs to tab-complete a <code>minecraft:ask_server</code> suggestion type.
+
x = -cos(pitch) * sin(yaw)
 +
y = -sin(pitch)
 +
z =  cos(pitch) * cos(yaw)
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,009: Line 3,083:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| {{Change|0x01|0x04}}
+
  | rowspan="4"| ''protocol:''<br/><code>{{change|0x1C|0x1E}}</code><br/><br/>''resource:''<br/><code>move_player_rot</code>
  |rowspan="5"| Play
+
  | rowspan="4"| Play
  |rowspan="5"| Server
+
  | rowspan="4"| Server
  |style="background-color: #d9ead3;"| Transaction Id
+
  | Yaw
  |style="background-color: #d9ead3;"| VarInt
+
  | {{Type|Float}}
  |style="background-color: #d9ead3;"| The id received in the tab completion request packet, must match or the client will ignore this packet.  Client generates this and increments it each time it sends another tab completion that doesn't get a response.
+
  | Absolute rotation on the X Axis, in degrees.
 
  |-
 
  |-
  | Text
+
  | Pitch
  | String ({{change|32767|256}})
+
  | {{Type|Float}}
  | All text behind the cursor without the <code>/</code> (e.g. to the left of the cursor in left-to-right languages like English)
+
  | Absolute rotation on the Y Axis, in degrees.
  |- style="background-color: #f4cccc; text-decoration: line-through;"
+
  |- {{removed}}
  | Assume Command
+
  | On Ground
  | Boolean
+
  | {{Type|Boolean}}
  | If true, the server will parse Text as a command even if it doesn't start with a <code>/</code>. Used in the command block GUI.
+
  | True if the client is on the ground, false otherwise.
  |- style="background-color: #f4cccc; text-decoration: line-through;"
+
  |- {{added}}
  | Has Position
+
  | Flags
  | Boolean
+
  | {{Type|Byte}}
|  
+
  | Bit field: 0x01: on ground, 0x02: pushing against wall.
  |- style="background-color: #f4cccc; text-decoration: line-through;"
 
| Looked At Block
 
| Optional Position
 
| The position of the block being looked at. Only sent if Has Position is true.
 
 
  |}
 
  |}
 +
{{Anchor|Set Player Movement Flags}}
 +
==== Set Player {{change|On Ground|Movement Flags}} ====
  
==== Craft Recipe Request ====
+
This packet as well as [[#Set Player Position|Set Player Position]], [[#Set Player Rotation|Set Player Rotation]], and [[#Set Player Position and Rotation|Set Player Position and Rotation]] are called the “serverbound movement packets”. Vanilla clients will send Move Player Position once every 20 ticks even for a stationary player.
  
A replacement for [[Protocol#Prepare Crafting Grid|Prepare Crafting Grid]].  It appears to behave more or less the same, but the client does not specify where to move the items.
+
This packet is used to indicate whether the player is on ground (walking/swimming), or airborne (jumping/falling).
  
This packet is sent when a player clicks a recipe in the crafting book that is craftable (white border).
+
When dropping from sufficient height, fall damage is applied when this state goes from false to true. The amount of damage applied is based on the point where it last changed from true to false. Note that there are several movement related packets containing this state.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,047: Line 3,119:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x12
+
| rowspan="2"| ''protocol:''<br/><code>{{change|0x1D|0x1F}}</code><br/><br/>''resource:''<br/><code>move_player_status_only</code>
  |rowspan="3"| Play
+
| rowspan="2"| Play
  |rowspan="3"| Server
+
| rowspan="2"| Server
  | Window ID
+
| {{removed}} | On Ground
  | Byte
+
| {{removed}} | {{Type|Boolean}}
  |
+
| {{removed}} | True if the client is on the ground, false otherwise.
 +
|- {{added}}
 +
| Flags
 +
| {{Type|Byte}}
 +
| Bit field: 0x01: on ground, 0x02: pushing against wall.
 +
|}
 +
 
 +
==== Place Recipe ====
 +
 
 +
This packet is sent when a player clicks a recipe in the crafting book that is craftable (white border).
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
  | rowspan="3"| ''protocol:''<br/><code>{{change|0x22|0x24}}</code><br/><br/>''resource:''<br/><code>place_recipe</code>
 +
  | rowspan="3"| Play
 +
  | rowspan="3"| Server
 +
  | Window ID
 +
  | {{Type|Byte}}
 +
  |
 
  |-
 
  |-
  | Recipe
+
  | Recipe{{change|| ID}}
  | {{Change|VarInt|Identifier}}
+
  | {{change|{{Type|Identifier}}|{{Type|VarInt}}}}
  | A recipe ID
+
  | {{change|A recipe ID.|ID of recipe previously defined in [[#Recipe Book Add|Recipe Book Add]].}}
 
  |-
 
  |-
 
  | Make all
 
  | Make all
  | Boolean
+
  | {{Type|Boolean}}
  | Affects the amount of items processed; true if shift is down when clicked
+
  | Affects the amount of items processed; true if shift is down when clicked.
 
  |}
 
  |}
 
+
 
==== Recipe Book Data ====
+
==== Player Input ====
(previously known as Crafting Book Data)
+
 
 
+
{| class="wikitable"
{| class="wikitable"
+
  ! Packet ID
  ! Packet ID
+
  ! State
  ! State
+
  ! Bound To
  ! Bound To
+
  ! Field Name
  !colspan="2"| Field Name
+
  ! Field Type
  ! Field Type
+
  ! Notes
  ! Notes
+
  |-
  |-
+
  | rowspan="3"| ''protocol:''<br/><code>{{change|0x26|0x28}}</code><br/><br/>''resource:''<br/><code>player_input</code>
  |rowspan="7"| 0x17
+
  | rowspan="3"| Play
  |rowspan="7"| Play
+
  | rowspan="3"| Server
  |rowspan="7"| Server
+
  | {{removed}} | Sideways
  |colspan="2"| Type
+
| {{removed}} | {{Type|Float}}
  | VarInt
+
| {{removed}} | Positive to the left of the player.
  | Determines the format of the rest of the packet
+
|- {{removed}}
  |-
+
| Forward
  ! Type
+
| {{Type|Float}}
  ! Field Name
+
| Positive forward.
  !  
+
|-
  !  
+
| Flags
 +
| {{Type|Unsigned Byte}}
 +
| Bit mask{{change|. 0x1: jump, 0x2: unmount.|; see below.}}
 +
|}
 +
 
 +
The flags are as follows:
 +
 
 +
{| class="wikitable" {{added}}
 +
|-
 +
! Hex Mask
 +
! Field
 +
|-
 +
| 0x01
 +
| Forward
 +
|-
 +
| 0x02
 +
| Backward
 +
|-
 +
| 0x04
 +
| Left
 +
|-
 +
| 0x08
 +
| Right
 +
|-
 +
| 0x10
 +
| Jump
 +
|-
 +
| 0x20
 +
| Sneak
 +
|-
 +
| 0x40
 +
| Sprint
 +
|}
 +
 
 +
==== Set Seen Recipe ====
 +
 
 +
Sent when recipe is first seen in recipe book. Replaces Recipe Book Data, type 0.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| ''protocol:''<br/><code>{{change|0x29|0x2B}}</code><br/><br/>''resource:''<br/><code>recipe_book_seen_recipe</code>
 +
  | Play
 +
| Server
 +
| Recipe ID
 +
| {{change|{{Type|Identifier}}|{{Type|VarInt}}}}
 +
  | ID of recipe previously defined in [[#Recipe Book Add|Recipe Book Add]].
 +
|}
 +
 
 +
==== Use Item On ====
 +
 
 +
{| class="wikitable"
 +
  |-
 +
  ! Packet ID
 +
! State
 +
! Bound To
 +
  ! Field Name
 +
  ! Field Type
 +
  ! Notes
 +
|-
 +
| rowspan="9"| ''protocol:''<br/><code>{{change|0x38|0x3A}}</code><br/><br/>''resource:''<br/><code>use_item_on</code>
 +
| rowspan="9"| Play
 +
| rowspan="9"| Server
 +
| Hand
 +
| {{Type|VarInt}} {{Type|Enum}}
 +
| The hand from which the block is placed; 0: main hand, 1: off hand.
 +
|-
 +
| Location
 +
| {{Type|Position}}
 +
| Block position.
 
  |-
 
  |-
  | 0: Displayed Recipe
+
  | Face
  | Recipe ID
+
  | {{Type|VarInt}} {{Type|Enum}}
| {{Change|Int|Identifer}}
+
  | The face on which the block is placed (as documented at [[#Player Action|Player Action]]).
  | A recipe ID
 
 
  |-
 
  |-
  |rowspan="4"| 1: Recipe Book States
+
  | Cursor Position X
  | Crafting Recipe Book Open
+
  | {{Type|Float}}
| Boolean
+
  | The position of the crosshair on the block, from 0 to 1 increasing from west to east.
  | Whether the player has the crafting recipe book currently openened/active.
 
 
  |-
 
  |-
  | Crafting Recipe Filter Active
+
  | Cursor Position Y
  | Boolean
+
  | {{Type|Float}}
| Whether the player has the crafting recipe book filter option currently active.
+
  | The position of the crosshair on the block, from 0 to 1 increasing from bottom to top.
|- style="background-color: #d9ead3;"
 
| Smelting Recipe Book Open
 
| Boolean
 
| Whether the player has the smelting recipe book currently openened/active.
 
|- style="background-color: #d9ead3;"
 
| Smelting Recipe Filter Active
 
| Boolean
 
| Whether the player has the smelting recipe book filter option currently active.
 
  |}
 
 
 
The Recipe Book Status type is send when one of the states changes.
 
 
 
== Handshaking ==
 
 
 
=== Clientbound ===
 
 
 
There are no clientbound packets in the Handshaking state, since the protocol immediately switches to a different state after the client sends the first packet.
 
 
 
=== Serverbound ===
 
 
 
==== Handshake ====
 
 
 
This causes the server to switch into the target state.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="4"| 0x00
+
  | Cursor Position Z
|rowspan="4"| Handshaking
+
  | {{Type|Float}}
  |rowspan="4"| Server
+
| The position of the crosshair on the block, from 0 to 1 increasing from north to south.
| Protocol Version
 
| VarInt
 
| See [[protocol version numbers]] (currently {{change|340|382}})
 
 
  |-
 
  |-
  | Server Address
+
  | Inside block
  | String
+
  | {{Type|Boolean}}
  | Hostname or IP, e.g. localhost or 127.0.0.1, that was used to connect.  The Notchian server does not use this information.
+
  | True when the player's head is inside of a block.
  |-  
+
  |- {{added}}
  | Server Port
+
  | World border hit
  | Unsigned Short
+
  | {{Type|Boolean}}
  | Default is 25565.  The Notchian server does not use this information.
+
  | Seems to always be false, even when interacting with blocks around or outside the world border, or while the player is outside the border.
 
  |-
 
  |-
  | Next State
+
  | Sequence
  | VarInt Enum
+
  | {{Type|VarInt}}
  | 1 for [[#Status|status]], 2 for [[#Login|login]]
+
  | Block change sequence number (see [[#Acknowledge Block Change]]).
 
  |}
 
  |}
  
== Status ==
+
Upon placing a block, this packet is sent once.
 
 
=== Clientbound ===
 
 
 
No changes so far.
 
 
 
=== Serverbound ===
 
 
 
No changes so far.
 
  
== Login ==
+
The Cursor Position X/Y/Z fields (also known as in-block coordinates) are calculated using raytracing. The unit corresponds to sixteen pixels in the default resource pack. For example, let's say a slab is being placed against the south face of a full block. The Cursor Position X will be higher if the player was pointing near the right (east) edge of the face, lower if pointing near the left. The Cursor Position Y will be used to determine whether it will appear as a bottom slab (values 0.0–0.5) or as a top slab (values 0.5-1.0). The Cursor Position Z should be 1.0 since the player was looking at the southernmost part of the block.
 
 
=== Clientbound ===
 
 
 
No changes so far.
 
 
 
=== Serverbound ===
 
 
 
No changes so far.
 
  
 +
Inside block is true when a player's head (specifically eyes) are inside of a block's collision. In 1.13 and later versions, collision is rather complicated and individual blocks can have multiple collision boxes. For instance, a ring of vines has a non-colliding hole in the middle. This value is only true when the player is directly in the box. In practice, though, this value is only used by scaffolding to place in front of the player when sneaking inside of it (other blocks will place behind when you intersect with them -- try with glass for instance).
  
 
[[Category:Minecraft Modern]]
 
[[Category:Minecraft Modern]]

Latest revision as of 10:08, 25 November 2024

This page documents the changes from release 1.21.1 (protocol 767) to the current release (1.21.3, protocol 768). The stable protocol documentation is currently lagging behind, and the changes documented here will be merged soon, once they are complete. The current pre-release (snapshot 24w44a) is not yet documented.

One who wishes to commandeer the merging of this into Protocol when an update is made must be sure to respect any changes that may have occurred to the respective packets there.

Contents

Contents

Data types

Name Size (bytes) Encodes Notes
Teleport Flags 4 See #Teleport Flags Bit field specifying how a teleportation is to be applied on each axis.
Recipe Display Varies See Recipes#Recipe Display structure Description of a recipe for use for use by the client.
Slot Display Varies See Recipes#Slot Display structure Description of a recipe ingredient slot for use for use by the client.

Teleport Flags

A bit field represented as an Int, specifying how a teleportation is to be applied on each axis.

In the lower 8 bits of the bit field, a set bit means the teleportation on the corresponding axis is relative, and an unset bit that it is absolute.

Hex Mask Field
0x0001 Relative X
0x0002 Relative Y
0x0004 Relative Z
0x0008 Relative Yaw
0x0010 Relative Pitch
0x0020 Relative Velocity X
0x0040 Relative Velocity Y
0x0080 Relative Velocity Z
0x0100 Rotate velocity according to the change in rotation, before applying the velocity change in this packet. Combining this with absolute rotation works as expected—the difference in rotation is still used.

Packets

ID Packet name Documentation
Play clientbound
0x12 Close Container Current Pre
0x13 Set Container Content Current Pre
0x14 Set Container Property Current Pre
0x15 Set Container Slot Current Pre
0x17 Set Cooldown Current Pre
0x70 0x20 Teleport Entity Current Pre
0x20 0x21 Explosion Current Pre
0x23 0x24 Open Horse Screen Current Pre
0x2B 0x2C Login (play) Current Pre
0x31 Move Minecart Along Track Pre
0x37 0x39 Place Ghost Recipe Current Pre
0x3E 0x40 Player Info Update Current Pre
0x40 0x42 Synchronize Player Position Current Pre
0x41 Update Recipe Book Current
0x43 Player Rotation Pre
0x44 Recipe Book Add Pre
0x45 Recipe Book Remove Pre
0x46 Recipe Book Settings Pre
0x47 0x4C Respawn Current Pre
0x5a Set Cursor Item Pre
0x53 0x63 Set Held Item Current (unchanged)
0x66 Set Player Inventory Slot Pre
0x64 0x6b Update Time Current Pre
0x77 Synchronize Vehicle Position Pre
0x77 0x7e Update Recipes Current Pre
Play serverbound
0x02 Bundle Item Selected Pre
0x0b Client Tick End Pre
0x0E 0x10 Click Container Current Pre
0x0F 0x11 Close Container Current Pre
0x14 0x16 Edit Book Current Pre
0x1A 0x1C Set Player Position Current Pre
0x1B 0x1D Set Player Position and Rotation Current Pre
0x1C 0x1E Set Player Rotation Current Pre
0x1D Set Player On Ground Current
0x1F Set Player Movement Flags Pre
0x22 0x24 Place Recipe Current Pre
0x26 0x28 Player Input Current Pre
0x29 0x2B Set Seen Recipe Current Pre
0x38 0x3A Use Item On Current Pre

Entity Metadata

Entity Metadata Format

Painting Variant

See also: Registry Data#Painting Variant
Name Type Meaning
Width Int The width of the painting, in blocks.
Height Int The height of the painting, in blocks.
Asset ID Identifier The texture for the painting.

The Notchian client uses the corresponding asset located at textures/painting.

Has title Boolean
Title Optional Text Component The displayed title of the painting. Only present if Has title is true.
Has author Boolean
Author Optional Text Component The displayed author of the painting. Only present if Has author is true.

Registry Data

Painting Variant

The minecraft:painting_variant registry. It defines the textures and dimensions for the game's paintings.

Name Type Meaning Values
asset_id String Tag The texture for the painting.

The Notchian client uses the corresponding asset located at textures/painting.

Example: "minecraft:backyard".
height Int Tag The height of the painting, in blocks. Example: 2
width Int Tag The width of the painting, in blocks.
title Compound Tag or String Tag The displayed title of the painting. See Text formatting. Example: {"color": "gray", "translate": "painting.minecraft.skeleton.title"}
author Compound Tag or String Tag The displayed author of the painting. See Text formatting. Example: {"color": "gray", "translate": "painting.minecraft.skeleton.author"}

Slot Data

Structured components

Type Name Description Data
6 minecraft:item_model Item's model. As follows:
Name Type Description
Model Identifier
20 21 minecraft:food Makes the item consumable restore the player's hunger bar when consumed. As follows:
Name Type Description
Nutrition VarInt Non-negative
Saturation Modifier Float How much saturation will be given after consuming the item.
Can Always Eat Boolean Whether the item can always be eaten, even at full hunger.
Seconds To Eat Float How long it takes to consume the item.
Using converts to Slot Data This specifies the item produced after consuming the current item. In the Notchian server, this is used for stews, which turn into bowls. Set this to Air if the item should be consumed normally without leaving any other item after.
Number of effects VarInt Number of elements in the following array.
Effect Type ID Array Potion Effect The potion effect. See Potion Effect.
Probability Float The probability for this effect to be chosen.
22 minecraft:consumable Makes the item consumable. As follows:
Name Type Description
Consume seconds Float How long it takes to consume the item.
Animation VarInt Enum 0: none, 1: eat, 2: drink, 3: block, 4: bow, 5: spear, 6: crossbow, 7: spyglass, 8: toot_horn, 9: brush
Sound ID or Sound Event ID in the minecraft:sound_event registry, or an inline definition.
Has consume particles Boolean
Number of effects VarInt Number of elements in the following array.
Effects Array of Consume Effect Effects to apply on consumption. See Consume Effect.
23 minecraft:use_remainder This specifies the item produced after using the current item. In the Notchian server, this is used for stews, which turn into bowls. As follows:
Name Type Description
Remainder Slot
24 minecraft:use_cooldown Cooldown to apply on use of the item. As follows:
Name Type Description
Seconds Float
Cooldown group Optional Identifier Group of items to apply the cooldown to. Only present if Has cooldown group is true; otherwise defaults to the item's identifier.
21 25 minecraft:fire damage_resistant Marks this item as fire damage resistant.
The client won't render the item as being on-fire if this component is present.
None. As follows:
Name Type Description
Types Identifier Tag specifying damage types the item is immune to. Not prefixed by '#'!.
27 minecraft:enchantable Allows the item to be enchanted by an enchanting table. As follows:
Name Type Description
Value VarInt Opaque internal value controlling how expensive enchantments may be offered.
28 minecraft:equippable Allows the item to be equipped by the player. As follows:
Name Type Description
Slot VarInt Enum 0: mainhand, 1: feet, 2: legs, 3: chest, 4: head, 5: offhand, 6: body
Equip sound ID or Sound Event ID in the minecraft:sound_event registry, or an inline definition.
Has model Boolean
Model Optional Identifier Only present if Has model is true.
Has camera overlay Boolean
Camera overlay Optional Identifier Only present if Has camera overlay is true.
Has allowed entities Boolean
Allowed entities Optional ID Set IDs in the minecraft:entity_type registry. Only present if Has allowed entities is true.
Dispensable Boolean
Swappable Boolean
Damage on hurt Boolean
29 minecraft:repairable Items that can be combined with this item in an anvil to repair it. As follows:
Name Type Description
Items ID Set IDs in the minecraft:item registry.
30 minecraft:glider Makes the item function like elytra. None.
31 minecraft:tooltip_style Custom textures for the item tooltip. As follows:
Name Type Description
Style Identifier
32 minecraft:death_protection Makes the item function like a totem of undying. As follows:
Name Type Description
Number of effects VarInt Number of elements in the following array.
Effects Array of Consume Effect Effects to apply on consumption. See Consume Effect.
31 41 minecraft:potion_contents Visual and effects of a potion item. As follows:
Name Type Description
Has Potion ID Boolean Whether this potion has an ID in the potion registry. If true, it has the default effects associated with the potion type.
Potion ID Optional VarInt The ID of the potion type in the potion registry. Only present if Has Potion ID is true.
Has Custom Color Boolean Whether this potion has a custom color. If false, it uses the default color associated with the potion type.
Custom Color Optional Int The RGB components of the color, encoded as an integer. Only present if Has Custom Color is true.
Number Of Custom Effects VarInt The number of elements in the following array.
Custom Effects Array of Potion Effect Any custom effects the potion might have. See Potion Effect.
Custom Name String

Other types

Consume Effect

WIP

Instrument

Name Type Description
Sound Event Id or Sound Event The sound to be played.
Use duration VarInt Float The maximum range of the sound.
Range Float The range of the instrument.
Description Text Component Description shown in the item tooltip.

Particles

Particle Name Particle ID Data
minecraft:dust 13
Field Name Field Type Meaning
Red Float The red RGB value, between 0 and 1. Divide actual RGB value by 255.
Green Float The green RGB value, between 0 and 1. Divide actual RGB value by 255.
Blue Float The blue RGB value, between 0 and 1. Divide actual RGB value by 255.
Color Int The color, encoded as 0xRRGGBB; top bits are ignored.
Scale Float The scale, will be clamped between 0.01 and 4.
minecraft:dust_color_transition 14
Field Name Field Type Meaning
From Red Float The start red RGB value, between 0 and 1. Divide actual RGB value by 255.
From Green Float The start green RGB value, between 0 and 1. Divide actual RGB value by 255.
From Blue Float The start blue RGB value, between 0 and 1. Divide actual RGB value by 255.
From Color Int The start color, encoded as 0xRRGGBB; top bits are ignored.
To Red Float The end red RGB value, between 0 and 1. Divide actual RGB value by 255.
To Green Float The end green RGB value, between 0 and 1. Divide actual RGB value by 255.
To Blue Float The end blue RGB value, between 0 and 1. Divide actual RGB value by 255.
To Color Int The end color, encoded as 0xRRGGBB; top bits are ignored.
Scale Float The scale, will be clamped between 0.01 and 4.

Recipes

(this is meant to become a new page.)

Recipe Display structure

Name Type Description
Recipe Display Type VarInt ID in the minecraft:recipe_display registry.
Data Varies See #Recipe Display types below.

Recipe Display types

ID Name Data
0 minecraft:crafting_shapeless data
1 minecraft:crafting_shaped data
2 minecraft:furnace data
3 minecraft:stonecutter data
4 minecraft:smithing data
minecraft:crafting_shapeless
Name Type Description
Ingredient Count VarInt Number of elements in the following array.
Ingredients Array of Slot Display
Result Slot Display
Crafting Station Slot Display Crafting station icon to display in the recipe notification.
minecraft:crafting_shaped
Name Type Description
Width VarInt
Height VarInt
Ingredient Count VarInt Number of elements in the following array. Always equal to Width * Height.
Ingredients Array of Slot Display
Result Slot Display
Crafting Station Slot Display Crafting station icon to display in the recipe notification.
minecraft:furnace
Name Type Description
Ingredient Slot Display
Fuel Slot Display
Result Slot Display
Crafting Station Slot Display Crafting station icon to display in the recipe notification.
Cooking Time VarInt Time to smelt in a regular furnace, in ticks.
Experience Float
minecraft:stonecutter
Name Type Description
Ingredient Slot Display
Result Slot Display
Crafting Station Slot Display Crafting station icon to display in the recipe notification.
minecraft:smithing
Name Type Description
Template Slot Display
Base Slot Display
Addition Slot Display
Result Slot Display
Crafting Station Slot Display Crafting station icon to display in the recipe notification.

Slot Display structure

Name Type Description
Slot Display Type VarInt ID in the minecraft:slot_display registry.
Data Varies See #Slot Display types below.

Slot Display types

ID Name Data
0 minecraft:empty no data
1 minecraft:any_fuel no data
2 minecraft:item data
3 minecraft:item_stack data
4 minecraft:tag data
5 minecraft:smithing_trim data
6 minecraft:with_remainder data
7 minecraft:composite data
minecraft:item
Name Type Description
Item Type VarInt ID in the minecraft:item registry.
minecraft:item_stack
Name Type Description
Item Stack Slot
minecraft:tag
Name Type Description
Tag Identifier Tag in the minecraft:item registry. Not prefixed by '#'!.
minecraft:smithing_trim
Name Type Description
Base Slot Display
Material Slot Display
Pattern Slot Display
minecraft:with_remainder
Name Type Description
Ingredient Slot Display
Remainder Slot Display
minecraft:composite
Name Type Description
Option Count VarInt Number of elements in the following array.
Options Array of Slot Display

Handshake

No changes so far.

Status

No changes so far.

Login

No changes so far.

Configuration

No changes so far.

Play

Clientbound

Close Container

This packet is sent from the server to the client when a window is forcibly closed, such as when a chest is destroyed while it's open. The notchian client disregards the provided window ID and closes any active window.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x12

resource:
container_close
Play Client Window ID Unsigned Byte VarInt This is the ID of the window that was closed. 0 for inventory.

Set Container Content

The inventory slots

Replaces the contents of a container window. Sent by the server upon initialization of a container window or the player's inventory, and in response to state ID mismatches (see #Click Container).

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x13

resource:
container_set_content
Play Client Window ID Unsigned Byte VarInt The ID of window which items are being sent for. 0 for player inventory. The client ignores any packets targeting a Window ID other than the current one. However, an exception is made for the player inventory, which may be targeted at any time. (The Notchian server does not appear to utilize this special case.)
State ID VarInt A server-managed sequence number used to avoid desynchronization; see #Click Container.
Count VarInt Number of elements in the following array.
Slot Data Array of Slot
Carried Item Slot Item being dragged with the mouse.

See inventory windows for further information about how slots are indexed. Use Open Screen to open the container on the client.

Set Container Property

This packet is used to inform the client that part of a GUI window should be updated.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x14

resource:
container_set_data
Play Client Window ID Unsigned Byte VarInt
Property Short The property to be updated, see below.
Value Short The new value for the property, see below.

The meaning of the Property field depends on the type of the window. The following table shows the known combinations of window type and property, and how the value is to be interpreted.

Window type Property Value
Furnace 0: Fire icon (fuel left) counting from fuel burn time down to 0 (in-game ticks)
1: Maximum fuel burn time fuel burn time or 0 (in-game ticks)
2: Progress arrow counting from 0 to maximum progress (in-game ticks)
3: Maximum progress always 200 on the notchian server
Enchantment Table 0: Level requirement for top enchantment slot The enchantment's xp level requirement
1: Level requirement for middle enchantment slot
2: Level requirement for bottom enchantment slot
3: The enchantment seed Used for drawing the enchantment names (in SGA) clientside. The same seed is used to calculate enchantments, but some of the data isn't sent to the client to prevent easily guessing the entire list (the seed value here is the regular seed bitwise and 0xFFFFFFF0).
4: Enchantment ID shown on mouse hover over top enchantment slot The enchantment id (set to -1 to hide it), see below for values
5: Enchantment ID shown on mouse hover over middle enchantment slot
6: Enchantment ID shown on mouse hover over bottom enchantment slot
7: Enchantment level shown on mouse hover over the top slot The enchantment level (1 = I, 2 = II, 6 = VI, etc.), or -1 if no enchant
8: Enchantment level shown on mouse hover over the middle slot
9: Enchantment level shown on mouse hover over the bottom slot
Beacon 0: Power level 0-4, controls what effect buttons are enabled
1: First potion effect Potion effect ID for the first effect, or -1 if no effect
2: Second potion effect Potion effect ID for the second effect, or -1 if no effect
Anvil 0: Repair cost The repair's cost in xp levels
Brewing Stand 0: Brew time 0 – 400, with 400 making the arrow empty, and 0 making the arrow full
1: Fuel time 0 - 20, with 0 making the arrow empty, and 20 making the arrow full
Stonecutter 0: Selected recipe The index of the selected recipe. -1 means none is selected.
Loom 0: Selected pattern The index of the selected pattern. 0 means none is selected, 0 is also the internal id of the "base" pattern.
Lectern 0: Page number The current page number, starting from 0.

For an enchanting table, the following numerical IDs are used:

Numerical ID Enchantment ID Enchantment Name
0 minecraft:protection Protection
1 minecraft:fire_protection Fire Protection
2 minecraft:feather_falling Feather Falling
3 minecraft:blast_protection Blast Protection
4 minecraft:projectile_protection Projectile Protection
5 minecraft:respiration Respiration
6 minecraft:aqua_affinity Aqua Affinity
7 minecraft:thorns Thorns
8 minecraft:depth_strider Depth Strider
9 minecraft:frost_walker Frost Walker
10 minecraft:binding_curse Curse of Binding
11 minecraft:soul_speed Soul Speed
12 minecraft:swift_sneak Swift Sneak
13 minecraft:sharpness Sharpness
14 minecraft:smite Smite
15 minecraft:bane_of_arthropods Bane of Arthropods
16 minecraft:knockback Knockback
17 minecraft:fire_aspect Fire Aspect
18 minecraft:looting Looting
19 minecraft:sweeping_edge Sweeping Edge
20 minecraft:efficiency Efficiency
21 minecraft:silk_touch Silk Touch
22 minecraft:unbreaking Unbreaking
23 minecraft:fortune Fortune
24 minecraft:power Power
25 minecraft:punch Punch
26 minecraft:flame Flame
27 minecraft:infinity Infinity
28 minecraft:luck_of_the_sea Luck of the Sea
29 minecraft:lure Lure
30 minecraft:loyalty Loyalty
31 minecraft:impaling Impaling
32 minecraft:riptide Riptide
33 minecraft:channeling Channeling
34 minecraft:multishot Multishot
35 minecraft:quick_charge Quick Charge
36 minecraft:piercing Piercing
37 minecraft:density Density
38 minecraft:breach Breach
39 minecraft:wind_burst Wind Burst
40 minecraft:mending Mending
41 minecraft:vanishing_curse Curse of Vanishing

Set Container Slot

Sent by the server when an item in a slot (in a window) is added/removed.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x15

resource:
container_set_slot
Play Client Window ID Unsigned Byte VarInt The window which is being updated. 0 for player inventory. The client ignores any packets targeting a Window ID other than the current one; see below for exceptions , unless it is 0 (see below).
State ID VarInt A server-managed sequence number used to avoid desynchronization; see #Click Container.
Slot Short The slot that should be updated.
Slot Data Slot

If Window ID is 0, the hotbar and offhand slots (slots 36 through 45) may be updated even when a different container window is open. (The Notchian server does not appear to utilize this special case.) Updates are also restricted to those slots when the player is looking at a creative inventory tab other than the survival inventory. (The Notchian server does not handle this restriction in any way, leading to MC-242392.)

If Window ID is -1, the item being dragged with the mouse is set. In this case, State ID and Slot are ignored.

If Window ID is -2, any slot in the player's inventory can be updated irrespective of the current container window. In this case, State ID is ignored, and the Notchian server uses a bogus value of 0. Used by the Notchian server to implement the #Pick Item functionality.

When a container window is open, the server never sends updates targeting Window ID 0—all of the window types include slots for the player inventory. The client must automatically apply changes targeting the inventory portion of a container window to the main inventory; the server does not resend them for ID 0 when the window is closed. However, since the armor and offhand slots are only present on ID 0, updates to those slots occurring while a window is open must be deferred by the server until the window's closure.

Set Cooldown

Applies a cooldown period to all items with the given type. Used by the Notchian server with enderpearls. This packet should be sent when the cooldown starts and also when the cooldown ends (to compensate for lag), although the client will end the cooldown automatically. Can be applied to any item, note that interactions still get sent to the server with the item but the client does not play the animation nor attempt to predict results (i.e block placing).

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x17

resource:
cooldown
Play Client Item ID Cooldown Group VarInt Identifier Numeric ID of the item Group of items to apply a cooldown to.
Cooldown Ticks VarInt Number of ticks to apply a cooldown for, or 0 to clear the cooldown.

Teleport Entity

Warning.png The Mojang-specified name of this packet was changed in 1.21.2 from teleport_entity to entity_position_sync. There is a new teleport_entity, which this document more appropriately calls Synchronize Vehicle Position. That packet has a different function and will lead to confusing results if used in place of this one.

This packet is sent by the server when an entity moves more than 8 blocks.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x70 0x20

resource:
teleport_entity entity_position_sync
Play Client Entity ID VarInt
X Double
Y Double
Z Double
Velocity X Double
Velocity Y Double
Velocity Z Double
Yaw Angle Float Rotation on the X axis, in degrees.
Pitch Angle Float Rotation on the Y axis, in degrees.
On Ground Boolean

Explosion

Sent when an explosion occurs (creepers, TNT, and ghast fireballs).

Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x20 0x21

resource:
explode
Play Client X Double
Y Double
Z Double
Strength Float If the strength is greater or equal to 2.0, or the block interaction is not 0 (keep), large explosion particles are used. Otherwise, small explosion particles are used.
Record Count VarInt Number of elements in the following array.
Records Array of (Byte, Byte, Byte) Each record is 3 signed bytes long; the 3 bytes are the XYZ (respectively) signed offsets of affected blocks.
Has Player Motion Boolean
Player Motion X Float Optional Double X velocity of the player being pushed by the explosion. Only present if Has Player Motion is true.
Player Motion Y Float Optional Double Y velocity of the player being pushed by the explosion. Only present if Has Player Motion is true.
Player Motion Z Float Optional Double Z velocity of the player being pushed by the explosion. Only present if Has Player Motion is true.
Block Interaction VarInt Enum 0 = keep, 1 = destroy, 2 = destroy_with_decay, 3 = trigger_block.
Small Explosion Particle ID VarInt The particle ID listed in Particles.
Small Explosion Particle Data Varies Particle data as specified in Particles.
Large Explosion Particle ID VarInt The particle ID listed in Particles.
Large Explosion Particle Data Varies Particle data as specified in Particles.
Explosion Sound ID or Sound Event ID in the minecraft:sound_event registry, or an inline definition.

Open Horse Screen

This packet is used exclusively for opening the horse GUI. Open Screen is used for all other GUIs. The client will not open the inventory if the Entity ID does not point to an horse-like animal.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x23

resource:
horse_screen_open
Play Client Window ID Unsigned Byte VarInt
Slot count VarInt
Entity ID Int

Login (play)

Huh.png The following information needs to be added to this page:
Although the number of portal cooldown ticks is included in this packet, the whole portal usage process is still dictated entirely by the server. What kind of effect does this value have on the client, if any?

See Protocol Encryption for information on logging in.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x2B 0x2C

resource:
login
Play Client Entity ID Int The player's Entity ID (EID).
Is hardcore Boolean
Dimension Count VarInt Size of the following array.
Dimension Names Array of Identifier Identifiers for all dimensions on the server.
Max Players VarInt Was once used by the client to draw the player list, but now is ignored.
View Distance VarInt Render distance (2-32).
Simulation Distance VarInt The distance that the client will process specific things, such as entities.
Reduced Debug Info Boolean If true, a Notchian client shows reduced information on the debug screen. For servers in development, this should almost always be false.
Enable respawn screen Boolean Set to false when the doImmediateRespawn gamerule is true.
Do limited crafting Boolean Whether players can only craft recipes they have already unlocked. Currently unused by the client.
Dimension Type VarInt The ID of the type of dimension in the minecraft:dimension_type registry, defined by the Registry Data packet.
Dimension Name Identifier Name of the dimension being spawned into.
Hashed seed Long First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
Game mode Unsigned Byte 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
Previous Game mode Byte -1: Undefined (null), 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. The previous game mode. Vanilla client uses this for the debug (F3 + N & F3 + F4) game mode switch. (More information needed)
Is Debug Boolean True if the world is a debug mode world; debug mode worlds cannot be modified and have predefined blocks.
Is Flat Boolean True if the world is a superflat world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
Has death location Boolean If true, then the next two fields are present.
Death dimension name Optional Identifier Name of the dimension the player died in.
Death location Optional Position The location that the player died at.
Portal cooldown VarInt The number of ticks until the player can use the portal again.
Sea level VarInt
Enforces Secure Chat Boolean

Move Minecart Along Track

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x31

resource:
move_minecart_along_track
Play Client Entity ID VarInt
Step Count VarInt Number of elements in the following array.
Steps X Array Double
Y Double
Z Double
Velocity X Double
Velocity Y Double
Velocity Z Double
Yaw Angle
Pitch Angle
Weight Float

Player Info Update

Sent by the server to update the user list (<tab> in the client).

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x3E 0x40

resource:
player_info_update
Play Client Actions Byte Determines what actions are present.
Number Of Players VarInt Number of elements in the following array.
Players UUID Array UUID The player UUID
Player Actions Array of Player Actions The length of this array is determined by the number of Player Actions that give a non-zero value when applying its mask to the actions flag. For example given the decimal number 5, binary 00000101. The masks 0x01 and 0x04 would return a non-zero value, meaning the Player Actions array would include two actions: Add Player and Update Game Mode.
Player Actions
Action Mask Field Name Type Notes
Add Player 0x01 Name String (16)
Number Of Properties VarInt Number of elements in the following array.
Property Name Array String (32767)
Value String (32767)
Is Signed Boolean
Signature Optional String (32767) Only if Is Signed is true.
Initialize Chat 0x02 Has Signature Data Boolean
Chat session ID UUID Only sent if Has Signature Data is true.
Public key expiry time Long Key expiry time, as a UNIX timestamp in milliseconds. Only sent if Has Signature Data is true.
Encoded public key size VarInt Size of the following array. Only sent if Has Signature Data is true. Maximum length is 512 bytes.
Encoded public key Byte Array (512) The player's public key, in bytes. Only sent if Has Signature Data is true.
Public key signature size VarInt Size of the following array. Only sent if Has Signature Data is true. Maximum length is 4096 bytes.
Public key signature Byte Array (4096) The public key's digital signature. Only sent if Has Signature Data is true.
Update Game Mode 0x04 Game Mode VarInt
Update Listed 0x08 Listed Boolean Whether the player should be listed on the player list.
Update Latency 0x10 Ping VarInt Measured in milliseconds.
Update Display Name 0x20 Has Display Name Boolean
Display Name Optional Text Component Only sent if Has Display Name is true.
Update List Priority 0x40 Priority VarInt See below.

The properties included in this packet are the same as in Login Success, for the current player.

Ping values correspond with icons in the following way:

  • A ping that negative (i.e. not known to the server yet) will result in the no connection icon.
  • A ping under 150 milliseconds will result in 5 bars
  • A ping under 300 milliseconds will result in 4 bars
  • A ping under 600 milliseconds will result in 3 bars
  • A ping under 1000 milliseconds (1 second) will result in 2 bars
  • A ping greater than or equal to 1 second will result in 1 bar.

The order of players in the player list is determined as follows:

  • Players with higher priorities are sorted before those with lower priorities.
  • Among players of equal priorities, spectators are sorted after non-spectators.
  • Within each of those groups, players are sorted into teams. The teams are ordered case-sensitively by team name in ascending order. Players with no team are listed first.
  • The players of each team (and non-team) are sorted case-insensitively by name in ascending order.

Synchronize Player Position

Teleports the client, e.g. during login, when using an ender pearl, in response to invalid move packets, etc.

Due to latency, the server may receive outdated movement packets sent before the client was aware of the teleport. To account for this, the server ignores all movement packets from the client until a Confirm Teleportation packet with an ID matching the one sent in the teleport packet is received.

Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0, -1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360 (see MC-90097).

Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x40 0x42

resource:
player_position
Play Client Teleport ID VarInt Client should confirm this packet with Confirm Teleportation containing the same Teleport ID.
X Double Absolute or relative position, depending on Flags.
Y Double Absolute or relative position, depending on Flags.
Z Double Absolute or relative position, depending on Flags.
Velocity X Double
Velocity Y Double
Velocity Z Double
Yaw Float Absolute or relative rotation on the X axis, in degrees.
Pitch Float Absolute or relative rotation on the Y axis, in degrees.
Flags Byte Teleport Flags Reference the Flags table below. When the value of the this byte masked is zero the field is absolute, otherwise relative.
Teleport ID VarInt Client should confirm this packet with Confirm Teleportation containing the same Teleport ID.

Player Rotation

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x43

resource:
player_rotation
Play Client Yaw Float Rotation on the X axis, in degrees.
Pitch Float Rotation on the Y axis, in degrees.

Place Ghost Recipe

Response to the serverbound packet (Place Recipe), with the same recipe ID. Appears to be used to notify the UI.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x37 0x39

resource:
place_ghost_recipe
Play Client Window ID Byte VarInt
Recipe Identifier A recipe ID.
Recipe Display Recipe Display

Recipe Book Add

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x44

resource:
recipe_book_add
Play Client Recipe Count VarInt Number of elements in the following array.
Recipes Recipe ID Array VarInt ID to assign to the recipe.
Display Recipe Display
Group ID VarInt
Category ID VarInt ID in the minecraft:recipe_book_category registry.
Has Ingredients Boolean
Ingredient Count Optional VarInt Number of elements in the following array. Only present if Has Ingredients is true.
Ingredients Optional Array of ID Set IDs in the minecraft:item registry, or an inline definition. Only present if Has Ingredients is true.
Flags Byte 0x01: show notification; 0x02: highlight as new
Replace Boolean Replace or Add to known recipes

Recipe Book Remove

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x45

resource:
recipe_book_remove
Play Client Recipe Count VarInt Number of elements in the following array.
Recipes Array of VarInt IDs of recipes to remove.

Recipe Book Settings

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x46

resource:
recipe_book_settings
Play Client Crafting Recipe Book Open Boolean If true, then the crafting recipe book will be open when the player opens its inventory.
Crafting Recipe Book Filter Active Boolean If true, then the filtering option is active when the players opens its inventory.
Smelting Recipe Book Open Boolean If true, then the smelting recipe book will be open when the player opens its inventory.
Smelting Recipe Book Filter Active Boolean If true, then the filtering option is active when the players opens its inventory.
Blast Furnace Recipe Book Open Boolean If true, then the blast furnace recipe book will be open when the player opens its inventory.
Blast Furnace Recipe Book Filter Active Boolean If true, then the filtering option is active when the players opens its inventory.
Smoker Recipe Book Open Boolean If true, then the smoker recipe book will be open when the player opens its inventory.
Smoker Recipe Book Filter Active Boolean If true, then the filtering option is active when the players opens its inventory.

Respawn

Huh.png The following information needs to be added to this page:
Although the number of portal cooldown ticks is included in this packet, the whole portal usage process is still dictated entirely by the server. What kind of effect does this value have on the client, if any?

To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x47 0x4C

resource:
respawn
Play Client Dimension Type VarInt The ID of type of dimension in the minecraft:dimension_type registry, defined by the Registry Data packet.
Dimension Name Identifier Name of the dimension being spawned into.
Hashed seed Long First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
Game mode Unsigned Byte 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
Previous Game mode Byte -1: Undefined (null), 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. The previous game mode. Vanilla client uses this for the debug (F3 + N & F3 + F4) game mode switch. (More information needed)
Is Debug Boolean True if the world is a debug mode world; debug mode worlds cannot be modified and have predefined blocks.
Is Flat Boolean True if the world is a superflat world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
Has death location Boolean If true, then the next two fields are present.
Death dimension Name Optional Identifier Name of the dimension the player died in.
Death location Optional Position The location that the player died at.
Portal cooldown VarInt The number of ticks until the player can use the portal again.
Sea level VarInt
Data kept Byte Bit mask. 0x01: Keep attributes, 0x02: Keep metadata. Tells which data should be kept on the client side once the player has respawned.

In the Notchian implementation, this is context dependent:

  • normal respawns (after death) keep no data;
  • exiting the end poem/credits keeps the attributes;
  • other dimension changes (portals or teleports) keep all data.

Warning.png Avoid changing player's dimension to same dimension they were already in unless they are dead. If you change the dimension to one they are already in, weird bugs can occur, such as the player being unable to attack other players in new world (until they die and respawn).

Before 1.16, if you must respawn a player in the same dimension without killing them, send two respawn packets, one to a different world and then another to the world you want. You do not need to complete the first respawn; it only matters that you send two packets.

Set Cursor Item

Packet ID State Bound To Field Name Field Type Notes
0x5A Play Client Slot Data Slot

Update Time

Time is based on ticks, where 20 ticks happen every second. There are 24000 ticks in a day, making Minecraft days exactly 20 minutes long.

The time of day is based on the timestamp modulo 24000. 0 is sunrise, 6000 is noon, 12000 is sunset, and 18000 is midnight.

The default SMP server increments the time by 20 every second.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x64 0x6B

resource:
set_time
Play Client World Age Long In ticks; not changed by server commands.
Time of day Long The world (or region) time, in ticks. If negative the sun will stop moving at the Math.abs of the time.
Time of day increasing Boolean If true, the client should automatically advance the time of day according to its ticking rate.

Set Player Inventory Slot

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x66

resource:
set_player_inventory
Play Client Slot VarInt
Slot Data Slot

Synchronize Vehicle Position

Teleports the entity on the client without changing the reference point of movement deltas in future Update Entity Position packets. Seems to be used to make relative adjustments to vehicle positions; more information needed.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x77

resource:
teleport_entity
Play Client Entity ID VarInt
X Double
Y Double
Z Double
Velocity X Double
Velocity Y Double
Velocity Z Double
Yaw Float Rotation on the Y axis, in degrees.
Pitch Float Rotation on the Y axis, in degrees.
Flags Teleport Flags
On Ground Boolean

Update Recipes

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x77 0x7e

resource:
update_recipes
Play Client Num Recipes VarInt Number of elements in the following array.
Recipe Recipe ID Array Identifier
Type ID VarInt Enum The recipe type, see below.
Data Varies Additional data for the recipe.
Property Set Count VarInt Number of elements in the following array.
Property Sets Property Set ID Array Identifier
Item Count VarInt Number of elements in the following array.
Items Array of VarInt IDs in the minecraft:item registry.
Stonecutter Recipe Count VarInt Number of elements in the following array.
Stonecutter Recipes Ingredients Array ID Set
Slot Display Slot Display

Recipe types:

ID Type Description Data
0 minecraft:crafting_shaped Shaped crafting recipe. All items must be present in the same pattern (which may be flipped horizontally or translated). As follows:
Name Type Description
Group String (32767) Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
Category VarInt Enum Building = 0, Redstone = 1, Equipment = 2, Misc = 3
Width VarInt
Height VarInt
Ingredients Array of Ingredient Length is width * height. Indexed by x + (y * width).
Result Slot
Show notification Boolean Show a toast when the recipe is added.
1 minecraft:crafting_shapeless Shapeless crafting recipe. All items in the ingredient list must be present, but in any order/slot. As follows:
Name Type Description
Group String (32767) Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
Category VarInt Enum Building = 0, Redstone = 1, Equipment = 2, Misc = 3
Ingredient count VarInt Number of elements in the following array.
Ingredients Array of Ingredient.
Result Slot
2 minecraft:crafting_special_armordye Recipe for dying leather armor As follows:
Name Type Description
Category VarInt Enum Building = 0, Redstone = 1, Equipment = 2, Misc = 3
3 minecraft:crafting_special_bookcloning Recipe for copying contents of written books
4 minecraft:crafting_special_mapcloning Recipe for copying maps
5 minecraft:crafting_special_mapextending Recipe for adding paper to maps
6 minecraft:crafting_special_firework_rocket Recipe for making firework rockets
7 minecraft:crafting_special_firework_star Recipe for making firework stars
8 minecraft:crafting_special_firework_star_fade Recipe for making firework stars fade between multiple colors
9 minecraft:crafting_special_tippedarrow Recipe for crafting tipped arrows
10 minecraft:crafting_special_bannerduplicate Recipe for copying banner patterns
11 minecraft:crafting_special_shielddecoration Recipe for applying a banner's pattern to a shield
12 minecraft:crafting_special_shulkerboxcoloring Recipe for recoloring a shulker box
13 minecraft:crafting_special_suspiciousstew Recipe for crafting suspicious stews
14 minecraft:crafting_special_repairitem Recipe for repairing items via crafting
22 minecraft:crafting_decorated_pot Recipe for crafting decorated pots
15 minecraft:smelting Smelting recipe As follows:
Name Type Description
Group String (32767) Used to group similar recipes together in the recipe book.
Category VarInt Enum Food = 0, Blocks = 1, Misc = 2
Ingredient Ingredient
Result Slot
Experience Float
Cooking time VarInt
16 minecraft:blasting Blast furnace recipe
17 minecraft:smoking Smoker recipe
18 minecraft:campfire_cooking Campfire recipe
19 minecraft:stonecutting Stonecutter recipe As follows:
Name Type Description
Group String (32767) Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
Ingredient Ingredient
Result Slot
20 minecraft:smithing_transform Recipe for smithing netherite gear As follows:
Name Type Description
Template Ingredient The smithing template.
Base Ingredient The base item.
Addition Ingredient The additional ingredient.
Result Slot
21 minecraft:smithing_trim Recipe for applying armor trims As follows:
Name Type Description
Template Ingredient The smithing template.
Base Ingredient The base item.
Addition Ingredient The additional ingredient.

Ingredient is defined as:

Name Type Description
Count VarInt Number of elements in the following array.
Items Array of Slot Any item in this array may be used for the recipe. The count of each item should be 1.

Serverbound

Bundle Item Selected

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x02

resource:
bundle_item_selected
Play Server Slot of Bundle VarInt
Slot in Bundle VarInt

Client Tick End

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x0B

resource:
client_tick_end
Play Server no fields

Click Container

This packet is sent by the client when the player clicks on a slot in a window.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x0E 0x10

resource:
container_click
Play Server Window ID Unsigned Byte VarInt The ID of the window which was clicked. 0 for player inventory. The server ignores any packets targeting a Window ID other than the current one, including ignoring 0 when any other window is open.
State ID VarInt The last received State ID from either a Set Container Slot or a Set Container Content packet.
Slot Short The clicked slot number, see below.
Button Byte The button used in the click, see below.
Mode VarInt Enum Inventory operation mode, see below.
Length of the array VarInt Maximum value for Notchian server is 128 slots.
Array of changed slots Slot number Array (128) Short
Slot data Slot New data for this slot, in the client's opinion; see below.
Carried item Slot Item carried by the cursor. Has to be empty (item ID = -1) for drop mode, otherwise nothing will happen.

See Inventory for further information about how slots are indexed.

After performing the action, the server compares the results to the slot change information included in the packet, as applied on top of the server's view of the container's state prior to the action. For any slots that do not match, it sends Set Container Slot packets containing the correct results. If State ID does not match the last ID sent by the server, it will instead send a full Set Container Content to resynchronize the client.

When right-clicking on a stack of items, half the stack will be picked up and half left in the slot. If the stack is an odd number, the half left in the slot will be smaller of the amounts.

The distinct type of click performed by the client is determined by the combination of the Mode and Button fields.

Mode Button Slot Trigger
0 0 Normal Left mouse click
1 Normal Right mouse click
0 -999 Left click outside inventory (drop cursor stack)
1 -999 Right click outside inventory (drop cursor single item)
1 0 Normal Shift + left mouse click
1 Normal Shift + right mouse click (identical behavior)
2 0 Normal Number key 1
1 Normal Number key 2
2 Normal Number key 3
8 Normal Number key 9
Button is used as the slot index (impossible in vanilla clients)
40 Normal Offhand swap key F
3 2 Normal Middle click, only defined for creative players in non-player inventories.
4 0 Normal* Drop key (Q) (* Clicked item is always empty)
1 Normal* Control + Drop key (Q) (* Clicked item is always empty)
5 0 -999 Starting left mouse drag
4 -999 Starting right mouse drag
8 -999 Starting middle mouse drag, only defined for creative players in non-player inventories.
1 Normal Add slot for left-mouse drag
5 Normal Add slot for right-mouse drag
9 Normal Add slot for middle-mouse drag, only defined for creative players in non-player inventories.
2 -999 Ending left mouse drag
6 -999 Ending right mouse drag
10 -999 Ending middle mouse drag, only defined for creative players in non-player inventories.
6 0 Normal Double click
1 Normal Pickup all but check items in reverse order (impossible in vanilla clients)

Starting from version 1.5, “painting mode” is available for use in inventory windows. It is done by picking up stack of something (more than 1 item), then holding mouse button (left, right or middle) and dragging held stack over empty (or same type in case of right button) slots. In that case client sends the following to server after mouse button release (omitting first pickup packet which is sent as usual):

  1. packet with mode 5, slot -999, button (0 for left | 4 for right);
  2. packet for every slot painted on, mode is still 5, button (1 | 5);
  3. packet with mode 5, slot -999, button (2 | 6);

If any of the painting packets other than the “progress” ones are sent out of order (for example, a start, some slots, then another start; or a left-click in the middle) the painting status will be reset.

Close Container

This packet is sent by the client when closing a window.

Notchian clients send a Close Window packet with Window ID 0 to close their inventory even though there is never an Open Screen packet for the inventory.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x0F 0x11

resource:
container_close
Play Server Window ID Unsigned Byte VarInt This is the ID of the window that was closed. 0 for player inventory.

Edit Book

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x14 0x16

resource:
edit_book
Play Server Slot VarInt The hotbar slot where the written book is located
Count VarInt Number of elements in the following array. Maximum array size is 200 100.
Entries Array (200 100) of String (8192 1024) Text from each page. Maximum string length is 8192 1024 chars.
Has title Boolean If true, the next field is present. true if book is being signed, false if book is being edited.
Title Optional String (128 32) Title of book.

Set Player Position

Updates the player's XYZ position on the server.

If the player is in a vehicle, the position is ignored (but in case of Set Player Position and Rotation, the rotation is still used as normal). No validation steps other than value range clamping are performed in this case.

If the player is sleeping, the position (or rotation) is not changed, and a Synchronize Player Position is sent if the received position deviated from the server's view by more than a meter.

The Notchian server silently clamps the x and z coordinates between -30,000,000 and 30,000,000, and the y coordinate between -20,000,000 and 20,000,000. A similar condition has historically caused a kick for "Illegal position"; this is no longer the case. However, infinite or NaN coordinates (or angles) still result in a kick for multiplayer.disconnect.invalid_player_movement.

As of 1.20.6, checking for moving too fast is achieved like this (sic):

  • Each server tick, the player's current position is stored.
  • When the player moves, the offset from the stored position to the requested position is computed (Δx, Δy, Δz).
  • The requested movement distance squared is computed as Δx² + Δy² + Δz².
  • The baseline expected movement distance squared is computed based on the player's server-side velocity as Vx² + Vy² + Vz². The player's server-side velocity is a somewhat ill-defined quantity that includes among other things gravity, jump velocity and knockback, but not regular horizontal movement. A proper description would bring much of Minecraft's physics engine with it. It is accessible as the Motion NBT tag on the player entity.
  • The maximum permitted movement distance squared is computed as 100 (300 if the player is using an elytra), multiplied by the number of movement packets received since the last tick, including this one, unless that value is greater than 5, in which case no multiplier is applied.
  • If the requested movement distance squared minus the baseline distance squared is more than the maximum squared, the player is moving too fast.

If the player is moving too fast, it is logged that "<player> moved too quickly! " followed by the change in x, y, and z, and the player is teleported back to their current (before this packet) server-side position.

Checking for block collisions is achieved like this:

  • A temporary collision-checked move of the player is attempted from its current position to the requested one.
  • The offset from the resulting position to the requested position is computed. If the absolute value of the offset on the y axis is less than 0.5, it (only the y component) is rounded down to 0.
  • If the magnitude of the offset is greater than 0.25 and the player isn't in creative or spectator mode, it is logged that "<player> moved wrongly!", and the player is teleported back to their current (before this packet) server-side position.
  • In addition, if the player's hitbox stationary at the requested position would intersect with a block, and they aren't in spectator mode, they are teleported back without a log message.

Checking for illegal flight is achieved like this:

  • When a movement packet is received, a flag indicating whether or not the player is floating mid-air is updated. The flag is set if the move test described above detected no collision below the player and the y component of the offset from the player's current position to the requested one is greater than -0.5, unless any of various conditions permitting flight (creative mode, elytra, levitation effect, etc., but not jumping) are met.
  • Each server tick, it is checked if the flag has been set for more than 80 consecutive ticks. If so, and the player isn't currently sleeping, dead or riding a vehicle, they are kicked for multiplayer.disconnect.flying.
Packet ID State Bound To Field Name Field Type Notes
protocol:
0x1A 0x1C

resource:
move_player_pos
Play Server X Double Absolute position.
Feet Y Double Absolute feet position, normally Head Y - 1.62.
Z Double Absolute position.
On Ground Boolean True if the client is on the ground, false otherwise.
Flags Byte Bit field: 0x01: on ground, 0x02: pushing against wall.

Set Player Position and Rotation

A combination of Move Player Rotation and Move Player Position.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x1B 0x1D

resource:
move_player_pos_rot
Play Server X Double Absolute position.
Feet Y Double Absolute feet position, normally Head Y - 1.62.
Z Double Absolute position.
Yaw Float Absolute rotation on the X Axis, in degrees.
Pitch Float Absolute rotation on the Y Axis, in degrees.
On Ground Boolean True if the client is on the ground, false otherwise.
Flags Byte Bit field: 0x01: on ground, 0x02: pushing against wall.

Set Player Rotation

The unit circle for yaw
The unit circle of yaw, redrawn

Updates the direction the player is looking in.

Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0,-1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.

Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.

The yaw and pitch of player (in degrees), standing at point (x0, y0, z0) and looking towards point (x, y, z) can be calculated with:

dx = x-x0
dy = y-y0
dz = z-z0
r = sqrt( dx*dx + dy*dy + dz*dz )
yaw = -atan2(dx,dz)/PI*180
if yaw < 0 then
    yaw = 360 + yaw
pitch = -arcsin(dy/r)/PI*180

You can get a unit vector from a given yaw/pitch via:

x = -cos(pitch) * sin(yaw)
y = -sin(pitch)
z =  cos(pitch) * cos(yaw)
Packet ID State Bound To Field Name Field Type Notes
protocol:
0x1C 0x1E

resource:
move_player_rot
Play Server Yaw Float Absolute rotation on the X Axis, in degrees.
Pitch Float Absolute rotation on the Y Axis, in degrees.
On Ground Boolean True if the client is on the ground, false otherwise.
Flags Byte Bit field: 0x01: on ground, 0x02: pushing against wall.

Set Player On Ground Movement Flags

This packet as well as Set Player Position, Set Player Rotation, and Set Player Position and Rotation are called the “serverbound movement packets”. Vanilla clients will send Move Player Position once every 20 ticks even for a stationary player.

This packet is used to indicate whether the player is on ground (walking/swimming), or airborne (jumping/falling).

When dropping from sufficient height, fall damage is applied when this state goes from false to true. The amount of damage applied is based on the point where it last changed from true to false. Note that there are several movement related packets containing this state.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x1D 0x1F

resource:
move_player_status_only
Play Server On Ground Boolean True if the client is on the ground, false otherwise.
Flags Byte Bit field: 0x01: on ground, 0x02: pushing against wall.

Place Recipe

This packet is sent when a player clicks a recipe in the crafting book that is craftable (white border).

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x22 0x24

resource:
place_recipe
Play Server Window ID Byte
Recipe ID Identifier VarInt A recipe ID. ID of recipe previously defined in Recipe Book Add.
Make all Boolean Affects the amount of items processed; true if shift is down when clicked.

Player Input

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x26 0x28

resource:
player_input
Play Server Sideways Float Positive to the left of the player.
Forward Float Positive forward.
Flags Unsigned Byte Bit mask. 0x1: jump, 0x2: unmount. ; see below.

The flags are as follows:

Hex Mask Field
0x01 Forward
0x02 Backward
0x04 Left
0x08 Right
0x10 Jump
0x20 Sneak
0x40 Sprint

Set Seen Recipe

Sent when recipe is first seen in recipe book. Replaces Recipe Book Data, type 0.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x29 0x2B

resource:
recipe_book_seen_recipe
Play Server Recipe ID Identifier VarInt ID of recipe previously defined in Recipe Book Add.

Use Item On

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x38 0x3A

resource:
use_item_on
Play Server Hand VarInt Enum The hand from which the block is placed; 0: main hand, 1: off hand.
Location Position Block position.
Face VarInt Enum The face on which the block is placed (as documented at Player Action).
Cursor Position X Float The position of the crosshair on the block, from 0 to 1 increasing from west to east.
Cursor Position Y Float The position of the crosshair on the block, from 0 to 1 increasing from bottom to top.
Cursor Position Z Float The position of the crosshair on the block, from 0 to 1 increasing from north to south.
Inside block Boolean True when the player's head is inside of a block.
World border hit Boolean Seems to always be false, even when interacting with blocks around or outside the world border, or while the player is outside the border.
Sequence VarInt Block change sequence number (see #Acknowledge Block Change).

Upon placing a block, this packet is sent once.

The Cursor Position X/Y/Z fields (also known as in-block coordinates) are calculated using raytracing. The unit corresponds to sixteen pixels in the default resource pack. For example, let's say a slab is being placed against the south face of a full block. The Cursor Position X will be higher if the player was pointing near the right (east) edge of the face, lower if pointing near the left. The Cursor Position Y will be used to determine whether it will appear as a bottom slab (values 0.0–0.5) or as a top slab (values 0.5-1.0). The Cursor Position Z should be 1.0 since the player was looking at the southernmost part of the block.

Inside block is true when a player's head (specifically eyes) are inside of a block's collision. In 1.13 and later versions, collision is rather complicated and individual blocks can have multiple collision boxes. For instance, a ring of vines has a non-colliding hole in the middle. This value is only true when the player is directly in the box. In practice, though, this value is only used by scaffolding to place in front of the player when sneaking inside of it (other blocks will place behind when you intersect with them -- try with glass for instance).