Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
m (→‎Effect: missing change)
(Most 1.21.2 packet changes (with the exception of Update Recipes).)
(588 intermediate revisions by 45 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|1.13, protocol 393]]). 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 8: Line 8:
  
 
=== Data types ===
 
=== Data types ===
 
==== Other definitions ====
 
 
===== Global palette =====
 
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/1.13.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.jar net.minecraft.data.Main --reports</code>.  See [[Data Generators]] for more information.}}
 
 
=== Packets ===
 
  
 
{| class="wikitable"
 
{| class="wikitable"
! ID
 
! Packet name
 
!colspan="2"| Documentation
 
 
  |-
 
  |-
!colspan="4"| Handshaking serverbound
+
! Name
{{PacketList|0x00|Handshake}}
+
  ! Size (bytes)
  |-
+
! Encodes
!colspan="4"| Play clientbound
+
! Notes
{{PacketList|0x04|Spawn Painting}}
+
|- {{added}}
{{PacketList|0x07|Statistics}}
+
! id=Type:Teleport_Flags | {{Type|Teleport Flags}}
{{PacketList|0x09|Update Block Entity}}
+
| 4
{{PacketList|0x0B|Block Change}}
+
| Bit field specifying how a teleportation is to be applied on each axis.
{{PacketList|{{change|0x0F|0x0E}}|Chat Message (clientbound)|pre=unchanged}}
+
| See [[#Teleport Flags]]
{{PacketList|{{change|0x10|0x0F}}|Multi Block Change}}
+
|- {{added}}
{{PacketList|{{change|0x0E|0x10}}|Tab-Complete (clientbound)}}
+
! id=Type:ID_Set | {{Type|ID Set}}
{{PacketList|0x11|Declare Commands|rel=added}}
+
| Varies
{{PacketList|{{change|0x11|0x12}}|Confirm Transaction (clientbound)|pre=unchanged}}
+
| Set of registry IDs specified either inline or as a reference to a tag.
{{PacketList|{{change|0x12|0x13}}|Close Window (clientbound)|pre=unchanged}}
+
  | See [[#ID Set]]
{{PacketList|{{change|0x13|0x14}}|Open Window|pre=unchanged}}
 
{{PacketList|{{change|0x14|0x15}}|Window Items|pre=unchanged}}
 
{{PacketList|{{change|0x15|0x16}}|Window Property|pre=unchanged}}
 
{{PacketList|{{change|0x16|0x17}}|Set Slot|pre=unchanged}}
 
{{PacketList|{{change|0x17|0x18}}|Set Cooldown|pre=unchanged}}
 
{{PacketList|{{change|0x18|0x19}}|Plugin Message (clientbound)}}
 
{{PacketList|{{change|0x19|0x1A}}|Named Sound Effect}}
 
{{PacketList|{{change|0x1A|0x1B}}|Disconnect (play)|pre=unchanged}}
 
{{PacketList|{{change|0x1B|0x1C}}|Entity Status|pre=unchanged}}
 
{{PacketList|0x1D|NBT Query Response|rel=added}}
 
{{PacketList|{{change|0x1C|0x1E}}|Explosion|pre=unchanged}}
 
{{PacketList|{{change|0x1D|0x1F}}|Unload Chunk|pre=unchanged}}
 
{{PacketList|{{change|0x1E|0x20}}|Change Game State|pre=unchanged}}
 
{{PacketList|{{change|0x1F|0x21}}|Keep Alive (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x20|0x22}}|Chunk Data}}
 
{{PacketList|{{change|0x21|0x23}}|Effect}}
 
{{PacketList|{{change|0x22|0x24}}|Spawn Particle}}
 
{{PacketList|{{change|0x23|0x25}}|Join Game|pre=unchanged}}
 
{{PacketList|{{change|0x24|0x26}}|Map}}
 
{{PacketList|{{change|0x25|0x27}}|Entity|pre=unchanged}}
 
{{PacketList|{{change|0x26|0x28}}|Entity Relative Move|pre=unchanged}}
 
{{PacketList|{{change|0x27|0x29}}|Entity Look And Relative Move|pre=unchanged}}
 
{{PacketList|{{change|0x28|0x2A}}|Entity Look|pre=unchanged}}
 
{{PacketList|{{change|0x29|0x2B}}|Vehicle Move (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x2A|0x2C}}|Open Sign Editor|pre=unchanged}}
 
{{PacketList|{{change|0x2B|0x2D}}|Craft Recipe Response}}
 
{{PacketList|{{change|0x2C|0x2E}}|Player Abilities (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x2D|0x2F}}|Combat Event|pre=unchanged}}
 
{{PacketList|{{change|0x2E|0x30}}|Player List Item|pre=unchanged}}
 
{{PacketList|0x31|Face Player|rel=added}}
 
{{PacketList|{{change|0x2F|0x32}}|Player Position And Look (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x30|0x33}}|Use Bed|pre=unchanged}}
 
{{PacketList|{{change|0x31|0x34}}|Unlock Recipes}}
 
{{PacketList|{{change|0x32|0x35}}|Destroy Entities|pre=unchanged}}
 
{{PacketList|{{change|0x33|0x36}}|Remove Entity Effect|pre=unchanged}}
 
{{PacketList|{{change|0x34|0x37}}|Resource Pack Send|pre=unchanged}}
 
{{PacketList|{{change|0x35|0x38}}|Respawn|pre=unchanged}}
 
{{PacketList|{{change|0x36|0x39}}|Entity Head Look|pre=unchanged}}
 
{{PacketList|{{change|0x37|0x3A}}|Select Advancement Tab|pre=unchanged}}
 
{{PacketList|{{change|0x38|0x3B}}|World Border|pre=unchanged}}
 
{{PacketList|{{change|0x39|0x3C}}|Camera|pre=unchanged}}
 
{{PacketList|{{change|0x3A|0x3D}}|Held Item Change (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x3B|0x3E}}|Display Scoreboard|pre=unchanged}}
 
{{PacketList|{{change|0x3C|0x3F}}|Entity Metadata|pre=unchanged}}
 
{{PacketList|{{change|0x3D|0x40}}|Attach Entity|pre=unchanged}}
 
{{PacketList|{{change|0x3E|0x41}}|Entity Velocity|pre=unchanged}}
 
{{PacketList|{{change|0x3F|0x42}}|Entity Equipment|pre=unchanged}}
 
{{PacketList|{{change|0x40|0x43}}|Set Experience|pre=unchanged}}
 
{{PacketList|{{change|0x41|0x44}}|Update Health|pre=unchanged}}
 
{{PacketList|{{change|0x42|0x45}}|Scoreboard Objective}}
 
{{PacketList|{{change|0x43|0x46}}|Set Passengers|pre=unchanged}}
 
{{PacketList|{{change|0x44|0x47}}|Teams}}
 
{{PacketList|{{change|0x45|0x48}}|Update Score|pre=unchanged}}
 
{{PacketList|{{change|0x46|0x49}}|Spawn Position|pre=unchanged}}
 
{{PacketList|{{change|0x47|0x4A}}|Time Update|pre=unchanged}}
 
{{PacketList|{{change|0x48|0x4B}}|Title|pre=unchanged}}
 
{{PacketList|0x4C|Stop Sound|rel=added}}
 
{{PacketList|{{change|0x49|0x4D}}|Sound Effect|pre=unchanged}}
 
{{PacketList|{{change|0x4A|0x4E}}|Player List Header And Footer|pre=unchanged}}
 
{{PacketList|{{change|0x4B|0x4F}}|Collect Item|pre=unchanged}}
 
{{PacketList|{{change|0x4C|0x50}}|Entity Teleport|pre=unchanged}}
 
{{PacketList|{{change|0x4D|0x51}}|Advancements|pre=unchanged}}
 
{{PacketList|{{change|0x4E|0x52}}|Entity Properties|pre=unchanged}}
 
{{PacketList|{{change|0x4F|0x53}}|Entity Effect|pre=unchanged}}
 
{{PacketList|0x54|Declare Recipes|rel=added}}
 
{{PacketList|0x55|Tags|rel=added}}
 
  |-
 
!colspan="4"| Play serverbound
 
{{PacketList|0x01|Query Block NBT|rel=added}}
 
{{PacketList|{{change|0x01|0x05}}|Tab-Complete (serverbound)}}
 
{{PacketList|{{change|0x05|0x06}}|Confirm Transaction (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x06|0x07}}|Enchant Item|pre=unchanged}}
 
{{PacketList|{{change|0x07|0x08}}|Click Window|pre=unchanged}}
 
{{PacketList|{{change|0x08|0x09}}|Close Window (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x09|0x0A}}|Plugin message (serverbound)}}
 
{{PacketList|0x0B|Edit Book|rel=added}}
 
{{PacketList|0x0C|Query Entity NBT|rel=added}}
 
{{PacketList|{{change|0x0A|0x0D}}|Use Entity|pre=unchanged}}
 
{{PacketList|{{change|0x0B|0x0E}}|Keep Alive (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x0C|0x0F}}|Player|pre=unchanged}}
 
{{PacketList|{{change|0x0D|0x10}}|Player Position|pre=unchanged}}
 
{{PacketList|{{change|0x0E|0x11}}|Player Position And Look (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x0F|0x12}}|Player Look|pre=unchanged}}
 
{{PacketList|{{change|0x10|0x13}}|Vehicle Move (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x11|0x14}}|Steer Boat|pre=unchanged}}
 
{{PacketList|0x15|Pick Item|rel=added}}
 
{{PacketList|{{change|0x12|0x16}}|Craft Recipe Request}}
 
{{PacketList|{{change|0x13|0x17}}|Player Abilities (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x14|0x18}}|Player Digging|pre=unchanged}}
 
{{PacketList|{{change|0x15|0x19}}|Entity Action|pre=unchanged}}
 
{{PacketList|{{change|0x16|0x1A}}|Steer Vehicle|pre=unchanged}}
 
{{PacketList|{{change|0x17|0x1B}}|Recipe Book Data}}
 
{{PacketList|0x1C|Name Item|rel=added}}
 
{{PacketList|{{change|0x18|0x1D}}|Resource Pack Status|pre=unchanged}}
 
{{PacketList|{{change|0x19|0x1E}}|Advancement Tab|pre=unchanged}}
 
{{PacketList|0x1F|Select Trade|rel=added}}
 
{{PacketList|0x20|Set Beacon Effect|rel=added}}
 
{{PacketList|{{change|0x1A|0x21}}|Held Item Change (serverbound)|pre=unchanged}}
 
{{PacketList|0x22|Update Command Block|rel=added}}
 
{{PacketList|0x23|Update Command Block Minecart|rel=added}}
 
{{PacketList|{{change|0x1B|0x24}}|Creative Inventory Action|pre=unchanged}}
 
{{PacketList|0x25|Update Structure Block|rel=added}}
 
{{PacketList|{{change|0x1C|0x26}}|Update Sign|pre=unchanged}}
 
{{PacketList|{{change|0x1D|0x27}}|Animation (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x1E|0x28}}|Spectate|pre=unchanged}}
 
{{PacketList|{{change|0x1F|0x29}}|Player Block Placement|pre=unchanged}}
 
{{PacketList|{{change|0x20|0x2A}}|Use Item|pre=unchanged}}
 
|-
 
!colspan="5"| Login clientbound
 
{{PacketList|0x04|Login Plugin Request|rel=added}}
 
|-
 
!colspan="3"| Login serverbound
 
{{PacketList|0x02|Login Plugin Response|rel=added}}
 
 
  |}
 
  |}
  
== New/modified data types ==
+
==== Teleport Flags ====
  
=== [[Slot]] ===
+
A bit field represented as an {{Type|Int}}, specifying how a teleportation is to be applied on each axis.
  
{| class="wikitable"
+
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.
! Name
 
! Type
 
! Meaning
 
|-
 
| {{Change|Block ID|Item ID}}
 
| Short
 
| 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.}}
 
|-
 
| Item Count
 
| Optional Byte
 
| Not present if Block ID is <code>-1</code>.
 
|- {{Removed}}
 
| Item Damage
 
| Optional Short
 
| Not present if Block ID is <code>-1</code>.
 
|-
 
| NBT
 
| Optional NBT
 
| 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:
 
|}
 
 
 
=== Particle ===
 
 
 
{| class="wikitable"
 
! Field Name
 
! Field Type
 
! Meaning
 
|-
 
| ID
 
| VarInt
 
| The ID of the particle type, see below.
 
|-
 
| Data
 
| Varies
 
| Varies based on the particle type, see below.
 
|}
 
  
 
{| class="wikitable"
 
{| class="wikitable"
 
  |-
 
  |-
  ! Particle Name
+
  ! Hex Mask
  ! Particle ID
+
  ! Field
! Data
 
|-
 
| <code>minecraft:ambient_entity_effect</code>
 
| 0
 
| None
 
|-
 
| <code>minecraft:angry_villager</code>
 
| 1
 
| None
 
|-
 
| <code>minecraft:barrier</code>
 
| 2
 
| None
 
|-
 
| <code>minecraft:block</code>
 
| 3
 
|
 
{| class="wikitable"
 
  ! Field Name
 
  ! Field Type
 
  ! Meaning
 
  |-
 
  | BlockState
 
  | VarInt
 
  | The ID of the block state.
 
  |}
 
|-
 
| <code>minecraft:bubble</code>
 
| 4
 
| None
 
|-
 
| <code>minecraft:cloud</code>
 
| 5
 
| None
 
|-
 
| <code>minecraft:crit</code>
 
| 6
 
| None
 
|-
 
| <code>minecraft:damage_indicator</code>
 
| 7
 
| None
 
|-
 
| <code>minecraft:dragon_breath</code>
 
| 8
 
| None
 
|-
 
| <code>minecraft:dripping_lava</code>
 
| 9
 
| None
 
 
  |-
 
  |-
  | <code>minecraft:dripping_water</code>
+
  | 0x0001
  | 10
+
  | Relative X
| None
 
|-
 
| <code>minecraft:dust</code>
 
| 11
 
|
 
{| class="wikitable"
 
  ! Field Name
 
  ! Field Type
 
  ! Meaning
 
  |-
 
  | Red
 
  | Float
 
  | Red value, 0-1
 
  |-
 
  | Green
 
  | Float
 
  | Green value, 0-1
 
  |-
 
  | Blue
 
  | Float
 
  | Blue value, 0-1
 
  |-
 
  | Scale
 
  | Float
 
  | The scale, will be clamped between 0.01 and 4.
 
  |}
 
 
  |-
 
  |-
  | <code>minecraft:effect</code>
+
  | 0x0002
  | 12
+
  | Relative Y
| None
 
 
  |-
 
  |-
  | <code>minecraft:elder_guardian</code>
+
  | 0x0004
  | 13
+
  | Relative Z
| None
 
 
  |-
 
  |-
  | <code>minecraft:enchanted_hit</code>
+
  | 0x0008
  | 14
+
  | Relative Yaw
| None
 
 
  |-
 
  |-
  | <code>minecraft:enchant</code>
+
  | 0x0010
  | 15
+
  | Relative Pitch
| None
+
  |- {{added}}
  |-
+
  | 0x0020
  | <code>minecraft:end_rod</code>
+
  | Relative Velocity X
  | 16
+
  |- {{added}}
| None
+
  | 0x0040
  |-
+
  | Relative Velocity Y
  | <code>minecraft:entity_effect</code>
+
  |- {{added}}
  | 17
+
  | 0x0080
| None
+
  | Relative Velocity Z
  |-
+
  |- {{added}}
  | <code>minecraft:explosion_emitter</code>
+
  | 0x0100
| 18
+
  | 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.
  | None
 
  |-
 
  | <code>minecraft:explosion</code>
 
  | 19
 
| None
 
|-
 
| <code>minecraft:falling_dust</code>
 
| 20
 
|
 
{| class="wikitable"
 
  ! Field Name
 
  ! Field Type
 
  ! Meaning
 
  |-
 
  | BlockState
 
  | VarInt
 
  | The ID of the block state.
 
  |}
 
|-
 
| <code>minecraft:firework</code>
 
| 21
 
| None
 
|-
 
| <code>minecraft:fishing</code>
 
| 22
 
| 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"
 
  ! Field Name
 
  ! Field Type
 
  ! Meaning
 
  |-
 
  | Item
 
  | [[Slot]]
 
  | The item that will be used.
 
  |}
 
|-
 
| <code>minecraft:item_slime</code>
 
| 28
 
| None
 
|-
 
| <code>minecraft:item_snowball</code>
 
| 29
 
| None
 
|-
 
| <code>minecraft:large_smoke</code>
 
| 30
 
| None
 
|-
 
| <code>minecraft:lava</code>
 
| 31
 
| None
 
|-
 
| <code>minecraft:mycelium</code>
 
| 32
 
| None
 
|-
 
| <code>minecraft:note</code>
 
| 33
 
| None
 
|-
 
| <code>minecraft:poof</code>
 
| 34
 
| None
 
|-
 
| <code>minecraft:portal</code>
 
| 35
 
| None
 
|-
 
| <code>minecraft:rain</code>
 
| 36
 
| None
 
|-
 
| <code>minecraft:smoke</code>
 
| 37
 
| None
 
|-
 
| <code>minecraft:spit</code>
 
| 38
 
| None
 
|-
 
| <code>minecraft:squid_ink</code>
 
| 39
 
| None
 
|-
 
| <code>minecraft:sweep_attack</code>
 
| 40
 
| None
 
|-
 
| <code>minecraft:totem_of_undying</code>
 
| 41
 
| None
 
|-
 
| <code>minecraft:underwater</code>
 
| 42
 
| None
 
|-
 
| <code>minecraft:splash</code>
 
| 43
 
| None
 
|-
 
| <code>minecraft:witch</code>
 
| 44
 
| None
 
|-
 
| <code>minecraft:bubble_pop</code>
 
| 45
 
| None
 
|-
 
| <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
 
 
  |}
 
  |}
  
=== [[Chat]] ===
+
==== ID Set ====
 
 
==== Selector component ====
 
 
 
