Difference between revisions of "Protocol"

From wiki.vg
Jump to navigation Jump to search
m (→‎Update Score: It's not the score name; it's the entity name)
m (More documentation on plugin message)
 
(434 intermediate revisions by more than 100 users not shown)
Line 3: Line 3:
 
   |BACKGROUND = #99CCFF
 
   |BACKGROUND = #99CCFF
 
   |WIDTH = 100%
 
   |WIDTH = 100%
   |ICON =  
+
   |ICON =
 
   |HEADING = Heads up!
 
   |HEADING = Heads up!
   |CONTENT = This article is about the protocol for the latest '''stable''' release of Minecraft '''computer edition'''. For the computer edition pre-releases, see [[Pre-release protocol]]. For Pocket Edition, see [[Pocket Edition Protocol Documentation]].
+
   |CONTENT = This article is about the protocol for the latest '''stable''' release of Minecraft '''Java Edition''' ([[Protocol version numbers|1.19, protocol 759]]). For the Java Edition pre-releases, see [[Pre-release protocol]]. For the incomplete Bedrock Edition docs, see [[Bedrock Protocol]]. For the old Pocket Edition, see [[Pocket Edition Protocol Documentation]].
 
}}
 
}}
  
 
This page presents a dissection of the current '''[https://minecraft.net/ Minecraft] protocol'''.
 
This page presents a dissection of the current '''[https://minecraft.net/ Minecraft] protocol'''.
  
If you're having trouble, check out the [[Protocol FAQ|FAQ]] or ask for help in the IRC channel ([irc://irc.freenode.net/mcdevs #mcdevs on chat.freenode.net]).
+
If you're having trouble, check out the [[Protocol FAQ|FAQ]] or ask for help in the IRC channel [ircs://irc.libera.chat:6697 #mcdevs on irc.libera.chat] ([https://wiki.vg/MCDevs More Information]).
  