Displays the results of an entity selector.  '''Should not be sent to clients'''; only intended for commands and client-to-server actions.  If the component contains a <code>selector</code> key, then it is a selector component.
 
  
The server resolves the list selector into a list of entities, each with an appropriate hover event, {{change|and joined with commas and "and" (but it lacks a [[wikipedia:serial comma|serial comma]])|joined with commas between each entry, without an "and"}}.
+
Represents a set of IDs in a certain registry (implied by context), either directly (enumerated IDs) or indirectly (tag name).
  
== Entity Metadata Format ==
+
{| class="wikitable" {{added}}
 
 
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"
 
 
  ! Name
 
  ! Name
 
  ! Type
 
  ! Type
  ! Meaning
+
  ! Description
|-
 
| Index
 
| Unsigned Byte
 
| 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.
 
 
  |-
 
  |-
 
  | Type
 
  | Type
  | Optional Byte Enum
+
  | {{Type|VarInt}}
| Only if Index is not <code>0xff</code>; the type of the index, see the table below
+
  | Identifier used to determine the data that follows. It can be either:
|-
+
* 0 - Represents a named set of IDs defined by a tag.
| Value
+
* Anything else - Represents an ad-hoc set of IDs enumerated inline.
| Optional ''value of Type''
 
| Only if Index is not <code>0xff</code>: the value of the metadata field
 
|}
 
 
 