'''Note:''' While you may use the contents of this page without restriction to create servers, clients, bots, etc… you still need to provide attribution to #mcdevs if you copy any of the contents of this page for publication elsewhere.
+
'''Note:''' While you may use the contents of this page without restriction to create servers, clients, bots, etc; substantial reproductions of this page must be attributed IAW [https://creativecommons.org/licenses/by-sa/4.0/ CC BY-SA 4.0].
  
 
The changes between versions may be viewed at [[Protocol History]].
 
The changes between versions may be viewed at [[Protocol History]].
Line 18: Line 18:
 
== Definitions ==
 
== Definitions ==
  
The Minecraft server accepts connections from TCP clients and communicates with them using ''packets''. A packet is a sequence of bytes sent over the TCP connection. The meaning of a packet depends both on its packet ID and the current state of the connection. The initial state of each connection is [[#Handshaking|Handshaking]], and state is switched using the packets [[#Handshake|Handshake]] ([[#Handshaking|Handshaking]], 0x00, serverbound) and [[#Login Success|Login Success]] ([[#Login|Login]], 0x02, clientbound).
+
The Minecraft server accepts connections from TCP clients and communicates with them using ''packets''. A packet is a sequence of bytes sent over the TCP connection. The meaning of a packet depends both on its packet ID and the current state of the connection. The initial state of each connection is [[#Handshaking|Handshaking]], and state is switched using the packets [[#Handshake|Handshake]] and [[#Login Success|Login Success]].
  
 
=== Data types ===
 
=== Data types ===
Line 47: Line 47:
 
  |-
 
  |-
 
  | Global palette
 
  | Global palette
  | A table/dictionary/palette mapping nonnegative integers to block states. The block state IDs can be constructed from {{Minecraft Wiki|Data values|this table}} by multiplying what the Minecraft Wiki calls “block IDs” by 16 and adding the metadata/damage value (or in most programming languages <code>block_id &lt;&lt; 4 <nowiki>|</nowiki> metadata</code>).
+
  | A table/dictionary/palette mapping nonnegative integers to block states. 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 [https://pokechu22.github.io/Burger/1.19.html burger].
 +
 
 +
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.
 
  |-
 
  |-
 
  | Notchian
 
  | Notchian
 
  | The official implementation of vanilla Minecraft as developed and released by Mojang.
 
  | The official implementation of vanilla Minecraft as developed and released by Mojang.
 +
|-
 +
| Sequence
 +
| The action number counter for local block changes, incremented by one when clicking a block with a hand, right clicking an item, or starting or finishing digging a block. Counter handles latency to avoid applying outdated block changes to the local world.  Also is used to revert ghost blocks created when placing blocks, using buckets, or breaking blocks.
 
  |}
 
  |}
  
 
== Packet format ==
 
== Packet format ==
 +
 +
Packets cannot be larger than 2<sup>21</sup> &minus; 1 or 2097151 bytes (the maximum that can be sent in a 3-byte VarInt).  For compressed packets, this applies to both the compressed length and uncompressed lengths.
  
 
=== Without compression ===
 
=== Without compression ===
Line 64: Line 71:
 
  | Length
 
  | Length
 
  | VarInt
 
  | VarInt
  | Length of packet data + length of the packet ID
+
  | Length of Packet ID + Data
 
  |-
 
  |-
 
  | Packet ID
 
  | Packet ID
 
  | VarInt
 
  | VarInt
  |  
+
  |
 
  |-
 
  |-
 
  | Data
 
  | Data
Line 77: Line 84:
 
=== With compression ===
 
=== With compression ===
  
Once a [[#Set Compression|Set Compression]] packet (with a non-negative threshold) is sent, [[wikipedia:Zlib|zlib]] compression is enabled for all following packets. The format of a packet changes slighty to include the size of the uncompressed packet.
+
Once a [[#Set Compression|Set Compression]] packet (with a non-negative threshold) is sent, [[wikipedia:Zlib|zlib]] compression is enabled for all following packets. The format of a packet changes slightly to include the size of the uncompressed packet.
  
 
{| class=wikitable
 
{| class=wikitable
Line 97: Line 104:
 
  |rowspan="2"| Yes
 
  |rowspan="2"| Yes
 
  | Packet ID
 
  | Packet ID
  | Varint
+
  | VarInt
 
  | zlib compressed packet ID (see the sections below)
 
  | zlib compressed packet ID (see the sections below)
 
  |-
 
  |-
Line 105: Line 112:
 
  |}
 
  |}
  
The length given by the Packet Length field is the number of bytes that remain in that packet, including the Data Length field.
+
If the size of the buffer containing the packet data and ID (as a VarInt) is smaller than the threshold specified in the packet [[#Set Compression|Set Compression]]. It will be sent as uncompressed. This is done by setting the data length as 0. (Comparable to sending a non-compressed format with an extra 0 between the length, and packet data).
 
 
If Data Length is set to zero, then the packet is uncompressed; otherwise it is the size of the uncompressed packet.
 
  
If compressed, the uncompressed length of (Packet ID + Data) must be equal to or over the threshold set in the packet [[#Set Compression 2|Set Compression]] ([[#Login|Login]], 0x03, clientbound), otherwise the receiving party will disconnect.
+
If it's larger than the threshold, then it follows the regular compressed protocol format.
  
Compression can be disabled by sending the packet [[#Set Compression|Set Compression]] ([[#Login|Login]], 0x03, clientbound) with a negative Threshold, or not sending the Set Compression packet at all.
+
Compression can be disabled by sending the packet [[#Set Compression|Set Compression]] with a negative Threshold, or not sending the Set Compression packet at all.
  
 
== Handshaking ==
 
== Handshaking ==
Line 138: Line 143:
 
  | Protocol Version
 
  | Protocol Version
 
  | VarInt
 
  | VarInt
  | See [[protocol version numbers]] (currently 316 in Minecraft 1.11.2)
+
  | See [[protocol version numbers]] (currently 759 in Minecraft 1.19).
 
  |-
 
  |-
 
  | Server Address
 
  | Server Address
 
  | String (255)
 
  | String (255)
  | Hostname or IP, e.g. localhost or 127.0.0.1, that was used to connect. The Notchian server does not use this information.
+
  | Hostname or IP, e.g. localhost or 127.0.0.1, that was used to connect. The Notchian server does not use this information. Note that SRV records are a simple redirect, e.g. if _minecraft._tcp.example.com points to mc.example.org, users connecting to example.com will provide example.org as server address in addition to connecting to it.
  |-  
+
  |-
 
  | Server Port
 
  | Server Port
 
  | Unsigned Short
 
  | Unsigned Short
  | Default is 25565. The Notchian server does not use this information.
+
  | Default is 25565. The Notchian server does not use this information.
 
  |-
 
  |-
 
  | Next State
 
  | Next State
 
  | VarInt Enum
 
  | VarInt Enum
  | 1 for [[#Status|status]], 2 for [[#Login|login]]
+
  | 1 for [[#Status|Status]], 2 for [[#Login|Login]].
 
  |}
 
  |}
  
Line 157: Line 162:
 
{{Warning|This packet uses a nonstandard format. It is never length-prefixed, and the packet ID is an Unsigned Byte instead of a VarInt.}}
 
{{Warning|This packet uses a nonstandard format. It is never length-prefixed, and the packet ID is an Unsigned Byte instead of a VarInt.}}
  
While not technically part of the current protocol, legacy clients may send this packet to initiate [[Server List Ping]], and modern servers should handle it correctly.
+
While not technically part of the current protocol, legacy clients may send this packet to initiate [[Server List Ping]], and modern servers should handle it correctly
 +
The format of this packet is a remnant of the pre-Netty age, before the switch to Netty in 1.7 brought the standard format that is recognized now. This packet merely exists to inform legacy clients that they can't join our modern server.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 172: Line 178:
 
  | Payload
 
  | Payload
 
  | Unsigned Byte
 
  | Unsigned Byte
  | always 1 (<code>0x01</code>)
+
  | always 1 (<code>0x01</code>).
 
  |}
 
  |}
  
 
See [[Server List Ping#1.6]] for the details of the protocol that follows this packet.
 
See [[Server List Ping#1.6]] for the details of the protocol that follows this packet.
  
== Play ==
+
== Status ==
 +
{{Main|Server List Ping}}
  
 
=== Clientbound ===
 
=== Clientbound ===
  
==== Spawn Object ====
+
==== Status Response ====
 
 
Sent by the server when a vehicle or other object is created.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 193: Line 198:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="12"| 0x00
+
  |rowspan="2"| 0x00
  |rowspan="12"| Play
+
  |rowspan="2"| Status
  |rowspan="12"| Client
+
  |rowspan="2"| Client
| Entity ID
 
| VarInt
 
| EID of the object
 
 
  |-
 
  |-
  | Object UUID
+
  | JSON Response
  | UUID
+
  | String (32767)
  |  
+
  | See [[Server List Ping#Response]]; as with all strings this is prefixed by its length as a VarInt.
 +
|}
 +
 
 +
==== Ping Response ====
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | Type
+
  | 0x01
  | Byte
+
  | Status
  | The type of object (see [[Entities#Objects]])
+
  | Client
  |-
+
  | Payload
  | X
+
  | Long
  | Double
+
  | Should be the same as sent by the client.
  |  
+
  |}
  |-
+
 
  | Y
+
=== Serverbound ===
  | Double
+
 
  |
+
==== Status Request ====
 +
 
 +
The status can only be requested once immediately after the handshake, before any ping. The server won't respond otherwise.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
  ! State
 +
! Bound To
 +
  ! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | Z
+
  | 0x00
  | Double
+
  | Status
  |  
+
  | Server
  |-
+
  |colspan="3"| ''no fields''
| Pitch
 
| Angle
 
|
 
|-
 
| Yaw
 
| Angle
 
|
 
|-
 
| Data
 
| Int
 
| Meaning dependent on the value of the Type field, see [[Object Data]] for details.
 
|-
 
| Velocity X
 
| Short
 
|rowspan="3"| Same units as [[#Entity Velocity|Entity Velocity]].  Always sent, but only used when Data is greater than 0 (except for some entities which always ignore it; see [[Object Data]] for details).
 
|-
 
| Velocity Y
 
| Short
 
|-
 
| Velocity Z
 
| Short
 
 
  |}
 
  |}
  
==== Spawn Experience Orb ====
+
==== Ping Request ====
 
 
Spawns one or more experience orbs.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 255: Line 255:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| 0x01
+
  | 0x01
  |rowspan="5"| Play
+
  | Status
|rowspan="5"| Client
+
  | Server
| Entity ID
+
  | Payload
| VarInt
+
  | Long
|
+
  | May be any number. Notchian clients use a system-dependent time value which is counted in milliseconds.
|-
 
| X
 
| Double
 
|
 
  |-
 
  | Y
 
| Double
 
  |  
 
  |-
 
| Z
 
| Double
 
|
 
|-
 
| Count
 
| Short
 
| The amount of experience this orb will reward once collected
 
 
  |}
 
  |}
  
==== Spawn Global Entity ====
+
== Login ==
 +
 
 +
The login process is as follows:
 +
 
 +
# C→S: [[#Handshake|Handshake]] with Next State set to 2 (login)
 +
# C→S: [[#Login Start|Login Start]]
 +
# S→C: [[#Encryption Request|Encryption Request]]
 +
# Client auth
 +
# C→S: [[#Encryption Response|Encryption Response]]
 +
# Server auth, both enable encryption
 +
# S→C: [[#Set Compression|Set Compression]] (optional)
 +
# S→C: [[#Login Success|Login Success]]
 +
 
 +
Set Compression, if present, must be sent before Login Success. Note that anything sent after Set Compression must use the [[#With compression|Post Compression packet format]].
 +
 
 +
For unauthenticated ("cracked"/offline-mode) and integrated servers (either of the two conditions is enough for an unencrypted connection) there is no encryption. In that case [[#Login Start|Login Start]] is directly followed by [[#Login Success|Login Success]]. The Notchian server uses UUID v3 for offline player UUIDs, with the namespace “OfflinePlayer” and the value as the player’s username. For example, Notch’s offline UUID would be derived from the string “OfflinePlayer:Notch”. This is not a requirement however, the UUID may be anything.
 +
 
 +
See [[Protocol Encryption]] for details.
 +
 
 +
=== Clientbound ===
  
With this packet, the server notifies the client of thunderbolts striking within a 512 block radius around the player. The coordinates specify where exactly the thunderbolt strikes.
+
==== Disconnect (login) ====
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 291: Line 294:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| 0x02
+
  | 0x00
  |rowspan="5"| Play
+
  | Login
  |rowspan="5"| Client
+
  | Client
  | Entity ID
+
  | Reason
  | VarInt
+
  | [[Chat]]
  | The EID of the thunderbolt
+
  | The reason why the player was disconnected.
|-
+
  |}
| Type
+
 
| Byte Enum
+
==== Encryption Request ====
| The global entity type, currently always 1 for thunderbolt
 
|-
 
| X
 
| Double
 
|
 
|-
 
| Y
 
| Double
 
|
 
|-
 
| Z
 
| Double
 
|
 
  |}
 
 
 
==== Spawn Mob ====
 
 
 
Sent by the server when a mob entity is spawned.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 327: Line 312:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="13"| 0x03
+
  |rowspan="5"| 0x01
  |rowspan="13"| Play
+
  |rowspan="5"| Login
  |rowspan="13"| Client
+
  |rowspan="5"| Client
  | Entity ID
+
  | Server ID
 +
| String (20)
 +
| Appears to be empty.
 +
|-
 +
| Public Key Length
 
  | VarInt
 
  | VarInt
  |  
+
  | Length of Public Key
 
  |-
 
  |-
  | Entity UUID
+
  | Public Key
  | UUID
+
  | Byte Array
  |  
+
  | The server's public key, in bytes.
 
  |-
 
  |-
  | Type
+
  | Verify Token Length
 
  | VarInt
 
  | VarInt
  | The type of mob. See [[Entities#Mobs]]
+
  | Length of Verify Token. Always 4 for Notchian servers.
 
  |-
 
  |-
  | X
+
  | Verify Token
  | Double
+
  | Byte Array
  |  
+
  | A sequence of random bytes generated by the server.
  |-
+
  |}
| Y
+
 
  | Double
+
See [[Protocol Encryption]] for details.
  |
+
 
  |-
+
==== Login Success ====
  | Z
+
 
  | Double
+
{| class="wikitable"
  |
+
  ! Packet ID
 +
  ! State
 +
  ! Bound To
 +
  !colspan="2"| Field Name
 +
  !colspan="2"| Field Type
 +
  ! Notes
 
  |-
 
  |-
  | Yaw
+
  |rowspan="7"| 0x02
  | Angle
+
|rowspan="7"| Login
  |  
+
  |rowspan="7"| Client
 +
  |colspan="2"| UUID
 +
|colspan="2"| UUID
 +
|colspan="2"|
 
  |-
 
  |-
  | Pitch
+
  |colspan="2"| Username
  | Angle
+
  |colspan="2"| String (16)
  |  
+
  |colspan="2"|
 
  |-
 
  |-
  | Head Pitch
+
  |colspan="2"| Number Of Properties
  | Angle
+
  |colspan="2"| VarInt
  |  
+
  | Number of elements in the following array.
 
  |-
 
  |-
  | Velocity X
+
  |rowspan="4"| Property
  | Short
+
| Name
  | Same units as [[#Entity Velocity|Entity Velocity]]
+
|rowspan="4"| Array
 +
  | String (32767)
 +
  |colspan="2"|
 
  |-
 
  |-
  | Velocity Y
+
  | Value
  | Short
+
  | String (32767)
  | Same units as [[#Entity Velocity|Entity Velocity]]
+
  |colspan="1"|
 
  |-
 
  |-
  | Velocity Z
+
  | Is Signed
  | Short
+
  | Boolean
  | Same units as [[#Entity Velocity|Entity Velocity]]
+
  |colspan="2"|
 
  |-
 
  |-
  | Metadata
+
  | Signature
  | [[Entities#Entity Metadata Format|Entity Metadata]]
+
  | Optional String (32767)
  |  
+
  | Only if Is Signed is true.
 
  |}
 
  |}
  
==== Spawn Painting ====
+
This packet switches the connection state to [[#Play|play]].
 +
 
 +
{{Warning2|The (notchian) server might take a bit to fully transition to the Play state, so it's recommended to wait before sending Play packets, either by setting a timeout, or waiting for Play packets from the server (usually [[#Login (play)|Login (play)]]).
  
This packet shows location, name, and type of painting.
+
The notchian client doesn't send any (non-[[#Keep Alive|keep alive]]) packets until the next tick/[[#Set Time|Set Time]] packet.
 +
}}
 +
 
 +
==== Set Compression ====
 +
 
 +
Enables compression.  If compression is enabled, all following packets are encoded in the [[#With compression|compressed packet format]].  Negative or zero values will disable compression, meaning the packet format should remain in the [[#Without compression|uncompressed packet format]].  However, this packet is entirely optional, and if not sent, compression will also not be enabled (the notchian server does not send the packet when compression is disabled).
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 395: Line 401:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| 0x04
+
  | 0x03
  |rowspan="5"| Play
+
  | Login
  |rowspan="5"| Client
+
  | Client
  | Entity ID
+
  | Threshold
 
  | VarInt
 
  | VarInt
  |  
+
  | Maximum size of a packet before it is compressed.
 +
|}
 +
 
 +
==== 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 notchian 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
 
  |-
 
  |-
  | Entity UUID
+
  |rowspan="3"| 0x04
  | UUID
+
|rowspan="3"| Login
  |  
+
|rowspan="3"| Client
 +
| Message ID
 +
  | VarInt
 +
  | Generated by the server - should be unique to the connection.
 
  |-
 
  |-
  | Title
+
  | Channel
  | String (13)
+
  | Identifier
  | Name of the painting. Max length 13
+
  | Name of the [[plugin channel]] used to send the data.
 
  |-
 
  |-
  | Location
+
  | Data
| Position
+
  | Byte Array
| Center coordinates (see below)
+
  | Any data, depending on the channel. The length of this array must be inferred from the packet length.
|-
 
| 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.
+
=== Serverbound ===
  
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):
+
==== Login Start  ====
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Name
+
  ! Packet ID
  ! x
+
! State
  ! y
+
  ! Bound To
  ! width
+
  ! Field Name
  ! height
+
  ! Field Type
 +
  ! Notes
 +
|-
 +
|rowspan="7"| 0x00
 +
|rowspan="7"| Login
 +
|rowspan="7"| Server
 +
| Name
 +
| String (16)
 +
| Player's Username.
 
  |-
 
  |-
  | <code>Kebab</code>
+
  | Has Sig Data
  | 0
+
  | Boolean
  | 0
+
  | Whether or not the next 5 fields should be sent.
| 16
 
| 16
 
 
  |-
 
  |-
  | <code>Aztec</code>
+
  | Timestamp
  | 16
+
  | Long
  | 0
+
  | When the key data will expire. Optional. Only sent if Has Sig Data is true.
  | 16
+
  |-
  | 16
+
  | Public Key Length
 +
| VarInt
 +
| Length of Public Key. Optional. Only sent if Has Sig Data is true.
 
  |-
 
  |-
  | <code>Alban</code>
+
  | Public Key
  | 32
+
  | Byte Array
  | 0
+
  | The encoded bytes of the public key the client received from Mojang. Optional. Only sent if Has Sig Data is true.
| 16
 
| 16
 
 
  |-
 
  |-
  | <code>Aztec2</code>
+
  | Signature Length
  | 48
+
  | VarInt
  | 0
+
  | Length of Signature. Optional. Only sent if Has Sig Data is true.
| 16
 
| 16
 
 
  |-
 
  |-
  | <code>Bomb</code>
+
  | Signature
  | 64
+
  | Byte Array
  | 0
+
  | The bytes of the public key signature the client received from Mojang. Optional. Only sent if Has Sig Data is true.
  | 16
+
  |}
  | 16
+
 
 +
==== Encryption Response ====
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | <code>Plant</code>
+
  |rowspan="8"| 0x01
  | 80
+
|rowspan="8"| Login
  | 0
+
  |rowspan="8"| Server
  | 16
+
  | Shared Secret Length
  | 16
+
  | VarInt
 +
  | Length of Shared Secret.
 
  |-
 
  |-
  | <code>Wasteland</code>
+
  | Shared Secret
  | 96
+
  | Byte Array
  | 0
+
  | Shared Secret value, encrypted with the server's public key.
| 16
 
| 16
 
 
  |-
 
  |-
  | <code>Pool</code>
+
  | Has Verify Token
  | 0
+
  | Boolean
  | 32
+
  | Whether or not the Verify Token should be sent. If not, then the salt and signature will be sent.
  | 32
+
  |-
  | 16
+
  | Optional Verify Token Length
 +
| VarInt
 +
| Length of Verify Token. Optional and only sent if Has Verify Token is true.
 
  |-
 
  |-
  | <code>Courbet</code>
+
  | Optional Verify Token
  | 32
+
  | Byte Array
  | 32
+
  | Verify Token value, encrypted with the same public key as the shared secret. Optional and only sent if Has Verify Token is true.
| 32
 
| 16
 
 
  |-
 
  |-
  | <code>Sea</code>
+
  | Optional Salt
  | 64
+
  | Long
  | 32
+
  | Cryptography, used for validating the message signature. Optional and only sent if Has Verify Token is false.
| 32
 
| 16
 
 
  |-
 
  |-
  | <code>Sunset</code>
+
  | Optional Message Signature Length
  | 96
+
  | VarInt
  | 32
+
  | Array Length. Optional and only sent if Has Verify Token is false.
| 32
 
| 16
 
 
  |-
 
  |-
  | <code>Creebet</code>
+
  | Optional Message Signature
  | 128
+
  | Byte Array
  | 32
+
  | The bytes of the public key signature the client received from Mojang. Optional and only sent if Has Verify Token is false.
  | 32
+
  |}
  | 16
+
 
 +
See [[Protocol Encryption]] for details. See [[Mojang_API#Player_Certificates]] for an API to get the message signature.
 +
 
 +
==== Login Plugin Response ====
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
  ! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | <code>Wanderer</code>
+
  |rowspan="3"| 0x02
  | 0
+
|rowspan="3"| Login
  | 64
+
  |rowspan="3"| Server
  | 16
+
  | Message ID
  | 32
+
  | VarInt
 +
  | Should match ID from server.
 
  |-
 
  |-
  | <code>Graham</code>
+
  | Successful
| 16
+
| Boolean
| 64
+
| <code>true</code> if the client understood the request, <code>false</code> otherwise. When <code>false</code>, no payload follows.
| 16
 
| 32
 
 
  |-
 
  |-
  | <code>Match</code>
+
  | Data
  | 0
+
  | Optional Byte Array
  | 128
+
  | Any data, depending on the channel. The length of this array must be inferred from the packet length.
  | 32
+
  |}
  | 32
+
 
 +
== Play ==
 +
 
 +
=== Clientbound ===
 +
 
 +
==== Spawn Entity ====
 +
 
 +
Sent by the server when a vehicle or other non-living entity is created.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
  ! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | <code>Bust</code>
+
  |rowspan="13"| 0x00
  | 32
+
|rowspan="13"| Play
  | 128
+
  |rowspan="13"| Client
  | 32
+
  | Entity ID
  | 32
+
  | VarInt
 +
  | A unique integer ID mostly used in the protocol to identify the entity.
 
  |-
 
  |-
  | <code>Stage</code>
+
  | Entity UUID
  | 64
+
  | UUID
  | 128
+
  | A unique identifier that is mostly used in persistence and places where the uniqueness matters more.
| 32
 
| 32
 
 
  |-
 
  |-
  | <code>Void</code>
+
  | Type
  | 96
+
  | VarInt
  | 128
+
  | The type of the entity (see "type" field of the list of [[entity_metadata#Mobs|Mob types]]).
| 32
 
| 32
 
 
  |-
 
  |-
  | <code>SkullAndRoses</code>
+
  | X
  | 128
+
  | Double
  | 128
+
  |
| 32
 
| 32
 
 
  |-
 
  |-
  | <code>Wither</code>
+
  | Y
  | 160
+
  | Double
  | 128
+
  |
| 32
 
| 32
 
 
  |-
 
  |-
  | <code>Fighters</code>
+
  | Z
  | 0
+
| Double
  | 96
+
|
  | 64
+
  |-
  | 32
+
  | Pitch
 +
  | Angle
 +
  | To get the real pitch, you must divide this by (256.0F / 360.0F)
 
  |-
 
  |-
  | <code>Pointer</code>
+
  | Yaw
  | 0
+
  | Angle
  | 192
+
  | To get the real yaw, you must divide this by (256.0F / 360.0F)
| 64
 
| 64
 
 
  |-
 
  |-
  | <code>Pigscene</code>
+
  | Head Yaw
  | 64
+
  | Angle
  | 192
+
  |- Only used by living entities, where the head of the entity may differ from the general body rotation.
  | 64
+
  | Data
  | 64
+
  | VarInt
 +
| Meaning dependent on the value of the Type field, see [[Object Data]] for details.
 
  |-
 
  |-
  | <code>BurningSkull</code>
+
  | Velocity X
  | 128
+
  | Short
  | 192
+
  |rowspan="3"| Same units as [[#Set Entity Motion|Set Entity Motion]].
| 64
 
| 64
 
 
  |-
 
  |-
  | <code>Skeleton</code>
+
  | Velocity Y
  | 192
+
  | Short
| 64
 
| 64
 
| 48
 
 
  |-
 
  |-
  | <code>DonkeyKong</code>
+
  | Velocity Z
  | 192
+
  | Short
| 112
 
| 64
 
| 48
 
 
  |}
 
  |}
  
The {{Minecraft Wiki|Painting#Canvases|Minecraft Wiki article on paintings}} also provides a list of painting names to the actual images.
+
==== Spawn Experience Orb ====
  
==== Spawn Player ====
+
Spawns one or more experience orbs.
 
 
This packet is sent by the server when a player comes into visible range, ''not'' when a player joins.
 
 
 
This packet must be sent after the [[#Player List Item|Player List Item]] ([[#Play|Play]], 0x38, clientbound) packet that adds the player data for the client to use when spawning a player. If the Player List Item for the player spawned by this packet is not present when this packet arrives, Notchian clients will not spawn the player entity. The Player List Item packet includes skin/cape data.
 
 
 
Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 605: Line 638:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="8"| 0x05
+
  |rowspan="5"| 0x01
  |rowspan="8"| Play
+
  |rowspan="5"| Play
  |rowspan="8"| Client
+
  |rowspan="5"| Client
 +
| Entity ID
 +
| VarInt
 +
|
 +
|-
 +
| X
 +
| Double
 +
|
 +
|-
 +
| Y
 +
| Double
 +
|
 +
|-
 +
| Z
 +
| Double
 +
|
 +
|-
 +
| Count
 +
| Short
 +
| The amount of experience this orb will reward once collected.
 +
|}
 +
 
 +
==== Spawn Player ====
 +
 
 +
This packet is sent by the server when a player comes into visible range, ''not'' when a player joins.
 +
 
 +
This packet must be sent after the [[#Player Info|Player Info]] packet that adds the player data for the client to use when spawning a player. If the Player Info for the player spawned by this packet is not present when this packet arrives, Notchian clients will not spawn the player entity. The Player Info packet includes skin/cape data.
 +
 
 +
Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="7"| 0x02
 +
|rowspan="7"| Play
 +
|rowspan="7"| Client
 
  | Entity ID
 
  | Entity ID
 
  | VarInt
 
  | VarInt
  | Player's EID
+
  | A unique integer ID mostly used in the protocol to identify the player.
 
  |-
 
  |-
 
  | Player UUID
 
  | Player UUID
 
  | UUID
 
  | UUID
  | See below for notes on {{Minecraft Wiki|Server.properties#online-mode|offline mode}} and NPCs
+
  | See below for notes on {{Minecraft Wiki|Server.properties#online-mode|offline mode}} and NPCs.
 
  |-
 
  |-
 
  | X
 
  | X
 
  | Double
 
  | Double
  |  
+
  |
 
  |-
 
  |-
 
  | Y
 
  | Y
 
  | Double
 
  | Double
  |  
+
  |
 
  |-
 
  |-
 
  | Z
 
  | Z
 
  | Double
 
  | Double
  |  
+
  |
 
  |-
 
  |-
 
  | Yaw
 
  | Yaw
 
  | Angle
 
  | Angle
  |  
+
  |
 
  |-
 
  |-
 
  | Pitch
 
  | Pitch
 
  | Angle
 
  | Angle
|
+
  |
|-
 
| Metadata
 
| [[Entities#Entity Metadata Format|Entity Metadata]]
 
  |  
 
 
  |}
 
  |}
  
 
When in {{Minecraft Wiki|Server.properties#online-mode|online mode}}, the UUIDs must be valid and have valid skin blobs.
 
When in {{Minecraft Wiki|Server.properties#online-mode|online mode}}, the UUIDs must be valid and have valid skin blobs.
  
In offline mode, [[Wikipedia:Universally unique identifier#Versions 3 and 5 (namespace name-based)|UUID v3]] is used with the String <code>OfflinePlayer:&lt;player name&gt;</code>, encoded in UTF-8 (and case-sensitive).
+
In offline mode, [[Wikipedia:Universally unique identifier#Versions 3 and 5 (namespace name-based)|UUID v3]] is used with the String <code>OfflinePlayer:&lt;player name&gt;</code>, encoded in UTF-8 (and case-sensitive).  The Notchain server uses <code>UUID.nameUUIDFromBytes</code>, implemented by OpenJDK [https://github.com/AdoptOpenJDK/openjdk-jdk8u/blob/9a91972c76ddda5c1ce28b50ca38cbd8a30b7a72/jdk/src/share/classes/java/util/UUID.java#L153-L175 here].
  
 
For NPCs UUID v2 should be used. Note:
 
For NPCs UUID v2 should be used. Note:
Line 651: Line 720:
 
In an example UUID, <code>xxxxxxxx-xxxx-Yxxx-xxxx-xxxxxxxxxxxx</code>, the UUID version is specified by <code>Y</code>. So, for UUID v3, <code>Y</code> will always be <code>3</code>, and for UUID v2, <code>Y</code> will always be <code>2</code>.
 
In an example UUID, <code>xxxxxxxx-xxxx-Yxxx-xxxx-xxxxxxxxxxxx</code>, the UUID version is specified by <code>Y</code>. So, for UUID v3, <code>Y</code> will always be <code>3</code>, and for UUID v2, <code>Y</code> will always be <code>2</code>.
  
==== Animation (clientbound) ====
+
==== Entity Animation (clientbound) ====
  
 
Sent whenever an entity should change animation.
 
Sent whenever an entity should change animation.
Line 663: Line 732:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x06
+
  |rowspan="2"| 0x03
 
  |rowspan="2"| Play
 
  |rowspan="2"| Play
 
  |rowspan="2"| Client
 
  |rowspan="2"| Client
 
  | Entity ID
 
  | Entity ID
 
  | VarInt
 
  | VarInt
  | Player ID
+
  | Player ID.
 
  |-
 
  |-
 
  | Animation
 
  | Animation
 
  | Unsigned Byte
 
  | Unsigned Byte
  | Animation ID (see below)
+
  | Animation ID (see below).
 
  |}
 
  |}
  
Line 700: Line 769:
 
  |}
 
  |}
  
==== Statistics ====
+
==== Award Statistics ====
 +
 
 +
Sent as a response to [[#Client Command|Client Command]] (id 1). Will only send the changed values if previously requested.
  
 
{| class="wikitable"
 
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
 
  ! 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="3"| 0x07
+
  |rowspan="4"| 0x04
  |rowspan="3"| Play
+
  |rowspan="4"| Play
  |rowspan="3"| Client
+
  |rowspan="4"| Client
 
  |colspan="2"| Count
 
  |colspan="2"| Count
 
  |colspan="2"| VarInt
 
  |colspan="2"| VarInt
  | Number of elements in the following array
+
  | Number of elements in the following array.
 +
|-
 +
|rowspan="3"| Statistic
 +
| Category ID
 +
|rowspan="3"| Array
 +
| VarInt
 +
| See below.
 
  |-
 
  |-
  |rowspan="2"| Statistic
+
  | Statistic ID
  | Name
+
  | VarInt
|rowspan="2"| Array
+
  | See below.
  | String (32767)
 
| [https://gist.github.com/thinkofname/a1842c21a0cf2e1fb5e0 https://gist.github.com/thinkofname/a1842c21a0cf2e1fb5e0]
 
 
  |-
 
  |-
 
  | Value
 
  | Value
 
  | VarInt
 
  | VarInt
  | The amount to set it to
+
  | The amount to set it to.
 
  |}
 
  |}
  
==== Block Break Animation ====
+
Categories (these are namespaced, but with <code>:</code> replaced with <code>.</code>):
 
 
0–9 are the displayable destroy stages and each other number means that there is no animation on this coordinate.
 
 
 
Block break animations can still be applied on air; the animation will remain visible although there is no block being broken.  However, if this is applied to a transparent block, odd graphical effects may happen, including water losing its transparency. (An effect similar to this can be seen in normal gameplay when breaking ice blocks)
 
 
 
If you need to display several break animations at the same time you have to give each of them a unique Entity ID.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  ! Name
  ! State
+
! ID
  ! Bound To
+
  ! Registry
  ! Field Name
+
  |-
  ! Field Type
+
| <code>minecraft.mined</code>
  ! Notes
+
| 0
 +
| Blocks
 +
|-
 +
| <code>minecraft.crafted</code>
 +
| 1
 +
| Items
 +
|-
 +
| <code>minecraft.used</code>
 +
| 2
 +
| Items
 +
|-
 +
  | <code>minecraft.broken</code>
 +
  | 3
 +
  | Items
 
  |-
 
  |-
  |rowspan="3"| 0x08
+
  | <code>minecraft.picked_up</code>
|rowspan="3"| Play
+
  | 4
|rowspan="3"| Client
+
  | Items
| Entity ID
 
  | VarInt
 
  | Entity ID of the entity breaking the block
 
 
  |-
 
  |-
  | Location
+
  | <code>minecraft.dropped</code>
  | Position
+
  | 5
  | Block Position
+
  | Items
 
  |-
 
  |-
  | Destroy Stage
+
  | <code>minecraft.killed</code>
| Byte
+
  | 6
  | 0–9 to set it, any other value to remove it
+
  | Entities
  |}
 
 
 
==== Update Block Entity ====
 
 
 
Sets tile entity associated with the block at the given location.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x09
+
  | <code>minecraft.killed_by</code>
|rowspan="3"| Play
+
  | 7
|rowspan="3"| Client
+
  | Entities
| Location
 
  | Position
 
  |  
 
 
  |-
 
  |-
  | Action
+
  | <code>minecraft.custom</code>
| Unsigned Byte
+
  | 8
| The type of update to perform, see below
+
  | Custom
|-
 
| NBT Data
 
  | [[NBT|NBT Tag]]
 
  | 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:
+
Blocks, Items, and Entities use block (not block state), item, and entity ids.
 
 
* '''1''': Set data of a mob spawner (everything except for SpawnPotentials: current delay, min/max delay, mob to be spawned, spawn count, spawn range, etc.)
 
* '''2''': Set command block text (command and last execution status)
 
* '''3''': Set the level, primary, and secondary powers of a beacon
 
* '''4''': Set rotation and skin of mob head
 
* '''5''': Set type of flower in flower pot
 
* '''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 (unclear if there is any actual data)
 
 
 
==== Block Action ====
 
 
 
This packet is used for a number of actions and animations performed by blocks, usually non-persistent.
 
  
See [[Block Actions]] for a list of values.
+
Custom has the following (unit only matters for clients):
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  ! Name
! State
+
  ! ID
! Bound To
+
  ! Unit
! Field Name
 
  ! Field Type
 
  ! Notes
 
 
  |-
 
  |-
  |rowspan="4"| 0x0A
+
  | <code>minecraft.leave_game</code>
|rowspan="4"| Play
+
  | 0
|rowspan="4"| Client
+
  | None
| Location
 
  | Position
 
  | Block coordinates
 
 
  |-
 
  |-
  | Action ID (Byte 1)
+
  | <code>minecraft.play_one_minute</code>
  | Unsigned Byte
+
  | 1
  | Varies depending on block — see [[Block Actions]]
+
  | Time
 
  |-
 
  |-
  | Action Param (Byte 2)
+
  | <code>minecraft.time_since_death</code>
  | Unsigned Byte
+
  | 2
  | Varies depending on block — see [[Block Actions]]
+
  | Time
 
  |-
 
  |-
  | Block Type
+
  | <code>minecraft.time_since_rest</code>
| VarInt
+
  | 3
| The block type ID for the block, not including metadata/damage value.  This must match the block at the given coordinates.
+
  | Time
  |}
 
 
 
==== Block Change ====
 
 
 
Fired whenever a block is changed within the render distance.
 
 
 
{{Warning2|Changing a block in a chunk that is not loaded is not a stable action. The Notchian client currently uses a ''shared'' empty chunk which is modified for all block changes in unloaded chunks; while in 1.9 this chunk never renders in older versions the changed block will appear in all copies of the empty chunk.  Servers should avoid sending block changes in unloaded chunks and clients should ignore such packets.}}
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x0B
+
  | <code>minecraft.sneak_time</code>
|rowspan="2"| Play
+
  | 4
|rowspan="2"| Client
+
  | Time
| Location
 
  | Position
 
  | Block Coordinates
 
 
  |-
 
  |-
  | Block ID
+
  | <code>minecraft.walk_one_cm</code>
| VarInt
+
  | 5
| The new block state ID for the block as given in the {{Minecraft Wiki|Data values#Block IDs|global palette}} (When reading data: <code>type = id &gt;&gt; 4</code>, <code>meta = id & 15</code>, when writing data: <code>id = type &lt;&lt; 4 &#124; (meta &amp; 15)</code>)
+
  | Distance
  |}
 
 
 
==== Boss Bar ====
 
 
 
{| class="wikitable"
 
! Packet ID
 
  ! State
 
! Bound To
 
!colspan="2"| Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="15"| 0x0C
+
  | <code>minecraft.crouch_one_cm</code>
|rowspan="15"| Play
+
  | 6
|rowspan="15"| Client
+
  | Distance
|colspan="2"| UUID
 
  | UUID
 
  | Unique ID for this bar
 
 
  |-
 
  |-
  |colspan="2"| Action
+
  | <code>minecraft.sprint_one_cm</code>
  | VarInt Enum
+
  | 7
  | Determines the layout of the remaining packet
+
  | Distance
 
  |-
 
  |-
  ! Action
+
  | <code>minecraft.walk_on_water_one_cm</code>
  ! Field Name
+
  | 8
  !
+
  | Distance
  !
+
  |-
 +
| <code>minecraft.fall_one_cm</code>
 +
| 9
 +
| Distance
 
  |-
 
  |-
  |rowspan="5"| 0: add
+
  | <code>minecraft.climb_one_cm</code>
| Title
+
  | 10
  | [[Chat]]
+
  | Distance
  |  
 
 
  |-
 
  |-
  | Health
+
  | <code>minecraft.fly_one_cm</code>
  | Float
+
  | 11
  | From 0 to 1. Values greater than 1 do not crash a Notchian client, and start [https://i.johni0702.de/nA.png rendering part of a second health bar] at around 1.5.
+
  | Distance
 
  |-
 
  |-
  | Color
+
  | <code>minecraft.walk_under_water_one_cm</code>
  | VarInt Enum
+
  | 12
  | Color ID (see below)
+
  | Distance
 
  |-
 
  |-
  | Division
+
  | <code>minecraft.minecart_one_cm</code>
  | VarInt Enum
+
  | 13
  | Type of division (see below)
+
  | Distance
 
  |-
 
  |-
  | Flags
+
  | <code>minecraft.boat_one_cm</code>
  | Unsigned Byte
+
  | 14
  | Bit mask. 0x1: should darken sky, 0x2: is dragon bar (used to play end music)
+
  | Distance
 
  |-
 
  |-
  | 1: remove
+
  | <code>minecraft.pig_one_cm</code>
  | ''no fields''
+
  | 15
  | ''no fields''
+
  | Distance
| Removes this boss bar
 
 
  |-
 
  |-
  | 2: update health
+
  | <code>minecraft.horse_one_cm</code>
  | Health
+
  | 16
  | Float
+
  | Distance
| as above
 
 
  |-
 
  |-
  | 3: update title
+
  | <code>minecraft.aviate_one_cm</code>
  | Title
+
  | 17
| [[Chat]]
+
  | Distance
  |  
 
 
  |-
 
  |-
  |rowspan="2"| 4: update style
+
  | <code>minecraft.swim_one_cm</code>
| Color
+
  | 18
  | VarInt Enum
+
  | Distance
  | Color ID (see below)
 
 
  |-
 
  |-
  | Dividers
+
  | <code>minecraft.strider_one_cm</code>
  | VarInt Enum
+
  | 19
  | as above
+
  | Distance
 
  |-
 
  |-
  | 5: update flags
+
  | <code>minecraft.jump</code>
  | Flags
+
  | 20
  | Unsigned Byte
+
  | None
| as above
 
 
  |-
 
  |-
  |}
+
  | <code>minecraft.drop</code>
 
+
| 21
{| class="wikitable"
+
| None
  ! ID
+
  |-
  ! Color
+
  | <code>minecraft.damage_dealt</code>
 +
| 22
 +
| Damage
 
  |-
 
  |-
  | 0
+
  | <code>minecraft.damage_dealt_absorbed</code>
  | Pink
+
  | 23
 +
| Damage
 
  |-
 
  |-
  | 1
+
  | <code>minecraft.damage_dealt_resisted</code>
  | Blue
+
  | 24
 +
| Damage
 
  |-
 
  |-
  | 2
+
  | <code>minecraft.damage_taken</code>
  | Red
+
  | 25
 +
| Damage
 
  |-
 
  |-
  | 3
+
  | <code>minecraft.damage_blocked_by_shield</code>
  | Green
+
  | 26
 +
| Damage
 
  |-
 
  |-
  | 4
+
  | <code>minecraft.damage_absorbed</code>
  | Yellow
+
  | 27
 +
| Damage
 
  |-
 
  |-
  | 5
+
  | <code>minecraft.damage_resisted</code>
  | Purple
+
  | 28
 +
| Damage
 
  |-
 
  |-
  | 6
+
  | <code>minecraft.deaths</code>
  | White
+
  | 29
  |}
+
  | None
 
 
{| class="wikitable"
 
! ID
 
! Type of division
 
 
  |-
 
  |-
  | 0
+
  | <code>minecraft.mob_kills</code>
  | No division
+
  | 30
 +
| None
 
  |-
 
  |-
  | 1
+
  | <code>minecraft.animals_bred</code>
  | 6 notches
+
  | 31
 +
| None
 
  |-
 
  |-
  | 2
+
  | <code>minecraft.player_kills</code>
  | 10 notches
+
  | 32
 +
| None
 
  |-
 
  |-
  | 3
+
  | <code>minecraft.fish_caught</code>
  | 12 notches
+
  | 33
 +
| None
 
  |-
 
  |-
  | 4
+
  | <code>minecraft.talked_to_villager</code>
  | 20 notches
+
  | 34
  |}
+
  | None
 
+
|-
==== Server Difficulty ====
+
| <code>minecraft.traded_with_villager</code>
 
+
  | 35
Changes the difficulty setting in the client's option menu
+
  | None
 
+
  |-
{| class="wikitable"
+
  | <code>minecraft.eat_cake_slice</code>
  ! Packet ID
+
  | 36
  ! State
+
  | None
  ! Bound To
 
  ! Field Name
 
  ! Field Type
 
  ! Notes
 
 
  |-
 
  |-
  |rowspan="1"| 0x0D
+
  | <code>minecraft.fill_cauldron</code>
|rowspan="1"| Play
+
  | 37
|rowspan="1"| Client
+
  | None
| Difficulty
 
| Unsigned Byte
 
  | 0: peaceful, 1: easy, 2: normal, 3: hard
 
  |}
 
 
 
==== Tab-Complete (clientbound) ====
 
 
 
The server responds with a list of auto-completions of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported. The client sorts these alphabetically before listing them.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x0E
+
  | <code>minecraft.use_cauldron</code>
|rowspan="2"| Play
+
  | 38
|rowspan="2"| Client
+
  | None
| Count
 
  | VarInt
 
  | Number of elements in the following array
 
 
  |-
 
  |-
  | Matches
+
  | <code>minecraft.clean_armor</code>
  | Array of String (32767)
+
  | 39
  | One eligible command, note that each command is sent separately instead of in a single string, hence the need for Count
+
  | None
  |}
+
  |-
 
+
  | <code>minecraft.clean_banner</code>
==== Chat Message (clientbound) ====
+
| 40
 
+
  | None
Identifying the difference between Chat/System Message is important as it helps respect the user's chat visibility options. While game info accepts json formatting it will not display, old style §-based formatting works. See [[Chat#Processing chat|processing chat]] for more info about these positions.
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x0F
+
  | <code>minecraft.clean_shulker_box</code>
|rowspan="2"| Play
+
  | 41
|rowspan="2"| Client
+
  | None
| JSON Data
 
  | [[Chat]]
 
  | Limited to 32767 bytes
 
 
  |-
 
  |-
  | Position
+
  | <code>minecraft.interact_with_brewingstand</code>
| Byte
+
  | 42
| 0: chat (chat box), 1: system message (chat box), 2: game info (above hotbar).
+
  | None
|}
 
 
 
==== Multi Block Change ====
 
 
 
Fired whenever 2 or more blocks are changed within the same chunk on the same tick.
 
 
 
{{Warning|Changing blocks in chunks not loaded by the client is unsafe (see note on [[#Block Change|Block Change]]).}}
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
! State
 
! Bound To
 
!colspan="2"| Field Name
 
  !colspan="2"| Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="6"| 0x10
+
  | <code>minecraft.interact_with_beacon</code>
|rowspan="6"| Play
+
  | 43
|rowspan="6"| Client
+
  | None
  |colspan="2"| Chunk X
 
|colspan="2"| Int
 
  | Chunk X coordinate
 
 
  |-
 
  |-
  |colspan="2"| Chunk Z
+
  | <code>minecraft.inspect_dropper</code>
  |colspan="2"| Int
+
  | 44
  | Chunk Z coordinate
+
  | None
 
  |-
 
  |-
  |colspan="2"| Record Count
+
  | <code>minecraft.inspect_hopper</code>
  |colspan="2"| VarInt
+
  | 45
  | Number of elements in the following array, i.e. the number of blocks affected
+
  | None
 
  |-
 
  |-
  |rowspan="3"| Record
+
  | <code>minecraft.inspect_dispenser</code>
| Horizontal Position
+
| 46
|rowspan="3"| Array
+
| None
| 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
+
  | <code>minecraft.play_noteblock</code>
  | Unsigned Byte
+
  | 47
  | Y coordinate of the block
+
  | None
 
  |-
 
  |-
  | Block ID
+
  | <code>minecraft.tune_noteblock</code>
  | VarInt
+
| 48
  | The new block state ID for the block as given in the {{Minecraft Wiki|Data values#Block IDs|global palette}} (When reading data: <code>type = id &gt;&gt; 4</code>, <code>meta = id & 15</code>, when writing data: <code>id = type &lt;&lt; 4 &#124; (meta &amp; 15)</code>)
+
| None
 +
|-
 +
| <code>minecraft.pot_flower</code>
 +
| 49
 +
| None
 +
|-
 +
| <code>minecraft.trigger_trapped_chest</code>
 +
| 50
 +
| None
 +
|-
 +
| <code>minecraft.open_enderchest</code>
 +
| 51
 +
| None
 +
|-
 +
| <code>minecraft.enchant_item</code>
 +
| 52
 +
| None
 +
|-
 +
| <code>minecraft.play_record</code>
 +
| 53
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_furnace</code>
 +
  | 54
 +
  | None
 +
|-
 +
| <code>minecraft.interact_with_crafting_table</code>
 +
| 55
 +
| None
 +
|-
 +
| <code>minecraft.open_chest</code>
 +
| 56
 +
| None
 +
|-
 +
| <code>minecraft.sleep_in_bed</code>
 +
| 57
 +
| None
 +
|-
 +
| <code>minecraft.open_shulker_box</code>
 +
| 58
 +
| None
 +
|-
 +
| <code>minecraft.open_barrel</code>
 +
| 59
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_blast_furnace</code>
 +
| 60
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_smoker</code>
 +
| 61
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_lectern</code>
 +
| 62
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_campfire</code>
 +
| 63
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_cartography_table</code>
 +
| 64
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_loom</code>
 +
| 65
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_stonecutter</code>
 +
| 66
 +
| None
 +
|-
 +
| <code>minecraft.bell_ring</code>
 +
| 67
 +
| None
 +
|-
 +
| <code>minecraft.raid_trigger</code>
 +
| 68
 +
| None
 +
|-
 +
| <code>minecraft.raid_win</code>
 +
| 69
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_anvil</code>
 +
| 70
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_grindstone</code>
 +
| 71
 +
| None
 +
|-
 +
| <code>minecraft.target_hit</code>
 +
| 72
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_smithing_table</code>
 +
| 73
 +
| None
 
  |}
 
  |}
  
To decode the position into a world position:
+
Units:
 
 
<syntaxhighlight lang="java">
 
worldX = (horizPos >> 4 & 15) + (chunkX * 16);
 
worldY = vertPos;
 
worldZ = (horizPos & 15) + (chunkZ * 16);
 
</syntaxhighlight>
 
  
==== Confirm Transaction (clientbound) ====
+
* 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
  
A packet from the server indicating whether a request from the client was accepted, or whether there was a conflict (due to lag).  If the packet was not accepted, the client must respond with a [[#Confirm Transaction (serverbound)|serverbound confirm transaction]] packet.
+
==== Acknowledge Block Change ====
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,117: Line 1,170:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x11
+
  |rowspan="4"| 0x05
  |rowspan="3"| Play
+
  |rowspan="4"| Play
  |rowspan="3"| Client
+
  |rowspan="4"| Client
  | Window ID
+
  | Sequence ID
  | Byte
+
  | VarInt
  | The ID of the window that the action occurred in
+
  | Represents the sequence to acknowledge, this is used for properly syncing block changes to the client after interactions.
|-
 
| Action Number
 
| Short
 
| Every action that is to be accepted has a unique number. This field corresponds to that number.
 
 
  |-
 
  |-
| Accepted
 
| Boolean
 
| Whether the action was accepted
 
 
  |}
 
  |}
  
==== Close Window (clientbound) ====
 
  
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.
+
==== Set Block Destroy Stage ====
  
Note, notchian clients send a close window packet with Window ID 0 to close their inventory even though there is never an [[#Open Window|Open Window]] packet for inventory.  
+
0–9 are the displayable destroy stages and each other number means that there is no animation on this coordinate.
 +
 
 +
Block break animations can still be applied on air; the animation will remain visible although there is no block being broken.  However, if this is applied to a transparent block, odd graphical effects may happen, including water losing its transparency.  (An effect similar to this can be seen in normal gameplay when breaking ice blocks)
 +
 
 +
If you need to display several break animations at the same time you have to give each of them a unique Entity ID. The entity ID does not need to correspond to an actual entity on the client. It is valid to use a randomly generated number.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,147: Line 1,196:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  | 0x12
+
  |rowspan="3"| 0x06
  | Play
+
  |rowspan="3"| Play
  | Client
+
  |rowspan="3"| Client
  | Window ID
+
  | Entity ID
  | Unsigned Byte
+
  | VarInt
  | This is the ID of the window that was closed. 0 for inventory.
+
  | The ID of the entity breaking the block.
 +
|-
 +
| Location
 +
| Position
 +
| Block Position.
 +
|-
 +
| Destroy Stage
 +
| Byte
 +
| 0–9 to set it, any other value to remove it.
 
  |}
 
  |}
  
==== Open Window ====
+
==== Block Entity Data ====
  
This is sent to the client when it should open an inventory, such as a chest, workbench, or furnace. This message is not sent anywhere for clients opening their own inventory.
+
Sets the block entity associated with the block at the given location.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,167: Line 1,224:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| 0x13
+
  |rowspan="3"| 0x07
  |rowspan="5"| Play
+
  |rowspan="3"| Play
  |rowspan="5"| Client
+
  |rowspan="3"| Client
  | Window ID
+
  | Location
  | Unsigned Byte
+
  | Position
  | A unique id number for the window to be displayed. Notchian server implementation is a counter, starting at 1.
+
  |
 
  |-
 
  |-
  | Window Type
+
  | Type
  | String (32)
+
  | VarInt
  | The window type to use for display. See [[Inventory]] for a list.
+
  | The type of the block entity
 
  |-
 
  |-
  | Window Title
+
  | NBT Data
  | [[Chat]]
+
  | [[NBT|NBT Tag]]
  | The title of the window
+
  | 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).
  |-
 
| Number Of Slots
 
| Unsigned Byte
 
| Number of slots in the window (excluding the number of slots in the player inventory)
 
|-
 
| Entity ID
 
| Optional Int
 
| EntityHorse's EID. Only sent when Window Type is “EntityHorse”
 
 
  |}
 
  |}
  
See [[Inventory]] for further information.
+
==== Block Action ====
 +
 
 +
This packet is used for a number of actions and animations performed by blocks, usually non-persistent.  The client ignores the provided block type and instead uses the block state in their world.
  
==== Window Items ====
+
See [[Block Actions]] for a list of values.
[[File:Inventory-slots.png|thumb|The inventory slots]]
 
  
Sent by the server when items in multiple slots (in a window) are added/removed. This includes the main inventory, equipped armour and crafting slots.
+
{{Warning2|This packet uses a block ID, not a block state.}}
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,206: Line 1,256:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x14
+
  |rowspan="4"| 0x08
  |rowspan="3"| Play
+
  |rowspan="4"| Play
  |rowspan="3"| Client
+
  |rowspan="4"| Client
  | Window ID
+
  | Location
 +
| Position
 +
| Block coordinates.
 +
|-
 +
| Action ID (Byte 1)
 
  | Unsigned Byte
 
  | Unsigned Byte
  | The ID of window which items are being sent for. 0 for player inventory.
+
  | Varies depending on block — see [[Block Actions]].
 
  |-
 
  |-
  | Count
+
  | Action Parameter (Byte 2)
  | Short
+
  | Unsigned Byte
  | Number of elements in the following array
+
  | Varies depending on block — see [[Block Actions]].
 
  |-
 
  |-
  | Slot Data
+
  | Block Type
  | Array of [[Slot Data|Slot]]
+
  | VarInt
  |  
+
  | The block type ID for the block.  This must match the block at the given coordinates.
 
  |}
 
  |}
  
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.
 
  
==== Window Property ====
+
==== Block Update ====
 +
 
 +
Fired whenever a block is changed within the render distance.
  
This packet is used to inform the client that part of a GUI window should be updated.
+
{{Warning2|Changing a block in a chunk that is not loaded is not a stable action.  The Notchian client currently uses a ''shared'' empty chunk which is modified for all block changes in unloaded chunks; while in 1.9 this chunk never renders in older versions the changed block will appear in all copies of the empty chunk.  Servers should avoid sending block changes in unloaded chunks and clients should ignore such packets.}}
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,236: Line 1,291:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x15
+
  |rowspan="2"| 0x09
  |rowspan="3"| Play
+
  |rowspan="2"| Play
  |rowspan="3"| Client
+
  |rowspan="2"| Client
  | Window ID
+
  | Location
  | Unsigned Byte
+
  | Position
  |  
+
  | Block Coordinates.
 
  |-
 
  |-
  | Property
+
  | Block ID
  | Short
+
  | VarInt
  | The property to be updated, see below
+
  | The new block state ID for the block as given in the {{Minecraft Wiki|Data values#Block IDs|global palette}}. See that section for more information.
|-
 
| 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.
+
==== Boss Bar ====
  
 
{| class="wikitable"
 
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
!colspan="2"| Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  ! Window type
+
  |rowspan="14"| 0x0A
  ! Property
+
  |rowspan="14"| Play
  ! Value
+
  |rowspan="14"| Client
 +
|colspan="2"| UUID
 +
| UUID
 +
| Unique ID for this bar.
 
  |-
 
  |-
  |rowspan="4"| Furnace
+
  |colspan="2"| Action
  | 0: Fire icon (fuel left)
+
  | VarInt Enum
  | counting from fuel burn time down to 0 (in-game ticks)
+
  | Determines the layout of the remaining packet.
 
  |-
 
  |-
  | 1: Maximum fuel burn time
+
  ! Action
  | fuel burn time or 0 (in-game ticks)
+
  ! Field Name
 +
!
 +
!
 
  |-
 
  |-
  | 2: Progress arrow
+
  |rowspan="5"| 0: add
  | counting from 0 to maximum progress (in-game ticks)
+
| Title
 +
| [[Chat]]
 +
  |
 
  |-
 
  |-
  | 3: Maximum progress
+
  | Health
  | always 200 on the notchian server
+
| Float
 +
  | From 0 to 1. Values greater than 1 do not crash a Notchian client, and start [https://i.johni0702.de/nA.png rendering part of a second health bar] at around 1.5.
 
  |-
 
  |-
  |rowspan="10"| Enchantment Table
+
  | Color
  | 0: Level requirement for top enchantment slot
+
  | VarInt Enum
  |rowspan="3"| The enchantment's xp level requirement
+
  | Color ID (see below).
 
  |-
 
  |-
  | 1: Level requirement for middle enchantment slot
+
  | Division
 +
| VarInt Enum
 +
| Type of division (see below).
 
  |-
 
  |-
  | 2: Level requirement for bottom enchantment slot
+
  | Flags
 +
| Unsigned Byte
 +
| Bit mask. 0x1: should darken sky, 0x2: is dragon bar (used to play end music), 0x04: create fog (previously was also controlled by 0x02).
 
  |-
 
  |-
  | 3: The enchantment seed
+
  | 1: remove
  | 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>).
+
  | ''no fields''
 +
| ''no fields''
 +
| Removes this boss bar.
 
  |-
 
  |-
  | 4: Enchantment ID shown on mouse hover over top enchantment slot
+
  | 2: update health
  |rowspan="3"| The enchantment id (set to -1 to hide it)
+
  | Health
 +
| Float
 +
| ''as above''
 
  |-
 
  |-
  | 5: Enchantment ID shown on mouse hover over middle enchantment slot
+
  | 3: update title
 +
| Title
 +
| [[Chat]]
 +
|
 
  |-
 
  |-
  | 6: Enchantment ID shown on mouse hover over bottom enchantment slot
+
  |rowspan="2"| 4: update style
 +
| Color
 +
| VarInt Enum
 +
| Color ID (see below).
 +
|-
 +
| Dividers
 +
| VarInt Enum
 +
| ''as above''
 +
|-
 +
| 5: update flags
 +
| Flags
 +
| Unsigned Byte
 +
| ''as above''
 
  |-
 
  |-
  | 7: Enchantment level shown on mouse hover over the top slot
+
  |}
|rowspan="3"| The enchantment level (1 = I, 2 = II, 6 = VI, etc.), or -1 if no enchant
+
 
 +
{| class="wikitable"
 +
! ID
 +
! Color
 
  |-
 
  |-
  | 8: Enchantment level shown on mouse hover over the middle slot
+
  | 0
 +
| Pink
 
  |-
 
  |-
  | 9: Enchantment level shown on mouse hover over the bottom slot
+
  | 1
 +
| Blue
 
  |-
 
  |-
  |rowspan="3"| Beacon
+
  | 2
| 0: Power level
+
  | Red
  | 0-4, controls what effect buttons are enabled
 
 
  |-
 
  |-
  | 1: First potion effect
+
  | 3
  | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the first effect, or -1 if no effect
+
  | Green
 
  |-
 
  |-
  | 2: Second potion effect
+
  | 4
  | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the second effect, or -1 if no effect
+
  | Yellow
 
  |-
 
  |-
  | Anvil
+
  | 5
  | 0: Repair cost
+
  | Purple
| The repair's cost in xp levels
 
 
  |-
 
  |-
  | Brewing Stand
+
  | 6
  | 0: Brew time
+
  | White
| 0–400, with 400 making the arrow empty, and 0 making the arrow full
 
 
  |}
 
  |}
  
==== Set Slot ====
+
{| class="wikitable"
 
+
! ID
Sent by the server when an item in a slot (in a window) is added/removed.
+
! Type of division
 +
|-
 +
| 0
 +
| No division
 +
|-
 +
| 1
 +
| 6 notches
 +
|-
 +
| 2
 +
| 10 notches
 +
|-
 +
| 3
 +
| 12 notches
 +
|-
 +
| 4
 +
| 20 notches
 +
|}
 +
 
 +
==== Change Difficulty ====
 +
 
 +
Changes the difficulty setting in the client's option menu
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,329: Line 1,439:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x16
+
  |rowspan="2"| 0x0B
  |rowspan="3"| Play
+
  |rowspan="2"| Play
  |rowspan="3"| Client
+
  |rowspan="2"| Client
  | Window ID
+
  | Difficulty
  | Byte
+
  | Unsigned Byte
  | The window which is being updated. 0 for player inventory. Note that all known window types include the player inventory. This packet will only be sent for the currently opened window while the player is performing actions, even if it affects the player inventory. After the window is closed, a number of these packets are sent to update the player's inventory window (0).
+
  | 0: peaceful, 1: easy, 2: normal, 3: hard.
 
  |-
 
  |-
  | Slot
+
  | Difficulty locked?
  | Short
+
  | Boolean
| The slot that should be updated
+
  |
|-
 
| Slot Data
 
| [[Slot Data|Slot]]
 
  |  
 
 
  |}
 
  |}
  
To set the cursor (the item currently dragged with the mouse), use -1 as Window ID and as Slot.
+
==== Chat Preview (clientbound) ====
  
This packet can only be used to edit the hotbar of the player's inventory if window ID is set to 0 (slots 36 through 44).  If the window ID is set to -2, then any slot in the inventory can be used but no add item animation will be played.
+
Sets the message to preview on the client.
 
 
==== 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.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,361: Line 1,463:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x17
+
  |rowspan="3"| 0x0C
  |rowspan="2"| Play
+
  |rowspan="3"| Play
  |rowspan="2"| Client
+
  |rowspan="3"| Client
  | Item ID
+
  | Query ID
  | VarInt
+
  | Integer
  | Numeric ID of the item to apply a cooldown to.
+
|
 +
|-
 +
| Component is Present
 +
| Boolean
 +
  |
 
  |-
 
  |-
  | Cooldown Ticks
+
  | Message to Preview
  | VarInt
+
  | Component
  | Number of ticks to apply a cooldown for, or 0 to clear the cooldown.
+
  |
 
  |}
 
  |}
  
==== Plugin Message (clientbound) ====
+
==== Clear Titles ====
 
 
{{Main|Plugin channels}}
 
 
 
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>.
 
  
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/]
+
Clear the client's current title information, with the option to also reset it.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,389: Line 1,491:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x18
+
  |rowspan="1"| 0x0D
  |rowspan="2"| Play
+
  |rowspan="1"| Play
  |rowspan="2"| Client
+
  |rowspan="1"| Client
  | Channel
+
  | Reset
  | String (20)
+
  | Boolean
  | Name of the [[plugin channel]] used to send the data
+
  |
|-
 
| 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.
 
 
  |}
 
  |}
  
==== Named Sound Effect ====
+
==== Command Suggestions Response ====
{{See also|#Sound Effect}}
 
  
Used to play a sound effect on the client. Custom sounds may be added by resource packs.
+
The server responds with a list of auto-completions of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported. The client sorts these alphabetically before listing them.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,410: Line 1,507:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  !colspan="2"| Field Name
  ! Field Type
+
  !colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="7"| 0x19
+
  |rowspan="8"| 0x0E
  |rowspan="7"| Play
+
  |rowspan="8"| Play
  |rowspan="7"| Client
+
  |rowspan="8"| Client
| Sound Name
 
| String (256)
 
| All sound effect names as of 1.11.0 can be seen [http://pokechu22.github.io/Burger/1.11.html#sounds here].
 
 
  |-
 
  |-
  | Sound Category
+
  |colspan="2"| ID
  | VarInt Enum
+
  |colspan="2"| VarInt
  | The category that this sound will be played from ([https://gist.github.com/konwboj/7c0c380d3923443e9d55 current categories])
+
  | Transaction ID.
 
  |-
 
  |-
  | Effect Position X
+
  |colspan="2"| Start
  | Int
+
|colspan="2"| VarInt
  | Effect X multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
+
  | Start of the text to replace.
 +
  |-
 +
|colspan="2"| Length
 +
|colspan="2"| VarInt
 +
| Length of the text to replace.
 
  |-
 
  |-
  | Effect Position Y
+
  |colspan="2"| Count
  | Int
+
  |colspan="2"| VarInt
  | Effect Y multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
+
  | Number of elements in the following array.
 
  |-
 
  |-
  | Effect Position Z
+
  |rowspan="3"| Matches
  | Int
+
  | Match
  | Effect Z multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
+
  |rowspan="3"| Array
 +
| String (32767)
 +
| One eligible value to insert, note that each command is sent separately instead of in a single string, hence the need for Count.  Note that for instance this doesn't include a leading <code>/</code> on commands.
 
  |-
 
  |-
  | Volume
+
  | Has tooltip
  | Float
+
  | Boolean
  | 1 is 100%, can be more
+
  | True if the following is present.
 
  |-
 
  |-
  | Pitch
+
  | Tooltip
  | Float
+
  | Optional [[Chat]]
  | Float between 0.5 and 2.0 by Notchian clients
+
  | Tooltip to display; only present if previous boolean is true.
 
  |}
 
  |}
  
==== Disconnect (play) ====
+
==== Commands ====
 +
 
 +
Lists all of the commands on the server, and how they are parsed.
  
Sent by the server before it disconnects a client. The client assumes that the server has already closed the connection by the time the packet arrives.
+
This is a directed graph, with one root node. Each redirect or child node must refer only to nodes that have already been declared.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,458: Line 1,560:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  | 0x1A
+
  |rowspan="3"| 0x0F
  | Play
+
  |rowspan="3"| Play
  | Client
+
  |rowspan="3"| Client
  | Reason
+
  | Count
  | [[Chat]]
+
| VarInt
  | Displayed to the client when the connection terminates.
+
  | Number of elements in the following array.
 +
|-
 +
| Nodes
 +
| Array of [[Command Data|Node]]
 +
  | An array of nodes.
 +
|-
 +
| Root index
 +
| VarInt
 +
| Index of the <code>root</code> node in the previous array.
 
  |}
 
  |}
  
==== Entity Status ====
+
For more information on this packet, see the [[Command Data]] article.
 +
 
 +
==== Close Container (clientbound) ====
  
Entity statuses generally trigger an animation for an entity. The available statuses vary by the entity's type (and are available to subclasses of that type as well).
+
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.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,478: Line 1,590:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x1B
+
  | 0x10
  |rowspan="2"| Play
+
  | Play
  |rowspan="2"| Client
+
  | Client
  | Entity ID
+
  | Window ID
  | Int
+
  | Unsigned Byte
|
+
  | This is the ID of the window that was closed. 0 for inventory.
|-
 
| Entity Status
 
| Byte Enum
 
  | See below
 
 
  |}
 
  |}
  
See [[entities]] for a list of which statuses are valid for each type of entity.
+
==== Set Container Content ====
 
+
[[File:Inventory-slots.png|thumb|The inventory slots]]
==== 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
+
Sent by the server when items in multiple slots (in a window) are added/removed. This includes the main inventory, equipped armour and crafting slots. This packet with Window ID set to "0" is sent during the player joining sequence to initialise the player's inventory.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,506: Line 1,611:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="9"| 0x1C
+
  |rowspan="5"| 0x11
  |rowspan="9"| Play
+
  |rowspan="5"| Play
  |rowspan="9"| Client
+
  |rowspan="5"| Client
  | X
+
  | Window ID
  | Float
+
  | Unsigned Byte
  |  
+
  | The ID of window which items are being sent for. 0 for player inventory.
 
  |-
 
  |-
  | Y
+
  | State ID
  | Float
+
  | VarInt
  |  
+
  | The last received State ID from either a [[#Set Container Slot|Set Container Slot]] or a [[#Set Container Content|Set Container Content]] packet
 
  |-
 
  |-
  | Z
+
  | Count
  | Float
+
  | VarInt
  |  
+
  | Number of elements in the following array.
 
  |-
 
  |-
  | Radius
+
  | Slot Data
  | Float
+
  | Array of [[Slot Data|Slot]]
| Currently unused in the client
 
 
  |-
 
  |-
  | Record Count
+
  | Carried Item
  | Int
+
  | [[Slot Data|Slot]]
| Number of elements in the following array
+
  | Item held by player.
|-
 
| Records
 
| Array of (Byte, Byte, Byte)
 
  | Each record is 3 signed bytes long, each bytes are the XYZ (respectively) offsets of affected blocks.
 
|-
 
| Player Motion X
 
| Float
 
| X velocity of the player being pushed by the explosion
 
|-
 
| Player Motion Y
 
| Float
 
| Y velocity of the player being pushed by the explosion
 
|-
 
| Player Motion Z
 
| Float
 
| Z velocity of the player being pushed by the explosion
 
 
  |}
 
  |}
  
==== Unload Chunk ====
+
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.
  
Tells the client to unload a chunk column.
+
==== Set Container Property ====
  
{| class="wikitable"
+
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
 
|-
 
|rowspan="2"| 0x1D
 
|rowspan="2"| Play
 
|rowspan="2"| Client
 
| Chunk X
 
| Int
 
| Block coordinate divided by 16, rounded down
 
|-
 
| Chunk Z
 
| Int
 
| Block coordinate divided by 16, rounded down
 
|}
 
 
 
It is legal to send this packet even if the given chunk is not currently loaded.
 
 
 
==== Change Game State ====
 
 
 
Used for a wide variety of game state things, from weather to bed use to game mode to demo messages.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,584: Line 1,648:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x1E
+
  |rowspan="3"| 0x12
  |rowspan="2"| Play
+
  |rowspan="3"| Play
  |rowspan="2"| Client
+
  |rowspan="3"| Client
  | Reason
+
  | Window ID
 
  | Unsigned Byte
 
  | Unsigned Byte
  | See below
+
  |
 +
|-
 +
| Property
 +
| Short
 +
| The property to be updated, see below.
 
  |-
 
  |-
 
  | Value
 
  | Value
  | Float
+
  | Short
  | Depends on Reason
+
  | The new value for the property, see below.
 
  |}
 
  |}
  
''Reason codes'':
+
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.
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Reason
+
|-
  ! Effect
+
  ! Window type
 +
  ! Property
 
  ! Value
 
  ! Value
 
  |-
 
  |-
  | 0
+
  |rowspan="4"| Furnace
  | Invalid Bed
+
  | 0: Fire icon (fuel left)
  | Would be used to switch between messages, but the only used message is 0 for invalid bed
+
  | counting from fuel burn time down to 0 (in-game ticks)
 
  |-
 
  |-
  | 1
+
  | 1: Maximum fuel burn time
  | End raining
+
  | 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
 
  |-
 
  |-
  | 2
+
  |rowspan="10"| Enchantment Table
  | Begin raining
+
  | 0: Level requirement for top enchantment slot
  |  
+
  |rowspan="3"| The enchantment's xp level requirement
 
  |-
 
  |-
  | 3
+
  | 1: Level requirement for middle enchantment slot
| Change game mode
 
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator
 
 
  |-
 
  |-
  | 4
+
  | 2: Level requirement for bottom enchantment slot
| Exit end
 
| 0: Immediately send Client Status of respawn without showing end credits; 1: Show end credits and respawn at the end (or when esc is pressed).  1 is sent if the player has not yet received the "The end?" achievement, while if they do have it 0 is used.
 
 
  |-
 
  |-
  | 5
+
  | 3: The enchantment seed
  | Demo message
+
  | 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>).
  | 0: Show welcome to demo screen, 101: Tell movement controls, 102: Tell jump control, 103: Tell inventory control
 
|-
 
| 6
 
| Arrow hitting player
 
| Appears to be played when an arrow strikes another player in Multiplayer
 
 
  |-
 
  |-
  | 7
+
  | 4: Enchantment ID shown on mouse hover over top enchantment slot
  | Fade value
+
  |rowspan="3"| The enchantment id (set to -1 to hide it), see below for values
| The current darkness value. 1 = Dark, 0 = Bright, Setting the value higher causes the game to change color and freeze
 
 
  |-
 
  |-
  | 8
+
  | 5: Enchantment ID shown on mouse hover over middle enchantment slot
| Fade time
 
| Time in ticks for the sky to fade
 
 
  |-
 
  |-
  | 10
+
  | 6: Enchantment ID shown on mouse hover over bottom enchantment slot
| Play elder guardian mob appearance (effect and sound)
 
|
 
|}
 
 
 
==== Keep Alive (clientbound) ====
 
 
 
The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same packet. If the client does not respond to them for over 30 seconds, the server kicks the client. Vice versa, if the server does not send any keep-alives for 20 seconds, the client will disconnect and yields a "Timed out" exception.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="1"| 0x1F
+
  | 7: Enchantment level shown on mouse hover over the top slot
  |rowspan="1"| Play
+
  |rowspan="3"| The enchantment level (1 = I, 2 = II, 6 = VI, etc.), or -1 if no enchant
|rowspan="1"| Client
+
  |-
  | Keep Alive ID
+
  | 8: Enchantment level shown on mouse hover over the middle slot
  | VarInt
+
  |-
  |  
+
  | 9: Enchantment level shown on mouse hover over the bottom slot
  |}
+
|-
 
+
  |rowspan="3"| Beacon
==== Chunk Data ====
+
  | 0: Power level
{{See also|#Unload Chunk}}
+
  | 0-4, controls what effect buttons are enabled
 
 
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).
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
  ! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="9"| 0x20
+
  | 1: First potion effect
  |rowspan="9"| Play
+
  | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the first effect, or -1 if no effect
|rowspan="9"| Client
 
| Chunk X
 
| Int
 
| Block coordinate divided by 16, rounded down
 
 
  |-
 
  |-
  | Chunk Z
+
  | 2: Second potion effect
  | Int
+
  | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the second effect, or -1 if no effect
| Block coordinate divided by 16, rounded down
 
 
  |-
 
  |-
  | Ground-Up Continuous
+
  | Anvil
  | Boolean
+
  | 0: Repair cost
  | This is true if the packet represents all chunk sections in this vertical chunk column, where the Primary Bit Mask specifies exactly which chunk sections are included, and which are air.
+
  | The repair's cost in xp levels
 
  |-
 
  |-
  | Primary Bit Mask
+
  |rowspan="2"| Brewing Stand
  | VarInt
+
  | 0: Brew time
  | 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).
+
  | 0 – 400, with 400 making the arrow empty, and 0 making the arrow full
|-
 
| Size
 
| VarInt
 
| Size of Data in bytes, plus size of Biomes in bytes if present
 
 
  |-
 
  |-
  | Data
+
  | 1: Fuel time
  | Array of [[SMP Map Format|Chunk Section]]
+
  | 0 - 20, with 0 making the arrow empty, and 20 making the arrow full
| The length of the array is equal to the number of bits set in Primary Bit Mask. Chunks are sent bottom-to-top, i.e. the first chunk, if sent, extends from Y=0 to Y=15.
 
 
  |-
 
  |-
  | Biomes
+
  | Stonecutter
  | Optional Byte Array
+
  | 0: Selected recipe
  | Only if Ground-Up Continuous: biome array, byte per XZ coordinate, 256 bytes total.
+
  | The index of the selected recipe. -1 means none is selected.
 
  |-
 
  |-
  | Number of block entities
+
  | Loom
  | VarInt
+
  | 0: Selected pattern
  | Length of the following array
+
  | The index of the selected pattern. 0 means none is selected, 0 is also the internal id of the "base" pattern.
 
  |-
 
  |-
  | Block entities
+
  | Lectern
  | Array of [[NBT|NBT Tag]]
+
  | 0: Page number
  | All block entities in the chunk.  Use the x, y, and z tags in the NBT to determine their positions.
+
  | The current page number, starting from 0.
 
  |}
 
  |}
  
==== Effect ====
+
For an enchanting table, the following numerical IDs are used:
 
 
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"
  ! Packet ID
+
  ! Numerical ID
  ! State
+
  ! Enchantment ID
  ! Bound To
+
  ! Enchantment Name
  ! Field Name
+
|-
  ! Field Type
+
  | 0
  ! Notes
+
  | minecraft:protection
 +
  | Protection
 
  |-
 
  |-
  |rowspan="4"| 0x21
+
  | 1
|rowspan="4"| Play
+
  | minecraft:fire_protection
|rowspan="4"| Client
+
  | Fire Protection
| Effect ID
 
  | Int
 
  | The ID of the effect, see below
 
 
  |-
 
  |-
  | Location
+
  | 2
  | Position
+
  | minecraft:feather_falling
  | The location of the effect
+
  | Feather Falling
 
  |-
 
  |-
  | Data
+
  | 3
  | Int
+
  | minecraft:blast_protection
  | Extra data for certain effects, see below
+
  | Blast Protection
 
  |-
 
  |-
  | Disable Relative Volume
+
  | 4
  | Boolean
+
  | minecraft:projectile_protection
| See above
+
  | Projectile Protection
  |}
 
 
 
Effect IDs:
 
 
 
{| class="wikitable"
 
! ID
 
! Name
 
! Data
 
 
  |-
 
  |-
  !colspan="3"| Sound
+
  | 5
 +
| minecraft:respiration
 +
| Respiration
 
  |-
 
  |-
  | 1000
+
  | 6
  | Dispenser dispenses
+
  | minecraft:aqua_affinity
  |  
+
  | Aqua Affinity
 
  |-
 
  |-
  | 1001
+
  | 7
  | Dispenser fails to dispense
+
  | minecraft:thorns
  |  
+
  | Thorns
 
  |-
 
  |-
  | 1002
+
  | 8
  | Dispenser shoots
+
  | minecraft:depth_strider
  |  
+
  | Depth Strider
 
  |-
 
  |-
  | 1003
+
  | 9
  | Ender eye launched
+
  | minecraft:frost_walker
  |  
+
  | Frost Walker
 
  |-
 
  |-
  | 1004
+
  | 10
  | Firework shot
+
  | minecraft:binding_curse
  |  
+
  | Curse of Binding
 
  |-
 
  |-
  | 1005
+
  | 11
  | Iron door opened
+
  | minecraft:soul_speed
  |  
+
  | Soul Speed
 
  |-
 
  |-
  | 1006
+
  | 12
  | Wooden door opened
+
  | minecraft:sharpness
  |  
+
  | Sharpness
 
  |-
 
  |-
  | 1007
+
  | 13
  | Wooden trapdoor opened
+
  | minecraft:smite
  |  
+
  | Smite
 
  |-
 
  |-
  | 1008
+
  | 14
  | Fence gate opened
+
  | minecraft:bane_of_arthropods
  |  
+
  | Bane of Arthropods
 
  |-
 
  |-
  | 1009
+
  | 15
  | Fire extinguished
+
  | minecraft:knockback
  |  
+
  | Knockback
 
  |-
 
  |-
  | 1010
+
  | 16
  | Play record
+
  | minecraft:fire_aspect
  | {{Minecraft Wiki|Music Discs|Record ID}}
+
  | Fire Aspect
 
  |-
 
  |-
  | 1011
+
  | 17
  | Iron door closed
+
  | minecraft:looting
  |  
+
  | Looting
 
  |-
 
  |-
  | 1012
+
  | 18
  | Wooden door closed
+
  | minecraft:sweeping
  |  
+
  | Sweeping Edge
 
  |-
 
  |-
  | 1013
+
  | 19
  | Wooden trapdoor closed
+
  | minecraft:efficiency
  |  
+
  | Efficiency
 
  |-
 
  |-
  | 1014
+
  | 20
  | Fence gate closed
+
  | minecraft:silk_touch
  |  
+
  | Silk Touch
 
  |-
 
  |-
  | 1015
+
  | 21
  | Ghast warns
+
  | minecraft:unbreaking
  |  
+
  | Unbreaking
 
  |-
 
  |-
  | 1016
+
  | 22
  | Ghast shoots
+
  | minecraft:fortune
  |  
+
  | Fortune
 
  |-
 
  |-
  | 1017
+
  | 23
  | Enderdragon shoots
+
  | minecraft:power
  |  
+
  | Power
 
  |-
 
  |-
  | 1018
+
  | 24
  | Blaze shoots
+
  | minecraft:punch
  |  
+
  | Punch
 
  |-
 
  |-
  | 1019
+
  | 25
  | Zombie attacks wood door
+
  | minecraft:flame
  |  
+
  | Flame
 
  |-
 
  |-
  | 1020
+
  | 26
  | Zombie attacks iron door
+
  | minecraft:infinity
  |  
+
  | Infinity
 
  |-
 
  |-
  | 1021
+
  | 27
  | Zombie breaks wood door
+
  | minecraft:luck_of_the_sea
  |
+
  | Luck of the Sea
 
  |-
 
  |-
  | 1022
+
  | 28
  | Wither breaks block
+
  | minecraft:lure
  |
+
  | Lure
 
  |-
 
  |-
  | 1023
+
  | 29
  | Wither spawned
+
  | minecraft:loyalty
  |  
+
  | Loyalty
 
  |-
 
  |-
  | 1024
+
  | 30
  | Wither shoots
+
  | minecraft:impaling
  |
+
  | Impaling
 
  |-
 
  |-
  | 1025
+
  | 31
  | Bat takes off
+
  | minecraft:riptide
  |
+
  | Riptide
 
  |-
 
  |-
  | 1026
+
  | 32
  | Zombie infects
+
  | minecraft:channeling
  |
+
  | Channeling
 
  |-
 
  |-
  | 1027
+
  | 33
  | Zombie villager converted
+
  | minecraft:multishot
  |
+
  | Multishot
 
  |-
 
  |-
  | 1028
+
  | 34
  | Ender dragon death
+
  | minecraft:quick_charge
  |
+
  | Quick Charge
 
  |-
 
  |-
  | 1029
+
  | 35
  | Anvil destroyed
+
  | minecraft:piercing
  |  
+
  | Piercing
 
  |-
 
  |-
  | 1030
+
  | 36
  | Anvil used
+
  | minecraft:mending
  |  
+
  | Mending
 
  |-
 
  |-
  | 1031
+
  | 37
  | Anvil landed
+
  | minecraft:vanishing_curse
  |
+
  | Curse of Vanishing
  |-
+
  |}
  | 1032
+
 
  | Portal travel
+
==== Set Container Slot ====
  |
+
 
 +
Sent by the server when an item in a slot (in a window) is added/removed.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
  ! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | 1033
+
  |rowspan="4"| 0x13
  | Chorus flower grown
+
|rowspan="4"| Play
  |
+
|rowspan="4"| Client
 +
| Window ID
 +
  | Byte
 +
  | The window which is being updated. 0 for player inventory. Note that all known window types include the player inventory. This packet will only be sent for the currently opened window while the player is performing actions, even if it affects the player inventory. After the window is closed, a number of these packets are sent to update the player's inventory window (0).
 
  |-
 
  |-
  | 1034
+
  | State ID
  | Chorus flower died
+
  | VarInt
  |  
+
  | The last received State ID from either a [[#Set Container Slot|Set Container Slot]] or a [[#Set Container Content|Set Container Content]] packet
 
  |-
 
  |-
  | 1035
+
  | Slot
  | Brewing stand brewed
+
  | Short
  |
+
  | The slot that should be updated.
 
  |-
 
  |-
  | 1036
+
  | Slot Data
  | Iron trapdoor opened
+
  | [[Slot Data|Slot]]
|
 
|-
 
| 1037
 
| Iron trapdoor closed
 
 
  |
 
  |
 +
|}
 +
 +
To set the cursor (the item currently dragged with the mouse), use -1 as Window ID and as Slot.
 +
 +
This packet can only be used to edit the hotbar of the player's inventory if window ID is set to 0 (slots 36 through 45) if the player is in creative, with their inventory open, and not in their survival inventory tab.  Otherwise, when window ID is 0, it can edit any slot in the player's inventory.  If the window ID is set to -2, then any slot in the inventory can be used but no add item animation will be played.
 +
 +
==== Set Cooldown ====
 +
 +
Applies a cooldown period to all items with the given type.  Used by the Notchian server with enderpearls.  This packet should be sent when the cooldown starts and also when the cooldown ends (to compensate for lag), although the client will end the cooldown automatically. Can be applied to any item, note that interactions still get sent to the server with the item but the client does not play the animation nor attempt to predict results (i.e block placing).
 +
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  !colspan="3"| Particle
+
  |rowspan="2"| 0x14
  |-
+
  |rowspan="2"| Play
| 2000
+
  |rowspan="2"| Client
  | Spawns 10 smoke particles, e.g. from a fire
+
  | Item ID
| Direction, see below
+
  | VarInt
  |-
+
  | Numeric ID of the item to apply a cooldown to.
  | 2001
 
  | Block break + block break sound
 
| {{Minecraft Wiki|Data values|Block ID}}
 
 
  |-
 
  |-
  | 2002/2007
+
  | Cooldown Ticks
  | Splash potion. Particle effect + glass break sound.
+
  | VarInt
  | [http://minecraft.gamepedia.com/Data_values#Potions Potion ID]
+
  | Number of ticks to apply a cooldown for, or 0 to clear the cooldown.
|-
 
| 2003
 
| Eye of Ender entity break animation — particles and sound
 
|
 
|-
 
| 2004
 
| Mob spawn particle effect: smoke + flames
 
|
 
|-
 
| 2005
 
| Bonemeal particles
 
| How many particles to spawn (if set to 0, 15 are spawned)
 
|-
 
| 2006
 
| Dragon breath
 
|
 
|-
 
| 3000
 
| End gateway spawn
 
|
 
|-
 
| 3001
 
| Enderdragon growl
 
|
 
 
  |}
 
  |}
  
Smoke directions:
+
==== Plugin Message (clientbound) ====
 +
 
 +
{{Main|Plugin channels}}
 +
 
 +
Mods and plugins can use this to send their data. Minecraft itself uses several [[plugin channel]]s. These internal channels are in the <code>minecraft</code> namespace.
 +
 
 +
More information on how it works on [https://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/ Dinnerbone's blog]. More documentation about internal and popular registered channels are [[plugin channel|here]].
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! ID
+
  ! Packet ID
  ! Direction
+
  ! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 0
+
  |rowspan="2"| 0x15
  | South-East
+
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Channel
 +
| Identifier
 +
  | Name of the [[plugin channel]] used to send the data.
 
  |-
 
  |-
  | 1
+
  | Data
  | South
+
  | Byte Array
  |-
+
  | Any data.
| 2
 
| South-West
 
|-
 
| 3
 
| East
 
|-
 
| 4
 
| (Up or middle ?)
 
|-
 
| 5
 
| West
 
|-
 
| 6
 
| North-East
 
|-
 
| 7
 
| North
 
|-
 
| 8
 
| North-West
 
 
  |}
 
  |}
  
==== Particle ====
+
In notchian client/server implementation, when sending data, data size is capped at 32767 bytes when server-bound and 1048576 bytes when client-bound. Though nothing prevents the server and client from reading larger data.
 +
 
 +
==== Custom Sound Effect ====
 +
{{See also|#Sound}}
  
Displays the named particle
+
Used to play a sound effect on the client. Custom sounds may be added by resource packs.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,997: Line 2,007:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="11"| 0x22
+
  |rowspan="8"| 0x16
  |rowspan="11"| Play
+
  |rowspan="8"| Play
  |rowspan="11"| Client
+
  |rowspan="8"| Client
  | Particle ID
+
  | Sound Name
 +
| Identifier
 +
| All sound effect names can be seen [https://pokechu22.github.io/Burger/1.19.html#sounds here].
 +
|-
 +
| Sound Category
 +
| VarInt Enum
 +
| The category that this sound will be played from ([https://gist.github.com/konwboj/7c0c380d3923443e9d55 current categories]).
 +
|-
 +
| Effect Position X
 
  | Int
 
  | Int
  | See below
+
  | Effect X multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part).
 
  |-
 
  |-
  | Long Distance
+
  | Effect Position Y
  | Boolean
+
  | Int
  | If true, particle distance increases from 256 to 65536
+
  | Effect Y multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part).
 
  |-
 
  |-
  | X
+
  | Effect Position Z
  | Float
+
  | Int
  | X position of the particle
+
  | Effect Z multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part).
 
  |-
 
  |-
  | Y
+
  | Volume
 
  | Float
 
  | Float
  | Y position of the particle
+
  | 1 is 100%, can be more.
 
  |-
 
  |-
  | Z
+
  | Pitch
| Float
 
| Z position of the particle
 
|-
 
| Offset X
 
| Float
 
| This is added to the X position after being multiplied by random.nextGaussian()
 
|-
 
| Offset Y
 
| Float
 
| This is added to the Y position after being multiplied by random.nextGaussian()
 
|-
 
| Offset Z
 
| Float
 
| This is added to the Z position after being multiplied by random.nextGaussian()
 
|-
 
| Particle Data
 
 
  | Float
 
  | Float
  | The data of each particle
+
  | Float between 0.5 and 2.0 by Notchian clients.
|-
 
| Particle Count
 
| Int
 
| The number of particles to create
 
 
  |-
 
  |-
  | Data
+
  | Seed
  | Array of VarInt
+
  | long
  | Length depends on particle. "iconcrack" has length of 2, "blockcrack", and "blockdust" have lengths of 1, the rest have 0.
+
  | Seed used to pick sound variant.
 
  |}
 
  |}
  
Particle IDs:
+
==== Disconnect (play) ====
 +
 
 +
Sent by the server before it disconnects a client. The client assumes that the server has already closed the connection by the time the packet arrives.
  
 
{| class="wikitable"
 
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  ! Particle Name
+
  | 0x17
  ! Particle ID
+
  | Play
  |-
+
  | Client
  | explode
+
  | Reason
  | 0
+
  | [[Chat]]
  |-
+
  | Displayed to the client when the connection terminates.
  | largeexplosion
+
  |}
  | 1
+
 
 +
==== Entity Event ====
 +
 
 +
Entity statuses generally trigger an animation for an entity. The available statuses vary by the entity's type (and are available to subclasses of that type as well).
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | hugeexplosion
+
  |rowspan="2"| 0x18
  | 2
+
  |rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Entity ID
 +
| Int
 +
|
 
  |-
 
  |-
  | fireworksSpark
+
  | Entity Status
  | 3
+
  | Byte Enum
 +
| See [[Entity statuses]] for a list of which statuses are valid for each type of entity.
 +
|}
 +
 
 +
==== 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
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | bubble
+
  |rowspan="9"| 0x19
  | 4
+
|rowspan="9"| Play
 +
|rowspan="9"| Client
 +
| X
 +
| Double
 +
  |
 
  |-
 
  |-
  | splash
+
  | Y
  | 5
+
| Double
 +
  |
 
  |-
 
  |-
  | wake
+
  | Z
  | 6
+
| Double
 +
  |
 
  |-
 
  |-
  | suspended
+
  | Strength
  | 7
+
  | Float
 +
| A strength greater than or equal to 2.0 spawns a <code>minecraft:explosion_emitter</code> particle, while a lesser strength spawns a <code>minecraft:explosion</code> particle.
 
  |-
 
  |-
  | depthsuspend
+
  | Record Count
  | 8
+
  | VarInt
 +
| Number of elements in the following array.
 
  |-
 
  |-
  | crit
+
  | Records
  | 9
+
  | Array of (Byte, Byte, Byte)
 +
| Each record is 3 signed bytes long; the 3 bytes are the XYZ (respectively) signed offsets of affected blocks.
 
  |-
 
  |-
  | magicCrit
+
  | Player Motion X
  | 10
+
  | Float
 +
| X velocity of the player being pushed by the explosion.
 
  |-
 
  |-
  | smoke
+
  | Player Motion Y
  | 11
+
  | Float
 +
| Y velocity of the player being pushed by the explosion.
 
  |-
 
  |-
  | largesmoke
+
  | Player Motion Z
  | 12
+
  | Float
 +
| Z velocity of the player being pushed by the explosion.
 +
|}
 +
 
 +
==== Unload Chunk ====
 +
 
 +
Tells the client to unload a chunk column.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | spell
+
  |rowspan="2"| 0x1A
  | 13
+
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Chunk X
 +
| Int
 +
  | Block coordinate divided by 16, rounded down.
 
  |-
 
  |-
  | instantSpell
+
  | Chunk Z
  | 14
+
  | Int
  |-
+
  | Block coordinate divided by 16, rounded down.
  | mobSpell
+
  |}
  | 15
+
 
 +
It is legal to send this packet even if the given chunk is not currently loaded.
 +
 
 +
==== Game Event ====
 +
 
 +
Used for a wide variety of game events, from weather to bed use to gamemode to demo messages.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
  ! Field Type
 +
! Notes
 
  |-
 
  |-
  | mobSpellAmbient
+
  |rowspan="2"| 0x1B
  | 16
+
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Event
 +
| Unsigned Byte
 +
  | See below.
 
  |-
 
  |-
  | witchMagic
+
  | Value
  | 17
+
  | Float
 +
| Depends on Reason.
 +
|}
 +
 
 +
''Events'':
 +
 
 +
{| class="wikitable"
 +
! Event
 +
! Effect
 +
! Value
 
  |-
 
  |-
  | dripWater
+
  | 0
  | 18
+
  | No respawn block available
 +
| Note: Sends message 'block.minecraft.spawn.not_valid'(You have no home bed or charged respawn anchor, or it was obstructed) to the client.
 
  |-
 
  |-
  | dripLava
+
  | 1
  | 19
+
| End raining
 +
  |
 
  |-
 
  |-
  | angryVillager
+
  | 2
  | 20
+
| Begin raining
 +
  |
 
  |-
 
  |-
  | happyVillager
+
  | 3
  | 21
+
  | Change gamemode
 +
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 
  |-
 
  |-
  | townaura
+
  | 4
  | 22
+
  | Win game
 +
| 0: Just respawn player. <br>1: Roll the credits and respawn player. <br> Note that 1 is only sent by notchian server when player has not yet achieved advancement "The end?", else 0 is sent.
 
  |-
 
  |-
  | note
+
  | 5
  | 23
+
  | Demo event
 +
| 0: Show welcome to demo screen<br> 101: Tell movement controls<br> 102: Tell jump control<br> 103: Tell inventory control<br> 104: Tell that the demo is over and print a message about how to take a screenshot.
 
  |-
 
  |-
  | portal
+
  | 6
  | 24
+
  | Arrow hit player
 +
| Note: Sent when any player is struck by an arrow.
 
  |-
 
  |-
  | enchantmenttable
+
  | 7
  | 25
+
  | Rain level change
 +
| Note: Seems to change both skycolor and lightning.<br>Rain level starting from 0 to 1.
 
  |-
 
  |-
  | flame
+
  | 8
  | 26
+
  | Thunder level change
 +
| Note: Seems to change both skycolor and lightning (same as Rain level change, but doesn't start rain). It also requires rain to render by notchian client.<br>Thunder level starting from 0 to 1.
 
  |-
 
  |-
  | lava
+
  | 9
  | 27
+
  | Play pufferfish sting sound.
 
  |-
 
  |-
  | footstep
+
  | 10
  | 28
+
| Play elder guardian mob appearance (effect and sound).
 +
  |
 
  |-
 
  |-
  | cloud
+
  | 11
  | 29
+
  | Enable respawn screen
  |-
+
  |  0: Enable respawn screen, 1: Immediately respawn (sent when the doImmediateRespawn gamerule changes).
| reddust
 
| 30
 
|-
 
| snowballpoof
 
| 31
 
|-
 
| snowshovel
 
| 32
 
|-
 
| slime
 
| 33
 
|-
 
  | heart
 
| 34
 
|-
 
| barrier
 
| 35
 
|-
 
| iconcrack_(id)_(data)
 
| 36
 
|-
 
| blockcrack_(id+(data<<12))
 
| 37
 
|-
 
| blockdust_(id)
 
| 38
 
|-
 
| droplet
 
| 39
 
|-
 
| take
 
| 40
 
|-
 
| mobappearance
 
| 41
 
|-
 
| dragonbreath
 
| 42
 
|-
 
| endrod
 
| 43
 
|-
 
| damageindicator
 
| 44
 
|-
 
| sweepattack
 
| 45
 
|-
 
| fallingdust
 
| 46
 
 
  |}
 
  |}
  
==== Join Game ====
+
==== Open Horse Screen ====
  
See [[Protocol Encryption]] for information on logging in.
+
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 2,206: Line 2,258:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="7"| 0x23
+
  |rowspan="3"| 0x1C
  |rowspan="7"| Play
+
  |rowspan="3"| Play
  |rowspan="7"| Client
+
  |rowspan="3"| Client
  | Entity ID
+
  | Window ID
| Int
 
| The player's Entity ID (EID)
 
|-
 
| Gamemode
 
 
  | Unsigned Byte
 
  | Unsigned Byte
  | 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. Bit 3 (0x8) is the hardcore flag.
+
  |
 
  |-
 
  |-
  | Dimension
+
  | Slot count
  | Int Enum
+
  | VarInt
  | -1: Nether, 0: Overworld, 1: End; also, note that this is not a VarInt but instead a regular int.
+
  |
 
  |-
 
  |-
  | Difficulty
+
  | Entity ID
  | Unsigned Byte
+
  | Integer
  | 0: peaceful, 1: easy, 2: normal, 3: hard
+
  |
|-
 
| Max Players
 
| Unsigned Byte
 
| Was once used by the client to draw the player list, but now is ignored
 
|-
 
| Level Type
 
| String Enum (16)
 
| default, flat, largeBiomes, amplified, default_1_1
 
|-
 
| Reduced Debug Info
 
| 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.
 
 
  |}
 
  |}
  
==== Map ====
+
==== Initialize World Border ====
 
 
Updates a rectangular area on a {{Minecraft Wiki|map}} item.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,246: Line 2,280:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
  !colspan="2"| Field Type
+
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="13"| 0x24
+
  |rowspan="8"| 0x1D
  |rowspan="13"| Play
+
  |rowspan="8"| Play
  |rowspan="13"| Client
+
  |rowspan="8"| Client
  |colspan="2"| Item Damage
+
  | X
  |colspan="2"| VarInt
+
| Double
  | The damage value (map ID) of the map being modified
+
|
 +
|-
 +
  | Z
 +
| Double
 +
  |
 
  |-
 
  |-
  |colspan="2"| Scale
+
  | Old Diameter
  |colspan="2"| Byte
+
  | Double
  | From 0 for a fully zoomed-in map (1 block per pixel) to 4 for a fully zoomed-out map (16 blocks per pixel)
+
  | Current length of a single side of the world border, in meters.
|-
 
|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="3"| Icon
+
  | New Diameter
| Direction And Type
+
  | Double
|rowspan="3"| Array
+
  | Target length of a single side of the world border, in meters.
  | Byte
 
  | 0xF0 = Direction, 0x0F = Type
 
 
  |-
 
  |-
  | X
+
  | Speed
  | Byte
+
  | VarLong
  |  
+
  | Number of real-time ''milli''seconds until New Diameter is reached. It appears that Notchian server does not sync world border speed to game ticks, so it gets out of sync with server lag. If the world border is not moving, this is set to 0.
 
  |-
 
  |-
  | Z
+
  | Portal Teleport Boundary
  | Byte
+
  | VarInt
  |  
+
  | Resulting coordinates from a portal teleport are limited to ±value. Usually 29999984.
|-
 
|colspan="2"| Columns
 
|colspan="2"| Byte
 
| Number of columns updated
 
 
  |-
 
  |-
  |colspan="2"| Rows
+
  | Warning Blocks
  |colspan="2"| Optional Byte
+
  | VarInt
  | Only if Columns is more than 0; number of rows updated
+
  | In meters.
 
  |-
 
  |-
  |colspan="2"| X
+
  | Warning Time
  |colspan="2"| Optional Byte
+
  | VarInt
  | Only if Columns is more than 0; x offset of the westernmost column
+
  | In seconds as set by <code>/worldborder warning time</code>.
 
  |-
 
  |-
|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).
+
The Notchian client determines how solid to display the warning by comparing to whichever is higher, the warning distance or whichever is lower, the distance from the current diameter to the target diameter or the place the border will be after warningTime seconds. In pseudocode:
  
Types are based off of rows and columns in <code>map_icons.png</code>:
+
<syntaxhighlight lang="java">
 +
distance = max(min(resizeSpeed * 1000 * warningTime, abs(targetDiameter - currentDiameter)), warningDistance);
 +
if (playerDistance < distance) {
 +
    warning = 1.0 - playerDistance / distance;
 +
} else {
 +
    warning = 0.0;
 +
}
 +
</syntaxhighlight>
 +
 
 +
==== Keep Alive (clientbound) ====
 +
 
 +
The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same payload (see [[#Keep Alive (serverbound)|serverbound Keep Alive]]). If the client does not respond to them for over 30 seconds, the server kicks the client. Vice versa, if the server does not send any keep-alives for 20 seconds, the client will disconnect and yields a "Timed out" exception.
 +
 
 +
The Notchian server uses a system-dependent time in milliseconds to generate the keep alive ID value.
  
 
{| class="wikitable"
 
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  ! Icon type
+
| 0x1E
  ! Result
+
| Play
 +
| Client
 +
| Keep Alive ID
 +
| Long
 +
|
 +
|}
 +
 
 +
==== Chunk Data and Update Light ====
 +
{{Main|Chunk Format}}
 +
{{See also|#Unload Chunk}}
 +
 
 +
{{Need Info|How do biomes work now?  The biome change happened at the same time as the seed change, but it's not clear how/if biomes could be computed given that it's not the actual seed...  ([https://www.reddit.com/r/Mojira/comments/e5at6i/a_discussion_for_the_changes_to_how_biomes_are/ /r/mojira discussion] which notes that it seems to be some kind of interpolation, and 3D biomes are only used in the nether)}}
 +
 
 +
The server only sends skylight information for chunk pillars in the {{Minecraft Wiki|Overworld}}, it's up to the client to know in which dimension 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 [[#Block Entity Data|Block Entity Data]] later).
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
!colspan="2"| Field Name
 +
  !colspan="2"| Field Type
 +
  ! Notes
 
  |-
 
  |-
  | 0
+
  |rowspan="25"| 0x1F
  | White arrow (players)
+
|rowspan="25"| Play
 +
|rowspan="25"| Client
 +
|colspan="2"| Chunk X
 +
|colspan="2"| Int
 +
  | Chunk coordinate (block coordinate divided by 16, rounded down)
 
  |-
 
  |-
  | 1
+
  |colspan="2"| Chunk Z
  | Green arrow (item frames)
+
|colspan="2"| Int
 +
  | Chunk coordinate (block coordinate divided by 16, rounded down)
 
  |-
 
  |-
  | 2
+
  |colspan="2"| Heightmaps
  | Red arrow
+
|colspan="2"| [[NBT]]
 +
| Compound containing one long array named <code>MOTION_BLOCKING</code>, which is a heightmap for the highest solid block at each position in the chunk (as a compacted long array with 256 entries, with the number of bits per entry varying depending on the world's height, defined by the formula <code>ceil(log2(height + 1))</code>). The Notchian server also adds a <code>WORLD_SURFACE</code> long array, the purpose of which is unknown, but it's not required for the chunk to be accepted.
 +
|-
 +
|colspan="2"| Size
 +
|colspan="2"| VarInt
 +
| Size of Data in bytes
 +
|-
 +
|colspan="2"| Data
 +
|colspan="2"| Byte array
 +
| See [[Chunk Format#Data structure|data structure]] in Chunk Format
 +
|-
 +
|colspan="2"| Number of block entities
 +
|colspan="2"| VarInt
 +
| Number of elements in the following array
 +
|-
 +
|rowspan="4" | Block Entity
 +
| Packed XZ
 +
|rowspan="4" | Array
 +
| Byte
 +
| The packed section coordinates, calculated from <code><nowiki>((blockX & 15) << 4) | (blockZ & 15)</nowiki></code>
 +
|-
 +
| Y
 +
| Short
 +
| The height relative to the world
 +
|-
 +
| Type
 +
| VarInt
 +
| The type of block entity
 +
|-
 +
| Data
 +
  | [[NBT]]
 +
| The block entity's data, without the X, Y, and Z values
 +
|-
 +
|colspan="2"| Trust Edges
 +
|colspan="2"| Boolean
 +
| If edges should be trusted for light updates.
 +
|-
 +
|colspan="2"| Sky Light Mask
 +
|colspan="2"| BitSet
 +
| BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has data in the Sky Light array below.  The least significant bit is for blocks 16 blocks to 1 block below the min world height (one section below the world), while the most significant bit covers blocks 1 to 16 blocks above the max world height (one section above the world).
 +
|-
 +
|colspan="2"| Block Light Mask
 +
|colspan="2"| BitSet
 +
| BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has data in the Block Light array below.  The order of bits is the same as in Sky Light Mask.
 
  |-
 
  |-
  | 3
+
  |colspan="2"| Empty Sky Light Mask
  | Blue arrow
+
  |colspan="2"| BitSet
 +
| BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has all zeros for its Sky Light data.  The order of bits is the same as in Sky Light Mask.
 
  |-
 
  |-
  | 4
+
  |colspan="2"| Empty Block Light Mask
  | White cross
+
  |colspan="2"| BitSet
 +
| BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has all zeros for its Block Light data.  The order of bits is the same as in Sky Light Mask.
 
  |-
 
  |-
  | 5
+
  |colspan="2"| Sky Light array count
  | Red pointer
+
|colspan="2"| VarInt
 +
  | Number of entries in the following array; should match the number of bits set in Sky Light Mask
 
  |-
 
  |-
  | 6
+
  |rowspan="2"| Sky Light arrays
  | White circle (off-map players)
+
| Length
 +
|rowspan="2"| Array
 +
| VarInt
 +
  | Length of the following array in bytes (always 2048)
 
  |-
 
  |-
  | 7
+
  | Sky Light array
  | Small white circle (far-off-map players)
+
  | Array of 2048 bytes
 +
| There is 1 array for each bit set to true in the sky light mask, starting with the lowest value.  Half a byte per light value. Indexed <code><nowiki>((y<<8) | (z<<4) | x) / 2 </nowiki></code> If there's a remainder, masked 0xF0 else 0x0F.
 
  |-
 
  |-
  | 8
+
  |colspan="2"| Block Light array count
  | Mansion
+
|colspan="2"| VarInt
 +
  | Number of entries in the following array; should match the number of bits set in Block Light Mask
 
  |-
 
  |-
  | 9
+
  |rowspan="2"| Block Light arrays
  | Temple
+
| Length
 +
|rowspan="2"| Array
 +
| VarInt
 +
  | Length of the following array in bytes (always 2048)
 
  |-
 
  |-
  | 10-15
+
  | Block Light array
  | Unused (blue square)
+
  | Array of 2048 bytes
 +
| There is 1 array for each bit set to true in the block light mask, starting with the lowest value.  Half a byte per light value. Indexed <code><nowiki>((y<<8) | (z<<4) | x) / 2 </nowiki></code> If there's a remainder, masked 0xF0 else 0x0F.
 
  |}
 
  |}
  
==== Entity Relative Move ====
+
Note that the Notchian client requires an [[#Set Center Chunk|Set Center Chunk]] packet when it crosses a chunk border, otherwise it'll only display render distance + 2 chunks around the chunk it spawned in.
  
This packet is sent by the server when an entity moves less then 8 blocks; if an entity moves more than 8 blocks [[#Entity Teleport|Entity Teleport]] ([[#Play|Play]], 0x4A, clientbound) should be sent instead.
+
The compacted array format has been adjusted so that individual entries no longer span across multiple longs, affecting the main data array and heightmaps.
  
This packet allows at most 8 blocks movement in any direction, because short range is from -32768 to 32767. And <code>32768 / (128 * 32)</code> = 8.
+
New format, 5 bits per block, containing the following references to blocks in a palette (not shown): <span style="border: solid 2px hsl(0, 90%, 60%)">1</span><span style="border: solid 2px hsl(30, 90%, 60%)">2</span><span style="border: solid 2px hsl(60, 90%, 60%)">2</span><span style="border: solid 2px hsl(90, 90%, 60%)">3</span><span style="border: solid 2px hsl(120, 90%, 60%)">4</span><span style="border: solid 2px hsl(150, 90%, 60%)">4</span><span style="border: solid 2px hsl(180, 90%, 60%)">5</span><span style="border: solid 2px hsl(210, 90%, 60%)">6</span><span style="border: solid 2px hsl(240, 90%, 60%)">6</span><span style="border: solid 2px hsl(270, 90%, 60%)">4</span><span style="border: solid 2px hsl(300, 90%, 60%)">8</span><span style="border: solid 2px hsl(330, 90%, 60%)">0</span><span style="border: solid 2px hsl(0, 90%, 30%)">7</span><span style="border: solid 2px hsl(30, 90%, 30%)">4</span><span style="border: solid 2px hsl(60, 90%, 30%)">3</span><span style="border: solid 2px hsl(90, 90%, 30%)">13</span><span style="border: solid 2px hsl(120, 90%, 30%)">15</span><span style="border: solid 2px hsl(150, 90%, 30%)">16</span><span style="border: solid 2px hsl(180, 90%, 30%)">9</span><span style="border: solid 2px hsl(210, 90%, 30%)">14</span><span style="border: solid 2px hsl(240, 90%, 30%)">10</span><span style="border: solid 2px hsl(270, 90%, 30%)">12</span><span style="border: solid 2px hsl(300, 90%, 30%)">0</span><span style="border: solid 2px hsl(330, 90%, 30%)">2</span>
 +
 
 +
<code>0020863148418841</code> <code><span style="outline: dashed 2px black">0000</span><span style="outline: solid 2px hsl(330, 90%, 60%)">00000</span><span style="outline: solid 2px hsl(300, 90%, 60%)">01000</span><span style="outline: solid 2px hsl(270, 90%, 60%)">00100</span><span style="outline: solid 2px hsl(240, 90%, 60%)">00110</span><span style="outline: solid 2px hsl(210, 90%, 60%)">00110</span><span style="outline: solid 2px hsl(180, 90%, 60%)">00101</span><span style="outline: solid 2px hsl(150, 90%, 60%)">00100</span><span style="outline: solid 2px hsl(120, 90%, 60%)">00100</span><span style="outline: solid 2px hsl(90, 90%, 60%)">00011</span><span style="outline: solid 2px hsl(60, 90%, 60%)">00010</span><span style="outline: solid 2px hsl(30, 90%, 60%)">00010</span><span style="outline: solid 2px hsl(0, 90%, 60%)">00001</span></code><br>
 +
<code>01018A7260F68C87</code> <code><span style="outline: dashed 2px black">0000</span><span style="outline: solid 2px hsl(330, 90%, 30%)">00010</span><span style="outline: solid 2px hsl(300, 90%, 30%)">00000</span><span style="outline: solid 2px hsl(270, 90%, 30%)">01100</span><span style="outline: solid 2px hsl(240, 90%, 30%)">01010</span><span style="outline: solid 2px hsl(210, 90%, 30%)">01110</span><span style="outline: solid 2px hsl(180, 90%, 30%)">01001</span><span style="outline: solid 2px hsl(150, 90%, 30%)">10000</span><span style="outline: solid 2px hsl(120, 90%, 30%)">01111</span><span style="outline: solid 2px hsl(90, 90%, 30%)">01101</span><span style="outline: solid 2px hsl(60, 90%, 30%)">00011</span><span style="outline: solid 2px hsl(30, 90%, 30%)">00100</span><span style="outline: solid 2px hsl(0, 90%, 30%)">00111</span></code>
 +
 
 +
==== World Event ====
 +
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), effect 1028 (enderdragon death), and effect 1038 (end portal opening); it is ignored on other effects.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,365: Line 2,486:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| 0x25
+
  |rowspan="4"| 0x20
  |rowspan="5"| Play
+
  |rowspan="4"| Play
  |rowspan="5"| Client
+
  |rowspan="4"| Client
  | Entity ID
+
  | Event
  | VarInt
+
  | Int
  |  
+
  | The event, see below.
 
  |-
 
  |-
  | Delta X
+
  | Location
  | Short
+
  | Position
  | Change in X position as <code>(currentX * 32 - prevX * 32) * 128</code>
+
  | The location of the event.
 
  |-
 
  |-
  | Delta Y
+
  | Data
  | Short
+
  | Int
  | Change in Y position as <code>(currentY * 32 - prevY * 32) * 128</code>
+
  | Extra data for certain events, see below.
 
  |-
 
  |-
  | Delta Z
+
  | Disable Relative Volume
| Short
 
| Change in Z position as <code>(currentZ * 32 - prevZ * 32) * 128</code>
 
|-
 
| On Ground
 
 
  | Boolean
 
  | Boolean
  |  
+
  | See above.
 
  |}
 
  |}
  
==== Entity Look And Relative Move ====
+
Events:
 
 
This packet is sent by the server when an entity rotates and moves. Since a short range is limited from -32768 to 32767, and movement is offset of fixed-point numbers, this packet allows at most 8 blocks movement in any direction. (<code>-32768 / (32 * 128) == -8</code>)
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  ! ID
  ! State
+
  ! Name
! Bound To
+
  ! Data
! Field Name
 
  ! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="7"| 0x26
+
  !colspan="3"| Sound
|rowspan="7"| Play
 
|rowspan="7"| Client
 
| Entity ID
 
| VarInt
 
|
 
 
  |-
 
  |-
  | Delta X
+
  | 1000
  | Short
+
  | Dispenser dispenses
  | Change in X position as <code>(currentX * 32 - prevX * 32) * 128</code>
+
  |
 
  |-
 
  |-
  | Delta Y
+
  | 1001
  | Short
+
  | Dispenser fails to dispense
  | Change in Y position as <code>(currentY * 32 - prevY * 32) * 128</code>
+
  |
 
  |-
 
  |-
  | Delta Z
+
  | 1002
  | Short
+
  | Dispenser shoots
  | Change in Z position as <code>(currentZ * 32 - prevZ * 32) * 128</code>
+
  |
 
  |-
 
  |-
  | Yaw
+
  | 1003
  | Angle
+
  | Ender eye launched
  | New angle, not a delta
+
  |
 
  |-
 
  |-
  | Pitch
+
  | 1004
  | Angle
+
  | Firework shot
  | New angle, not a delta
+
  |
 
  |-
 
  |-
  | On Ground
+
  | 1005
  | Boolean
+
  | Iron door opened
  |  
+
  |
|}
 
 
 
==== Entity Look ====
 
 
 
This packet is sent by the server when an entity rotates.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="4"| 0x27
+
  | 1006
|rowspan="4"| Play
+
  | Wooden door opened
|rowspan="4"| Client
+
  |
| Entity ID
 
  | VarInt
 
  |  
 
 
  |-
 
  |-
  | Yaw
+
  | 1007
  | Angle
+
  | Wooden trapdoor opened
  | New angle, not a delta
+
  |
 
  |-
 
  |-
  | Pitch
+
  | 1008
  | Angle
+
  | Fence gate opened
  | New angle, not a delta
+
  |
 
  |-
 
  |-
  | On Ground
+
  | 1009
  | Boolean
+
  | Fire extinguished
  |  
+
  |
|}
 
 
 
==== Entity ====
 
 
 
This packet may be used to initialize an entity.
 
 
 
For player entities, either this packet or any move/look packet is sent every game tick. So the meaning of this packet is basically that the entity did not move/look since the last such packet.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="1"| 0x28
+
  | 1010
  |rowspan="1"| Play
+
  | Play record
  |rowspan="1"| Client
+
  | Special case, see below for more info.
| Entity ID
 
| VarInt
 
|
 
|}
 
 
 
==== Vehicle Move (clientbound) ====
 
 
 
Note that all fields use absolute positioning and do not allow for relative positioning.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="7"| 0x29
+
  | 1011
  |rowspan="7"| Play
+
| Iron door closed
  |rowspan="7"| Client
+
  |
  | X
+
  |-
  | Double
+
  | 1012
  | Absolute position (X coordinate)
+
  | Wooden door closed
 +
  |
 
  |-
 
  |-
  | Y
+
  | 1013
  | Double
+
  | Wooden trapdoor closed
  | Absolute position (Y coordinate)
+
  |
 
  |-
 
  |-
  | Z
+
  | 1014
  | Double
+
  | Fence gate closed
  | Absolute position (Z coordinate)
+
  |
 
  |-
 
  |-
  | Yaw
+
  | 1015
  | Float
+
  | Ghast warns
  | Absolute rotation on the vertical axis, in degrees
+
  |
 
  |-
 
  |-
  | Pitch
+
  | 1016
  | Float
+
  | Ghast shoots
  | Absolute rotation on the horizontal axis, in degrees
+
  |
|}
 
 
 
==== Open Sign Editor ====
 
 
 
Sent when the client has placed a sign and is allowed to send [[#Update Sign|Update Sign]].
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="1"| 0x2A
+
  | 1017
  |rowspan="1"| Play
+
  | Enderdragon shoots
  |rowspan="1"| Client
+
  |
| Location
 
| Position
 
|
 
|}
 
 
 
==== Player Abilities (clientbound) ====
 
 
 
The latter 2 floats are used to indicate the field of view and flying speed respectively, while the first byte is used to determine the value of 4 booleans.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x2B
+
  | 1018
|rowspan="3"| Play
+
  | Blaze shoots
|rowspan="3"| Client
+
  |
| Flags
 
  | Byte
 
  | Bit field, see below
 
 
  |-
 
  |-
  | Flying Speed
+
  | 1019
  | Float
+
  | Zombie attacks wood door
  |  
+
  |
 
  |-
 
  |-
  | Field of View Modifier
+
  | 1020
  | Float
+
  | Zombie attacks iron door
  | Modifies the field of view, like a speed potion. A Notchian server will use the same value as the movement speed (send in the [[Protocol#Entity_Properties|Entity Properties]] packet).
+
  |
|}
 
 
 
About the flags:
 
 
 
{| class="wikitable"
 
 
  |-
 
  |-
  ! Field
+
  | 1021
  ! Bit
+
  | Zombie breaks wood door
 +
|
 
  |-
 
  |-
  | Invulnerable
+
  | 1022
  | 0x01
+
| Wither breaks block
 +
  |
 
  |-
 
  |-
  | Flying
+
  | 1023
  | 0x02
+
| Wither spawned
 +
  |
 
  |-
 
  |-
  | Allow Flying
+
  | 1024
  | 0x04
+
| Wither shoots
 +
  |
 
  |-
 
  |-
  | Creative Mode
+
  | 1025
  | 0x08
+
  | Bat takes off
  |}
+
  |
 
 
==== Combat Event ====
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
!colspan="2"| Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="8"| 0x2C
+
  | 1026
|rowspan="8"| Play
+
  | Zombie infects
|rowspan="8"| Client
+
  |
|colspan="2"| Event
 
  | VarInt Enum
 
  | Determines the layout of the remaining packet
 
 
  |-
 
  |-
  ! Event
+
  | 1027
  ! Field Name
+
  | Zombie villager converted
  !
+
  |
!
 
 
  |-
 
  |-
  | 0: enter combat
+
  | 1028
  | ''no fields''
+
  | Ender dragon death
| ''no fields''
+
  |
  |  
 
 
  |-
 
  |-
  |rowspan="2"| 1: end combat
+
  | 1029
| Duration
+
  | Anvil destroyed
  | VarInt
+
  |
  |  
 
 
  |-
 
  |-
  | Entity ID
+
  | 1030
  | Int
+
  | Anvil used
  |  
+
  |
 
  |-
 
  |-
  |rowspan="3"| 2: entity dead
+
  | 1031
| Player ID
+
  | Anvil landed
  | VarInt
+
  |
  |  
 
 
  |-
 
  |-
  | Entity ID
+
  | 1032
  | Int
+
  | Portal travel
  |  
+
  |
 
  |-
 
  |-
  | Message
+
  | 1033
  | [[Chat]]
+
  | Chorus flower grown
  |  
+
  |
|}
 
 
 
==== Player List Item ====
 
 
 
Sent by the server to update the user list (<tab> in the client).
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
!colspan="4"| Field Name
 
!colspan="3"| Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="19"| 0x2D
+
  | 1034
|rowspan="19"| Play
+
  | Chorus flower died
|rowspan="19"| Client
+
  |
  |colspan="4"| Action
 
|colspan="3"| VarInt
 
  | Determines the rest of the Player format after the UUID
 
 
  |-
 
  |-
  |colspan="4"| Number Of Players
+
  | 1035
  |colspan="3"| VarInt
+
  | Brewing stand brewed
  | Number of elements in the following array
+
  |
 
  |-
 
  |-
  |rowspan="17"| Player
+
  | 1036
|colspan="3"| UUID
+
  | Iron trapdoor opened
  |rowspan="17"| Array
+
  |
|colspan="2"| UUID
 
  |  
 
 
  |-
 
  |-
  ! Action
+
  | 1037
  !colspan="2"| Field Name
+
  | Iron trapdoor closed
  !colspan="2"|  
+
  |
!
 
 
  |-
 
  |-
  |rowspan="10"| 0: add player
+
  | 1038
|colspan="2"| Name
+
  | End portal created in overworld
  |colspan="2"| String (16)
+
  |
  |  
 
 
  |-
 
  |-
  |colspan="2"| Number Of Properties
+
  | 1039
  |colspan="2"| VarInt
+
  | Phantom bites
  | Number of elements in the following array
+
  |
 
  |-
 
  |-
  |rowspan="4"| Property
+
  | 1040
| Name
+
  | Zombie converts to drowned
|rowspan="4"| Array
+
  |
  | String (32767)
 
  |  
 
 
  |-
 
  |-
  | Value
+
  | 1041
  | String (32767)
+
  | Husk converts to zombie by drowning
|
+
  |
|-
 
| Is Signed
 
| Boolean
 
  |  
 
 
  |-
 
  |-
  | Signature
+
  | 1042
  | Optional String (32767)
+
  | Grindstone used
  | Only if Is Signed is true
+
  |
 
  |-
 
  |-
  |colspan="2"| Gamemode
+
  | 1043
  |colspan="2"| VarInt
+
  | Book page turned
  |  
+
  |
 
  |-
 
  |-
|colspan="2"| Ping
 
|colspan="2"| VarInt
 
|
 
 
  |-
 
  |-
  |colspan="2"| Has Display Name
+
  !colspan="3"| Particle
|colspan="2"| Boolean
 
|
 
 
  |-
 
  |-
  |colspan="2"| Display Name
+
  | 1500
  |colspan="2"| Optional [[Chat]]
+
  | Composter composts
  | Only if Has Display Name is true
+
  |
 
  |-
 
  |-
  | 1: update gamemode
+
  | 1501
  |colspan="2"| Gamemode
+
  | Lava converts block (either water to stone, or removes existing blocks such as torches)
|colspan="2"| VarInt
+
  |
|
 
|-
 
| 2: update latency
 
|colspan="2"| Ping
 
|colspan="2"| VarInt
 
  |  
 
 
  |-
 
  |-
  |rowspan="2"| 3: update display name
+
  | 1502
|colspan="2"| Has Display Name
+
  | Redstone torch burns out
  |colspan="2"| Boolean
+
  |
  |  
 
 
  |-
 
  |-
  |colspan="2"| Display Name
+
  | 1503
  |colspan="2"| Optional [[Chat]]
+
  | Ender eye placed
  | Only send if Has Display Name is true
+
  |
 
  |-
 
  |-
  | 4: remove player
+
  | 2000
  |colspan="2"| ''no fields''
+
  | Spawns 10 smoke particles, e.g. from a fire
|colspan="2"| ''no fields''
+
| Direction, see below.
|
 
|}
 
 
 
The Property field looks as in the response of [[Mojang API#UUID -> Profile + Skin/Cape]], except of course using the protocol format instead of JSON. That is, each player will usually have one property with Name “textures” and Value being a base64-encoded JSON string as documented at [[Mojang API#UUID -> Profile + Skin/Cape]]. An empty properties array is also acceptable, and will cause clients to display the player with one of the two default skins depending on UUID.
 
 
 
==== Player Position And Look (clientbound) ====
 
 
 
Updates the player's position on the server. This packet will also close the “Downloading Terrain” screen when joining/respawning.
 
 
 
If the distance between the last known position of the player on the server and the new position set by this packet is greater than 100 meters, the client will be kicked for “You moved too quickly :( (Hacking?)”.
 
 
 
Also if the fixed-point number of X or Z is set greater than <code>3.2E7D</code> the client will be kicked for “Illegal position”.
 
 
 
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.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="7"| 0x2E
+
  | 2001
|rowspan="7"| Play
+
  | Block break + block break sound
|rowspan="7"| Client
+
  | Block state, as an index into the global palette.
| X
 
  | Double
 
  | Absolute or relative position, depending on Flags
 
 
  |-
 
  |-
  | Y
+
  | 2002
  | Double
+
  | Splash potion. Particle effect + glass break sound.
  | Absolute or relative position, depending on Flags
+
  | RGB color as an integer (e.g. 8364543 for #7FA1FF).
 
  |-
 
  |-
  | Z
+
  | 2003
  | Double
+
  | Eye of Ender entity break animation — particles and sound
  | Absolute or relative position, depending on Flags
+
  |
 
  |-
 
  |-
  | Yaw
+
  | 2004
  | Float
+
  | Mob spawn particle effect: smoke + flames
  | Absolute or relative rotation on the X axis, in degrees
+
  |
 +
|-
 +
| 2005
 +
| Bonemeal particles
 +
| How many particles to spawn (if set to 0, 15 are spawned).
 
  |-
 
  |-
  | Pitch
+
  | 2006
  | Float
+
  | Dragon breath
  | Absolute or relative rotation on the Y axis, in degrees
+
  |
 
  |-
 
  |-
  | Flags
+
  | 2007
  | Byte
+
  | Instant splash potion. Particle effect + glass break sound.
  | Bit field, see below
+
  | RGB color as an integer (e.g. 8364543 for #7FA1FF).
 
  |-
 
  |-
  | Teleport ID
+
  | 2008
  | VarInt
+
  | Ender dragon destroys block
  | Client should confirm this packet with [[#Teleport Confirm|Teleport Confirm]] containing the same Teleport ID
+
  |
|}
 
 
 
About the Flags field:
 
 
 
<Dinnerbone> It's a bitfield, X/Y/Z/Y_ROT/X_ROT. If X is set, the x value is relative and not absolute.
 
 
 
{| class="wikitable"
 
 
  |-
 
  |-
  ! Field
+
  | 2009
  ! Bit
+
  | Wet sponge vaporizes in nether
 +
|
 
  |-
 
  |-
  | X
+
  | 3000
  | 0x01
+
| End gateway spawn
 +
  |
 
  |-
 
  |-
  | Y
+
  | 3001
  | 0x02
+
| Enderdragon growl
 +
  |
 
  |-
 
  |-
  | Z
+
  | 3002
  | 0x04
+
| Electric spark
 +
  |
 
  |-
 
  |-
  | Y_ROT
+
  | 3003
  | 0x08
+
| Copper apply wax
 +
  |
 
  |-
 
  |-
  | X_ROT
+
  | 3004
  | 0x10
+
| Copper remove wax
 +
|
 +
|-
 +
| 3005
 +
| Copper scrape oxidation
 +
  |
 
  |}
 
  |}
  
==== Use Bed ====
+
Smoke directions:
 
 
This packet tells that a player goes to bed.
 
 
 
The client with the matching Entity ID will go into bed mode.
 
 
 
This Packet is sent to all nearby players including the one sent to bed.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  ! ID
  ! State
+
  ! Direction
  ! Bound To
+
  |-
  ! Field Name
+
| 0
  ! Field Type
+
| Down
  ! Notes
+
|-
 +
| 1
 +
| Up
 +
|-
 +
| 2
 +
| North
 +
  |-
 +
  | 3
 +
  | South
 
  |-
 
  |-
  |rowspan="2"| 0x2F
+
  | 4
|rowspan="2"| Play
+
  | West
|rowspan="2"| Client
 
| Entity ID
 
| VarInt
 
  | Sleeping player's EID
 
 
  |-
 
  |-
  | Location
+
  | 5
  | Position
+
  | East
| Block location of the head part of the bed
 
 
  |}
 
  |}
  
==== Destroy Entities ====
+
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.  See [[Data Generators]] for information on item IDs.
  
Sent by the server when a list of entities is to be destroyed on the client.
+
==== Particle ====
 +
 
 +
Displays the named particle
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,862: Line 2,814:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x30
+
  |rowspan="12"| 0x21
  |rowspan="2"| Play
+
  |rowspan="12"| Play
  |rowspan="2"| Client
+
  |rowspan="12"| Client
  | Count
+
  | Particle ID
 
  | VarInt
 
  | VarInt
  | Number of elements in the following array
+
  | The particle ID listed in [[#Particle|the particle data type]].
 
  |-
 
  |-
  | Entity IDs
+
  | Long Distance
  | Array of VarInt
+
  | Boolean
  | The list of entities of destroy
+
| If true, particle distance increases from 256 to 65536.
 +
|-
 +
| X
 +
| Double
 +
| X position of the particle.
 +
|-
 +
| Y
 +
| Double
 +
| Y position of the particle.
 +
|-
 +
| Z
 +
| Double
 +
| Z position of the particle.
 +
|-
 +
| Offset X
 +
| Float
 +
| This is added to the X position after being multiplied by <code>random.nextGaussian()</code>.
 +
|-
 +
| Offset Y
 +
| Float
 +
| This is added to the Y position after being multiplied by <code>random.nextGaussian()</code>.
 +
|-
 +
| Offset Z
 +
| Float
 +
| This is added to the Z position after being multiplied by <code>random.nextGaussian()</code>.
 +
|-
 +
| Max Speed
 +
| Float
 +
|
 +
|-
 +
| Particle Count
 +
| Int
 +
  | The number of particles to create.
 +
|-
 +
| Data
 +
| Varies
 +
| The variable data listed in [[#Particle|the particle data type]].
 
  |}
 
  |}
  
==== Remove Entity Effect ====
+
==== Update Light ====
 +
 
 +
Updates light levels for a chunk.  See {{Minecraft Wiki|Light}} for information on how lighting works in Minecraft.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,880: Line 2,870:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  !colspan="2"| Field Name
  ! Field Type
+
  !colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x31
+
  |rowspan="13"| 0x22
  |rowspan="2"| Play
+
  |rowspan="13"| Play
  |rowspan="2"| Client
+
  |rowspan="13"| Client
  | Entity ID
+
  |colspan="2"| Chunk X
  | VarInt
+
  |colspan="2"| VarInt
  |  
+
  | Chunk coordinate (block coordinate divided by 16, rounded down)
 
  |-
 
  |-
  | Effect ID
+
  |colspan="2"| Chunk Z
  | Byte
+
|colspan="2"| VarInt
  | See {{Minecraft Wiki|Status effect#List of effects|this table}}
+
| Chunk coordinate (block coordinate divided by 16, rounded down)
  |}
+
  |-
 
+
  |colspan="2"| Trust Edges
==== Resource Pack Send ====  
+
|colspan="2"| Boolean
 
+
| If edges should be trusted for light updates.
{| class="wikitable"
+
|-
  ! Packet ID
+
|colspan="2"| Sky Light Mask
  ! State
+
|colspan="2"| BitSet
  ! Bound To
+
| BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has data in the Sky Light array below.  The least significant bit is for blocks 16 blocks to 1 block below the min world height (one section below the world), while the most significant bit covers blocks 1 to 16 blocks above the max world height (one section above the world).
  ! Field Name
+
  |-
  ! Field Type
+
|colspan="2"| Block Light Mask
  ! Notes
+
|colspan="2"| BitSet
 +
| BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has data in the Block Light array below.  The order of bits is the same as in Sky Light Mask.
 +
|-
 +
|colspan="2"| Empty Sky Light Mask
 +
|colspan="2"| BitSet
 +
| BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has all zeros for its Sky Light data.  The order of bits is the same as in Sky Light Mask.
 +
|-
 +
|colspan="2"| Empty Block Light Mask
 +
|colspan="2"| BitSet
 +
| BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has all zeros for its Block Light data.  The order of bits is the same as in Sky Light Mask.
 +
|-
 +
|colspan="2"| Sky Light array count
 +
|colspan="2"| VarInt
 +
| Number of entries in the following array; should match the number of bits set in Sky Light Mask
 +
|-
 +
|rowspan="2"| Sky Light arrays
 +
| Length
 +
|rowspan="2"| Array
 +
  | VarInt
 +
  | Length of the following array in bytes (always 2048)
 +
  |-
 +
  | Sky Light array
 +
  | Array of 2048 bytes
 +
  | There is 1 array for each bit set to true in the sky light mask, starting with the lowest value.  Half a byte per light value.
 +
|-
 +
|colspan="2"| Block Light array count
 +
|colspan="2"| VarInt
 +
| Number of entries in the following array; should match the number of bits set in Block Light Mask
 
  |-
 
  |-
  |rowspan="2"| 0x32
+
  |rowspan="2"| Block Light arrays
  |rowspan="2"| Play
+
  | Length
  |rowspan="2"| Client
+
  |rowspan="2"| Array
  | URL
+
  | VarInt
  | String (32767)
+
  | Length of the following array in bytes (always 2048)
| The URL to the resource pack.
 
 
  |-
 
  |-
  | Hash
+
  | Block Light array
  | String (40)
+
  | Array of 2048 bytes
  | A 40 character hexadecimal and lowercase [[wikipedia:SHA-1|SHA-1]] hash of the resource pack file. (must be lower case in order to work)<br />If it's not a 40 character hexadecimal string, the client will not use it for hash verification and likely waste bandwidth — but it will still treat it as a unique id
+
  | There is 1 array for each bit set to true in the block light mask, starting with the lowest value.  Half a byte per light value.
 
  |}
 
  |}
  
==== Respawn ====
+
A bit will never be set in both the block light mask and the empty block light mask, though it may be present in neither of them (if the block light does not need to be updated for the corresponding chunk section).  The same applies to the sky light mask and the empty sky light mask.
 +
 
 +
==== Login (play) ====
  
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.
+
See [[Protocol Encryption]] for information on logging in.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,930: Line 2,948:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x33
+
  |rowspan="20"| 0x23
  |rowspan="4"| Play
+
  |rowspan="20"| Play
  |rowspan="4"| Client
+
  |rowspan="20"| Client
  | Dimension
+
  | Entity ID
  | Int Enum
+
  | Int
  | -1: The Nether, 0: The Overworld, 1: The End
+
  | The player's Entity ID (EID).
 
  |-
 
  |-
  | Difficulty
+
  | Is hardcore
  | Unsigned Byte
+
  | Boolean
  | 0: Peaceful, 1: Easy, 2: Normal, 3: Hard
+
  |
 
  |-
 
  |-
 
  | Gamemode
 
  | Gamemode
 
  | Unsigned Byte
 
  | Unsigned Byte
  | 0: survival, 1: creative, 2: adventure, 3: spectator. The hardcore flag is not included
+
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 +
|-
 +
| Previous Gamemode
 +
| Byte
 +
  | 0: survival, 1: creative, 2: adventure, 3: spectator. The hardcore flag is not included. The previous gamemode. Defaults to -1 if there is no previous gamemode. (More information needed)
 +
|-
 +
| Dimension Count
 +
| VarInt
 +
| Size of the following array.
 +
|-
 +
| Dimension Names
 +
| Array of Identifier
 +
| Identifiers for all dimensions on the server.
 +
|-
 +
| Registry Codec
 +
| [[NBT|NBT Tag Compound]]
 +
| Represents certain registries that are sent from the server and are applied on the client.
 +
|-
 +
| Dimension Type
 +
| Identifier
 +
| Name of the dimension type being spawned into.
 +
|-
 +
| 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
 +
|-
 +
| 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 {{Minecraft Wiki|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.
 +
|-
 +
| Is Debug
 +
| Boolean
 +
| True if the world is a {{Minecraft Wiki|debug mode}} world; debug mode worlds cannot be modified and have predefined blocks.
 +
|-
 +
| Is Flat
 +
| Boolean
 +
| 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.
 +
|-
 +
| Has death location
 +
| Boolean
 +
| If true, then the next two fields are present.
 +
|-
 +
| Death dimension name
 +
| Identifier
 +
| Name of the dimension the player died in.
 
  |-
 
  |-
  | Level Type
+
  | Death location
  | String (16)
+
  | Position
  | Same as [[#Join Game|Join Game]]
+
  | The location that the player died at.
 
  |}
 
  |}
  
{{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).
 
  
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.}}
+
The '''Registry Codec''' NBT Tag Compound ([https://gist.github.com/rj00a/f2970a8ce4d09477ec8f16003b9dce86 Default value in JSON as of 1.19]) includes three registries: "minecraft:dimension_type", "minecraft:worldgen/biome", and "minecraft:chat_type".
  
==== Entity Head Look ====
+
{| class="wikitable"
 +
!Name
 +
!Type
 +
!style="width: 250px;" colspan="2"| Notes
 +
|-
 +
| minecraft:dimension_type
 +
| TAG_Compound
 +
| The dimension type registry (see below).
 +
|-
 +
| minecraft:worldgen/biome
 +
| TAG_Compound
 +
| The biome registry (see below).
 +
|-
 +
| minecraft:chat_type
 +
| TAG_Compound
 +
| The chat type registry (see below).
 +
|}
  
Changes the direction an entity's head is facing.
+
Dimension type registry:
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  !Name
! State
+
  !Type
! Bound To
+
  !style="width: 250px;" colspan="2"| Notes
! Field Name
 
  ! Field Type
 
  ! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x34
+
  | type
  |rowspan="2"| Play
+
  | TAG_String
  |rowspan="2"| Client
+
  | The name of the registry. Always "minecraft:dimension_type".
| Entity ID
 
| VarInt
 
|
 
 
  |-
 
  |-
  | Head Yaw
+
  | value
  | Angle
+
  | TAG_List
  | New angle, not a delta
+
  | List of dimension types registry entries (see below).
 
  |}
 
  |}
  
==== World Border ====
+
Dimension type registry entry:
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  !Name
  ! State
+
  !Type
! Bound To
+
  !style="width: 250px;" colspan="2"| Notes
  !colspan="2"| Field Name
+
|-
  ! Field Type
+
| name
  ! Notes
+
  | TAG_String
 +
  | The name of the dimension type (for example, "minecraft:overworld").
 
  |-
 
  |-
  |rowspan="18"| 0x35
+
  | id
  |rowspan="18"| Play
+
  | TAG_Int
  |rowspan="18"| Client
+
  | The protocol ID of the dimension (matches the index of the element in the registry list).
|colspan="2"| Action
 
| VarInt Enum
 
| Determines the format of the rest of the packet
 
 
  |-
 
  |-
  ! Action
+
| element
  ! Field Name
+
| TAG_Compound
  !  
+
| The dimension type (see below).
  !  
+
|}
 +
 
 +
Dimension type:
 +
 
 +
{| class="wikitable"
 +
  ! Name
 +
  ! Type
 +
  !style="width: 250px;" colspan="2"| Meaning
 +
  ! Values
 
  |-
 
  |-
  | 0: set size
+
  | piglin_safe
  | Diameter
+
  | TAG_Byte
  | Double
+
  |colspan="2"| Whether piglins shake and transform to zombified piglins.
  | Length of a single side of the world border, in meters
+
  | 1: true, 0: false.
 
  |-
 
  |-
  |rowspan="3"| 1: lerp size
+
  | has_raids
  | Old Diameter
+
  | TAG_Byte
  | Double
+
  |colspan="2"| Whether players with the Bad Omen effect can cause a raid.
  | Current length of a single side of the world border, in meters
+
  | 1: true, 0: false.
 
  |-
 
  |-
  | New Diameter
+
  | monster_spawn_light_level
  | Double
+
  | TAG_Int
  | Target length of a single side of the world border, in meters
+
|colspan="2"|
 +
  |
 
  |-
 
  |-
  | Speed
+
  | monster_spawn_block_light_limit
  | VarLong
+
  | TAG_Int
  | Number of real-time ''milli''seconds until New Diameter is reached. It appears that Notchian server does not sync world border speed to game ticks, so it gets out of sync with server lag. If the world border is not moving, this is set to 0.
+
|colspan="2"|
 +
  |
 
  |-
 
  |-
  |rowspan="2"| 2: set center
+
  | natural
  | X
+
  | TAG_Byte
  | Double
+
  |colspan="2"| When false, compasses spin randomly. When true, nether portals can spawn zombified piglins.
  |  
+
  | 1: true, 0: false.
 
  |-
 
  |-
  | Z
+
  | ambient_light
  | Double
+
  | TAG_Float
  |  
+
  |colspan="2"| How much light the dimension has.
 +
| 0.0 to 1.0.
 
  |-
 
  |-
  |rowspan="8"| 3: initialize
+
  | fixed_time
  | X
+
  | Optional TAG_Long
  | Double
+
  |colspan="2"| If set, the time of the day is the specified value.
  |  
+
  | If set, 0 to 24000.
 
  |-
 
  |-
  | Z
+
  | infiniburn
  | Double
+
  | TAG_String
  |  
+
  |colspan="2"| A resource location defining what block tag to use for infiniburn.
 +
| "#" or minecraft resource "#minecraft:...".
 +
|-
 +
| respawn_anchor_works
 +
| TAG_Byte
 +
|colspan="2"| Whether players can charge and use respawn anchors.
 +
| 1: true, 0: false.
 +
|-
 +
| has_skylight
 +
| TAG_Byte
 +
|colspan="2"| Whether the dimension has skylight access or not.
 +
| 1: true, 0: false.
 
  |-
 
  |-
  | Old Diameter
+
  | bed_works
  | Double
+
  | TAG_Byte
  | Current length of a single side of the world border, in meters
+
  |colspan="2"| Whether players can use a bed to sleep.
 +
| 1: true, 0: false.
 
  |-
 
  |-
  | New Diameter
+
  | effects
  | Double
+
  | TAG_String
  | Target length of a single side of the world border, in meters
+
  |colspan="2"| ?
 +
| "minecraft:overworld", "minecraft:the_nether", "minecraft:the_end" or something else.
 
  |-
 
  |-
  | Speed
+
  | min_y
  | VarLong
+
  | TAG_Int
  | Number of real-time ''milli''seconds until New Diameter is reached. It appears that Notchian server does not sync world border speed to game ticks, so it gets out of sync with server lag. If the world border is not moving, this is set to 0.
+
  |colspan="2"| The minimum Y level.
 +
| A multiple of 16. Example: -64
 
  |-
 
  |-
  | Portal Teleport Boundary
+
  | height
  | VarInt
+
  | TAG_Int
  | Resulting coordinates from a portal teleport are limited to ±value. Usually 29999984.
+
  |colspan="2"| The maximum height.
 +
| A multiple of 16. Example: 256
 
  |-
 
  |-
  | Warning Time
+
  | logical_height
  | VarInt
+
  | TAG_Int
  | In seconds as set by <code>/worldborder warning time</code>
+
  |colspan="2"| The maximum height to which chorus fruits and nether portals can bring players within this dimension.
 +
| 0-384.
 
  |-
 
  |-
  | Warning Blocks
+
  | coordinate_scale
  | VarInt
+
  | TAG_Double
  | In meters
+
  |colspan="2"| The multiplier applied to coordinates when traveling to the dimension.
 +
| 0.00001 - 30000000.0
 
  |-
 
  |-
  |rowspan="1"| 4: set warning time
+
  | ultrawarm
  | Warning Time
+
  | TAG_Byte
  | VarInt
+
  |colspan="2"| Whether the dimensions behaves like the nether (water evaporates and sponges dry) or not. Also causes lava to spread thinner.
  | In seconds as set by <code>/worldborder warning time</code>
+
  | 1: true, 0: false.
 
  |-
 
  |-
  |rowspan="1"| 5: set warning blocks
+
  | has_ceiling
  | Warning Blocks
+
  | TAG_Byte
  | VarInt
+
  |colspan="2"| Whether the dimension has a bedrock ceiling or not. When true, causes lava to spread faster.
  | In meters
+
  | 1: true, 0: false.
 
  |}
 
  |}
  
The Notchian client determines how solid to display the warning by comparing to whichever is higher, the warning distance or whichever is lower, the distance from the current diameter to the target diameter or the place the border will be after warningTime seconds. In pseudocode:
+
Biome registry:
 
 
<syntaxhighlight lang="java">
 
distance = max(min(resizeSpeed * 1000 * warningTime, abs(targetDiameter - currentDiameter)), warningDistance);
 
if (playerDistance < distance) {
 
    warning = 1.0 - playerDistance / distance;
 
} else {
 
    warning = 0.0;
 
}
 
</syntaxhighlight>
 
  
==== Camera ====
+
{| class="wikitable"
 +
!Name
 +
!Type
 +
!style="width: 250px;" colspan="2"| Notes
 +
|-
 +
| type
 +
| TAG_String
 +
| The name of the registry. Always "minecraft:worldgen/biome".
 +
|-
 +
| value
 +
| TAG_List
 +
| List of biome registry entries (see below).
 +
|}
  
Sets the entity that the player renders from. This is normally used when the player left-clicks an entity while in spectator mode.
+
Biome registry entry:
  
The player's camera will move with the entity and look where it is looking. The entity is often another player, but can be any type of entity.  The player is unable to move this entity (move packets will act as if they are coming from the other entity).
+
{| class="wikitable"
 +
!Name
 +
!Type
 +
!style="width: 250px;" colspan="2"| Notes
 +
|-
 +
| name
 +
| TAG_String
 +
| The name of the biome (for example, "minecraft:ocean").
 +
|-
 +
| id
 +
| TAG_Int
 +
| The protocol ID of the biome (matches the index of the element in the registry list).
 +
|-
 +
  | element
 +
| TAG_Compound
 +
| The biome properties (see below).
 +
|}
  
If the given entity is not loaded by the player, this packet is ignored.  To return control to the player, send this packet with their entity ID.
+
Biome properties:
 
 
The Notchian server resets this (sends it back to the default entity) whenever the spectated entity is killed or the player sneaks, but only if they were spectating an entity. It also sends this packet whenever the player switches out of spectator mode (even if they weren't spectating an entity).
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  !colspan="3"|Name
  ! State
+
  !colspan="2"|Type
  ! Bound To
+
  !style="width: 250px;" colspan="2"| Meaning
  ! Field Name
+
  !colspan="2"|Values
  ! Field Type
+
|-
  ! Notes
+
|colspan="3"|precipitation
 +
|colspan="2"|TAG_String
 +
|colspan="2"| The type of precipitation in the biome.
 +
|colspan="2"|"rain", "snow", or "none".
 +
|-
 +
|colspan="3"| depth
 +
|colspan="2"| TAG_Float
 +
|colspan="2"| The depth factor of the biome.
 +
|colspan="2"| The default values vary between 1.5 and -1.8.
 +
|-
 +
|colspan="3"| temperature
 +
|colspan="2"| TAG_Float
 +
|colspan="2"| The temperature factor of the biome.
 +
|colspan="2"| The default values vary between 2.0 and -0.5.
 +
|-
 +
|colspan="3"| scale
 +
|colspan="2"| TAG_Float
 +
|colspan="2"| ?
 +
|colspan="2"| The default values vary between 1.225 and 0.0.
 +
|-
 +
|colspan="3"| downfall
 +
|colspan="2"| TAG_Float
 +
|colspan="2"| ?
 +
|colspan="2"| The default values vary between 1.0 and 0.0.
 +
|-
 +
|colspan="3"| category
 +
|colspan="2"| TAG_String
 +
|colspan="2"| The category of the biome.
 +
|colspan="2"| Known values are "ocean", "plains", "desert", "forest", "extreme_hills", "taiga", "swamp", "river", "nether", "the_end", "icy", "mushroom", "beach", "jungle", "mesa", "savanna", and "none".
 +
|-
 +
|colspan="3"| temperature_modifier
 +
|colspan="2"| Optional TAG_String
 +
|colspan="2"| ?
 +
|colspan="2"| The only known value is "frozen".
 +
|-
 +
|rowspan="13"| effects
 +
|colspan="2"| sky_color
 +
|rowspan="11"| TAG_Compound
 +
| TAG_Int
 +
|colspan="2"| The color of the sky.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
|colspan="2"| water_fog_color
 +
| TAG_Int
 +
|colspan="2"| Possibly the tint color when swimming.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
|colspan="2"| fog_color
 +
| TAG_Int
 +
|colspan="2"| Possibly the color of the fog effect when looking past the view distance.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
|colspan="2"| water_color
 +
| TAG_Int
 +
|colspan="2"| The tint color of the water blocks.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
|colspan="2"| foliage_color
 +
| Optional TAG_Int
 +
|colspan="2"| The tint color of the grass.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
|colspan="2"| grass_color
 +
| Optional TAG_Int
 +
| colspan="2"| ?
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
|colspan="2"| grass_color_modifier
 +
| Optional TAG_String
 +
|colspan="2"| Unknown, likely affects foliage color.
 +
| If set, known values are "swamp" and "dark_forest".
 +
|-
 +
|colspan="2"| music
 +
| Optional TAG_Compound
 +
|colspan="2"| Music properties for the biome.
 +
| If present, contains the fields: replace_current_music (TAG_Byte), sound (TAG_String), max_delay (TAG_Int), min_delay (TAG_Int).
 +
|-
 +
|colspan="2"| ambient_sound
 +
| Optional TAG_String
 +
|colspan="2"| Ambient soundtrack.
 +
| If present, the ID of a soundtrack. Example: "minecraft:ambient.basalt_deltas.loop".
 +
|-
 +
|colspan="2"| additions_sound
 +
| Optional TAG_Compound
 +
|colspan="2"| Additional ambient sound that plays randomly.
 +
| If present, contains the fields: sound (TAG_String), tick_chance (TAG_Double).
 +
|-
 +
|colspan="2"| mood_sound
 +
| Optional TAG_Compound
 +
|colspan="2"| Additional ambient sound that plays at an interval.
 +
| If present, contains the fields: sound (TAG_String), tick_delay (TAG_Int), offset (TAG_Double), block_search_extent (TAG_Int).
 +
|-
 +
|rowspan="2"| particle
 +
| probability
 +
|rowspan="2"| Optional TAG_Compound
 +
| TAG_FLOAT
 +
|rowspan="2"| Particles that appear randomly in the biome.
 +
  | Possibly the probability of spawning the particle.
 +
  | ?
 
  |-
 
  |-
  |rowspan="1"| 0x36
+
  | options
  |rowspan="1"| Play
+
  | TAG_COMPOUND
  |rowspan="1"| Client
+
  | The properties of the particle to spawn.
  | Camera ID
+
  | Contains the field "type" (TAG_String), which identifies the particle type.
| VarInt
 
| ID of the entity to set the client's camera to
 
 
  |}
 
  |}
  
The notchian also loads certain shaders for given entities:
+
Chat registry:
  
* Creeper &rarr; <code>shaders/post/creeper.json</code>
+
{| class="wikitable"
* Spider (and cave spider) &rarr; <code>shaders/post/spider.json</code>
+
!Name
* Enderman &rarr; <code>shaders/post/invert.json</code>
+
!Type
* Anything else &rarr; the current shader is unloaded
+
!style="width: 250px;" colspan="2"| Notes
 +
|-
 +
| type
 +
| TAG_String
 +
| The name of the registry. Always "minecraft:chat_type".
 +
|-
 +
| value
 +
| TAG_List
 +
| List of chat registry entries (see below).
 +
|}
  
==== Held Item Change (clientbound) ====
+
==== Map Data ====
  
Sent to change the player's slot selection.
+
Updates a rectangular area on a {{Minecraft Wiki|map}} item.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,123: Line 3,362:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  !colspan="2"| Field Name
  ! Field Type
+
  !colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="1"| 0x37
+
  |rowspan="17"| 0x24
  |rowspan="1"| Play
+
  |rowspan="17"| Play
  |rowspan="1"| Client
+
  |rowspan="17"| Client
  | Slot
+
|colspan="2"| Map ID
 +
|colspan="2"| VarInt
 +
| 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"| Locked
 +
|colspan="2"| Boolean
 +
| True if the map has been locked in a cartography table
 +
|-
 +
|colspan="2"| Tracking Position
 +
|colspan="2"| Boolean
 +
| Specifies whether player and item frame icons are shown
 +
|-
 +
|colspan="2"| Icon Count
 +
|colspan="2"| VarInt
 +
| Number of elements in the following array. Only present if "Tracking Position" is true.
 +
|-
 +
|rowspan="6"| Icon
 +
| Type
 +
|rowspan="6"| Array
 +
| VarInt enum
 +
| See below
 +
|-
 +
| X
 +
| Byte
 +
| Map coordinates: -128 for furthest left, +127 for furthest right
 +
|-
 +
  | Z
 
  | Byte
 
  | Byte
  | The slot which the player has selected (0–8)
+
  | Map coordinates: -128 for highest, +127 for lowest
|}
 
 
 
==== Display Scoreboard ====
 
 
 
This is sent to the client when it should display a scoreboard.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x38
+
  | Direction
|rowspan="2"| Play
 
|rowspan="2"| Client
 
| Position
 
 
  | Byte
 
  | Byte
  | The position of the scoreboard. 0: list, 1: sidebar, 2: below name.
+
  | 0-15
 
  |-
 
  |-
  | Score Name
+
  | Has Display Name
  | String (16)
+
  | Boolean
  | The unique name for the scoreboard to be displayed.
+
  |
  |}
+
  |-
 
+
| Display Name
==== Entity Metadata ====
+
| Optional [[Chat]]
 
+
| Only present if previous Boolean is true
Updates one or more [[Entities#Entity Metadata Format|metadata]] properties for an existing entity. Any properties not included in the Metadata field are left unchanged.
+
|-
 
+
|colspan="2"| Columns
{| class="wikitable"
+
|colspan="2"| Unsigned Byte
  ! Packet ID
+
| Number of columns updated
  ! State
+
|-
  ! Bound To
+
|colspan="2"| Rows
  ! Field Name
+
|colspan="2"| Optional Unsigned Byte
  ! Field Type
+
| Only if Columns is more than 0; number of rows updated
  ! Notes
+
|-
 +
|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
 
  |-
 
  |-
  |rowspan="2"| 0x39
+
  |colspan="2"| Length
  |rowspan="2"| Play
+
  |colspan="2"| Optional VarInt
|rowspan="2"| Client
+
  | Only if Columns is more than 0; length of the following array
| Entity ID
 
| VarInt
 
  |  
 
 
  |-
 
  |-
  | Metadata
+
  |colspan="2"| Data
  | [[Entities#Entity Metadata Format|Entity Metadata]]
+
  |colspan="2"| Optional Array of Unsigned Byte
  |  
+
  | Only if Columns is more than 0; see {{Minecraft Wiki|Map item format}}
 
  |}
 
  |}
  
==== Attach Entity ====
+
For icons, a direction of 0 is a vertical icon and increments by 22.5&deg; (360/16).
  
This packet is sent when an entity has been {{Minecraft Wiki|Lead|leashed}} to another entity.
+
Types are based off of rows and columns in <code>map_icons.png</code>:
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x3A
+
! Icon type
  |rowspan="2"| Play
+
! Result
  |rowspan="2"| Client
+
  |-
  | Attached Entity ID
+
  | 0
  | Int
+
  | White arrow (players)
  | Attached entity's EID
+
  |-
 +
  | 1
 +
  | Green arrow (item frames)
 
  |-
 
  |-
  | Holding Entity ID
+
  | 2
  | Int
+
  | Red arrow
| ID of the entity holding the lead. Set to -1 to detach.
 
|}
 
 
 
==== Entity Velocity ====
 
 
 
Velocity is believed to be in units of 1/8000 of a block per server tick (50ms); for example, -1343 would move (-1343 / 8000) = −0.167875 blocks per tick (or −3,3575 blocks per second).
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="4"| 0x3B
+
  | 3
|rowspan="4"| Play
+
  | Blue arrow
|rowspan="4"| Client
 
| Entity ID
 
| VarInt
 
  |  
 
 
  |-
 
  |-
  | Velocity X
+
  | 4
  | Short
+
  | White cross
| Velocity on the X axis
 
 
  |-
 
  |-
  | Velocity Y
+
  | 5
  | Short
+
  | Red pointer
| Velocity on the Y axis
 
 
  |-
 
  |-
  | Velocity Z
+
  | 6
  | Short
+
  | White circle (off-map players)
| Velocity on the Z axis
 
|}
 
 
 
==== Entity Equipment ====
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x3C
+
  | 7
|rowspan="3"| Play
+
  | Small white circle (far-off-map players)
|rowspan="3"| Client
 
| Entity ID
 
| VarInt
 
  | Entity's EID
 
 
  |-
 
  |-
  | Slot
+
  | 8
  | VarInt Enum
+
  | Mansion
| Equipment slot. 0: main hand, 1: off hand, 2–5: armor slot (2: boots, 3: leggings, 4: chestplate, 5: helmet)
 
 
  |-
 
  |-
  | Item
+
  | 9
  | [[Slot Data|Slot]]
+
  | Temple
|
 
|}
 
 
 
==== Set Experience ====
 
 
 
Sent by the server when the client should change experience levels.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x3D
+
  | 10
|rowspan="3"| Play
+
  | White Banner
|rowspan="3"| Client
 
| Experience bar
 
| Float
 
  | Between 0 and 1
 
 
  |-
 
  |-
  | Level
+
  | 11
| VarInt
+
  | Orange Banner
  |  
 
 
  |-
 
  |-
  | Total Experience
+
  | 12
  | VarInt
+
  | Magenta Banner
  | See {{Minecraft Wiki|Experience#Leveling up}} on the Minecraft Wiki for Total Experience to Level conversion
+
  |-
 +
| 13
 +
| Light Blue Banner
 +
|-
 +
| 14
 +
| Yellow Banner
 +
|-
 +
| 15
 +
| Lime Banner
 +
|-
 +
| 16
 +
| Pink Banner
 +
|-
 +
| 17
 +
| Gray Banner
 +
|-
 +
| 18
 +
| Light Gray Banner
 +
|-
 +
| 19
 +
| Cyan Banner
 +
|-
 +
| 20
 +
| Purple Banner
 +
|-
 +
| 21
 +
| Blue Banner
 +
|-
 +
| 22
 +
| Brown Banner
 +
|-
 +
| 23
 +
| Green Banner
 +
|-
 +
| 24
 +
| Red Banner
 +
|-
 +
| 25
 +
| Black Banner
 +
|-
 +
| 26
 +
| Treasure marker
 
  |}
 
  |}
  
==== Update Health ====
+
==== Merchant Offers ====
 
 
Sent by the server to update/set the health of the player it is sent to.
 
  
Food {{Minecraft Wiki|Food#Hunger vs. Saturation|saturation}} acts as a food “overcharge”. Food values will not decrease while the saturation is over zero. Players logging in automatically get a saturation of 5.0. Eating food increases the saturation as well as the food bar.
+
The list of trades a villager NPC is offering.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,303: Line 3,539:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  !colspan="2"| Field Name
  ! Field Type
+
  !colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x3E
+
  |rowspan="18"| 0x25
  |rowspan="3"| Play
+
  |rowspan="18"| Play
  |rowspan="3"| Client
+
  |rowspan="18"| Client
  | Health
+
  |-
  | Float
+
  | colspan="2" | Window ID
  | 0 or less = dead, 20 = full HP
+
| colspan="2" | VarInt
 +
| The ID of the window that is open; this is an int rather than a byte.
 +
|-
 +
  | colspan="2" | Size
 +
| colspan="2" | Byte
 +
| The number of trades in the following array.
 +
|-
 +
| rowspan="11" | Trades
 +
| Input item 1
 +
| rowspan="11" | Array
 +
| [[Slot]]
 +
| The first item the player has to supply for this villager trade. The count of the item stack is the default "price" of this trade.
 
  |-
 
  |-
  | Food
+
  | Output item
  | VarInt
+
  | [[Slot]]
  | 0–20
+
  | The item the player will receive from this villager trade.
  |-  
+
  |-
  | Food Saturation
+
  | Has second item
 +
| Boolean
 +
| Whether there is a second item.
 +
|-
 +
| Input item 2
 +
| Optional [[Slot]]
 +
| The second item the player has to supply for this villager trade; only present if has a second item is true.
 +
|-
 +
| Trade disabled
 +
| Boolean
 +
| True if the trade is disabled; false if the trade is enabled.
 +
|-
 +
| Number of trade uses
 +
| Integer
 +
| Number of times the trade has been used so far. If equal to the maximum number of trades, the client will display a red X.
 +
|-
 +
| Maximum number of trade uses
 +
| Integer
 +
| Number of times this trade can be used before it's exhausted.
 +
|-
 +
| XP
 +
| Integer
 +
| Amount of XP the villager will earn each time the trade is used.
 +
|-
 +
| Special Price
 +
| Integer
 +
| Can be zero or negative. The number is added to the price when an item is discounted due to player reputation or other effects.
 +
|-
 +
| Price Multiplier
 
  | Float
 
  | Float
  | Seems to vary from 0.0 to 5.0 in integer increments
+
  | Can be low (0.05) or high (0.2). Determines how much demand, player reputation, and temporary effects will adjust the price.
 +
|-
 +
| Demand
 +
| Integer
 +
| If positive, causes the price to increase. Negative values seem to be treated the same as zero.
 +
|-
 +
|colspan="2"| Villager level
 +
|colspan="2"| VarInt
 +
| Appears on the trade GUI; meaning comes from the translation key <code>merchant.level.</code> + level.
 +
1: Novice, 2: Apprentice, 3: Journeyman, 4: Expert, 5: Master.
 +
|-
 +
|colspan="2"| Experience
 +
|colspan="2"| VarInt
 +
| Total experience for this villager (always 0 for the wandering trader).
 +
|-
 +
|colspan="2"| Is regular villager
 +
|colspan="2"| Boolean
 +
| True if this is a regular villager; false for the wandering trader.  When false, hides the villager level and some other GUI elements.
 +
|-
 +
|colspan="2"| Can restock
 +
|colspan="2"| Boolean
 +
| True for regular villagers and false for the wandering trader. If true, the "Villagers restock up to two times per day." message is displayed when hovering over disabled trades.
 
  |}
 
  |}
  
==== Scoreboard Objective ====
+
Modifiers can increase or decrease the number of items for the first input slot. The second input slot and the output slot never change the nubmer of items. The number of items may never be less than 1, and never more than the stack size. If special price and demand are both zero, only the default price is displayed. If either is non-zero, then the adjusted price is displayed next to the crossed-out default price. The adjusted prices is calculated as follows:
 +
 
 +
Adjusted price = default price + floor(default price x multiplier x demand) + special price
 +
 
 +
[[File:1.14-merchant-slots.png|thumb|The merchant UI, for reference]]
 +
{{-}}
 +
 
 +
==== Update Entity Position ====
 +
 
 +
This packet is sent by the server when an entity moves less then 8 blocks; if an entity moves more than 8 blocks [[#Teleport Entity|Teleport Entity]] should be sent instead.
  
This is sent to the client when it should create a new {{Minecraft Wiki|scoreboard}} objective or remove one.
+
This packet allows at most 8 blocks movement in any direction, because short range is from -32768 to 32767. And <code>32768 / (128 * 32)</code> = 8.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,335: Line 3,640:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x3F
+
  |rowspan="5"| 0x26
  |rowspan="4"| Play
+
  |rowspan="5"| Play
  |rowspan="4"| Client
+
  |rowspan="5"| Client
  | Objective Name
+
  | Entity ID
  | String (16)
+
  | VarInt
  | An unique name for the objective
+
  |
 
  |-
 
  |-
  | Mode
+
  | Delta X
  | Byte
+
  | Short
  | 0 to create the scoreboard. 1 to remove the scoreboard. 2 to update the display text.  
+
  | Change in X position as <code>(currentX * 32 - prevX * 32) * 128</code>.
 
  |-
 
  |-
  | Objective Value
+
  | Delta Y
  | Optional String (32)
+
  | Short
| Only if mode is 0 or 2. The text to be displayed for the score
+
| Change in Y position as <code>(currentY * 32 - prevY * 32) * 128</code>.
 
  |-
 
  |-
  | Type
+
  | Delta Z
  | Optional String (16)
+
  | Short
  | Only if mode is 0 or 2. “integer” or “hearts”
+
| Change in Z position as <code>(currentZ * 32 - prevZ * 32) * 128</code>.
  |}
+
|-
 
+
| On Ground
==== Set Passengers ====
+
| Boolean
 +
  |
 +
  |}
 +
 
 +
==== Update Entity Position and Rotation ====
 +
 
 +
This packet is sent by the server when an entity rotates and moves. Since a short range is limited from -32768 to 32767, and movement is offset of fixed-point numbers, this packet allows at most 8 blocks movement in any direction. (<code>-32768 / (32 * 128) == -8</code>)
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,365: Line 3,676:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x40
+
  |rowspan="7"| 0x27
  |rowspan="3"| Play
+
  |rowspan="7"| Play
  |rowspan="3"| Client
+
  |rowspan="7"| Client
 
  | Entity ID
 
  | Entity ID
 
  | VarInt
 
  | VarInt
  | Vehicle's EID
+
  |
 +
|-
 +
| Delta X
 +
| Short
 +
| Change in X position as <code>(currentX * 32 - prevX * 32) * 128</code>.
 +
|-
 +
| Delta Y
 +
| Short
 +
| Change in Y position as <code>(currentY * 32 - prevY * 32) * 128</code>.
 +
|-
 +
| Delta Z
 +
| Short
 +
| Change in Z position as <code>(currentZ * 32 - prevZ * 32) * 128</code>.
 +
|-
 +
| Yaw
 +
| Angle
 +
| New angle, not a delta.
 
  |-
 
  |-
  | Passenger Count
+
  | Pitch
  | VarInt
+
  | Angle
  | Number of elements in the following array
+
  | New angle, not a delta.
 
  |-
 
  |-
  | Passengers
+
  | On Ground
  | Array of VarInt
+
  | Boolean
  | EIDs of entity's passengers
+
  |
 
  |}
 
  |}
  
==== Teams ====
+
==== Update Entity Rotation ====
  
Creates and updates teams.
+
This packet is sent by the server when an entity rotates.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,389: Line 3,716:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="23"| 0x41
+
  |rowspan="4"| 0x28
  |rowspan="23"| Play
+
  |rowspan="4"| Play
  |rowspan="23"| Client
+
  |rowspan="4"| Client
  |colspan="2"| Team Name
+
  | Entity ID
  | String (16)
+
  | VarInt
  | A unique name for the team. (Shared with scoreboard).
+
  |
 
  |-
 
  |-
  |colspan="2"| Mode
+
  | Yaw
  | Byte
+
  | Angle
  | Determines the layout of the remaining packet
+
  | New angle, not a delta.
 
  |-
 
  |-
  |rowspan="9"| 0: create team
+
  | Pitch
| Team Display Name
+
  | Angle
  | String (32)
+
  | New angle, not a delta.
  |  
 
 
  |-
 
  |-
  | Team Prefix
+
  | On Ground
  | String (16)
+
  | Boolean
  | Displayed before the names of players that are part of this team
+
|
 +
|}
 +
 
 +
==== Move Vehicle (clientbound) ====
 +
 
 +
Note that all fields use absolute positioning and do not allow for relative positioning.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
  ! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | Team Suffix
+
  |rowspan="5"| 0x29
  | String (16)
+
|rowspan="5"| Play
  | Displayed after the names of players that are part of this team
+
|rowspan="5"| Client
 +
| X
 +
  | Double
 +
  | Absolute position (X coordinate).
 
  |-
 
  |-
  | Friendly Flags
+
  | Y
  | Byte
+
  | Double
  | Bit mask. 0x01: Allow friendly fire, 0x02: can see invisible players on same team
+
  | Absolute position (Y coordinate).
 
  |-
 
  |-
  | Name Tag Visibility
+
  | Z
  | String Enum (32)
+
  | Double
  | <code>always</code>, <code>hideForOtherTeams</code>, <code>hideForOwnTeam</code>, <code>never</code>
+
  | Absolute position (Z coordinate).
 
  |-
 
  |-
  | Collision Rule
+
  | Yaw
  | String Enum (32)
+
  | Float
  | <code>always</code>, <code>pushOtherTeams</code>, <code>pushOwnTeam</code>, <code>never</code>
+
  | Absolute rotation on the vertical axis, in degrees.
 +
|-
 +
| Pitch
 +
| Float
 +
| Absolute rotation on the horizontal axis, in degrees.
 +
|}
 +
 
 +
==== Open Book ====
 +
 
 +
Sent when a player right clicks with a signed book. This tells the client to open the book GUI.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | Color
+
  | 0x2A
  | Byte
+
  | Play
  | For colors, the same [[Chat]] colors (0-15)-1 indicates RESET/no color.
+
  | Client
 +
| Hand
 +
| VarInt enum
 +
| 0: Main hand, 1: Off hand .
 +
|}
 +
 
 +
==== Open Screen ====
 +
 
 +
This is sent to the client when it should open an inventory, such as a chest, workbench, or furnace. This message is not sent anywhere for clients opening their own inventory. Resending this packet with already existing window id, will update the window title and window type without closing the window.
 +
For horses, use [[#Open Horse Screen|Open Horse Screen]].
 +
 
 +
{| class="wikitable"
 +
  ! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | Entity Count
+
  |rowspan="3"| 0x2B
 +
|rowspan="3"| Play
 +
|rowspan="3"| Client
 +
| Window ID
 
  | VarInt
 
  | VarInt
  | Number of elements in the following array
+
  | A unique id number for the window to be displayed. Notchian server implementation is a counter, starting at 1.
 
  |-
 
  |-
  | Entities
+
  | Window Type
  | Array of String (40)
+
  | VarInt
  | Identifiers for the entities in this team.  For players, this is their username; for other entities, it is their UUID.
+
  | The window type to use for display. Contained in the <code>minecraft:menu</code> registry; see [[Inventory]] for the different values.
 
  |-
 
  |-
  | 1: remove team
+
  | Window Title
  | ''no fields''
+
  | [[Chat]]
| ''no fields''
+
  | The title of the window.
|
 
|-
 
|rowspan="7"| 2: update team info
 
| Team Display Name
 
| String (32)
 
|
 
|-
 
| Team Prefix
 
| String (16)
 
| Displayed before the names of entities that are part of this team
 
|-
 
| 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>
 
|-
 
| Color
 
| Byte
 
| For colors, the same [[Chat]] colors (0-15).  -1 indicates RESET/no color.
 
  |-
 
|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.
 
 
  |}
 
  |}
  
==== Update Score ====
+
==== Open Sign Editor ====
  
This is sent to the client when it should update a scoreboard item.  
+
Sent when the client has placed a sign and is allowed to send [[#Update Sign|Update Sign]].  There must already be a sign at the given location (which the client does not do automatically) - send a [[#Block Update|Block Update]] first.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,506: Line 3,837:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x42
+
  | 0x2C
  |rowspan="4"| Play
+
  | Play
  |rowspan="4"| Client
+
  | Client
  | Entity Name
+
  | Location
| String (40)
+
  | Position
| The entity whose score this is.  For players, this is their username; for other entities, it is their UUID.
+
  |
|-
 
| Action
 
| Byte
 
| 0 to create/update an item. 1 to remove an item.
 
|-
 
| Objective Name
 
| String (16)
 
| The name of the objective the score belongs to
 
|-
 
| Value
 
  | Optional VarInt
 
  | The score to be displayed next to the entry. Only sent when Action does not equal 1.
 
 
  |}
 
  |}
  
==== Spawn Position ====
+
==== Ping (play) ====
  
Sent by the server after login to specify the