{| class="wikitable"
 
! Value of Type field
 
! [[Data types|Type]] of Value field
 
! Notes
 
|-
 
| 0
 
| Byte
 
|
 
|-
 
| 1
 
| VarInt
 
|
 
|-
 
| 2
 
| Float
 
|
 
|-
 
| 3
 
| String
 
|
 
|-
 
| 4
 
| [[Chat]]
 
|
 
|- {{Added}}
 
  | 5
 
| OptChat (Boolean + Optional [[Chat]])
 
| [[Chat]] is present if the Boolean is set to true
 
|-
 
| {{change|5|6}}
 
| [[Slot]]
 
|
 
|-
 
| {{change|6|7}}
 
| Boolean
 
|
 
|-
 
| {{change|7|8}}
 
| Rotation
 
| 3 floats: rotation on x, rotation on y, rotation on z
 
|-
 
| {{change|8|9}}
 
| [[Data Types#Position|Position]]
 
|
 
|-
 
| {{change|9|10}}
 
| OptPosition (Boolean + Optional Position)
 
| Position is present if the Boolean is set to true
 
|-
 
| {{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}}
+
| Tag Name
  | OptBlockID (VarInt)
+
  | {{Type|Optional}} {{Type|Identifier}}
| 0 for absent, otherwise index into the global palette. (Air is treated as absent)
+
  | The registry tag defining the ID set. Only present if Type is 0.
 
  |-
 
  |-
  | {{change|13|14}}
+
| IDs
| [[NBT|NBT Tag]]
+
  | {{Type|Optional}} {{Type|Array}} of {{Type|VarInt}}
|
+
  | An array of registry IDs. Only present if Type is not 0.<br>The size of the array is equal to <code>Type - 1</code>.
|- {{Added}}
 
  | 15
 
| [[#Particle]]
 
|
 
 
  |}
 
  |}
  
=== Entity ===
+
=== Packets ===
 
 
The base class.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Index
+
  ! ID
  ! Type
+
  ! Packet name
  !style="width: 250px;" colspan="2"| Meaning
+
  !colspan="2"| Documentation
! Default
 
|-
 
|rowspan="9"| 0
 
|rowspan="9"| Byte
 
! Bit mask
 
! Meaning
 
|rowspan="9"| 0
 
 
  |-
 
  |-
  | 0x01
+
  !colspan="4"| Play clientbound
  | On Fire
+
  {{PacketList|0x12|Close Container}}
 +
{{PacketList|0x13|Set Container Content}}
 +
{{PacketList|0x14|Set Container Property}}
 +
{{PacketList|0x15|Set Container Slot}}
 +
{{PacketList|0x17|Set Cooldown}}
 +
{{PacketList|0x20|Synchronize Entity Position|rel=added}}
 +
{{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|{{change|0x70|0x77}}|Teleport Entity}}
 
  |-
 
  |-
  | 0x02
+
  !colspan="4"| Play serverbound
  | Crouched
+
  {{PacketList|0x02|Bundle Item Selected|rel=added}}
|-
+
  {{PacketList|0x0b|Client Tick End|rel=added}}
| 0x04
+
  {{PacketList|{{change|0x0E|0x10}}|Click Container}}
  | Unused (previously riding)
+
  {{PacketList|{{change|0x0F|0x11}}|Close Container}}
|-
+
  {{PacketList|{{change|0x14|0x16}}|Edit Book}}
| 0x08
+
  {{PacketList|{{change|0x1A|0x1C}}|Set Player Position}}
  | Sprinting
+
  {{PacketList|{{change|0x1B|0x1D}}|Set Player Position and Rotation}}
|-
+
  {{PacketList|{{change|0x1C|0x1E}}|Set Player Rotation}}
| 0x10
+
  {{PacketList|0x1D|Set Player On Ground|pre=removed}}
| Unused (previously eating/drinking/blocking; use hand state now)
+
  {{PacketList|0x1F|Set Player Movement Flags|rel=added}}
  |-
+
  {{PacketList|{{change|0x22|0x24}}|Place Recipe}}
| 0x20
+
  {{PacketList|{{change|0x26|0x28}}|Player Input}}
| Invisible
+
  {{PacketList|{{change|0x29|0x2B}}|Set Seen Recipe}}
|-
 
  | 0x40
 
| Glowing effect
 
|-
 
| 0x80
 
  | Flying with {{Minecraft Wiki|elytra}}
 
|-
 
  | 1
 
| VarInt
 
|colspan="2"| Air
 
| 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 ===
+
== Handshake ==
  
Extends [[#Entity|Entity]].
+
No changes so far.
  
{| class="wikitable"
+
== Status ==
! Index
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
|-
 
| 6
 
| Float
 
|colspan="2"| Radius
 
| 0.5
 
|-
 
| 7
 
| VarInt
 
|colspan="2"| Color (only for mob spell particle)
 
| 0
 
|-
 
| 8
 
| Boolean
 
|colspan="2"| Ignore radius and show effect as single point, not area
 
| false
 
|- {{Added}}
 
| 9
 
| Particle
 
| colspan="2"| The [[#Particle]]
 
| <code>effect</code>
 
|- {{Removed}}
 
| 9
 
| VarInt
 
|colspan="2"| Particle ID
 
| 15 (mobSpell)
 
|- {{Removed}}
 
| 10
 
| VarInt
 
|colspan="2"| Particle parameter 1
 
| 0
 
|- {{Removed}}
 
| 11
 
| VarInt
 
|colspan="2"| Particle parameter 2
 
| 0
 
|}
 
  
=== Trident ===
+
No changes so far.
  
Extends [[#Arrow|Arrow]].
+
== Login ==
  
{| class="wikitable" {{Added}}
+
No changes so far.
! Index
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
|-
 
| 7
 
| VarInt
 
|colspan="2"| Loyalty level (enchantment)
 
| 0
 
|}
 
  
=== Boat ===
+
== Configuration ==
  
Extends [[#Entity|Entity]].
+
No changes so far.
  
{| class="wikitable"
+
== Play ==
! Index
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
|-
 
| 6
 
| VarInt
 
|colspan="2"| Time since last hit
 
| 0
 
|-
 
| 7
 
| VarInt
 
|colspan="2"| Forward direction
 
| 1
 
|-
 
| 8
 
| Float
 
|colspan="2"| Damage taken
 
| 0.0
 
|-
 
| 9
 
| VarInt
 
|colspan="2"| Type (0=oak, 1=spruce, 2=birch, 3=jungle, 4=acacia, 5=dark oak)
 
| 0
 
|-
 
| 10
 
| Boolean
 
|colspan="2"| Right paddle turning
 
| false
 
|-
 
| 11
 
| Boolean
 
|colspan="2"| Left paddle turning
 
| false
 
|- {{Added}}
 
| 12
 
| VarInt
 
|colspan="2"| Splash timer (?)
 
| 0
 
|}
 
  
=== Phantom ===
+
=== Clientbound ===
  
Extends [[#Flying|Flying]].
+
==== Close Container ====
  
{| class="wikitable" {{Added}}
+
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.
! Index
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
|-
 
| 12
 
| VarInt
 
|colspan="2"| Size
 
| 0
 
|}
 
  
Hitbox size is determined by horizontal=0.9 + 0.2*size and vertical=0.5 + 0.1 * i
+
{| class="wikitable"
 
+
  ! Packet ID
=== Dolphin ===
+
  ! State
 
+
  ! Bound To
Extends [[#Creature|Creature]].
+
  ! Field Name
 
+
  ! Field Type
No additional metadata.
 
 
 
=== WaterMob ===
 
 
 
Extends {{Change|[[#Insentient|Insentient]]|[[#Creature|Creature]]}}.
 
 
 
No additional metadata.
 
 
 
=== Abstract fish ===
 
 
 
Extends [[#WaterMob|WaterMob]].
 
 
 
{| class="wikitable" {{Added}}
 
! Index
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
|-
 
| 12
 
| Boolean
 
|colspan="2"| From bucket
 
| False
 
|}
 
 
 
=== Cod ===
 
 
 
Extends [[#AbstractFish|AbstractFish]].
 
 
 
No additional metadata.
 
 
 
=== Puffer fish ===
 
 
 
Extends [[#AbstractFish|AbstractFish]].
 
 
 
{| class="wikitable" {{Added}}
 
! Index
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
|-
 
| 13
 
| VarInt
 
|colspan="2"| PuffState (varies from 0 to 2)
 
| 0
 
|}
 
 
 
=== Salmon ===
 
 
 
Extends [[#AbstractFish|AbstractFish]].
 
 
 
No additional metadata.
 
 
 
=== Tropical fish ===
 
 
 
Extends [[#AbstractFish|AbstractFish]].
 
 
 
{| class="wikitable" {{Added}}
 
  ! Index
 
  ! Type
 
  !style="width: 250px;" colspan="2"| Meaning
 
! Default
 
|-
 
| 13
 
| VarInt
 
|colspan="2"| Variant
 
| 0
 
|}
 
 
 
=== Turtle ===
 
 
 
Extends [[#Animal|Animal]].
 
 
 
{| class="wikitable" {{Added}}
 
! Index
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
|-
 
| 13
 
| BlockPos
 
|colspan="2"| Home pos
 
| (0, 0, 0)
 
|-
 
| 14
 
| Boolean
 
|colspan="2"| Has egg
 
| false
 
|-
 
| 15
 
| Boolean
 
|colspan="2"| Laying egg (?)
 
| false
 
|-
 
| 16
 
| BlockPos
 
|colspan="2"| Travel pos
 
| (0, 0, 0)
 
|-
 
| 17
 
| Boolean
 
|colspan="2"| Going home
 
| false
 
|-
 
| 18
 
| Boolean
 
|colspan="2"| Traveling
 
| false
 
|}
 
 
 
=== Drowned ===
 
 
 
Extends [[#Drowned|Drowned]].
 
 
 
{| class="wikitable" {{Added}}
 
! Index
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
|-
 
| 15
 
| Boolean
 
|colspan="2"| Has target (?)
 
| false
 
|}
 
 
 
== Block Actions ==
 
 
 
No changes so far.
 
 
 
== Plugin Channels ==
 
 
 
All clientbound channels have been renamed to be namespaced identifiers.
 
 
 
=== <code>minecraft:register</code> ===
 
 
 
Formerly <code>REGISTER</code>.
 
 
 
=== <code>minecraft:unregister</code> ===
 
 
 
Formerly <code>UNREGISTER</code>.
 
 
 
=== <code>minecraft:brand</code> ===
 
 
 
Formerly <code>MC|Brand</code>.
 
 
 
=== <code>minecraft:book_open</code> ===
 
 
 
Formerly <code>MC|BOpen</code>.
 
 
 
=== <code>minecraft:trader_list</code> ===
 
 
 
Formerly <code>MC|TrList</code>.
 
 
 
=== <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" {{Removed}}
 
  ! Field name
 
  ! Field type
 
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  | Sound category
+
  | 0x12
  | String
+
  | 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.
+
  | Client
  |-
+
  | Window ID
  | Sound name
+
  | {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
| String
+
  | This is the ID of the window that was closed. 0 for inventory.
  | A [http://pokechu22.github.io/Burger/1.13.html#sounds sound effect name].  If left empty, ''all'' sounds are stopped.
 
 
  |}
 
  |}
  
{{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.}}
+
==== Set Container Content ====
 +
[[File:Inventory-slots.png|thumb|The inventory slots]]
  
{{Change||This plugin channel has been replaced by the [[#Stop sound|stop sound]] packet.}}
+
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]]).
  
=== <code>minecraft:debug/paths</code> ===
+
{| class="wikitable"
 
+
  ! Packet ID
Formerly <code>MC|DebugPath</code>.
+
! State
 
+
! Bound To
=== <code>minecraft:debug/neighbors_update</code> ===
+
! Field Name
 
+
  ! Field Type
Formerly <code>MC|DebugNeighborsUpdate</code>.
 
 
 
=== <code>minecraft:debug/caves</code> ===
 
 
 
Never sent, but (presumably) used to debug caves.  Does not render without modifying the client.
 
 
 
{| class="wikitable" {{Added}}
 
  !colspan="2"| Field name
 
  !colspan="2"| Field type
 
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |colspan="2"| Unknown 1
+
  | rowspan="5"| 0x13
  |colspan="2"| Position
+
  | rowspan="5"| Play
  |
+
  | rowspan="5"| Client
 +
| 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.)
 
  |-
 
  |-
  |colspan="2"| Count
+
  | State ID
  |colspan="2"| Int
+
  | {{Type|VarInt}}
  | Number of elements in the following array
+
  | A server-managed sequence number used to avoid desynchronization; see [[#Click Container]].
 
  |-
 
  |-
  |rowspan="2"| Data
+
  | Count
  | Unknown 2
+
  | {{Type|VarInt}}
|rowspan="2"| Array
+
  | Number of elements in the following array.
| Position
 
|
 
|-
 
| Unknown 3
 
| Float
 
|
 
|}
 
 
 
=== <code>minecraft:debug/structures</code> ===
 
 
 
Never sent, but (presumably) used to debug structures.  Does not render without modifying the client.
 
 
 
{| class="wikitable" {{Added}}
 
!colspan="2"| Field name
 
!colspan="2"| Field type
 
! Notes
 
|-
 
|colspan="2"| Unknown 1
 
|colspan="2"| Int
 
|
 
|-
 
|colspan="2"| Bounding box minX
 
|colspan="2"| Int
 
|rowspan="6"| min must be less than max
 
|-
 
|colspan="2"| Bounding box minY
 
|colspan="2"| Int
 
|-
 
|colspan="2"| Bounding box minZ
 
|colspan="2"| Int
 
|-
 
|colspan="2"| Bounding box maxX
 
|colspan="2"| Int
 
|-
 
|colspan="2"| Bounding box maxY
 
|colspan="2"| Int
 
|-
 
|colspan="2"| Bounding box maxZ
 
|colspan="2"| Int
 
|-
 
|colspan="2"| Count
 
|colspan="2"| Int
 
  | Number of elements in the following array
 
 
  |-
 
  |-
  |rowspan="7"| Unknown
+
  | Slot Data
  | Bounding box minX
+
  | {{Type|Array}} of [[Slot Data|Slot]]
|rowspan="7"| Array
 
| Int
 
|rowspan="6"| min must be less than max
 
 
  |-
 
  |-
  | Bounding box minY
+
  | Carried Item
  | Int
+
  | {{Type|Slot}}
|-
+
  | Item being dragged with the mouse.
| Bounding box minZ
 
| Int
 
|-
 
| Bounding box maxX
 
| Int
 
|-
 
| Bounding box maxY
 
| Int
 
|-
 
| Bounding box maxZ
 
| Int
 
|-
 
| Unknown
 
| Boolean
 
  |
 
 
  |}
 
  |}
  
=== <code>minecraft:debug/worldgen_attempt</code> ===
+
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.
  
Never sent, but (presumably) used to debug something with world generation.  Does not render without modifying the client.
+
==== Set Container Property ====
  
{{warning|This channel is invalid, as its name is longer than the max length (23 > 20).}}
+
This packet is used to inform the client that part of a GUI window should be updated.
 
 
{| class="wikitable" {{Added}}
 
! Field name
 
! Field type
 
! Notes
 
|-
 
| Unknown 1
 
| Position
 
|
 
|-
 
| Unknown 2
 
| Float
 
|
 
|-
 
| Unknown 3
 
| Float
 
|
 
|-
 
| Unknown 4
 
| Float
 
|
 
|-
 
| Unknown 5
 
| Float
 
|
 
|-
 
| Unknown 6
 
| Float
 
|
 
|}
 
 
 
=== <code>MC|BEdit</code> ===
 
 
 
{{Change|''Client to server''|Removed and replaced with [[#Edit Book|Edit Book]].}}
 
 
 
=== <code>MC|BSign</code> ===
 
 
 
{{Change|''Client to server''|Removed and replaced with [[#Edit Book|Edit Book]].}}
 
 
 
=== <code>MC|TrSel</code> ===
 
 
 
{{Change|''Client to server''|Removed and replaced with [[#Select Trade|Select Trade]].}}
 
 
 
=== <code>MC|AdvCmd</code> ===
 
 
 
{{Change|''Client to server''|Removed and replaced with [[#Update Command Block Minecart|Update Command Block Minecart]] (legacy usage may also require [[#Update Command Block|Update Command Block]]).}}
 
 
 
=== <code>MC|AutoCmd</code> ===
 
 
 
{{Change|''Client to server''|Removed and replaced with [[#Update Command Block|Update Command Block]].}}
 
 
 
=== <code>MC|Beacon</code> ===
 
 
 
{{Change|''Client to server''|Removed and replaced with [[#Set Beacon Effect|Set Beacon Effect]].}}
 
 
 
=== <code>MC|ItemName</code> ===
 
 
 
{{Change|''Client to server''|Removed and replaced with [[#Name Item|Name Item]].}}
 
 
 
=== <code>MC|Struct</code> ===
 
 
 
{{Change|''Client to server''|Removed and replaced with [[#Update Structure Block|Update Structure Block]].}}
 
 
 
=== <code>MC|PickItem</code> ===
 
 
 
{{Change|''Client to server''|Removed and replaced with [[#Pick Item|Pick Item]].}}
 
 
 
=== Community plugin channels ===
 
 
 
==== <code>BungeeCord</code> ====
 
 
 
Renamed to <code>bungeecord:main</code>.
 
 
 
==== <code>WDL|INIT</code>, <code>WDL|CONTROL</code>, <code>WDL|REQUEST</code> ====
 
 
 
Renamed to <code>wdl:init</code>, <code>wdl:control</code>, and <code>wdl:request</code> respectively.
 
 
 
== Play ==
 
 
 
=== Clientbound ===
 
 
 
==== Spawn Painting ====
 
 
 
This packet shows location, name, and type of painting.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,120: Line 230:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| 0x04
+
  | rowspan="3"| 0x14
  |rowspan="5"| Play
+
  | rowspan="3"| Play
  |rowspan="5"| Client
+
  | rowspan="3"| Client
  | Entity ID
+
  | Window ID
  | VarInt
+
  | {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
  |  
+
  |
 
  |-
 
  |-
  | Entity UUID
+
  | Property
  | UUID
+
  | {{Type|Short}}
  |  
+
  | The property to be updated, see below.
 
  |-
 
  |-
  | Motive
+
  | Value
  | {{Change|String (13)|VarInt}}
+
  | {{Type|Short}}
  | {{Change|Name of the painting. Max length 13|Panting's ID, see below}}
+
  | The new value for the property, see below.
|-
 
| Location
 
| Position
 
| Center coordinates (see below)
 
|-
 
| Direction
 
| Byte Enum
 
| Direction the painting faces (North = 2, South = 0, West = 1, East = 3)
 
 
  |}
 
  |}
  
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.
+
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.
 
 
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"
 
{| class="wikitable"
! Name
 
!{{Added}}| ID
 
! x
 
! y
 
! width
 
! height
 
 
  |-
 
  |-
  | {{Change|<code>Kebab</code>|<code>minecraft:kebab</code>}}
+
  ! Window type
  | 0
+
  ! Property
  | 0
+
  ! Value
| 0
 
| 16
 
| 16
 
 
  |-
 
  |-
  | {{Change|<code>Aztec</code>|<code>minecraft:aztec</code>}}
+
  | rowspan="4"| Furnace
  | 1
+
  | 0: Fire icon (fuel left)
| 16
+
  | counting from fuel burn time down to 0 (in-game ticks)
  | 0
 
| 16
 
| 16
 
 
  |-
 
  |-
  | {{change|<code>Alban</code>|<code>minecraft:alban</code>}}
+
  | 1: Maximum fuel burn time
| 2
+
  | fuel burn time or 0 (in-game ticks)
| 32
 
  | 0
 
| 16
 
| 16
 
 
  |-
 
  |-
  | {{change|<code>Aztec2</code>|<code>minecraft:aztec2</code>}}
+
  | 2: Progress arrow
| 3
+
  | counting from 0 to maximum progress (in-game ticks)
| 48
 
  | 0
 
| 16
 
| 16
 
 
  |-
 
  |-
  | {{change|<code>Bomb</code>|<code>minecraft:bomb</code>}}
+
  | 3: Maximum progress
| 4
+
  | always 200 on the notchian server
| 64
 
| 0
 
| 16
 
  | 16
 
 
  |-
 
  |-
  | {{change|<code>Plant</code>|<code>minecraft:plant</code>}}
+
  | rowspan="10"| Enchantment Table
| 5
+
  | 0: Level requirement for top enchantment slot
| 80
+
  | rowspan="3"| The enchantment's xp level requirement
  | 0
 
  | 16
 
| 16
 
 
  |-
 
  |-
  | {{change|<code>Wasteland</code>|<code>minecraft:wasteland</code>}}
+
  | 1: Level requirement for middle enchantment slot
| 6
 
| 96
 
| 0
 
| 16
 
| 16
 
 
  |-
 
  |-
  | {{change|<code>Pool</code>|<code>minecraft:pool</code>}}
+
  | 2: Level requirement for bottom enchantment slot
| 7
 
| 0
 
| 32
 
| 32
 
| 16
 
 
  |-
 
  |-
  | {{change|<code>Courbet</code>|<code>minecraft:courbet</code>}}
+
  | 3: The enchantment seed
| 8
+
| 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>).
| 32
 
| 32
 
| 32
 
| 16
 
 
  |-
 
  |-
  | {{change|<code>Sea</code>|<code>minecraft:sea</code>}}
+
  | 4: Enchantment ID shown on mouse hover over top enchantment slot
  | 9
+
  | rowspan="3"| The enchantment id (set to -1 to hide it), see below for values
| 64
 
| 32
 
| 32
 
| 16
 
 
  |-
 
  |-
  | {{change|<code>Sunset</code>|<code>minecraft:sunset</code>}}
+
  | 5: Enchantment ID shown on mouse hover over middle enchantment slot
| 10
 
| 96
 
| 32
 
| 32
 
| 16
 
 
  |-
 
  |-
  | {{change|<code>Creebet</code>|<code>minecraft:creebet</code>}}
+
  | 6: Enchantment ID shown on mouse hover over bottom enchantment slot
| 11
 
| 128
 
| 32
 
| 32
 
| 16
 
 
  |-
 
  |-
  | {{change|<code>Wanderer</code>|<code>minecraft:wanderer</code>}}
+
  | 7: Enchantment level shown on mouse hover over the top slot
  | 12
+
  | rowspan="3"| The enchantment level (1 = I, 2 = II, 6 = VI, etc.), or -1 if no enchant
| 0
 
| 64
 
| 16
 
| 32
 
 
  |-
 
  |-
  | {{change|<code>Graham</code>|<code>minecraft:graham</code>}}
+
  | 8: Enchantment level shown on mouse hover over the middle slot
| 13
 
| 16
 
| 64
 
| 16
 
| 32
 
|-
 
| {{change|<code>Match</code>|<code>minecraft:match</code>}}
 
| 14
 
| 0
 
| 128
 
| 32
 
| 32
 
 
  |-
 
  |-
  | {{change|<code>Bust</code>|<code>minecraft:bust</code>}}
+
  | 9: Enchantment level shown on mouse hover over the bottom slot
| 15
 
| 32
 
| 128
 
| 32
 
| 32
 
|-
 
| {{change|<code>Stage</code>|<code>minecraft:stage</code>}}
 
| 16
 
| 64
 
| 128
 
| 32
 
| 32
 
|-
 
| {{change|<code>Void</code>|<code>minecraft:void</code>}}
 
| 17
 
| 96
 
| 128
 
| 32
 
| 32
 
|-
 
| {{change|<code>SkullAndRoses</code>|<code>skull_and_roses</code>}}
 
| 18
 
| 128
 
| 128
 
| 32
 
| 32
 
|-
 
| {{change|<code>Wither</code>|<code>minecraft:wither</code>}}
 
| 19
 
| 160
 
| 128
 
| 32
 
| 32
 
|-
 
| {{change|<code>Fighters</code>|<code>minecraft:fighters</code>}}
 
| 20
 
| 0
 
| 96
 
| 64
 
| 32
 
|-
 
| {{change|<code>Pointer</code>|<code>minecraft:pointer</code>}}
 
| 21
 
| 0
 
| 192
 
| 64
 
| 64
 
|-
 
| {{change|<code>Pigscene</code>|<code>minecraft:pigscene</code>}}
 
| 22
 
| 64
 
| 192
 
| 64
 
| 64
 
|-
 
| {{change|<code>BurningSkull</code>|<code>minecraft:burning_skull</code>}}
 
| 23
 
| 128
 
| 192
 
| 64
 
| 64
 
|-
 
| {{change|<code>Skeleton</code>|<code>minecraft:skeleton</code>}}
 
| 24
 
| 192
 
| 64
 
| 64
 
| 48
 
|-
 
| {{change|<code>DonkeyKong</code>|<code>minecraft:donkey_kong</code>}}
 
| 25
 
| 192
 
| 112
 
| 64
 
| 48
 
|}
 
 
 
The {{Minecraft Wiki|Painting#Canvases|Minecraft Wiki article on paintings}} also provides a list of painting names to the actual images.
 
 
 
==== Statistics ====
 
 
 
Sent as a response to [[#Client_Status|Client Status]] (id 1).
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
!colspan="2"| Field Name
 
!colspan="2"| Field Type
 
! Notes
 
|-
 
|rowspan="6"| 0x07
 
|rowspan="6"| Play
 
|rowspan="6"| Client
 
|colspan="2"| Count
 
|colspan="2"| VarInt
 
| Number of elements in the following array
 
|-
 
|rowspan="4"| Statistic
 
|{{Removed}}| Name
 
|rowspan="4"| Array
 
|{{Removed}}| String (32767)
 
|{{Removed}}| [https://gist.github.com/Alvin-LB/8d0d13db00b3c00fd0e822a562025eff https://gist.github.com/Alvin-LB/8d0d13db00b3c00fd0e822a562025eff]
 
|- {{Added}}
 
| Category ID
 
| VarInt
 
| See below
 
|- {{Added}}
 
| Statistic ID
 
| VarInt
 
| See below
 
|-
 
| Value
 
| VarInt
 
| The amount to set it to
 
|}
 
 
 
Categories (these are namespaced, but with <code>:</code>. replaced with <code>.</code>):
 
 
 
{| class="wikitable"
 
! Name
 
! ID
 
! Registry
 
 
  |-
 
  |-
  | <code>minecraft.mined</code>
+
  | rowspan="3"| Beacon
  | 0
+
  | 0: Power level
  | Blocks
+
  | 0-4, controls what effect buttons are enabled
 
  |-
 
  |-
  | <code>minecraft.crafted</code>
+
  | 1: First potion effect
  | 1
+
  | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the first effect, or -1 if no effect
| Items
 
 
  |-
 
  |-
  | <code>minecraft.used</code>
+
  | 2: Second potion effect
  | 2
+
  | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the second effect, or -1 if no effect
| Items
 
 
  |-
 
  |-
  | <code>minecraft.broken</code>
+
  | Anvil
  | 3
+
  | 0: Repair cost
  | Items
+
  | The repair's cost in xp levels
 
  |-
 
  |-
  | <code>minecraft.picked_up</code>
+
  | rowspan="2"| Brewing Stand
  | 4
+
  | 0: Brew time
  | Items
+
  | 0 – 400, with 400 making the arrow empty, and 0 making the arrow full
 
  |-
 
  |-
  | <code>minecraft.dropped</code>
+
  | 1: Fuel time
  | 5
+
  | 0 - 20, with 0 making the arrow empty, and 20 making the arrow full
| Items
 
 
  |-
 
  |-
  | <code>minecraft.killed</code>
+
  | Stonecutter
  | 6
+
  | 0: Selected recipe
  | Entities
+
  | The index of the selected recipe. -1 means none is selected.
 
  |-
 
  |-
  | <code>minecraft.killed_by</code>
+
  | Loom
  | 7
+
  | 0: Selected pattern
  | Entities
+
  | The index of the selected pattern. 0 means none is selected, 0 is also the internal id of the "base" pattern.
 
  |-
 
  |-
  | <code>minecraft.custom</code>
+
  | Lectern
  | 8
+
  | 0: Page number
  | Custom
+
  | The current page number, starting from 0.
 
  |}
 
  |}
  
Blocks, Items, and Entities use block (not block state), item, and entity ids.
+
For an enchanting table, the following numerical IDs are used:
 
 
Custom has the following (unit only matters for clients):
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Name
+
  ! Numerical ID
  ! ID
+
  ! Enchantment ID
  ! Unit
+
  ! Enchantment Name
 
  |-
 
  |-
| <code>minecraft.leave_game</code>
 
 
  | 0
 
  | 0
  | None
+
  | minecraft:protection
 +
| Protection
 
  |-
 
  |-
| <code>minecraft.play_one_minute</code>
 
 
  | 1
 
  | 1
  | Time
+
  | minecraft:fire_protection
 +
| Fire Protection
 
  |-
 
  |-
| <code>minecraft.time_since_death</code>
 
 
  | 2
 
  | 2
  | Time
+
  | minecraft:feather_falling
 +
| Feather Falling
 
  |-
 
  |-
| <code>minecraft.sneak_Time</code>
 
 
  | 3
 
  | 3
  | Time
+
  | minecraft:blast_protection
 +
| Blast Protection
 
  |-
 
  |-
| <code>minecraft.walk_one_cm</code>
 
 
  | 4
 
  | 4
  | Distance
+
  | minecraft:projectile_protection
 +
| Projectile Protection
 
  |-
 
  |-
| <code>minecraft.crouch_one_cm</code>
 
 
  | 5
 
  | 5
  | Distance
+
  | minecraft:respiration
 +
| Respiration
 
  |-
 
  |-
| <code>minecraft.sprint_one_cm</code>
 
 
  | 6
 
  | 6
  | Distance
+
  | minecraft:aqua_affinity
 +
| Aqua Affinity
 
  |-
 
  |-
| <code>minecraft.swim_one_cm</code>
 
 
  | 7
 
  | 7
  | Distance
+
  | minecraft:thorns
 +
| Thorns
 
  |-
 
  |-
| <code>minecraft.fall_one_cm</code>
 
 
  | 8
 
  | 8
  | Distance
+
  | minecraft:depth_strider
 +
| Depth Strider
 
  |-
 
  |-
| <code>minecraft.climb_one_cm</code>
 
 
  | 9
 
  | 9
  | Distance
+
  | minecraft:frost_walker
 +
| Frost Walker
 
  |-
 
  |-
| <code>minecraft.fly_one_cm</code>
 
 
  | 10
 
  | 10
  | Distance
+
  | minecraft:binding_curse
 +
| Curse of Binding
 
  |-
 
  |-
| <code>minecraft.dive_one_cm</code>
 
 
  | 11
 
  | 11
  | Distance
+
  | minecraft:soul_speed
 +
| Soul Speed
 
  |-
 
  |-
| <code>minecraft.minecart_one_cm</code>
 
 
  | 12
 
  | 12
  | Distance
+
  | minecraft:swift_sneak
 +
| Swift Sneak
 
  |-
 
  |-
| <code>minecraft.boat_one_cm</code>
 
 
  | 13
 
  | 13
  | Distance
+
  | minecraft:sharpness
 +
| Sharpness
 
  |-
 
  |-
| <code>minecraft.pig_one_cm</code>
 
 
  | 14
 
  | 14
  | Distance
+
  | minecraft:smite
 +
| Smite
 
  |-
 
  |-
| <code>minecraft.horse_one_cm</code>
 
 
  | 15
 
  | 15
  | Distance
+
  | minecraft:bane_of_arthropods
 +
| Bane of Arthropods
 
  |-
 
  |-
| <code>minecraft.aviate_one_cm</code>
 
 
  | 16
 
  | 16
  | Distance
+
  | minecraft:knockback
 +
| Knockback
 
  |-
 
  |-
| <code>minecraft.jump</code>
 
 
  | 17
 
  | 17
  | None
+
  | minecraft:fire_aspect
 +
| Fire Aspect
 
  |-
 
  |-
| <code>minecraft.drop</code>
 
 
  | 18
 
  | 18
  | None
+
  | minecraft:looting
 +
| Looting
 
  |-
 
  |-
| <code>minecraft.damage_dealt</code>
 
 
  | 19
 
  | 19
  | Damage
+
  | minecraft:sweeping_edge
 +
| Sweeping Edge
 
  |-
 
  |-
| <code>minecraft.damage_taken</code>
 
 
  | 20
 
  | 20
  | Damage
+
  | minecraft:efficiency
 +
| Efficiency
 
  |-
 
  |-
| <code>minecraft.deaths</code>
 
 
  | 21
 
  | 21
  | None
+
  | minecraft:silk_touch
 +
| Silk Touch
 
  |-
 
  |-
| <code>minecraft.mob_kills</code>
 
 
  | 22
 
  | 22
  | None
+
  | minecraft:unbreaking
 +
| Unbreaking
 
  |-
 
  |-
| <code>minecraft.animals_bred</code>
 
 
  | 23
 
  | 23
  | None
+
  | minecraft:fortune
 +
| Fortune
 
  |-
 
  |-
| <code>minecraft.player_kills</code>
 
 
  | 24
 
  | 24
  | None
+
  | minecraft:power
 +
| Power
 
  |-
 
  |-
| <code>minecraft.fish_caught</code>
 
 
  | 25
 
  | 25
  | None
+
  | minecraft:punch
 +
| Punch
 
  |-
 
  |-
| <code>minecraft.talked_to_villager</code>
 
 
  | 26
 
  | 26
  | None
+
  | minecraft:flame
 +
| Flame
 
  |-
 
  |-
| <code>minecraft.traded_with_villager</code>
 
 
  | 27
 
  | 27
  | None
+
  | minecraft:infinity
 +
| Infinity
 
  |-
 
  |-
| <code>minecraft.eat_cake_slice</code>
 
 
  | 28
 
  | 28
  | None
+
  | minecraft:luck_of_the_sea
 +
| Luck of the Sea
 
  |-
 
  |-
| <code>minecraft.fill_cauldron</code>
 
 
  | 29
 
  | 29
  | None
+
  | minecraft:lure
 +
| Lure
 
  |-
 
  |-
| <code>minecraft.use_cauldron</code>
 
 
  | 30
 
  | 30
  | None
+
  | minecraft:loyalty
 +
| Loyalty
 
  |-
 
  |-
| <code>minecraft.clean_armor</code>
 
 
  | 31
 
  | 31
  | None
+
  | minecraft:impaling
 +
| Impaling
 
  |-
 
  |-
| <code>minecraft.clean_banner</code>
 
 
  | 32
 
  | 32
  | None
+
  | minecraft:riptide
 +
| Riptide
 
  |-
 
  |-
| <code>minecraft.interact_with_brewingstand</code>
 
 
  | 33
 
  | 33
  | None
+
  | minecraft:channeling
 +
| Channeling
 
  |-
 
  |-
| <code>minecraft.interact_with_beacon</code>
 
 
  | 34
 
  | 34
  | None
+
  | minecraft:multishot
 +
| Multishot
 
  |-
 
  |-
| <code>minecraft.inspect_dropper</code>
 
 
  | 35
 
  | 35
  | None
+
  | minecraft:quick_charge
 +
| Quick Charge
 
  |-
 
  |-
| <code>minecraft.inspect_hopper</code>
 
 
  | 36
 
  | 36
  | None
+
  | minecraft:piercing
 +
| Piercing
 
  |-
 
  |-
| <code>minecraft.inspect_dispenser</code>
 
 
  | 37
 
  | 37
  | None
+
  | minecraft:density
 +
| Density
 
  |-
 
  |-
| <code>minecraft.play_noteblock</code>
 
 
  | 38
 
  | 38
  | None
+
  | minecraft:breach
 +
| Breach
 
  |-
 
  |-
| <code>minecraft.tune_noteblock</code>
 
 
  | 39
 
  | 39
  | None
+
  | minecraft:wind_burst
 +
| Wind Burst
 
  |-
 
  |-
| <code>minecraft.pot_flower</code>
 
 
  | 40
 
  | 40
  | None
+
  | minecraft:mending
 +
| Mending
 
  |-
 
  |-
| <code>minecraft.trigger_trapped_chest</code>
 
 
  | 41
 
  | 41
  | None
+
  | minecraft:vanishing_curse
|-
+
  | Curse of Vanishing
| <code>minecraft.open_enderchest</code>
 
| 42
 
| None
 
|-
 
| <code>minecraft.enchant_item</code>
 
| 43
 
| None
 
|-
 
| <code>minecraft.play_record</code>
 
| 44
 
| None
 
|-
 
| <code>minecraft.interact_with_furnace</code>
 
| 45
 
| None
 
|-
 
| <code>minecraft.interact_with_crafting_table</code>
 
| 46
 
| None
 
|-
 
| <code>minecraft.open_chest</code>
 
| 47
 
| None
 
|-
 
| <code>minecraft.sleep_in_bed</code>
 
| 48
 
| None
 
|-
 
| <code>minecraft.open_shulker_box</code>
 
| 49
 
  | None
 
 
  |}
 
  |}
  
Units:
+
==== Set Container Slot ====
 
 
* 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 ====
+
Sent by the server when an item in a slot (in a window) is added/removed.
 
 
Sets tile entity associated with the block at the given location.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,652: Line 514:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x09
+
  | rowspan="4"| 0x15
  |rowspan="3"| Play
+
  | rowspan="4"| Play
  |rowspan="3"| Client
+
  | rowspan="4"| Client
  | Location
+
  | Window ID
  | Position
+
  | {{change|{{Type|Unsigned Byte}}|{{Type|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{{change|; see below for exceptions|, unless it is 0 (see below)}}.
 +
|-
 +
| State ID
 +
| {{Type|VarInt}}
 +
  | A server-managed sequence number used to avoid desynchronization; see [[#Click Container]].
 
  |-
 
  |-
  | Action
+
  | Slot
  | Unsigned Byte
+
  | {{Type|Short}}
  | The type of update to perform, see below
+
  | The slot that should be updated.
 
  |-
 
  |-
  | NBT Data
+
  | Slot Data
  | [[NBT|NBT Tag]]
+
  | {{Type|Slot}}
  | 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)
+
  |
 
  |}
 
  |}
  
''Action'' field:
+
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].)
  
* '''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.)
+
{{change|If Window ID is -1, the item being dragged with the mouse is set. In this case, State ID and Slot are ignored.|}}
* '''2''': Set command block text (command and last execution status)
 
* '''3''': Set the level, primary, and secondary powers of a beacon
 
* '''4''': Set rotation and skin of mob head
 
* {{Change|'''5''': Set type of flower in flower pot}}
 
* {{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 ====
+
{{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.|}}
  
Fired whenever a block is changed within the render distance.
+
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.
  
{{Warning2|Changing a block in a chunk that is not loaded is not a stable actionThe 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.}}
+
==== Set Cooldown ====
 +
 
 +
Applies a cooldown period to all items with the given typeUsed 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"
Line 1,696: Line 553:
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
 +
|-
 +
| rowspan="2"| 0x17
 +
| 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.
 
  |-
 
  |-
  |rowspan="2"| 0x0B
+
  | Cooldown Ticks
  |rowspan="2"| Play
+
  | {{Type|VarInt}}
|rowspan="2"| Client
+
  | Number of ticks to apply a cooldown for, or 0 to clear the cooldown.
| Location
 
| Position
 
| Block Coordinates
 
|-
 
| Block ID
 
| VarInt
 
  | 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.}}
 
 
  |}
 
  |}
  
==== Multi Block Change ====
+
==== Synchronize Entity Position ====
  
Fired whenever 2 or more blocks are changed within the same chunk on the same tick.
+
{| class="wikitable" {{added}}
 
 
{{Warning|Changing blocks in chunks not loaded by the client is unsafe (see note on [[#Block Change|Block Change]]).}}
 
 
 
{| 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"| {{Change|0x10|0x0F}}
+
  | rowspan="10"| 0x20
  |rowspan="6"| Play
+
  | rowspan="10"| Play
  |rowspan="6"| Client
+
  | rowspan="10"| Client
  |colspan="2"| Chunk X
+
  | Entity ID
  |colspan="2"| Int
+
  | {{Type|VarInt}}
  | Chunk X coordinate
+
  |
 
  |-
 
  |-
  |colspan="2"| Chunk Z
+
  | X
  |colspan="2"| Int
+
  | {{Type|Double}}
  | Chunk Z coordinate
+
  |  
 
  |-
 
  |-
  |colspan="2"| Record Count
+
  | Y
  |colspan="2"| VarInt
+
  | {{Type|Double}}
  | Number of elements in the following array, i.e. the number of blocks affected
+
  |
 
  |-
 
  |-
  |rowspan="3"| Record
+
  | Z
  | Horizontal Position
+
  | {{Type|Double}}
|rowspan="3"| Array
+
  |
  | 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
+
  | Velocity X
  | Unsigned Byte
+
  | {{Type|Double}}
  | Y coordinate of the block
+
  |
 
  |-
 
  |-
  | Block ID
+
  | Velocity Y
  | VarInt
+
  | {{Type|Double}}
| 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.}}
+
  |
  |}
 
 
 
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}}
+
  | Velocity Z
|rowspan="7"| Play
+
  | {{Type|Double}}
|rowspan="7"| Client
+
  |
|colspan="2" {{Added}}| Transaction Id
 
|colspan="2" {{Added}}| VarInt
 
|{{Added}}| This id should also be used in the tab completion response packet, or it will be ignored.
 
  |- {{Added}}
 
|colspan="2"|  Start
 
|colspan="2"|  VarInt
 
| Start of the text to replace
 
|- {{Added}}
 
  |colspan="2"|  Length
 
|colspan="2"|  VarInt
 
| Length of the text to replace
 
 
  |-
 
  |-
  |colspan="2"|  Count
+
  | Yaw
  |colspan="2"| VarInt
+
  | {{Type|Float}}
  | Number of elements in the following array
+
  | Rotation on the X axis, in degrees.
 
  |-
 
  |-
  |rowspan="3"| Matches
+
  | Pitch
| Match
+
  | {{Type|Float}}
  |rowspan="3"| Array
+
  | Rotation on the Y axis, in degrees.
| String (32767)
 
| 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.}}
 
 
  |-
 
  |-
  |{{Added}}| Has tooltip
+
  | On Ground
  |{{Added}}| Boolean
+
  | {{Type|Boolean}}
|{{Added}}| True if the following is present
+
  |
  |-
+
|}
|{{Added}}| Tooltip
 
|{{Added}}| Optional [[Chat]]
 
|{{Added}}| Tooltip to display; only present if previous Boolean is true
 
|}
 
  
==== Declare Commands ====
+
==== Explosion ====
  
Lists all of the commands on the server, and how they are parsed.
+
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).
  
This is a directed graph, with one root node. Each redirect or child node must refer only to nodes that have already been declared.
+
{{change|Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x|}}
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,818: Line 630:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  ! colspan="2" | Field Name
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x11
+
  | rowspan="19"| {{change|0x20|0x21}}
  |rowspan="3"| Play
+
  | rowspan="19"| Play
  |rowspan="3"| Client
+
  | rowspan="19"| Client
  | Count
+
  | colspan="2" | X
  | VarInt
+
  | {{Type|Double}}
  | Number of elements in the following array
+
  |
 
  |-
 
  |-
  | Nodes
+
  | colspan="2" | Y
  | Array of [[Command Data|Node]]
+
  | {{Type|Double}}
  | An array of nodes
+
  |
 
  |-
 
  |-
  | Root index
+
  | colspan="2" | Z
  | VarInt
+
  | {{Type|Double}}
  | Index of the <code>root</code> node in the previous array
+
  |
  |}
+
  |- {{removed}}
 
+
| colspan="2" | Strength
For more information on this packet, see the [[Command Data]] article.
+
| {{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.
==== Plugin Message (clientbound) ====
+
|- {{removed}}
 
+
| colspan="2" | Record Count
{{Main|Plugin channels}}
+
| {{Type|VarInt}}
 
+
| Number of elements in the following array.
Mods and plugins can use this to send their data. Minecraft itself uses a number of [[plugin channel]]s. These internal channels are prefixed with <code>MC|</code>.
+
|- {{removed}}
 
+
| colspan="2" | Records
More documentation on this: [http://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/ http://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/]
+
  | {{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.
{| class="wikitable"
+
  |- {{added}}
  ! Packet ID
+
  | colspan="2" | Has Player Motion
  ! State
+
  | {{Type|Boolean}}
  ! Bound To
+
  |
  ! Field Name
 
  ! Field Type
 
  ! Notes
 
 
  |-
 
  |-
  |rowspan="2"| {{Change|0x18|0x19}}
+
  | colspan="2" | Player Motion X
|rowspan="2"| Play
+
| {{change||{{Type|Optional}} }}{{Type|Float}}
|rowspan="2"| Client
+
  | X velocity of the player being pushed by the explosion.{{change|| Only present if Has Player Motion is true.}}
| Channel
 
| {{Change|String (20)|Identifier}}
 
  | Name of the [[plugin channel]] used to send the data
 
 
  |-
 
  |-
  | Data
+
  | colspan="2" | Player Motion Y
| Byte Array
+
  | {{change||{{Type|Optional}} }}{{Type|Float}}
  | Any data, depending on the channel. <code><nowiki>MC|</nowiki></code> channels are documented [[plugin channel|here]].  The length of this array must be inferred from the packet length.
+
| Y velocity of the player being pushed by the explosion.{{change|| Only present if Has Player Motion is true.}}
|}
 
 
 
 
 
==== Named Sound Effect ====
 
{{See also|#Sound Effect}}
 
 
 
Used to play a sound effect on the client. Custom sounds may be added by resource packs.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="7"| {{Change|0x19|0x1A}}
+
  | colspan="2" | Player Motion Z
  |rowspan="7"| Play
+
| {{change||{{Type|Optional}} }}{{Type|Float}}
  |rowspan="7"| Client
+
  | Z velocity of the player being pushed by the explosion.{{change|| Only present if Has Player Motion is true.}}
  | Sound Name
+
|- {{removed}}
| {{Change|String (256)|Identifier}}
+
  | colspan="2" | Block Interaction
  | All sound effect names as of 1.13-pre8 can be seen [http://pokechu22.github.io/Burger/1.13.html#sounds here].
+
  | {{Type|VarInt}} {{Type|Enum}}
 +
  | 0 = keep, 1 = destroy, 2 = destroy_with_decay, 3 = trigger_block.
 
  |-
 
  |-
  | Sound Category
+
  | colspan="2" | {{change|Small |}}Explosion Particle ID
  | VarInt Enum
+
  | {{Type|VarInt}}
  | The category that this sound will be played from ([https://gist.github.com/konwboj/7c0c380d3923443e9d55 current categories])
+
  | The particle ID listed in [[Particles]].
 
  |-
 
  |-
  | Effect Position X
+
  | colspan="2" | {{change|Small |}}Explosion Particle Data
  | Int
+
  | Varies
  | Effect X multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
+
  | Particle data as specified in [[Particles]].
 +
|- {{removed}}
 +
| colspan="2" | Large Explosion Particle ID
 +
| {{Type|VarInt}}
 +
| The particle ID listed in [[Particles]].
 +
|- {{removed}}
 +
| colspan="2" | Large Explosion Particle Data
 +
| Varies
 +
| Particle data as specified in [[Particles]].
 
  |-
 
  |-
  | Effect Position Y
+
  | rowspan="4" | Explosion Sound
  | Int
+
  | Sound ID
  | Effect Y multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
+
  | {{Type|VarInt}}
 +
| Represents the <code>Sound ID + 1</code>. If the value is 0, the packet contains a sound specified by Identifier.
 
  |-
 
  |-
  | Effect Position Z
+
  | Sound Name
  | Int
+
  | {{Type|Optional}} {{Type|Identifier}}
  | Effect Z multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
+
  | The name of the sound played. Only present if Sound ID is 0.
 
  |-
 
  |-
  | Volume
+
  | Has Fixed Range
  | Float
+
  | {{Type|Optional}} {{Type|Boolean}}
  | 1 is 100%, can be more
+
  | Whether is has fixed range. Only present if Sound ID is 0.
 
  |-
 
  |-
  | Pitch
+
  | Range
  | Float
+
  | {{Type|Optional}} {{Type|Float}}
  | Float between 0.5 and 2.0 by Notchian clients
+
  | The fixed range of the sound. Only present if previous boolean is true and Sound ID is 0.
 
  |}
 
  |}
  
==== NBT Query Response ====
+
==== Open Horse Screen ====
 
 
Sent in response to [[#Query Block NBT|Query Block NBT]] or [[#Query Entity NBT|Query Entity NBT]].
 
 
 
{| class="wikitable" {{Added}}
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
|rowspan="2"| 0x1D
 
|rowspan="2"| Play
 
|rowspan="2"| Client
 
| Transaction ID
 
| VarInt
 
| Can be compared to the one sent in the original query packet.
 
|-
 
| NBT
 
| [[NBT|NBT Tag]]
 
| The NBT of the block or entity.  May be a TAG_END (0) in which case no NBT is present.
 
|}
 
 
 
==== Chunk Data ====
 
{{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).
 
 
 
{{Change||Indexes into the global palette are still used, but since the global palette has changed, behavior is different.}}
 
{{Change||The Palette length field is no longer sent when using the global palette}}
 
  
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).
+
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"
 
{| class="wikitable"
Line 1,957: Line 727:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="9"| {{Change|0x20|0x22}}
+
  | rowspan="3"| 0x23
  |rowspan="9"| Play
+
  | rowspan="3"| Play
  |rowspan="9"| Client
+
  | rowspan="3"| Client
  | Chunk X
+
  | Window ID
  | Int
+
  | {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
  | Chunk coordinate (block coordinate divided by 16, rounded down)
+
  |
 
  |-
 
  |-
  | Chunk Z
+
  | Slot count
  | Int
+
  | {{Type|VarInt}}
  | Chunk coordinate (block coordinate divided by 16, rounded down)
+
  |
 
  |-
 
  |-
  | Ground-Up Continuous
+
  | Entity ID
  | Boolean
+
  | {{Type|Int}}
| See [[Chunk Format#Ground-up continuous|Chunk Format]]
+
  |
|-
 
| 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.
 
 
  |}
 
  |}
  
{{Warning2|The chunk data packet currently (for 1.13 snapshots) may allocate a data array slightly larger than necessary; see [https://bugs.mojang.com/browse/MC-131684 MC-131684].  As such, there may be extra data (all zeros) after the end of the buffer that is not used.}}
 
  
===== Data structure =====
+
==== Login (play) ====
  
The data section of the packet contains most of the useful data for the chunk.
+
{{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?}}
 
 
{| class="wikitable"
 
|-
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
| Data
 
| Array of [[Chunk Format#Chunk Section structure|Chunk Section]]
 
| 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.
 
|-
 
| Biomes
 
| Optional {{Change|Byte|Int}} Array
 
| Only sent if Ground-Up Continuous is true; 256 {{change|bytes|entries}} if present
 
|}
 
  
===== Direct palette =====
+
See [[Protocol Encryption]] for information on logging in.
 
 
This format is used for bits per block values greater than 9.  The number of bits used to represent a block are the base 2 logarithm of the number of block states, rounded up. For the current vanilla release, this is 13 bits per block.
 
 
 
:The "palette" uses the following format:
 
:{| class="wikitable"
 
|-
 
! Field Name
 
! Field Type
 
! Notes
 
|- {{Removed}}
 
| Dummy Palette Length
 
| VarInt
 
| Should always be 0.  Only exists to mirror the format used elsewhere.
 
|-
 
|colspan="3"| ''no fields''
 
|}
 
 
 
If Minecraft Forge is installed and a sufficiently large number of blocks are added, the bits per block value for the global palette will be increased to compensate for the increased ID count.  This increase can go up to 16 bits per block (for a total of 4096 block IDs; when combined with the 16 damage values, there are 65536 total states).  You can get the number of blocks with the "Number of ids" field found in the [[Minecraft Forge Handshake#RegistryData|RegistryData packet in the Forge Handshake]].
 
 
 
==== Effect ====
 
 
 
Sent when a client is to play a sound or particle effect.
 
 
 
By default, the Minecraft client adjusts the volume of sound effects based on distance. The final boolean field is used to disable this, and instead the effect is played from 2 blocks away in the correct direction. Currently this is only used for effect 1023 (wither spawn) and effect 1028 (enderdragon death); it is ignored on other effects.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,048: Line 758:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| {{Change|0x21|0x23}}
+
  | rowspan="23"| ''protocol:''<br/><code>{{change|0x2B|0x2C}}</code><br/><br/>''resource:''<br/><code>login</code>
  |rowspan="4"| Play
+
  | rowspan="23"| Play
  |rowspan="4"| Client
+
  | rowspan="23"| Client
  | Effect ID
+
  | Entity ID
  | Int
+
  | {{Type|Int}}
  | The ID of the effect, see below
+
  | The player's Entity ID (EID).
 
  |-
 
  |-
  | Location
+
  | Is hardcore
  | Position
+
  | {{Type|Boolean}}
  | The location of the effect
+
  |
 
  |-
 
  |-
  | Data
+
  | Dimension Count
  | Int
+
  | {{Type|VarInt}}
  | Extra data for certain effects, see below
+
  | Size of the following array.
 
  |-
 
  |-
  | Disable Relative Volume
+
  | Dimension Names
  | Boolean
+
  | {{Type|Array}} of {{Type|Identifier}}
  | See above
+
  | Identifiers for all dimensions on the server.
  |}
+
  |-
 
+
| Max Players
Effect IDs:
+
| {{Type|VarInt}}
 
+
  | Was once used by the client to draw the player list, but now is ignored.
{| class="wikitable"
 
  ! ID
 
! Name
 
! Data
 
 
  |-
 
  |-
  !colspan="3"| Sound
+
  | View Distance
 +
| {{Type|VarInt}}
 +
| Render distance (2-32).
 
  |-
 
  |-
  | 1000
+
  | Simulation Distance
  | Dispenser dispenses
+
  | {{Type|VarInt}}
  |  
+
  | The distance that the client will process specific things, such as entities.
 
  |-
 
  |-
  | 1001
+
  | Reduced Debug Info
  | Dispenser fails to dispense
+
  | {{Type|Boolean}}
  |  
+
  | If true, a Notchian client shows reduced information on the {{Minecraft Wiki|debug screen}}.  For servers in development, this should almost always be false.
 
  |-
 
  |-
  | 1002
+
  | Enable respawn screen
  | Dispenser shoots
+
  | {{Type|Boolean}}
  |  
+
  | Set to false when the doImmediateRespawn gamerule is true.
 
  |-
 
  |-
  | 1003
+
  | Do limited crafting
  | Ender eye launched
+
  | {{Type|Boolean}}
  |  
+
  | Whether players can only craft recipes they have already unlocked. Currently unused by the client.
 
  |-
 
  |-
  | 1004
+
  | Dimension Type
  | Firework shot
+
  | {{Type|VarInt}}
  |  
+
  | The ID of the type of dimension in the <code>minecraft:dimension_type</code> registry, defined by the Registry Data packet.
 
  |-
 
  |-
  | 1005
+
  | Dimension Name
  | Iron door opened
+
  | {{Type|Identifier}}
  |  
+
  | Name of the dimension being spawned into.
 
  |-
 
  |-
  | 1006
+
  | Hashed seed
  | Wooden door opened
+
  | {{Type|Long}}
  |  
+
  | First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
 
  |-
 
  |-
  | 1007
+
  | Game mode
  | Wooden trapdoor opened
+
  | {{Type|Unsigned Byte}}
  |  
+
  | 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 
  |-
 
  |-
  | 1008
+
  | Previous Game mode
  | Fence gate opened
+
  | {{Type|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)
 
  |-
 
  |-
  | 1009
+
  | Is Debug
  | Fire extinguished
+
  | {{Type|Boolean}}
  |  
+
  | True if the world is a {{Minecraft Wiki|debug mode}} world; debug mode worlds cannot be modified and have predefined blocks.
 
  |-
 
  |-
  | 1010
+
  | Is Flat
  | Play record
+
  | {{Type|Boolean}}
  | Special case, see below for more info
+
  | 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.
 
  |-
 
  |-
  | 1011
+
  | Has death location
  | Iron door closed
+
  | {{Type|Boolean}}
  |  
+
  | If true, then the next two fields are present.
 
  |-
 
  |-
  | 1012
+
  | Death dimension name
  | Wooden door closed
+
  | {{Type|Optional}} {{Type|Identifier}}
  |  
+
  | Name of the dimension the player died in.
 
  |-
 
  |-
  | 1013
+
  | Death location
  | Wooden trapdoor closed
+
  | {{Type|Optional}} {{Type|Position}}
  |  
+
  | The location that the player died at.
 
  |-
 
  |-
  | 1014
+
  | Portal cooldown
  | Fence gate closed
+
  | {{Type|VarInt}}
  |  
+
| The number of ticks until the player can use the portal again.
 +
|- {{added}}
 +
| Sea level
 +
| {{Type|VarInt}}
 +
  |
 
  |-
 
  |-
  | 1015
+
  | Enforces Secure Chat
  | Ghast warns
+
  | {{Type|Boolean}}
  |  
+
|
 +
|}
 +
 
 +
==== Move Minecart Along Track ====
 +
 
 +
{| class="wikitable" {{added}}
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! colspan="2"| Field Name
 +
! colspan="2"| Field Type
 +
  ! colspan="2"| Notes
 
  |-
 
  |-
  | 1016
+
  | rowspan="11"| 0x31
  | Ghast shoots
+
| rowspan="11"| Play
  |  
+
  | rowspan="11"| Client
 +
| colspan="2"| Entity ID
 +
| colspan="2"| {{Type|VarInt}}
 +
  |
 
  |-
 
  |-
  | 1017
+
  | colspan="2"| Step Count
  | Enderdragon shoots
+
  | colspan="2"| {{Type|VarInt}}
  |  
+
  | Number of elements in the following array.
 
  |-
 
  |-
  | 1018
+
  | rowspan="9"| Steps
  | Blaze shoots
+
| X
 +
| rowspan="9"| {{Type|Array}}
 +
  | {{Type|Double}}
 
  |  
 
  |  
 
  |-
 
  |-
  | 1019
+
  | Y
  | Zombie attacks wood door
+
  | {{Type|Double}}
 
  |  
 
  |  
 
  |-
 
  |-
  | 1020
+
  | Z
  | Zombie attacks iron door
+
  | {{Type|Double}}
 
  |  
 
  |  
 
  |-
 
  |-
  | 1021
+
  | Velocity X
  | Zombie breaks wood door
+
  | {{Type|Double}}
 
  |
 
  |
 
  |-
 
  |-
  | 1022
+
  | Velocity Y
  | Wither breaks block
+
  | {{Type|Double}}
 
  |
 
  |
 
  |-
 
  |-
  | 1023
+
  | Velocity Z
  | Wither spawned
+
  | {{Type|Double}}
  |  
+
  |
 
  |-
 
  |-
  | 1024
+
  | Yaw
  | Wither shoots
+
  | {{Type|Angle}}
 
  |
 
  |
 
  |-
 
  |-
  | 1025
+
  | Pitch
  | Bat takes off
+
  | {{Type|Angle}}
 
  |
 
  |
 
  |-
 
  |-
  | 1026
+
  | Weight
  | Zombie infects
+
  | {{Type|Float}}
  |
+
|}
 +
 
 +
==== 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
 
  |-
 
  |-
  | 1027
+
  | rowspan="4"| {{change|0x3E|0x40}}
  | Zombie villager converted
+
  | rowspan="4"| Play
  |
+
| rowspan="4"| Client
 +
| colspan="2"| Actions
 +
| colspan="2"| {{Type|Byte}}
 +
  | Determines what actions are present.
 
  |-
 
  |-
  | 1028
+
  | colspan="2"| Number Of Players
  | Ender dragon death
+
  | colspan="2"| {{Type|VarInt}}
  |
+
  | Number of elements in the following array.
 
  |-
 
  |-
  | 1029
+
  | rowspan="2" | Players
  | Anvil destroyed
+
| UUID
  |  
+
| rowspan="2" | {{Type|Array}}
 +
  | {{Type|UUID}}
 +
  | The player UUID
 
  |-
 
  |-
  | 1030
+
  | Player Actions
  | Anvil used
+
  | {{Type|Array}} of [[#player-info:player-actions|Player&nbsp;Actions]]
  |  
+
  | 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.
 +
|}
 +
 
 +
{| class="wikitable"
 +
|+ id="player-info:player-actions" | Player Actions
 +
! Action
 +
! Mask
 +
! colspan="2" | Field Name
 +
! colspan="2" | Type
 +
! Notes
 
  |-
 
  |-
  | 1031
+
  | rowspan="6" | Add Player
  | Anvil landed
+
| rowspan="6" | 0x01
  |
+
  | colspan="2" | Name
 +
  | colspan="2" | {{Type|String}} (16)
 
  |-
 
  |-
  | 1032
+
  | colspan="2" | Number Of Properties
  | Portal travel
+
  | colspan="2" | {{Type|VarInt}}
  |  
+
  | Number of elements in the following array.
 
  |-
 
  |-
  | 1033
+
  | rowspan="4" | Property
  | Chorus flower grown
+
| Name
 +
| rowspan="4"| {{Type|Array}}
 +
  | {{Type|String}} (32767)
 
  |
 
  |
 
  |-
 
  |-
  | 1034
+
  | Value
  | Chorus flower died
+
  | {{Type|String}} (32767)
  |  
+
  |
 
  |-
 
  |-
  | 1035
+
  | Is Signed
  | Brewing stand brewed
+
  | {{Type|Boolean}}
 
  |
 
  |
 
  |-
 
  |-
  | 1036
+
  | Signature
  | Iron trapdoor opened
+
  | {{Type|Optional}} {{Type|String}} (32767)
  |  
+
  | Only if Is Signed is true.
 
  |-
 
  |-
  | 1037
+
  | rowspan="7" | Initialize Chat
  | Iron trapdoor closed
+
| rowspan="7" | 0x02
  |
+
  | colspan="2" | Has Signature Data
 +
  | colspan="2" | {{Type|Boolean}}
 
  |-
 
  |-
  !colspan="3"| Particle
+
  | colspan="2" | Chat session ID
 +
| colspan="2" | {{Type|UUID}}
 +
| Only sent if Has Signature Data is true.
 
  |-
 
  |-
  | 2000
+
  | colspan="2" | Public key expiry time
  | Spawns 10 smoke particles, e.g. from a fire
+
  | colspan="2" | {{Type|Long}}
  | Direction, see below
+
  | Key expiry time, as a UNIX timestamp in milliseconds. Only sent if Has Signature Data is true.
 
  |-
 
  |-
  | 2001
+
  | colspan="2" | Encoded public key size
  | Block break + block break sound
+
  | colspan="2" | {{Type|VarInt}}
| Block state, {{change|determined by <code>meta << 12 | block id</code> (this differs from normal global palette use)|as an index into the global palette}}
+
| Size of the following array. Only sent if Has Signature Data is true. Maximum length is 512 bytes.
 
  |-
 
  |-
  | 2002
+
  | colspan="2" | Encoded public key
  | Splash potion. Particle effect + glass break sound.
+
  | colspan="2" | {{Type|Byte Array}} (512)
  | [http://minecraft.gamepedia.com/Data_values#Potions Potion ID]
+
  | The player's public key, in bytes. Only sent if Has Signature Data is true.
 
  |-
 
  |-
  | 2003
+
  | colspan="2" | Public key signature size
  | Eye of Ender entity break animation — particles and sound
+
  | colspan="2" | {{Type|VarInt}}
  |  
+
  | Size of the following array. Only sent if Has Signature Data is true. Maximum length is 4096 bytes.
 
  |-
 
  |-
  | 2004
+
  | colspan="2" | Public key signature
  | Mob spawn particle effect: smoke + flames
+
  | colspan="2" | {{Type|Byte Array}} (4096)
  |  
+
  | The public key's digital signature. Only sent if Has Signature Data is true.
 
  |-
 
  |-
  | 2005
+
  | Update Game Mode
  | Bonemeal particles
+
  | 0x04
  | How many particles to spawn (if set to 0, 15 are spawned)
+
  | colspan="2" | Game Mode
 +
| colspan="2" | {{Type|VarInt}}
 
  |-
 
  |-
  | 2006
+
  | Update Listed
  | Dragon breath
+
  | 0x08
  |
+
  | colspan="2" | Listed
 +
| colspan="2" | {{Type|Boolean}}
 +
| Whether the player should be listed on the player list.
 
  |-
 
  |-
  | 2007
+
  | Update Latency
  | Instant splash potion
+
  | 0x10
  | [http://minecraft.gamepedia.com/Data_values#Potions Potion ID]
+
  | colspan="2" | Ping
 +
| colspan="2" | {{Type|VarInt}}
 +
| Measured in milliseconds.
 
  |-
 
  |-
  | 3000
+
  | rowspan="2" | Update Display Name
  | End gateway spawn
+
| rowspan="2" | 0x20
  |  
+
  | colspan="2" | Has Display Name
 +
  | colspan="2" | {{Type|Boolean}}
 
  |-
 
  |-
  | 3001
+
  | colspan="2" | Display Name
  | Enderdragon growl
+
  | colspan="2" | {{Type|Optional}} {{Type|Text Component}}
  |
+
| Only sent if Has Display Name is true.
 +
|- {{added}}
 +
| Update List Priority
 +
| 0x40
 +
| colspan="2" | Priority
 +
| colspan="2" | {{Type|VarInt}}
 +
  | See below.
 
  |}
 
  |}
  
Smoke directions:
+
The properties included in this packet are the same as in [[#Login Success|Login Success]], for the current player.
  
{| class="wikitable"
+
Ping values correspond with icons in the following way:
! ID
+
* A ping that negative (i.e. not known to the server yet) will result in the no connection icon.
! Direction
+
* A ping under 150 milliseconds will result in 5 bars
|-
+
* A ping under 300 milliseconds will result in 4 bars
| 0
+
* A ping under 600 milliseconds will result in 3 bars
| South-East
+
* 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.
| 1
+
 
| South
+
The order of players in the player list is determined as follows:
|-
+
* {{change||Players with higher priorities are sorted before those with lower priorities.}}
| 2
+
* {{change||Among players of equal priorities, }}spectators are sorted after non-spectators.
| South-West
+
* 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.
| 3
+
 
| East
+
==== Synchronize Player Position ====
|-
+
 
| 4
+
Teleports the client, e.g. during login, when using an ender pearl, in response to invalid move packets, etc.
| (Up or middle ?)
 
|-
 
| 5
 
| West
 
|-
 
| 6
 
| North-East
 
|-
 
| 7
 
| North
 
|-
 
| 8
 
| North-West
 
|}
 
  
Play record: This is actually a special case within this packet. You can start/stop a record at a specific location. Use a valid {{Minecraft Wiki|Music Discs|Record ID}} to start a record (or overwrite a currently playing one), any other value will stop the record.  {{Change|While this packet still uses item IDs, item IDs have changed in 1.13.}}
+
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.
  
==== Spawn Particle ====
+
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]).
  
Displays the named particle
+
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 2,320: Line 1,077:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="11"| {{Change|0x22|0x24}}
+
  | rowspan="11"| ''protocol:''<br/><code>{{change|0x40|0x42}}</code><br/><br/>''resource:''<br/><code>player_position</code>
  |rowspan="11"| Play
+
  | rowspan="11"| Play
  |rowspan="11"| Client
+
  | rowspan="11"| Client
  | Particle ID
+
  | {{added}} | Teleport ID
  | Int
+
  | {{added}} | {{Type|VarInt}}
  | The particle ID listed in [[#Particle]].
+
  | {{added}} | Client should confirm this packet with [[#Confirm Teleportation|Confirm Teleportation]] containing the same Teleport ID.
|-
 
| Long Distance
 
| Boolean
 
| If true, particle distance increases from 256 to 65536
 
 
  |-
 
  |-
 
  | X
 
  | X
  | Float
+
  | {{Type|Double}}
  | X position of the particle
+
  | Absolute or relative position, depending on Flags.
 
  |-
 
  |-
 
  | Y
 
  | Y
  | Float
+
  | {{Type|Double}}
  | Y position of the particle
+
  | Absolute or relative position, depending on Flags.
 
  |-
 
  |-
 
  | Z
 
  | Z
  | Float
+
  | {{Type|Double}}
  | Z position of the particle
+
| Absolute or relative position, depending on Flags.
 +
|- {{added}}
 +
| Velocity X
 +
| {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity Y
 +
  | {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity Z
 +
| {{Type|Double}}
 +
|
 
  |-
 
  |-
  | Offset X
+
  | Yaw
  | Float
+
  | {{Type|Float}}
  | This is added to the X position after being multiplied by random.nextGaussian()
+
  | Absolute or relative rotation on the X axis, in degrees.
 
  |-
 
  |-
  | Offset Y
+
  | Pitch
  | Float
+
  | {{Type|Float}}
  | This is added to the Y position after being multiplied by random.nextGaussian()
+
  | Absolute or relative rotation on the Y axis, in degrees.
 
  |-
 
  |-
  | Offset Z
+
  | Flags
  | Float
+
  | {{change|{{Type|Byte}}|{{Type|Teleport Flags}}}}
  | This is added to the Z position after being multiplied by random.nextGaussian()
+
  | {{change|Reference the Flags table below. When the value of the this byte masked is zero the field is absolute, otherwise relative.|}}
 +
|- {{removed}}
 +
| Teleport ID
 +
| {{Type|VarInt}}
 +
| Client should confirm this packet with [[#Confirm Teleportation|Confirm Teleportation]] containing the same Teleport ID.
 +
|}
 +
 
 +
==== Player Rotation ====
 +
 
 +
{| class="wikitable" {{added}}
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | Particle Data
+
  | rowspan="2"| 0x43
  | Float
+
  | rowspan="2"| Play
  | The data of each particle
+
| rowspan="2"| Client
 +
| Yaw
 +
| {{Type|Float}}
 +
  | Rotation on the X axis, in degrees.
 
  |-
 
  |-
  | Particle Count
+
  | Pitch
| Int
+
  | {{Type|Float}}
| The number of particles to create
+
  | Rotation on the Y axis, in degrees.
|-
 
| Data
 
  | {{Change|Array of VarInt|Varies}}
 
  | {{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 ====
+
==== Place Ghost Recipe ====
  
Updates a rectangular area on a {{Minecraft Wiki|map}} item.
+
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"
Line 2,376: Line 1,155:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
  !colspan="2"| Field Type
+
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="16"| {{Change|0x24|0x26}}
+
  | rowspan="4"| {{change|0x37|0x39}}
  |rowspan="16"| Play
+
  | rowspan="4"| Play
  |rowspan="16"| Client
+
  | rowspan="4"| Client
  |colspan="2"| Item Damage
+
  | Window ID
|colspan="2"| VarInt
+
  | {{change|{{Type|Byte}}|{{Type|VarInt}}}}
| The damage value (map ID) of the map being modified
 
|-
 
|colspan="2"| Scale
 
|colspan="2"| Byte
 
| From 0 for a fully zoomed-in map (1 block per pixel) to 4 for a fully zoomed-out map (16 blocks per pixel)
 
|-
 
|colspan="2"| Tracking Position
 
|colspan="2"| Boolean
 
| Specifies whether the icons are shown
 
|-
 
|colspan="2"| Icon Count
 
|colspan="2"| VarInt
 
| Number of elements in the following array
 
|-
 
|rowspan="6"| Icon
 
  | {{Change|Direction And Type|Type}}
 
|rowspan="6"| Array
 
| {{Change|Byte|VarInt enum}}
 
| {{Change|0xF0 {{=}} Type, 0x0F {{=}} Direction|Type (see below)}}
 
|-
 
| X
 
| Byte
 
|
 
|-
 
| Z
 
| Byte
 
|
 
|- {{Added}}
 
| Direction
 
| Byte
 
| 0-15
 
|- {{Added}}
 
| Has Display Name
 
| Boolean
 
 
  |
 
  |
  |- {{Added}}
+
  |- {{removed}}
  | Display Name
+
  | Recipe
  | Optional [[Chat]]
+
  | {{Type|Identifier}}
| Only present if previous Boolean is true
+
  | A recipe ID.
|-
+
  |- {{added}}
  |colspan="2"| Columns
+
  | Recipe Display ID
|colspan="2"| Byte
+
  | {{Type|VarInt}}
| Number of columns updated
+
  | ID in the <code>minecraft:recipe_display</code> registry.
  |-
+
  |- {{added}}
  |colspan="2"| Rows
+
  | Recipe Data
  |colspan="2"| Optional Byte
+
  | Varies
| Only if Columns is more than 0; number of rows updated
+
  | Depends on Recipe Type; see below.
|-
 
|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).
+
''below''
  
Types are based off of rows and columns in <code>map_icons.png</code>:
+
==== Recipe Book Add ====
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! colspan="2"| Field Name
 +
! colspan="2"| Field Type
 +
! colspan="2"| Notes
 
  |-
 
  |-
  ! Icon type
+
  | rowspan="9"| 0x44
  ! Result
+
  | rowspan="9"| Play
 +
| rowspan="9"| Client
 +
| colspan="2"| Recipe Count
 +
| colspan="2"| {{Type|VarInt}}
 +
| Number of elements in the following array.
 
  |-
 
  |-
  | 0
+
  | rowspan="7"| Recipes
  | White arrow (players)
+
| Recipe ID
 +
| rowspan="7"| {{Type|Array}}
 +
| {{Type|VarInt}}
 +
  | ID to assign to the recipe.
 
  |-
 
  |-
  | 1
+
  | Display ID
  | Green arrow (item frames)
+
  | {{Type|VarInt}}
 +
| ID in the <code>minecraft:recipe_display</code> registry.
 
  |-
 
  |-
  | 2
+
  | Group ID
  | Red arrow
+
| {{Type|VarInt}}
 +
  |
 
  |-
 
  |-
  | 3
+
  | Category ID
  | Blue arrow
+
  | {{Type|VarInt}}
 +
| ID in the <code>minecraft:recipe_book_category</code> registry.
 
  |-
 
  |-
  | 4
+
  | Has Ingredients
  | White cross
+
| {{Type|Boolean}}
 +
  |
 
  |-
 
  |-
  | 5
+
  | Ingredient Count
  | Red pointer
+
  | {{Type|Optional}} {{Type|VarInt}}
 +
| Number of elements in the following array. Only present if Has Ingredients is true.
 
  |-
 
  |-
  | 6
+
  | Ingredients
  | White circle (off-map players)
+
  | {{Type|Optional}} {{Type|Array}} of {{Type|ID Set}}
 +
| Only present if Has Ingredients is true.
 
  |-
 
  |-
  | 7
+
  | colspan="2"| Flags
| Small white circle (far-off-map players)
+
  | colspan="2"| {{Type|Byte}}
|-
+
  | 0x01: show notification; 0x02: highlight as new
| 8
 
| Mansion
 
|-
 
| 9
 
| Temple
 
|- {{Added}}
 
| 10
 
  | White Banner
 
|- {{Added}}
 
| 11
 
| Orange Banner
 
|- {{Added}}
 
  | 12
 
| Magenta Banner
 
|- {{Added}}
 
| 13
 
| Light Blue Banner
 
|- {{Added}}
 
| 14
 
| Yellow Banner
 
|- {{Added}}
 
| 15
 
| Lime Banner
 
|- {{Added}}
 
| 16
 
| Pink Banner
 
|- {{Added}}
 
| 17
 
| Gray Banner
 
|- {{Added}}
 
| 18
 
| Light Gray Banner
 
|- {{Added}}
 
| 19
 
| Cyan Banner
 
|- {{Added}}
 
| 20
 
| Purple Banner
 
|- {{Added}}
 
| 21
 
| Blue Banner
 
|- {{Added}}
 
| 22
 
| Brown Banner
 
|- {{Added}}
 
| 23
 
| Green Banner
 
|- {{Added}}
 
| 24
 
| Red Banner
 
|- {{Added}}
 
| 25
 
| Black Banner
 
|- {{Added}}
 
| 26
 
| Treasure marker
 
 
  |}
 
  |}
  
==== Craft Recipe Response ====
+
==== Recipe Book Remove ====
  
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" {{added}}
 
 
{| class="wikitable"
 
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,553: Line 1,243:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| {{Change|0x2B|0x2D}}
+
  | rowspan="2"| 0x45
  |rowspan="2"| Play
+
  | rowspan="2"| Play
  |rowspan="2"| Client
+
  | rowspan="2"| Client
  | Window ID
+
  | Recipe Count
  | Byte
+
  | {{Type|VarInt}}
  |
+
  | Number of elements in the following array.
 
  |-
 
  |-
  | Recipe
+
  | Recipes
  | {{Change|VarInt|Identifer}}
+
  | {{Type|Array}} of {{Type|VarInt}}
  | A recipe ID
+
  | IDs of recipes to remove.
 
  |}
 
  |}
  
==== Face Player ====
+
==== Recipe Book Settings ====
  
Used to rotate the client player to face the given location or entity (for <code>/teleport [<targets>] <x> <y> <z> facing</code>).
+
{| class="wikitable" {{added}}
 
 
{| class="wikitable"
 
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,577: Line 1,265:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="8"| 0x31
+
  | rowspan="8"| 0x46
  |rowspan="8"| Play
+
  | rowspan="8"| Play
  |rowspan="8"| Client
+
  | 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.
 
  |-
 
  |-
  | Feet/eyes
+
  | Crafting Recipe Book Filter Active
  | VarInt enum
+
  | {{Type|Boolean}}
  | Values are feet=0, eyes=1.  If set to eyes, aims using the head position; otherwise aims using the feet position.
+
  | If true, then the filtering option is active when the players opens its inventory.
 
  |-
 
  |-
  | Target x
+
  | Smelting Recipe Book Open
  | Double
+
  | {{Type|Boolean}}
  | x coordinate of the point to face towards
+
  | If true, then the smelting recipe book will be open when the player opens its inventory.
 
  |-
 
  |-
  | Target y
+
  | Smelting Recipe Book Filter Active
  | Double
+
  | {{Type|Boolean}}
  | y coordinate of the point to face towards
+
  | If true, then the filtering option is active when the players opens its inventory.
 
  |-
 
  |-
  | Target z
+
  | Blast Furnace Recipe Book Open
  | Double
+
  | {{Type|Boolean}}
  | z coordinate of the point to face towards
+
  | If true, then the blast furnace recipe book will be open when the player opens its inventory.
 
  |-
 
  |-
  | Is entity
+
  | Blast Furnace Recipe Book Filter Active
  | Boolean
+
  | {{Type|Boolean}}
  | If true, additional information about an entity is provided.
+
  | If true, then the filtering option is active when the players opens its inventory.
 
  |-
 
  |-
  | Entity ID
+
  | Smoker Recipe Book Open
  | Optional VarInt
+
  | {{Type|Boolean}}
  | Only if is entity is true &mdash; the entity to face towards
+
  | If true, then the smoker recipe book will be open when the player opens its inventory.
 
  |-
 
  |-
  | Entity feet/eyes
+
  | Smoker Recipe Book Filter Active
  | Optional VarInt enum
+
  | {{Type|Boolean}}
  | Whether to look at the entity's eyes or feet.  Same values and meanings as before, just for the entity's head/feet.
+
  | If true, then the filtering option is active when the players opens its inventory.
 
  |}
 
  |}
  
If the entity given by entity ID cannot be found, this packet should be treated as if is entity was false.
+
==== Respawn ====
  
==== Unlock Recipes ====
+
{{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"
 
{| class="wikitable"
Line 2,622: Line 1,315:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="10"| {{Change|0x31|0x34}}
+
  | rowspan="13"| {{change|0x47|0x4C}}
  |rowspan="10"| Play
+
  | rowspan="13"| Play
  |rowspan="10"| Client
+
  | 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.
 
  |-
 
  |-
  | Action
+
  | Dimension Name
  | VarInt
+
  | {{Type|Identifier}}
  | 0: init, 1: add, 2: remove
+
  | Name of the dimension being spawned into.
 
  |-
 
  |-
  | Crafting Recipe Book Open
+
  | Hashed seed
  | Boolean
+
  | {{Type|Long}}
  | If true, then the crafting recipe book will be open when the player opens its inventory.
+
  | First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
 +
|-
 +
| Game mode
 +
| {{Type|Unsigned Byte}}
 +
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 
  |-
 
  |-
  | Crafting Recipe Book Filter Active
+
  | Previous Game mode
  | Boolean
+
  | {{Type|Byte}}
  | If true, then the filtering option is active when the players opens its inventory.
+
  | -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)
 
  |-
 
  |-
  |{{Added}}| Smelting Recipe Book Open
+
| Is Debug
  | Boolean
+
  | {{Type|Boolean}}
| If true, then the smelting recipe book will be open when the player opens its inventory.
+
  | True if the world is a {{Minecraft Wiki|debug mode}} world; debug mode worlds cannot be modified and have predefined blocks.
 
  |-
 
  |-
  |{{Added}}| Smelting Recipe Book Filter Active
+
| Is Flat
| Boolean
+
  | {{Type|Boolean}}
  | If true, then the filtering option is active when the players opens its inventory.
+
  | 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.
 
  |-
 
  |-
  | Array size 1
+
  | Has death location
  | VarInt
+
  | {{Type|Boolean}}
  | Number of elements in the following array
+
  | If true, then the next two fields are present.
 
  |-
 
  |-
  | Recipe IDs
+
  | Death dimension Name
  | Array of {{Change|VarInt|Identifier}}
+
  | {{Type|Optional}} {{Type|Identifier}}
  |
+
  | Name of the dimension the player died in.
 
  |-
 
  |-
  | Array size 2
+
  | Death location
  | Optional VarInt
+
  | {{Type|Optional}} {{Type|Position}}
  | Number of elements in the following array, only present if mode is 0 (init)
+
  | The location that the player died at.
 
  |-
 
  |-
  | Recipe IDs
+
  | Portal cooldown
  | Optional Array of {{Change|VarInt|Identifier}}, only present if mode is 0 (init)
+
  | {{Type|VarInt}}
 +
| The number of ticks until the player can use the portal again.
 +
|- {{added}}
 +
| Sea level
 +
| {{Type|VarInt}}
 
  |
 
  |
 +
|-
 +
| Data kept
 +
| {{Type|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.
 
  |}
 
  |}
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?
 
* 1 (add) = All the recipes in the list are added and their icon will be shown in the notification.
 
* 2 (remove) = Remove all the recipes in the list. This allows them to re-displayed when they are readded.
 
  
==== Scoreboard Objective ====
+
{{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).
  
This is sent to the client when it should create a new {{Minecraft Wiki|scoreboard}} objective or remove one.
+
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.}}
  
{| class="wikitable"
+
==== Set Cursor Item ====
 +
 
 +
{| class="wikitable" {{added}}
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,679: Line 1,389:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| {{Change|0x42|0x45}}
+
  | 0x5A
  |rowspan="4"| Play
+
  | Play
  |rowspan="4"| Client
+
  | Client
  | Objective Name
+
  | Slot Data
| String (16)
+
  | {{Type|Slot}}
| An unique name for the objective
+
  |
|-
 
| Mode
 
| Byte
 
| 0 to create the scoreboard. 1 to remove the scoreboard. 2 to update the display text.
 
|-
 
| Objective Value
 
  | Optional {{Change|String (32)|Chat}}
 
| Only if mode is 0 or 2. The text to be displayed for the score
 
|-
 
| Type
 
| Optional {{change|String|VarInt Enum}}
 
  | Only if mode is 0 or 2. {{change|“integer” or “hearts”|0 = "integer", 1 = "hearts"}}
 
 
  |}
 
  |}
  
==== Teams ====
+
==== Update Time ====
  
Creates and updates teams.
+
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 <code>20</code> every second.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,707: Line 1,409:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="27"| {{Change|0x44|0x47}}
+
  | rowspan="3"| {{change|0x64|0x6b}}
  |rowspan="27"| Play
+
  | rowspan="3"| Play
  |rowspan="27"| Client
+
  | rowspan="3"| Client
  |colspan="2"| Team Name
+
  | World Age
  | String (16)
+
  | {{Type|Long}}
  | A unique name for the team. (Shared with scoreboard).
+
  | In ticks; not changed by server commands.
 
  |-
 
  |-
  |colspan="2"| Mode
+
  | Time of day
  | Byte
+
| {{Type|Long}}
  | Determines the layout of the remaining packet
+
| The world (or region) time, in ticks. {{change|If negative the sun will stop moving at the Math.abs of the time.|}}
 +
|- {{added}}
 +
| Time of day increasing
 +
  | {{Type|Boolean}}
 +
  | If true, the client should automatically advance the time of day according to its ticking rate.
 +
|}
 +
 
 +
==== Set Player Inventory Slot ====
 +
 
 +
{| class="wikitable" {{added}}
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  |rowspan="11"| 0: create team
+
  | rowspan="2"| 0x66
  | Team Display Name
+
  | rowspan="2"| Play
  | {{Change|String (32)|Chat}}
+
  | rowspan="2"| Client
  |  
+
  | Slot
  |- {{Removed}}
+
  | {{Type|VarInt}}
| Team Prefix
+
  |
| String (16)
 
| Displayed before the names of players that are part of this team
 
|- {{Removed}}
 
  | Team Suffix
 
| String (16)
 
| Displayed after the names of players that are part of this team
 
 
  |-
 
  |-
  | Friendly Flags
+
  | Slot Data
| Byte
+
  | {{Type|Slot}}
| Bit mask. 0x01: Allow friendly fire, 0x02: can see invisible players 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.}}
 
|- {{Added}}
 
| Team Prefix
 
| Chat
 
| Displayed before the names of players that are part of this team
 
|- {{Added}}
 
| Team Suffix
 
| Chat
 
| Displayed after the names of players that are part of this team
 
|-
 
| Entity Count
 
| VarInt
 
| Number of elements in the following array
 
|-
 
| Entities
 
| Array of String (40)
 
| Identifiers for the entities in this team.  For players, this is their username; for other entities, it is their UUID.
 
|-
 
| 1: remove team
 
| ''no fields''
 
| ''no fields''
 
|
 
|-
 
|rowspan="9"| 2: update team info
 
| Team Display Name
 
  | {{Change|String (32)|Chat}}
 
  |  
 
|- {{Removed}}
 
| Team Prefix
 
| String (16)
 
| Displayed before the names of entities that are part of this team
 
|- {{Removed}}
 
| 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.}}
 
|- {{Added}}
 
| Team Prefix
 
| Chat
 
| Displayed before the names of players that are part of this team
 
|- {{Added}}
 
| 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
 
| Array of String (40)
 
| Identifiers for the entities added.  For players, this is their username; for other entities, it is their UUID.
 
|-
 
|rowspan="2"| 4: remove players from team
 
| Entity Count
 
| VarInt
 
| 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.
+
==== Teleport Entity ====
 +
 
 +
This packet is sent by the server when an entity moves more than 8 blocks.
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! ID
+
  ! Packet ID
  ! Formatting
+
  ! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 0-15
+
  | rowspan="11"| {{change|0x70|0x77}}
  | Color formatting, same values as [[Chat]] colors.
+
| rowspan="11"| Play
 +
| rowspan="11"| Client
 +
| Entity ID
 +
| {{Type|VarInt}}
 +
  |
 
  |-
 
  |-
  | 16
+
  | X
  | Obfuscated
+
| {{Type|Double}}
 +
  |
 
  |-
 
  |-
  | 17
+
  | Y
  | Bold
+
| {{Type|Double}}
 +
  |
 
  |-
 
  |-
  | 18
+
  | Z
  | Strikethrough
+
| {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity X
 +
| {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity Y
 +
| {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity Z
 +
| {{Type|Double}}
 +
  |
 
  |-
 
  |-
  | 19
+
  | Yaw
  | Underlined
+
  | {{Type|Angle}}
 +
| (Y Rot)New angle, not a delta.
 
  |-
 
  |-
  | 20
+
  | Pitch
  | Italic
+
| {{Type|Angle}}
 +
| (X Rot)New angle, not a delta.
 +
|- {{added}}
 +
| Flags
 +
| {{Type|Teleport Flags}}
 +
  |
 
  |-
 
  |-
  | 21
+
  | On Ground
  | Reset
+
| {{Type|Boolean}}
 +
  |
 
  |}
 
  |}
  
==== Stop Sound ====
+
=== Serverbound ===
  
{| class="wikitable"
+
==== Bundle Item Selected ====
 +
 
 +
{| class="wikitable" {{added}}
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,866: Line 1,523:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="7"| 0x4C
+
  | rowspan="2"| 0x02
  |rowspan="7"| Play
+
  | rowspan="2"| Play
  |rowspan="7"| Client
+
  | rowspan="2"| Server
  | Flags
+
  | Slot of Bundle
  | Byte
+
  | {{Type|VarInt}}
  | Controls which fields are present.
+
  |
 
  |-
 
  |-
  | Source
+
  | Slot in Bundle
  | Optional VarInt enum
+
  | {{Type|VarInt}}
| Only if flags is 3 or 1 (bit mask 0x1).  See below.  If not present, then sounds from all sources are cleared.
+
  |
|-
 
  | 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:
+
==== Client Tick End ====
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
  ! Name !! Value
+
  ! Packet ID
  |-
+
  ! State
  | master || 0
+
  ! Bound To
  |-
+
  ! Field Name
  | music || 1
+
  ! Field Type
  |-
+
  ! Notes
| record || 2
 
|-
 
| weather || 3
 
|-
 
| block || 4
 
|-
 
| hostile || 5
 
 
  |-
 
  |-
  | neutral || 6
+
  | 0x0B
|-
+
  | Play
| player || 7
+
  | Server
|-
+
  | colspan="3"| ''no fields''
  | ambient || 8
 
  |-
 
  | voice || 9
 
 
  |}
 
  |}
  
==== Declare Recipes ====
+
==== Click Container ====
 +
 
 +
This packet is sent by the client when the player clicks on a slot in a window.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,914: Line 1,559:
 
  ! 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="4"| 0x54
+
  | rowspan="9"| {{change|0x0E|0x10}}
  |rowspan="4"| Play
+
  | rowspan="9"| Play
  |rowspan="4"| Client
+
  | rowspan="9"| Server
  |colspan="2"| Num Recipes
+
  | colspan="2"| Window ID
  |colspan="2"| VarInt
+
  | colspan="2"| {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
  | Number of elements in the following array
+
  | 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.
 +
|-
 +
| colspan="2"| State ID
 +
| colspan="2"| {{Type|VarInt}}
 +
| 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.
 
  |-
 
  |-
  |rowspan="3"| Recipe
+
| colspan="2"| Slot
  | Recipe ID
+
| colspan="2"| {{Type|Short}}
  |rowspan="3"| Array
+
| colspan="2"| The clicked slot number, see below.
  | Identifier
+
|-
 +
| colspan="2"| Button
 +
| colspan="2"| {{Type|Byte}}
 +
| colspan="2"| The button used in the click, see below.
 +
|-
 +
| colspan="2"| Mode
 +
| colspan="2"| {{Type|VarInt}} {{Type|Enum}}
 +
| colspan="2"| Inventory operation mode, see below.
 +
|-
 +
| colspan="2"| Length of the array
 +
| colspan="2"| {{Type|VarInt}}
 +
| colspan="2"| Maximum value for Notchian server is 128 slots.
 +
|-
 +
  | rowspan="2"| Array of changed slots
 +
  | Slot number
 +
  | rowspan="2"| {{Type|Array}} (128)
 +
  | {{Type|Short}}
 
  |
 
  |
 
  |-
 
  |-
  | Type
+
  | Slot data
  | String
+
  | {{Type|Slot}}
  | The recipe type, see below
+
  | New data for this slot, in the client's opinion; see below.
 
  |-
 
  |-
  | Data
+
  | colspan="2"| Carried item
  | Optional, varies
+
  | colspan="2"| [[Slot Data|Slot]]
  | Additional data for the recipe. For some types, there will be no data.
+
  | colspan="2"| Item carried by the cursor. Has to be empty (item ID = -1) for drop mode, otherwise nothing will happen.
 
  |}
 
  |}
  
Recipe types:
+
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"
  ! Type
+
  ! Mode
  ! Description
+
  ! Button
  ! Data
+
  ! Slot
 +
! Trigger
 
  |-
 
  |-
  | <code>crafting_shapeless</code>
+
  ! rowspan="4"| 0
| Shapeless crafting recipe.  All items in the ingredient list must be present, but in any order/slot.
+
| 0
| As follows:
+
| Normal
  {| class="wikitable"
+
  | Left mouse click
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | Group
 
    | String
 
    | Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
 
    |-
 
    | Ingredient count
 
    | VarInt
 
    | Number of elements in the following array
 
    |-
 
    | Ingredients
 
    | Array of Ingredient
 
    |
 
    |-
 
    | Result
 
    | [[Slot]]
 
    |
 
    |}
 
 
  |-
 
  |-
  | <code>crafting_shaped</code>
+
  | 1
  | Shaped crafting recipe.  All items must be present in the same pattern (which may be flipped horizontally or translated)
+
  | Normal
| As follows:
+
  | Right mouse click
  {| 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>
+
  | 0
  | Recipe for dying leather armor
+
  | -999
  | None
+
  | Left click outside inventory (drop cursor stack)
 
  |-
 
  |-
  | <code>crafting_special_bookcloning</code>
+
  | 1
  | Recipe for copying contents of written books
+
  | -999
  | None
+
  | Right click outside inventory (drop cursor single item)
 
  |-
 
  |-
  | <code>crafting_special_mapcloning</code>
+
  ! rowspan="2"| 1
  | Recipe for copying maps
+
  | 0
  | None
+
  | Normal
 +
| Shift + left mouse click
 
  |-
 
  |-
  | <code>crafting_special_mapextending</code>
+
  | 1
  | Recipe for adding paper to maps
+
  | Normal
  | None
+
  | Shift + right mouse click ''(identical behavior)''
 
  |-
 
  |-
  | <code>crafting_special_firework_rocket</code>
+
  ! rowspan="7"| 2
  | Recipe for making firework rockets
+
  | 0
  | None
+
  | Normal
 +
| Number key 1
 
  |-
 
  |-
  | <code>crafting_special_firework_star</code>
+
  | 1
  | Recipe for making firework stars
+
  | Normal
  | None
+
  | Number key 2
 
  |-
 
  |-
  | <code>crafting_special_firework_star_fade</code>
+
  | 2
  | Recipe for making firework stars fade between multiple colors
+
  | Normal
  | None
+
  | Number key 3
 
  |-
 
  |-
  | <code>crafting_special_repairitem</code>
+
  |
  | Recipe for repairing items via crafting
+
  |
  | None
+
  |
 
  |-
 
  |-
  | <code>crafting_special_tippedarrow</code>
+
  | 8
  | Recipe for crafting tipped arrows
+
  | Normal
  | None
+
  | Number key 9
 
  |-
 
  |-
  | <code>crafting_special_bannerduplicate</code>
+
  |
  | Recipe for copying banner patterns
+
  |
  | None
+
  | Button is used as the slot index (impossible in vanilla clients)
 
  |-
 
  |-
  | <code>crafting_special_banneraddpattern</code>
+
  | 40
  | Recipe for adding patterns to banners
+
  | Normal
  | None
+
  | Offhand swap key F
 
  |-
 
  |-
  | <code>crafting_special_shielddecoration</code>
+
! 3
  | Recipe for applying a banner's pattern to a shield
+
  | 2
  | None
+
  | Normal
 +
  | Middle click, only defined for creative players in non-player inventories.
 
  |-
 
  |-
  | <code>crafting_special_shulkerboxcoloring</code>
+
  ! rowspan="2"| 4
  | Recipe for recoloring a shulker box
+
  | 0
  | None
+
  | Normal*
 +
| Drop key (Q) (* Clicked item is always empty)
 
  |-
 
  |-
  | <code>smelting</code>
+
  | 1
  | Smelting recipe
+
  | Normal*
  | As follows:
+
  | Control + Drop key (Q) (* Clicked item is always empty)
  {| class="wikitable"
 
    ! Name
 
    ! Type
 
    ! Description
 
    |-
 
    | Group
 
    | String
 
    | Used to group similar recipes together in the recipe book.
 
    |-
 
    | Ingredient
 
    | Ingredient
 
    |
 
    |-
 
    | Result
 
    | [[Slot]]
 
    |
 
    |-
 
    | Experience
 
    | Float
 
    |
 
    |-
 
    | Cooking time
 
    | VarInt
 
    |
 
    |}
 
|}
 
 
 
Ingredient is defined as:
 
 
 
{| class="wikitable"
 
! Name
 
! Type
 
! Description
 
 
  |-
 
  |-
  | Count
+
  ! rowspan="9"| 5
  | VarInt
+
  | 0
  | Number of elements in the following array
+
  | -999
 +
| Starting left mouse drag
 
  |-
 
  |-
  | Items
+
  | 4
  | Array of [[Slot]]
+
  | -999
  | Any item in this array may be used for the recipe.  The count of each item should be 1.
+
  | Starting right mouse drag
|}
 
 
 
==== Tags ====
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x55
+
  | 8
|rowspan="3"| Play
+
  | -999
|rowspan="3"| Client
+
  | Starting middle mouse drag, only defined for creative players in non-player inventories.
| Block Tags
 
  | (See below)
 
  | IDs are block IDs
 
 
  |-
 
  |-
  | Item Tags
+
  | 1
  | (See below)
+
  | Normal
  | IDs are item IDs
+
  | Add slot for left-mouse drag
 
  |-
 
  |-
  | Fluid Tags
+
  | 5
  | (See below)
+
  | Normal
  | IDs are fluid IDs
+
  | Add slot for right-mouse drag
|}
 
 
 
Tags look like:
 
 
 
{| class="wikitable"
 
!colspan="2"| Field Name
 
!colspan="2"| Field Type
 
! Notes
 
 
  |-
 
  |-
  |colspan="2"| Length
+
  | 9
  |colspan="2"| VarInt
+
  | Normal
  | Number of elements in the following array
+
  | Add slot for middle-mouse drag, only defined for creative players in non-player inventories.
 
  |-
 
  |-
  |rowspan="3"| Tags
+
  | 2
| Tag name
+
  | -999
|rowspan="3"| Array
+
  | Ending left mouse drag
  | Identifier
 
  |
 
 
  |-
 
  |-
  | Count
+
  | 6
  | VarInt
+
  | -999
  | Number of elements in the following array
+
  | Ending right mouse drag
 
  |-
 
  |-
  | Entries
+
  | 10
  | Array of VarInt
+
  | -999
  | Numeric ID of the block/item.
+
  | Ending middle mouse drag, only defined for creative players in non-player inventories.
|}
 
 
 
=== Serverbound ===
 
 
 
==== Query Block NBT ====
 
 
 
Used when <kbd>Shift</kbd>+<kbd>F3</kbd>+<kbd>I</kbd> is pressed while looking at a block.
 
 
 
{| class="wikitable" {{Added}}
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x01
+
  ! rowspan="2"| 6
|rowspan="2"| Play
+
  | 0
|rowspan="2"| Server
+
  | Normal
  | Transaction ID
+
  | Double click
  | VarInt
 
  | An incremental ID so that the client can verify that the response matches.
 
 
  |-
 
  |-
  | Location
+
  | 1
  | Position
+
  | Normal
  | The location of the block to check.
+
  | Pickup all but check items in reverse order (impossible in vanilla clients)
 
  |}
 
  |}
 
==== Tab-Complete (serverbound) ====
 
  
Sent when the client needs to tab-complete a <code>minecraft:ask_server</code> suggestion type.
+
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):
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
|rowspan="5"| {{Change|0x01|0x05}}
 
|rowspan="5"| Play
 
|rowspan="5"| Server
 
|{{Added}}| Transaction Id
 
|{{Added}}| VarInt
 
|{{Added}}| 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.
 
|-
 
| Text
 
| String ({{change|32767|256}})
 
| All text behind the cursor without the <code>/</code> (e.g. to the left of the cursor in left-to-right languages like English)
 
|- {{Removed}}
 
| Assume Command
 
| 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.
 
|- {{Removed}}
 
| Has Position
 
| Boolean
 
|
 
|- {{Removed}}
 
| Looked At Block
 
| Optional Position
 
| The position of the block being looked at. Only sent if Has Position is true.
 
|}
 
  
==== Plugin Message (serverbound) ====
+
# 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);
  
{{Main|Plugin channels}}
+
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.
  
Mods and plugins can use this to send their data. Minecraft itself uses a number of [[plugin channel]]s. These internal channels are prefixed with <code>MC|</code>.
+
==== Close Container ====
  
More documentation on this: [http://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/ http://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/]
+
This packet is sent by the client when closing a window.
  
Note that the length of Data is known only from the packet length, since the packet has no length field of any kind.
+
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"
Line 3,231: Line 1,757:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x0A
+
  | {{change|0x0F|0x11}}
  |rowspan="2"| Play
+
  | Play
  |rowspan="2"| Server
+
  | Server
  | Channel
+
  | Window ID
  | {{Change|String (20)|Identifier}}
+
  | {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
| Name of the [[plugin channel]] used to send the data
+
  | This is the ID of the window that was closed. 0 for player inventory.
|-
 
| Data
 
| Byte Array
 
  | Any data, depending on the channel. <code><nowiki>MC|</nowiki></code> channels are documented [[plugin channel|here]].  The length of this array must be inferred from the packet length.
 
 
  |}
 
  |}
  
 
==== Edit Book ====
 
==== Edit Book ====
  
{| class="wikitable" {{Added}}
+
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 3,253: Line 1,775:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x0B
+
  | rowspan="5"| {{change|0x14|0x16}}
  |rowspan="2"| Play
+
  | rowspan="5"| Play
  |rowspan="2"| Server
+
  | rowspan="5"| Server
  | New book
+
  | 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}}.
 
  |-
 
  |-
  | Is signing
+
  | Entries
  | Boolean
+
  | {{Type|Array}} ({{change|200|100}}) of {{Type|String}} ({{change|8192|1024}})
| True if the player is signing the book; false if the player is saving a draft.
+
| Text from each page. Maximum string length is {{change|8192|1024}} chars.
|}
 
 
 
When editing a draft, the [[NBT]] section of the Slot contains this:
 
 
 
<pre>
 
TAG_Compound(<nowiki>''</nowiki>): 1 entry
 
{
 
  TAG_List('pages'): 2 entries
 
  {
 
    TAG_String(0): 'Something on Page 1'
 
    TAG_String(1): 'Something on Page 2'
 
  }
 
}
 
</pre>
 
 
 
When signing the book, it instead looks like this:
 
 
 
<pre>
 
TAG_Compound(<nowiki>''</nowiki>): 3 entires
 
{
 
  TAG_String('author'): 'Steve'
 
  TAG_String('title'): 'A Wonderful Book'
 
  TAG_List('pages'): 2 entries
 
  {
 
    TAG_String(0): 'Something on Page 1'
 
    TAG_String(1): 'Something on Page 2'
 
  }
 
}
 
</pre>
 
 
 
==== Query Entity NBT ====
 
 
 
Used when <kbd>Shift</kbd>+<kbd>F3</kbd>+<kbd>I</kbd> is pressed while looking at an entity.
 
 
 
{| class="wikitable" {{Added}}
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x0C
+
  | Has title
|rowspan="2"| Play
+
  | {{Type|Boolean}}
|rowspan="2"| Server
+
  | If true, the next field is present. true if book is being signed, false if book is being edited.
  | Transaction ID
 
| VarInt
 
  | An incremental ID so that the client can verify that the response matches.
 
 
  |-
 
  |-
  | Entity ID
+
  | Title
  | VarInt
+
  | {{Type|Optional}} {{Type|String}} ({{change|128|32}})
  | The ID of the entity to query.
+
  | Title of book.
 
  |}
 
  |}
  
==== Pick Item ====
+
==== Set Player Position ====
  
Used to swap out an empty space on the hotbar with the item in the given inventory slot.  The Notchain client uses this for pick block functionality (middle click) to retrieve items from the inventory.
+
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.
  
{| class="wikitable" {{Added}}
+
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.
! Packet ID
+
 
! State
+
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>.
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
|rowspan="1"| 0x15
 
|rowspan="1"| Play
 
|rowspan="1"| Server
 
| Slot to use
 
| VarInt
 
| See [[Inventory]]
 
|}
 
  
The server will first search the player's hotbar for an empty slot, starting from the current slot and looping around to the slot before it. If there are no empty slots, it will start a second search from the current slot and find the first slot that does not contain an enchanted item. If there still are no slots that meet that criteria, then the server will use the currently selected slot.
+
As of 1.20.6, checking for moving too fast is achieved like this (sic):
  
After finding the appropriate slot, the server swaps the items and then send 3 packets:
+
* 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.
  
* [[Protocol#Set slot|Set Slot]], with window ID set to -2 and slot set to the newly chosen slot and the item set to the item that is now in that slot (which was previously at the slot the client requested)
+
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.
* Set Slot, with window ID set to -2 and slot set to the slot the player requested, with the item that is now in that slot and was previously on the hotbar slot
 
* [[Protocol#Held_Item_Change_.28clientbound.29|Held Item Change]], with the slot set to the newly chosen slot.
 
  
 +
Checking for block collisions is achieved like this:
  
==== Craft Recipe Request ====
+
* 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.
  
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.
+
Checking for illegal flight is achieved like this:
  
This packet is sent when a player clicks a recipe in the crafting book that is craftable (white border).
+
* 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"
 
{| class="wikitable"
Line 3,361: Line 1,840:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| {{Change|0x12|0x16}}
+
  | rowspan="5"| {{change|0x1A|0x1C}}
  |rowspan="3"| Play
+
  | rowspan="5"| Play
  |rowspan="3"| Server
+
  | rowspan="5"| Server
  | Window ID
+
  | X
  | Byte
+
  | {{Type|Double}}
  |
+
  | Absolute position.
 
  |-
 
  |-
  | Recipe
+
  | Feet Y
  | {{Change|VarInt|Identifier}}
+
  | {{Type|Double}}
  | A recipe ID
+
  | Absolute feet position, normally Head Y - 1.62.
 
  |-
 
  |-
  | Make all
+
  | Z
  | Boolean
+
  | {{Type|Double}}
  | Affects the amount of items processed; true if shift is down when clicked
+
| Absolute position.
 +
|- {{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: against wall.
 
  |}
 
  |}
  
==== Recipe Book Data ====
+
==== Set Player Position and Rotation ====
(previously known as Crafting Book Data)
+
 
 +
A combination of [[#Set Player Rotation|Move Player Rotation]] and [[#Set Player Position|Move Player Position]].
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,384: Line 1,872:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="7"| {{Change|0x17|0x1B}}
+
  | rowspan="7"| {{change|0x1B|0x1D}}
  |rowspan="7"| Play
+
  | rowspan="7"| Play
  |rowspan="7"| Server
+
  | rowspan="7"| Server
  |colspan="2"| Type
+
  | X
| VarInt
+
| {{Type|Double}}
  | Determines the format of the rest of the packet
+
  | Absolute position.
 
  |-
 
  |-
  ! Type
+
  | Feet Y
  ! Field Name
+
  | {{Type|Double}}
!
+
  | Absolute feet position, normally Head Y - 1.62.
  !
 
 
  |-
 
  |-
  | 0: Displayed Recipe
+
  | Z
| Recipe ID
+
  | {{Type|Double}}
  | {{Change|Int|Identifer}}
+
  | Absolute position.
  | A recipe ID
 
 
  |-
 
  |-
  |rowspan="4"| 1: Recipe Book States
+
  | Yaw
  | Crafting Recipe Book Open
+
  | {{Type|Float}}
| Boolean
+
  | Absolute rotation on the X Axis, in degrees.
  | Whether the player has the crafting recipe book currently opened/active.
 
 
  |-
 
  |-
  | Crafting Recipe Filter Active
+
  | Pitch
  | Boolean
+
  | {{Type|Float}}
  | Whether the player has the crafting recipe book filter option currently active.
+
  | Absolute rotation on the Y Axis, in degrees.
  |- {{Added}}
+
  |- {{removed}}
  | Smelting Recipe Book Open
+
  | On Ground
  | Boolean
+
  | {{Type|Boolean}}
  | Whether the player has the smelting recipe book currently opened/active.
+
  | True if the client is on the ground, false otherwise.
  |- {{Added}}
+
  |- {{added}}
  | Smelting Recipe Filter Active
+
  | Flags
  | Boolean
+
  | {{Type|Byte}}
  | Whether the player has the smelting recipe book filter option currently active.
+
  | Bit field: 0x01: on ground, 0x02: against wall.
 
  |}
 
  |}
  
The Recipe Book Status type is sent when one of the states changes.
+
==== Set Player Rotation ====
 +
[[File:Minecraft-trig-yaw.png|thumb|The unit circle for yaw]]
 +
[[File:Yaw.png|thumb|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.
  
==== Name Item ====
+
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.
  
Sent as a player is renaming an item in an anvil (each keypress in the anvil UI sends a new {{Change|<code>MC{{!}}ItemName</code>|Name Item}} packet).  If the new name is empty, then the item loses its custom name (this is different from setting the custom name to the normal name of the item).  The item name may be no longer than 35 characters long, and if it is longer than that, then the rename is silently ignored.
+
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:
  
{| class="wikitable" {{Added}}
+
dx = x-x0
  ! Packet ID
+
  dy = y-y0
  ! State
+
  dz = z-z0
  ! Bound To
+
  r = sqrt( dx*dx + dy*dy + dz*dz )
  ! Field Name
+
  yaw = -atan2(dx,dz)/PI*180
! Field Type
+
  if yaw < 0 then
! Notes
+
    yaw = 360 + yaw
|-
+
  pitch = -arcsin(dy/r)/PI*180
  |rowspan="1"| 0x1C
 
|rowspan="1"| Play
 
  |rowspan="1"| Server
 
| Item name
 
| String (32767)
 
| The new name of the item
 
|}
 
  
==== Select Trade ====
+
You can get a unit vector from a given yaw/pitch via:
  
When a player selects a specific trade offered by a villager NPC.
+
x = -cos(pitch) * sin(yaw)
 +
y = -sin(pitch)
 +
z =  cos(pitch) * cos(yaw)
  
{| class="wikitable" {{Added}}
+
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 3,458: Line 1,943:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="1"| 0x1E
+
  | rowspan="4"| {{change|0x1C|0x1E}}
  |rowspan="1"| Play
+
  | rowspan="4"| Play
  |rowspan="1"| Server
+
  | rowspan="4"| Server
  | Selected slot
+
  | Yaw
  | {{Change|Integer|VarInt}}
+
  | {{Type|Float}}
  | The selected slot int the players current (trading) inventory. (Was a full Integer for the plugin message)
+
| 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: against wall.
 
  |}
 
  |}
 +
{{Anchor|Set Player Movement Flags}}
 +
==== Set Player {{change|On Ground|Movement Flags}} ====
  
==== Set Beacon Effect ====
+
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.
  
Changes the effect of the current beacon.
+
This packet is used to indicate whether the player is on ground (walking/swimming), or airborne (jumping/falling).
 
 
{| class="wikitable" {{Added}}
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
|rowspan="2"| 0x20
 
|rowspan="2"| Play
 
|rowspan="2"| Server
 
| Primary Effect
 
| {{Change|Integer|VarInt}}
 
| A [http://minecraft.gamepedia.com/Data_values#Potions Potion ID]. (Was a full Integer for the plugin message)
 
|-
 
| Secondary Effect
 
| {{Change|Integer|VarInt}}
 
| A [http://minecraft.gamepedia.com/Data_values#Potions Potion ID]. (Was a full Integer for the plugin message)
 
|}
 
  
==== Update Command Block ====
+
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" {{Added}}
+
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 3,500: Line 1,979:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="11"| 0x22
+
  | rowspan="2"| {{change|0x1D|0x1F}}
  |rowspan="11"| Play
+
  | rowspan="2"| Play
  |rowspan="11"| Server
+
  | rowspan="2"| Server
  |- {{Removed}}
+
  | {{removed}} | On Ground
| X || Int ||  
+
  | {{removed}} | {{Type|Boolean}}
  |- {{Removed}}
+
  | {{removed}} | True if the client is on the ground, false otherwise.
| Y || Int ||
+
  |- {{added}}
|- {{Removed}}
 
  | Z || Int ||
 
|-
 
| Location
 
| Position
 
|
 
|-
 
| Command
 
| String (32767)
 
|
 
|- {{Removed}}
 
| Track output || Boolean || If false, the output of the previous command will not be stored within the command block.
 
  |-
 
| Mode || {{Change|String|VarInt}} enum || One of "SEQUENCE" {{change||(0)}}, "AUTO" {{change||(1)}}, and "REDSTONE" {{change||(2)}} <!-- remove quotes when merging into release article -->
 
|- {{Removed}}
 
| Is conditional || Boolean ||
 
|- {{Removed}}
 
| Automatic || Boolean ||
 
|-
 
 
  | Flags
 
  | Flags
  | Byte
+
  | {{Type|Byte}}
  | 0x01: Track Output (if false, the output of the previous command will not be stored within the command block); 0x02: Is conditional; 0x04: Automatic
+
  | Bit field: 0x01: on ground, 0x02: against wall.
 
  |}
 
  |}
  
==== Update Command Block Minecart ====
+
==== Place Recipe ====
  
{| class="wikitable" {{Added}}
+
This packet is sent when a player clicks a recipe in the crafting book that is craftable (white border).
 +
 
 +
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 3,541: Line 2,003:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x23
+
  | rowspan="3"| {{change|0x22|0x24}}
  |rowspan="3"| Play
+
  | rowspan="3"| Play
  |rowspan="3"| Server
+
  | rowspan="3"| Server
  | Entity ID
+
  | Window ID
  | {{Change|Int|VarInt}}
+
  | {{Type|Byte}}
 
  |
 
  |
 
  |-
 
  |-
  | Command
+
  | Recipe{{change|| ID}}
  | String
+
  | {{change|{{Type|Identifier}}|{{Type|VarInt}}}}
  |
+
  | {{change|A recipe ID.|ID of recipe previously defined in [[#Recipe Book Add|Recipe Book Add]].}}
 
  |-
 
  |-
  | Track Output
+
  | Make all
  | Boolean
+
  | {{Type|Boolean}}
  | If false, the output of the previous command will not be stored within the command block.
+
  | Affects the amount of items processed; true if shift is down when clicked.
 
  |}
 
  |}
  
==== Update Structure Block ====
+
==== Player Input ====
  
{| class="wikitable" {{Added}}
+
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 3,567: Line 2,029:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="22"| 0x25
+
  | rowspan="3"| {{change|0x26|0x28}}
  |rowspan="22"| Play
+
  | rowspan="3"| Play
  |rowspan="22"| Server
+
  | rowspan="3"| Server
  | {{Removed}}| X
+
  | {{removed}} | Sideways
  | {{Removed}}| Int
+
  | {{removed}} | {{Type|Float}}
| {{Removed}}| Tile entity location
+
  | {{removed}} | Positive to the left of the player.
|- {{Removed}}
+
  |- {{removed}}
| Y || Int || Tile entity location
+
  | Forward
|- {{Removed}}
+
  | {{Type|Float}}
| Z || Int || Tile entity location
+
  | Positive forward.
|-
 
| Location
 
| Position
 
| Block entity location
 
|-
 
| Action
 
  | {{Change|Byte|VarInt enum}}
 
| An additional action to perform beyond simply saving the given data; see below
 
|-
 
| Mode
 
| {{Change|String|VarInt}} enum
 
| One of "SAVE" {{change||(0)}}, "LOAD" {{change||(1)}}, "CORNER" {{change||(2)}}, "DATA" {{change||(3)}}. <!-- when merging remove quotes -->
 
  |-
 
| Name
 
| String
 
|
 
|-
 
| Offset X || {{Change|Int|Byte}}
 
  | Between -32 and 32
 
  |-
 
| Offset Y || {{Change|Int|Byte}}
 
  | Between -32 and 32
 
|-
 
| Offset Z || {{Change|Int|Byte}}
 
| Between -32 and 32
 
|-
 
| Size X || {{Change|Int|Byte}}
 
| Between 0 and 32
 
|-
 
| Size Y || {{Change|Int|Byte}}
 
| Between 0 and 32
 
|-
 
| Size Z || {{Change|Int|Byte}}
 
| Between 0 and 32
 
|-
 
| Mirror
 
| {{Change|String|VarInt}} enum
 
| One of "NONE" {{change||(0)}}, "LEFT_RIGHT" {{change||(1)}}, "FRONT_BACK" {{change||(2)}}. <!-- remove quotes when merging -->
 
|-
 
| Rotation
 
| {{Change|String|VarInt}} enum
 
| One of "NONE" {{change||(0)}}, "CLOCKWISE_90" {{change||(1)}}, "CLOCKWISE_180" {{change||(2)}}, "COUNTERCLOCKWISE_90" {{change||(3)}}. <!-- remove quotes when merging -->
 
|-
 
| Metadata
 
| String
 
|
 
|- {{Removed}}
 
| Ignore entities
 
| Boolean
 
|
 
|- {{Removed}}
 
| Show air
 
| Boolean
 
 
|- {{Removed}}
 
| Show bounding box
 
| Boolean
 
|
 
|-
 
| Integrity
 
| Float
 
| Between 0 and 1
 
|-
 
|Seed
 
|VarLong
 
|
 
 
  |-
 
  |-
 
  | Flags
 
  | Flags
  | Byte
+
  | {{Type|Unsigned Byte}}
  | 0x01: Ignore entities; 0x02: Show air; 0x04: Show bounding box
+
  | Bit mask{{change|. 0x1: jump, 0x2: unmount.|; see below.}}
 
  |}
 
  |}
  
Possible actions:
+
The flags are as follows:
  
* {{change|1|0}} - Update data
+
{| class="wikitable" {{added}}
* {{change|2|1}} - Save the structure
+
|-
* {{change|3|2}} - Load the structure
+
  ! Hex Mask
* {{change|4|3}} - Detect size
+
  ! Field
 
+
  |-
{{change|All other values are ignored.  }}The Notchian client uses {{change|1|update data}} to indicate no special action should be taken (i.e. the done button).
+
  | 0x01
 
+
  | Forward
== 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
+
  | 0x02
  |rowspan="4"| Handshaking
+
  | Backward
|rowspan="4"| Server
 
| Protocol Version
 
| VarInt
 
| See [[protocol version numbers]] (currently {{change|340|393}})
 
 
  |-
 
  |-
  | Server Address
+
  | 0x04
  | String
+
  | Left
| Hostname or IP, e.g. localhost or 127.0.0.1, that was used to connect.  The Notchian server does not use this information.
 
|-
 
| Server Port
 
| Unsigned Short
 
| Default is 25565.  The Notchian server does not use this information.
 
 
  |-
 
  |-
  | Next State
+
  | 0x08
  | VarInt Enum
+
  | Right
| 1 for [[#Status|status]], 2 for [[#Login|login]]
 
|}
 
 
 
== Status ==
 
 
 
=== Clientbound ===
 
 
 
No changes so far.
 
 
 
=== Serverbound ===
 
 
 
No changes so far.
 
 
 
== Login ==
 
 
 
=== Clientbound ===
 
 
 
==== Login Plugin Request ====
 
 
 
Used to implement a custom handshaking flow together with [[#Login_Plugin_Response | Login Plugin Response]].
 
 
 
Unlike plugin messages in "play" mode, these messages follow a lock-step request/response scheme, where the client is expected to respond to a request indicating whether it understood. The vanilla client always responds that it hasn't understood, and sends an empty payload.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x04
+
  | 0x10
|rowspan="3"| Play
+
  | Jump
|rowspan="3"| Client
 
| Message ID
 
| VarInt
 
  | Generated by the server - should be unique to the connection.
 
 
  |-
 
  |-
  | Channel
+
  | 0x20
  | Identifier
+
  | Sneak
| Name of the [[plugin channel]] used to send the data
 
 
  |-
 
  |-
  | Data
+
  | 0x40
  | Byte Array
+
  | Sprint
| Any data, depending on the channel. <code><nowiki>MC|</nowiki></code> channels are documented [[plugin channel|here]].  The length of this array must be inferred from the packet length.
 
 
  |}
 
  |}
  
=== Serverbound ===
+
==== Set Seen Recipe ====
  
==== Login Plugin Response ====
+
Sent when recipe is first seen in recipe book. Replaces Recipe Book Data, type 0.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,754: Line 2,086:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x02
+
  | {{change|0x29|0x2B}}
  |rowspan="3"| Play
+
  | Play
  |rowspan="3"| Client
+
  | Server
  | Message ID
+
  | Recipe ID
  | VarInt
+
  | {{change|{{Type|Identifier}}|{{Type|VarInt}}}}
| Should match ID from server.
+
  | ID of recipe previously defined in [[#Recipe Book Add|Recipe Book Add]].
|-
 
| Successful
 
| Boolean
 
  | <code>true</code> if the client understands the request, <code>false</code> otherwise. When <code>false</code>, no payload follows.
 
|-
 
| Data
 
| Optional Byte Array
 
| Any data, depending on the channel. <code><nowiki>MC|</nowiki></code> channels are documented [[plugin channel|here]].  The length of this array must be inferred from the packet length.
 
 
  |}
 
  |}
 
 
  
 
[[Category:Minecraft Modern]]
 
[[Category:Minecraft Modern]]

Revision as of 07:38, 4 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

Data types

Name Size (bytes) Encodes Notes
Teleport Flags 4 Bit field specifying how a teleportation is to be applied on each axis. See #Teleport Flags
ID Set Varies Set of registry IDs specified either inline or as a reference to a tag. See #ID Set

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.

ID Set

Represents a set of IDs in a certain registry (implied by context), either directly (enumerated IDs) or indirectly (tag name).

Name Type Description
Type VarInt Identifier used to determine the data that follows. It can be either:
  • 0 - Represents a named set of IDs defined by a tag.
  • Anything else - Represents an ad-hoc set of IDs enumerated inline.
Tag Name Optional Identifier The registry tag defining the ID set. Only present if Type is 0.
IDs Optional Array of VarInt An array of registry IDs. Only present if Type is not 0.
The size of the array is equal to Type - 1.

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
0x20 Synchronize Entity Position 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
0x70 0x77 Teleport Entity 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

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
0x12 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
0x13 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
0x14 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
0x15 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
0x17 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.

Synchronize Entity Position

Packet ID State Bound To Field Name Field Type Notes
0x20 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 X axis, in degrees.
Pitch 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
0x20 0x21 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 Optional Float X velocity of the player being pushed by the explosion. Only present if Has Player Motion is true.
Player Motion Y Optional Float Y velocity of the player being pushed by the explosion. Only present if Has Player Motion is true.
Player Motion Z Optional Float 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 Sound ID VarInt Represents the Sound ID + 1. If the value is 0, the packet contains a sound specified by Identifier.
Sound Name Optional Identifier The name of the sound played. Only present if Sound ID is 0.
Has Fixed Range Optional Boolean Whether is has fixed range. Only present if Sound ID is 0.
Range Optional Float The fixed range of the sound. Only present if previous boolean is true and Sound ID is 0.

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
0x23 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
0x31 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
0x3E 0x40 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
0x43 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
0x37 0x39 Play Client Window ID Byte VarInt
Recipe Identifier A recipe ID.
Recipe Display ID VarInt ID in the minecraft:recipe_display registry.
Recipe Data Varies Depends on Recipe Type; see below.

below

Recipe Book Add

Packet ID State Bound To Field Name Field Type Notes
0x44 Play Client Recipe Count VarInt Number of elements in the following array.
Recipes Recipe ID Array VarInt ID to assign to the recipe.
Display ID VarInt ID in the minecraft:recipe_display registry.
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 Only present if Has Ingredients is true.
Flags Byte 0x01: show notification; 0x02: highlight as new

Recipe Book Remove

Packet ID State Bound To Field Name Field Type Notes
0x45 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
0x46 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
0x47 0x4C 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
0x64 0x6b 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
0x66 Play Client Slot VarInt
Slot Data Slot

Teleport Entity

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
0x70 0x77 Play Client Entity ID VarInt
X Double
Y Double
Z Double
Velocity X Double
Velocity Y Double
Velocity Z Double
Yaw Angle (Y Rot)New angle, not a delta.
Pitch Angle (X Rot)New angle, not a delta.
Flags Teleport Flags
On Ground Boolean

Serverbound

Bundle Item Selected

Packet ID State Bound To Field Name Field Type Notes
0x02 Play Server Slot of Bundle VarInt
Slot in Bundle VarInt

Client Tick End

Packet ID State Bound To Field Name Field Type Notes
0x0B 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
0x0E 0x10 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
0x0F 0x11 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
0x14 0x16 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
0x1A 0x1C 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: 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
0x1B 0x1D 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: 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
0x1C 0x1E 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: 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
0x1D 0x1F Play Server On Ground Boolean True if the client is on the ground, false otherwise.
Flags Byte Bit field: 0x01: on ground, 0x02: 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
0x22 0x24 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
0x26 0x28 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
0x29 0x2B Play Server Recipe ID Identifier VarInt ID of recipe previously defined in Recipe Book Add.