Difference between revisions of "Protocol"

From wiki.vg
Jump to: navigation, search
(Combat Event: More info about this; it's used to display the game over screen and has some odd history)
 
(760 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
 +
{{Box
 +
  |BORDER = #9999FF
 +
  |BACKGROUND = #99CCFF
 +
  |WIDTH = 100%
 +
  |ICON =
 +
  |HEADING = Heads up!
 +
  |CONTENT = This article is about the protocol for the latest '''stable''' release of Minecraft '''computer edition''' ([[Protocol version numbers|1.15.2, protocol 578]]). For the computer edition pre-releases, see [[Pre-release protocol]]. For Pocket Edition, see [[Pocket Edition Protocol Documentation]].
 +
}}
  
This page presents a dissection of the current stable [http://minecraft.net/game/ Minecraft] protocol. The current pre-release protocol is documented [[Pre-release_protocol|elsewhere]].  
+
This page presents a dissection of the current '''[https://minecraft.net/ Minecraft] protocol'''.
  
Credit goes to the Great Old Ones, and the citizens of [irc://irc.freenode.net/#mcdevs <nowiki>#mcdevs</nowiki>] who helped by providing packet dumps and insight. If you're having trouble, check out the [[Protocol_FAQ|FAQ]].  Make sure you check the [[Data Types]] page.
+
If you're having trouble, check out the [[Protocol FAQ|FAQ]] or ask for help in the IRC channel [ircs://chat.freenode.net:6697/mcdevs #mcdevs on chat.freenode.net] ([http://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 the attribution above 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… you still need to provide attribution to #mcdevs if you copy any of the contents of this page for publication elsewhere.
  
The protocol for Pocket Minecraft is substantially different, and is documented at [[Pocket Minecraft Protocol]].
+
The changes between versions may be viewed at [[Protocol History]].
  
Additionally, the minecraft server supports two other protocols since beta 1.9pre4, [[Rcon]] (for remote administration) and [[Query]] (to query server properties). With the default settings, they listen on TCP 25575 and UDP 25565 respectively.
+
== Definitions ==
  
This is a fairly lengthy page, and to make it more readable certain terminology must be understood. Terms used on this page and their definition are provided below.
+
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}} <!-- Transcluded contents of Data types article in here — go to that page if you want to edit it -->
 +
 
 +
=== Other definitions ===
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
|-
| class="col0" |
+
! Term
| class="col1" | Definition
+
! Definition
|- class="row1"
+
|-
| class="col0 centeralign" | Player
+
| Player
| class="col1" | When used in the singular, Player always refers to the client connected to the server
+
| When used in the singular, Player always refers to the client connected to the server.
|- class="row2"
+
|-
| class="col0 centeralign" | Entity
+
| Entity
| class="col1" | Entity refers to any item, player, mob, minecart or boat in the world. This definition is subject to change as Notch extends the protocol
+
| Entity refers to any item, player, mob, minecart or boat etc. See {{Minecraft Wiki|Entity|the Minecraft Wiki article}} for a full list.
|- class="row3"
+
|-
| class="col0 centeralign" | EID
+
| EID
| class="col1" | An EID - or Entity ID - is a unique 4-byte integer used to identify a specific entity
+
| An EID or Entity ID is a 4-byte sequence used to identify a specific entity. An entity's EID is unique on the entire server.
|- class="row4"
+
|-
| class="col0 centeralign" | XYZ
+
| XYZ
| class="col1" | In this document, the axis names are the same as those used by Notch. Y points upwards, X points South, and Z points West.
+
| In this document, the axis names are the same as those shown in the debug screen (F3). Y points upwards, X points east, and Z points south.
|}
+
|-
 +
| Meter
 +
| The meter is Minecraft's base unit of length, equal to the length of a vertex of a solid block. The term “block” may be used to mean “meter” or “cubic meter”.
 +
|-
 +
| Global palette
 +
| 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.15.2.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
 +
| The official implementation of vanilla Minecraft as developed and released by Mojang.
 +
|}
  
== Plugin Channels ==
+
== Packet format ==
  
Plugin channels (present in 0xFA) are used to supplement the protocol. Information about these channels can be found at their page: [[plugin channel]]
+
=== Without compression ===
  
== Packets ==
+
{| class="wikitable"
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| Length
 +
| VarInt
 +
| Length of Packet ID + Data
 +
|-
 +
| Packet ID
 +
| VarInt
 +
|
 +
|-
 +
| Data
 +
| Byte Array
 +
| Depends on the connection state and packet ID, see the sections below
 +
|}
  
All packets begin with a single "Packet ID" byte.  Listed packet size includes this byte.  Packets are either "server to client", "client to server", or both.  If not specified, assume that the packet can be sent both ways.  There is no "length" field; for variable length packets, you must parse to the end to determine the length.
+
=== 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.
  
{{anchor|0x00}}
+
{| class=wikitable
=== Keep Alive (0x00) ===
+
! Compressed?
''Two-Way''
+
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| No
 +
| Packet Length
 +
| VarInt
 +
| Length of Data Length + compressed length of (Packet ID + Data)
 +
|-
 +
| No
 +
| Data Length
 +
| VarInt
 +
| Length of uncompressed (Packet ID + Data) or 0
 +
|-
 +
|rowspan="2"| Yes
 +
| Packet ID
 +
| VarInt
 +
| zlib compressed packet ID (see the sections below)
 +
|-
 +
| Data
 +
| Byte Array
 +
| zlib compressed packet data (see the sections below)
 +
|}
  
The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same packet.
+
The length given by the Packet Length field is the number of bytes that remain in that packet, including the Data Length field.
The Beta server will disconnect a client if it doesn't receive at least one packet before 1200 in-game ticks, and the Beta client will time out the connection under the same conditions. The client may send packets with Keep-alive ID=0.
+
 
 +
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|Set Compression]], otherwise the receiving party will disconnect.
 +
 
 +
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 ==
 +
 
 +
=== Clientbound ===
 +
 
 +
There are no clientbound packets in the Handshaking state, since the protocol immediately switches to a different state after the client sends the first packet.
 +
 
 +
=== Serverbound ===
 +
 
 +
==== Handshake ====
 +
 
 +
This causes the server to switch into the target state.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="4"| 0x00
 +
|rowspan="4"| Handshaking
 +
|rowspan="4"| Server
 +
| Protocol Version
 +
| VarInt
 +
| See [[protocol version numbers]] (currently 578 in Minecraft 1.15.2)
 +
|-
 +
| Server Address
 +
| 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. Note that SRV records are a complete redirect, e.g. if _minecraft._tcp.example.com points to mc.example.org, users connecting to example.com will provide mc.example.org as server address in addition to connecting to it.
 +
|-
 +
| Server Port
 +
| Unsigned Short
 +
| Default is 25565.  The Notchian server does not use this information.
 +
|-
 +
| Next State
 +
| VarInt Enum
 +
| 1 for [[#Status|status]], 2 for [[#Login|login]]
 +
|}
 +
 
 +
==== Legacy Server List Ping ====
 +
 
 +
{{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.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" | 0x00
+
| 0xFE
| class="col1 centeralign" | Keep-alive ID
+
| Handshaking
| class="col2 centeralign" | int
+
| Server
| class="col3 centeralign" | <code>957759560</code>
+
| Payload
| class="col4" | Server-generated random id
+
| Unsigned Byte
|- class="row2"
+
| always 1 (<code>0x01</code>)
| class="col0" | Total Size:
+
|}
| class="col1 rightalign" colspan="4" | 5 bytes
 
|}
 
  
 +
See [[Server List Ping#1.6]] for the details of the protocol that follows this packet.
  
{{anchor|0x01}}
+
== Status ==
=== Login Request (0x01) ===
+
{{Main|Server List Ping}}
  
''Server to Client''
+
=== Clientbound ===
  
See [[Protocol Encryption]] for information on logging in.
+
==== Response ====
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="1"| 0x00
 +
|rowspan="1"| Status
 +
|rowspan="1"| Client
 +
| JSON Response
 +
| String (32767)
 +
| See [[Server List Ping#Response]]
 +
|}
 +
 
 +
==== Pong ====
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="7" | 0x01
+
|rowspan="1"| 0x01
| class="col1 centeralign" | Entity ID
+
|rowspan="1"| Status
| class="col2 centeralign" | int
+
|rowspan="1"| Client
| class="col3 centeralign" | <code>1298</code>
+
| Payload
| class="col4" | The Player's Entity ID
+
| Long
|- class="row2"
+
  | Should be the same as sent by the client
| class="col0 centeralign" | Level type
+
|}
| class="col1 centeralign" | string
 
| class="col2 centeralign" | default
 
| class="col3" | <code>default</code>, <code>flat</code>, or <code>largeBiomes</code>. level-type in server.properties
 
|- class="row3"
 
| class="col0 centeralign" | Game mode
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | <code>0</code>
 
| class="col3" | <code>0</code>: survival, <code>1</code>: creative, <code>2</code>: adventure. Bit 3 (<code>0x8</code>) is the hardcore flag
 
|- class="row4"
 
| class="col0 centeralign" | Dimension
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | <code>0</code>
 
| class="col3" | <code>-1</code>: nether, <code>0</code>: overworld, <code>1</code>: end
 
|- class="row5"
 
| class="col0 centeralign" | Difficulty
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | <code>1</code>
 
| class="col3" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard
 
|- class="row6"
 
| class="col0 centeralign" | Not used
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | <code>0</code>
 
| class="col3" | Only 0 observed from vanilla server, was previously world height
 
|- class="row7"
 
| class="col0 centeralign" | Max players
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | <code>8</code>
 
| class="col3" | Used by the client to draw the player list
 
|- class="row8"
 
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 12 bytes + length of strings
 
|}
 
  
{{anchor|0x02}}
+
=== Serverbound ===
  
=== Handshake (0x02) ===
+
==== Request ====
  
''Client to server''
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="1"| 0x00
 +
| Status
 +
| Server
 +
|colspan="3"| ''no fields''
 +
|}
  
See [[Protocol Encryption]] for information on logging in.
+
==== Ping ====
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="4" | 0x02
+
|rowspan="1"| 0x01
| class="col1 centeralign" | Protocol Version
+
|rowspan="1"| Status
| class="col2 centeralign" | byte
+
|rowspan="1"| Server
| class="col3 centeralign" | <code>49</code>
+
| Payload
| class="col4" | As of 1.4.4 the protocol version is 49
+
| Long
|- class="row2"
+
| May be any number. Notchian clients use a system-dependent time value which is counted in milliseconds.
| class="col0 centeralign" | Username
+
|}
| class="col1 centeralign" | string
+
 
| class="col2 centeralign" | <code>_AlexM</code>
+
== Login ==
| class="col3" | The username of the player attempting to connect
+
 
|- class="row3"
+
The login process is as follows:
| class="col0 centeralign" | Server Host
+
 
| class="col1 centeralign" | string
+
# C→S: [[#Handshake|Handshake]] with Next State set to 2 (login)
| class="col2 centeralign" | <code>localhost</code>
+
# C→S: [[#Login Start|Login Start]]
| class="col3" |
+
# S→C: [[#Encryption Request|Encryption Request]]
|- class="row4"
+
# Client auth
| class="col0 centeralign" | Server Port
+
# C→S: [[#Encryption Response|Encryption Response]]
| class="col1 centeralign" | int
+
# Server auth, both enable encryption
| class="col2 centeralign" | <code>25565</code>
+
# S→C: [[#Set Compression|Set Compression]] (optional)
| class="col3" |
+
# S→C: [[#Login Success|Login Success]]
|- class="row5"
+
 
| class="col0" | Total Size:
+
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]].
| class="col1 rightalign" colspan="4" | 10 bytes + length of strings
+
 
|}
+
For unauthenticated and localhost connections (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]].
  
{{anchor|0x03}}
+
See [[Protocol Encryption]] for details.
  
=== Chat Message (0x03) ===
+
=== Clientbound ===
  
''Two-Way''
+
==== Disconnect (login) ====
  
The default server will check the message to see if it begins with a '/'. If it doesn't, the username of the sender is prepended and sent to all other clients (including the original sender). If it does, the server assumes it to be a command and attempts to process it. A message longer than 100 characters will cause the server to kick the client. (As of 1.3.2, the vanilla client appears to limit the text a user can enter to 100 charaters.) This limits the chat message packet length to 103 bytes. Note that this limit does not apply to incoming chat messages as the server may have prepended other information, not limited to, but usually including, a username.
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="1"| 0x00
 +
|rowspan="1"| Login
 +
|rowspan="1"| Client
 +
| Reason
 +
| [[Chat]]
 +
|
 +
|}
  
A message longer than 119 characters will cause the server and client to print the message "Received string length longer than maximum allowed (X > 119)", with no side effects.
+
==== Encryption Request ====
  
For more information, see [[Chat]].
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="5"| 0x01
 +
|rowspan="5"| Login
 +
|rowspan="5"| Client
 +
| Server ID
 +
| String (20)
 +
| Appears to be empty
 +
|-
 +
| Public Key Length
 +
| VarInt
 +
| Length of Public Key
 +
|-
 +
| Public Key
 +
| Byte Array
 +
|
 +
|-
 +
| Verify Token Length
 +
| VarInt
 +
| Length of Verify Token. Always 4 for Notchian servers.
 +
|-
 +
| Verify Token
 +
| Byte Array
 +
| A sequence of random bytes generated by the server
 +
|}
 +
 
 +
See [[Protocol Encryption]] for details.
 +
 
 +
==== Login Success ====
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" | 0x03
+
|rowspan="2"| 0x02
| class="col1 centeralign" | Message
+
|rowspan="2"| Login
| class="col2 centeralign" | string
+
|rowspan="2"| Client
| class="col3 centeralign" | <code>&lt;Bob&gt; Hello World!</code>
+
| UUID
| class="col4" | User input '''must''' be sanitized server-side
+
| String (36)
|- class="row2"
+
| Unlike in other packets, this field contains the UUID as a string with hyphens.
| class="col0" | Total Size:
+
|-
| class="col1 rightalign" colspan="4" | 3 bytes + length of strings
+
| Username
|}
+
| String (16)
 +
|  
 +
|}
 +
 
 +
This packet switches the connection state to [[#Play|play]].
 +
 
 +
==== Set Compression ====
  
 +
Enables compression.  If compression is enabled, all following packets are encoded in the [[#With compression|compressed packet format]].  Negative 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).
  
{{anchor|0x04}}
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="1"| 0x03
 +
|rowspan="1"| Login
 +
|rowspan="1"| Client
 +
| Threshold
 +
| VarInt
 +
| Maximum size of a packet before it is compressed
 +
|}
  
=== Time Update (0x04) ===
+
==== Login Plugin Request ====
  
''Server to Client''
+
Used to implement a custom handshaking flow together with [[#Login_Plugin_Response | Login Plugin Response]].
  
Time is based on ticks, where 20 ticks happen every second. There are 24000 ticks in a day, making Minecraft days exactly 20 minutes long.
+
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
 +
|-
 +
|rowspan="3"| 0x04
 +
|rowspan="3"| Login
 +
|rowspan="3"| Client
 +
| Message ID
 +
| VarInt
 +
| Generated by the server - should be unique to the connection.
 +
|-
 +
| Channel
 +
| Identifier
 +
| Name of the [[plugin channel]] used to send the data
 +
|-
 +
| Data
 +
| Byte Array
 +
| Any data, depending on the channel. The length of this array must be inferred from the packet length.
 +
|}
  
The time of day is based on the timestamp modulo 24000. 0 is sunrise, 6000 is noon, 12000 is sunset, and 18000 is midnight.
+
=== Serverbound ===
  
The default SMP server increments the time by <code>20</code> every second.
+
==== Login Start  ====
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
! class="col0" | Packet ID
+
! State
! class="col1" | Field Name
+
! Bound To
! class="col2" | Field Type
+
! Field Name
! class="col3" | Example
+
! Field Type
! class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="2" | 0x04
+
|rowspan="1"| 0x00
| class="col1 centeralign" | Age of the world
+
|rowspan="1"| Login
| class="col2 centeralign" | long
+
|rowspan="1"| Server
| class="col3 centeralign" | 45464654
+
| Name
| class="col4" | In ticks; not changed by server commands
+
| String (16)
|- class="row2"
+
| Player's Username
| class="col0 centeralign" | Time of Day
+
|}
| class="col1 centeralign" | long
 
| class="col2 centeralign" | 21321
 
| class="col3" | The world (or region) time, in ticks
 
|- class="row3"
 
! class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 17 Bytes
 
|}
 
  
 +
==== Encryption Response ====
  
{{anchor|0x05}}
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="4"| 0x01
 +
|rowspan="4"| Login
 +
|rowspan="4"| Server
 +
| Shared Secret Length
 +
| VarInt
 +
| Length of Shared Secret
 +
|-
 +
| Shared Secret
 +
| Byte Array
 +
|
 +
|-
 +
| Verify Token Length
 +
| VarInt
 +
| Length of Verify Token
 +
|-
 +
| Verify Token
 +
| Byte Array
 +
|
 +
|}
  
=== Entity Equipment (0x05) ===
+
See [[Protocol Encryption]] for details.
  
''Server to Client''
+
==== Login Plugin Response ====
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="3" | 0x05
+
|rowspan="3"| 0x02
| class="col1 centeralign" | Entity ID
+
|rowspan="3"| Login
| class="col2 centeralign" | int
+
|rowspan="3"| Server
| class="col3 centeralign" | 0x00010643
+
| Message ID
| class="col4" | Named Entity ID
+
| VarInt
|- class="row2"
+
| Should match ID from server.
| class="col0 centeralign" | Slot
+
|-
| class="col1 centeralign" | short
+
| Successful
| class="col2 centeralign" | 4
+
| Boolean
| class="col3" | Equipment slot: 0=held, 1-4=armor slot
+
| <code>true</code> if the client understands the request, <code>false</code> otherwise. When <code>false</code>, no payload follows.
|- class="row3"
+
|-
| class="col0 centeralign" | Item
+
| Data
| class="col1 centeralign" | [[Slot_Data|slot]]
+
| Optional Byte Array
| class="col2 centeralign" |
+
| Any data, depending on the channel. The length of this array must be inferred from the packet length.
| class="col3" | Item in slot format
+
|}
|- class="row5"
 
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 7 bytes + slot data
 
|}
 
  
{{anchor|0x06}}
+
== Play ==
  
=== Spawn Position (0x06) ===
+
=== Clientbound ===
  
''Server to Client''
+
==== Spawn Entity ====
  
Sent by the server after login to specify the coordinates of the spawn point (the point at which players spawn at, and which the compass points to). It can be sent at any time to update the point compasses point at.
+
Sent by the server when a vehicle or other non-living entity is created.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="3" | 0x06
+
|rowspan="12"| 0x00
| class="col1 centeralign" | X
+
|rowspan="12"| Play
| class="col2 centeralign" | int
+
|rowspan="12"| Client
| class="col3 centeralign" | <code>117</code>
+
| Entity ID
| class="col4 centeralign" | Spawn X in block coordinates
+
| VarInt
|- class="row2"
+
| EID of the entity
| class="col0 centeralign" | Y
+
|-
| class="col1 centeralign" | int
+
| Object UUID
| class="col2 centeralign" | <code>70</code>
+
| UUID
| class="col3 centeralign" | Spawn Y in block coordinates
+
|  
|- class="row3"
+
|-
| class="col0 centeralign" | Z
+
| Type
| class="col1 centeralign" | int
+
| VarInt
| class="col2 centeralign" | <code>-46</code>
+
| The type of entity (same as in [[#Spawn Mob|Spawn Mob]])
| class="col3 centeralign" | Spawn Z in block coordinates
+
|-
|- class="row4"
+
| X
| class="col0" | Total Size:
+
| Double
| class="col1 rightalign" colspan="4" | 13 bytes
+
|  
|}
+
|-
 +
| Y
 +
| Double
 +
|  
 +
|-
 +
| Z
 +
| Double
 +
|
 +
|-
 +
| 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 ====
  
{{anchor|0x07}}
+
Spawns one or more experience orbs.
=== Use Entity (0x07) ===
 
  
''Client to Server''
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="5"| 0x01
 +
|rowspan="5"| Play
 +
|rowspan="5"| Client
 +
| Entity ID
 +
| VarInt
 +
|
 +
|-
 +
| X
 +
| Double
 +
|
 +
|-
 +
| Y
 +
| Double
 +
|
 +
|-
 +
| Z
 +
| Double
 +
|
 +
|-
 +
| Count
 +
| Short
 +
| The amount of experience this orb will reward once collected
 +
|}
  
This packet is sent from the client to the server when the client attacks or right-clicks another entity (a player, minecart, etc).
+
==== Spawn Weather Entity ====
  
A Notchian server only accepts this packet if the entity being attacked/used is visible without obstruction and within a 4-unit radius of the player's position.
+
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.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="3" | 0x07
+
|rowspan="5"| 0x02
| class="col1 centeralign" | User
+
|rowspan="5"| Play
| class="col2 centeralign" | int
+
|rowspan="5"| Client
| class="col3 centeralign" | <code>1298</code>
+
| Entity ID
| class="col4" | The entity of the player (ignored by the server)
+
| VarInt
|- class="row2"
+
| The EID of the thunderbolt
| class="col0 centeralign" | Target
+
|-
| class="col1 centeralign" | int
+
| Type
| class="col2 centeralign" | <code>1805</code>
+
| Byte Enum
| class="col3" | The entity the player is interacting with
+
| The global entity type, currently always 1 for thunderbolt
|- class="row3"
+
|-
| class="col0 centeralign" | Mouse button
+
| X
| class="col1 centeralign" | boolean
+
| Double
| class="col2 centeralign" | <code>true</code>
+
|  
| class="col3" | <code>true</code> when the player is left-clicking and <code>false</code> when right-clicking.
+
|-
|- class="row4"
+
| Y
| class="col0" | Total Size:
+
| Double
| class="col1 rightalign" colspan="4" | 10 bytes
+
|  
|}
+
|-
 +
| Z
 +
| Double
 +
|  
 +
|}
  
 +
==== Spawn Living Entity ====
  
{{anchor|0x08}}
+
Sent by the server when a living entity is spawned.
  
=== Update Health (0x08) ===
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="12"| 0x03
 +
|rowspan="12"| Play
 +
|rowspan="12"| Client
 +
| Entity ID
 +
| VarInt
 +
|
 +
|-
 +
| Entity UUID
 +
| UUID
 +
|
 +
|-
 +
| Type
 +
| VarInt
 +
| The type of mob. See [[Entities#Mobs]]
 +
|-
 +
| X
 +
| Double
 +
|
 +
|-
 +
| Y
 +
| Double
 +
|
 +
|-
 +
| Z
 +
| Double
 +
|
 +
|-
 +
| Yaw
 +
| Angle
 +
|
 +
|-
 +
| Pitch
 +
| Angle
 +
|
 +
|-
 +
| Head Pitch
 +
| Angle
 +
|
 +
|-
 +
| Velocity X
 +
| Short
 +
| Same units as [[#Entity Velocity|Entity Velocity]]
 +
|-
 +
| Velocity Y
 +
| Short
 +
| Same units as [[#Entity Velocity|Entity Velocity]]
 +
|-
 +
| Velocity Z
 +
| Short
 +
| Same units as [[#Entity Velocity|Entity Velocity]]
 +
|}
  
''Server to Client''
+
==== Spawn Painting ====
  
Sent by the server to update/set the health of the player it is sent to. Added in protocol version 5.
+
This packet shows location, name, and type of painting.
  
Food 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.
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="5"| 0x04
 +
|rowspan="5"| Play
 +
|rowspan="5"| Client
 +
| Entity ID
 +
| VarInt
 +
|
 +
|-
 +
| Entity UUID
 +
| UUID
 +
|
 +
|-
 +
| Motive
 +
| VarInt
 +
| Panting's ID, see below
 +
|-
 +
| Location
 +
| Position
 +
| Center coordinates (see below)
 +
|-
 +
| Direction
 +
| Byte Enum
 +
| Direction the painting faces (North = 2, South = 0, West = 1, East = 3)
 +
|}
 +
 
 +
Calculating the center of an image: given a (width × height) grid of cells, with <code>(0, 0)</code> being the top left corner, the center is <code>(max(0, width / 2 - 1), height / 2)</code>. E.g. <code>(1, 0)</code> for a 2×1 painting, or <code>(1, 2)</code> for a 4×4 painting.
 +
 
 +
List of paintings by coordinates in <code>paintings_kristoffer_zetterstrand.png</code> (where x and y are in pixels from the top left and width and height are in pixels or 16ths of a block):
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Name
| class="col0" | Packet ID
+
! ID
| class="col1" | Field Name
+
! x
| class="col2" | Field Type
+
! y
| class="col3" | Example
+
! width
| class="col4" | Notes
+
! height
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="3" | 0x08
+
| <code>minecraft:kebab</code>
| class="col1 centeralign" | Health
+
| 0
| class="col2 centeralign" | short
+
| 0
| class="col3 centeralign" | 20
+
| 0
| class="col4" | 0 or less = dead, 20 = full HP
+
| 16
|- class="row2"
+
| 16
| class="col0 centeralign" | Food
+
|-
| class="col1 centeralign" | short
+
| <code>minecraft:aztec</code>
| class="col2 centeralign" | 20
+
| 1
| class="col3" | 0 - 20
+
| 16
|- class="row3"
+
| 0
| class="col0 centeralign" | Food Saturation
+
| 16
| class="col1 centeralign" | float
+
| 16
| class="col2 centeralign" | 5.0
+
|-
| class="col3" | Seems to vary from 0.0 to 5.0 in integer increments
+
| <code>minecraft:alban</code>
|- class="row4"
+
| 2
| class="col0" | Total Size:
+
| 32
| class="col1 rightalign" colspan="4" | 9 bytes
+
| 0
|}
+
| 16
 +
| 16
 +
|-
 +
| <code>minecraft:aztec2</code>
 +
| 3
 +
| 48
 +
| 0
 +
| 16
 +
| 16
 +
|-
 +
| <code>minecraft:bomb</code>
 +
| 4
 +
| 64
 +
| 0
 +
| 16
 +
| 16
 +
|-
 +
| <code>minecraft:plant</code>
 +
| 5
 +
| 80
 +
| 0
 +
| 16
 +
| 16
 +
|-
 +
| <code>minecraft:wasteland</code>
 +
| 6
 +
| 96
 +
| 0
 +
| 16
 +
| 16
 +
|-
 +
| <code>minecraft:pool</code>
 +
| 7
 +
| 0
 +
| 32
 +
| 32
 +
| 16
 +
|-
 +
| <code>minecraft:courbet</code>
 +
| 8
 +
| 32
 +
| 32
 +
| 32
 +
| 16
 +
|-
 +
| <code>minecraft:sea</code>
 +
| 9
 +
| 64
 +
| 32
 +
| 32
 +
| 16
 +
|-
 +
| <code>minecraft:sunset</code>
 +
| 10
 +
| 96
 +
| 32
 +
| 32
 +
| 16
 +
|-
 +
| <code>minecraft:creebet</code>
 +
| 11
 +
| 128
 +
| 32
 +
| 32
 +
| 16
 +
|-
 +
| <code>minecraft:wanderer</code>
 +
| 12
 +
| 0
 +
| 64
 +
| 16
 +
| 32
 +
|-
 +
| <code>minecraft:graham</code>
 +
| 13
 +
| 16
 +
| 64
 +
| 16
 +
| 32
 +
|-
 +
| <code>minecraft:match</code>
 +
| 14
 +
| 0
 +
| 128
 +
| 32
 +
| 32
 +
|-
 +
| <code>minecraft:bust</code>
 +
| 15
 +
| 32
 +
| 128
 +
| 32
 +
| 32
 +
|-
 +
| <code>minecraft:stage</code>
 +
| 16
 +
| 64
 +
| 128
 +
| 32
 +
| 32
 +
|-
 +
| <code>minecraft:void</code>
 +
| 17
 +
| 96
 +
| 128
 +
| 32
 +
| 32
 +
|-
 +
| <code>skull_and_roses</code>
 +
| 18
 +
| 128
 +
| 128
 +
| 32
 +
| 32
 +
|-
 +
| <code>minecraft:wither</code>
 +
| 19
 +
| 160
 +
| 128
 +
| 32
 +
| 32
 +
|-
 +
| <code>minecraft:fighters</code>
 +
| 20
 +
| 0
 +
| 96
 +
| 64
 +
| 32
 +
|-
 +
| <code>minecraft:pointer</code>
 +
| 21
 +
| 0
 +
| 192
 +
| 64
 +
| 64
 +
|-
 +
| <code>minecraft:pigscene</code>
 +
| 22
 +
| 64
 +
| 192
 +
| 64
 +
| 64
 +
|-
 +
| <code>minecraft:burning_skull</code>
 +
| 23
 +
| 128
 +
| 192
 +
| 64
 +
| 64
 +
|-
 +
| <code>minecraft:skeleton</code>
 +
| 24
 +
| 192
 +
| 64
 +
| 64
 +
| 48
 +
|-
 +
| <code>minecraft:donkey_kong</code>
 +
| 25
 +
| 192
 +
| 112
 +
| 64
 +
| 48
 +
|}
  
 +
The {{Minecraft Wiki|Painting#Canvases|Minecraft Wiki article on paintings}} also provides a list of painting names to the actual images.
  
{{anchor|0x09}}
+
==== Spawn Player ====
=== Respawn (0x09) ===
 
  
''Server to Client''
+
This packet is sent by the server when a player comes into visible range, ''not'' when a player joins.
  
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.
+
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"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="5" | 0x09
+
|rowspan="7"| 0x05
| class="col1 centeralign" | Dimension
+
|rowspan="7"| Play
| class="col2 centeralign" | int
+
|rowspan="7"| Client
| class="col3 centeralign" | <code>1</code>
+
| Entity ID
| class="col4" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End
+
| VarInt
|- class="row2"
+
| Player's EID
| class="col0 centeralign" | Difficulty
+
|-
| class="col1 centeralign" | byte
+
| Player UUID
| class="col2 centeralign" | <code>1</code>
+
| UUID
| class="col3" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard. <code>1</code> is always sent c->s
+
| See below for notes on {{Minecraft Wiki|Server.properties#online-mode|offline mode}} and NPCs
|- class="row3"
+
|-
| class="col0 centeralign" | Game mode
+
| X
| class="col1 centeralign" | byte
+
| Double
| class="col2 centeralign" | <code>1</code>
+
|  
| class="col3" | <code>0</code>: survival, <code>1</code>: creative, <code>2</code>: adventure. The hardcore flag is not included
+
|-
|- class="row4"
+
| Y
| class="col0 centeralign" | World height
+
| Double
| class="col1 centeralign" | short
+
|  
| class="col2 centeralign" | <code>256</code>
+
|-
| class="col3" | Defaults to <code>256</code>
+
| Z
|- class="row5"
+
| Double
| class="col0 centeralign" | Level type
+
|  
| class="col1 centeralign" | string
+
|-
| class="col2 centeralign" | default
+
| Yaw
| class="col3" | See [[#0x01|0x01 login]]
+
| Angle
|- class="row6"
+
|  
| class="col0" | Total Size:
+
|-
| class="col1 rightalign" colspan="4" | 11 bytes + length of string
+
| Pitch
|}
+
| Angle
{{anchor|0x0A}}
+
|  
 +
|}
 +
 
 +
When in {{Minecraft Wiki|Server.properties#online-mode|online mode}}, the UUIDs must be valid and have valid skin blobs.
  
=== Player (0x0A) ===
+
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).
  
''Client to Server''
+
For NPCs UUID v2 should be used. Note:
  
This packet is used to indicate whether the player is on ground (walking/swimming), or airborne (jumping/falling).
+
<+Grum> i will never confirm this as a feature you know that :)
  
When dropping from sufficient height, fall damage is applied when this state goes from False to True. The amount of damage applied is based on the point where it last changed from True to False. Note that there are several movement related packets containing this state.
+
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>.
  
This packet was previously referred to as Flying
+
==== Entity Animation (clientbound) ====
 +
 
 +
Sent whenever an entity should change animation.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" | 0x0A
+
|rowspan="2"| 0x06
| class="col1 centeralign" | On Ground
+
|rowspan="2"| Play
| class="col2 centeralign" | boolean
+
|rowspan="2"| Client
| class="col3 centeralign" | <code>1</code>
+
| Entity ID
| class="col4" | <code>True</code> if the client is on the ground, <code>False</code> otherwise
+
| VarInt
|- class="row2"
+
| Player ID
| class="col0" | Total Size:
+
|-
| class="col1 rightalign" colspan="4" | 2 bytes
+
| Animation
|}
+
| Unsigned Byte
 +
| Animation ID (see below)
 +
|}
  
 +
Animation can be one of the following values:
  
{{anchor|0x0B}}
+
{| class="wikitable"
=== Player Position (0x0B) ===
+
! ID
 +
! Animation
 +
|-
 +
| 0
 +
| Swing main arm
 +
|-
 +
| 1
 +
| Take damage
 +
|-
 +
| 2
 +
| Leave bed
 +
|-
 +
| 3
 +
| Swing offhand
 +
|-
 +
| 4
 +
| Critical effect
 +
|-
 +
| 5
 +
| Magic critical effect
 +
|}
  
''Client to Server''
+
==== Statistics ====
  
Updates the players XYZ position on the server.
+
Sent as a response to [[#Client_Status|Client Status 0x04]] (id 1).
If <code>Stance - Y</code> is less than <code>0.1</code> or greater than <code>1.65</code>, the stance is illegal and the client will be kicked with the message “Illegal Stance”.
 
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 units will result in the client being kicked for "You moved too quickly :( (Hacking?)"
 
Also if the absolute number of X or Z is set greater than <code>3.2E7D</code> the client will be kicked for "Illegal position"
 
  
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
!colspan="2"| Field Name
 +
!colspan="2"| Field Type
 +
! Notes
 +
|-
 +
|rowspan="4"| 0x07
 +
|rowspan="4"| Play
 +
|rowspan="4"| Client
 +
|colspan="2"| Count
 +
|colspan="2"| VarInt
 +
| Number of elements in the following array
 +
|-
 +
|rowspan="2"| Statistic
 +
| Category ID
 +
|rowspan="2"| Array
 +
| VarInt
 +
| See below
 +
|-
 +
| Statistic ID
 +
| VarInt
 +
| See below
 +
|-
 +
|colspan="2"| Value
 +
|colspan="2"| VarInt
 +
| The amount to set it to
 +
|}
 +
 +
Categories (these are namespaced, but with <code>:</code> replaced with <code>.</code>):
 +
 +
{| class="wikitable"
 +
! Name
 +
! ID
 +
! Registry
 +
|-
 +
| <code>minecraft.mined</code>
 +
| 0
 +
| Blocks
 +
|-
 +
| <code>minecraft.crafted</code>
 +
| 1
 +
| Items
 +
|-
 +
| <code>minecraft.used</code>
 +
| 2
 +
| Items
 +
|-
 +
| <code>minecraft.broken</code>
 +
| 3
 +
| Items
 +
|-
 +
| <code>minecraft.picked_up</code>
 +
| 4
 +
| Items
 +
|-
 +
| <code>minecraft.dropped</code>
 +
| 5
 +
| Items
 +
|-
 +
| <code>minecraft.killed</code>
 +
| 6
 +
| Entities
 +
|-
 +
| <code>minecraft.killed_by</code>
 +
| 7
 +
| Entities
 +
|-
 +
| <code>minecraft.custom</code>
 +
| 8
 +
| Custom
 +
|}
 +
 +
Blocks, Items, and Entities use block (not block state), item, and entity ids.
 +
 +
Custom has the following (unit only matters for clients):
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Name
| class="col0" | Packet ID
+
! ID
| class="col1" | Field Name
+
! Unit
| class="col2" | Field Type
+
|-
| class="col3" | Example
+
| <code>minecraft.leave_game</code>
| class="col4" | Notes
+
| 0
|- class="row1"
+
| None
| class="col0 centeralign" rowspan="5" | 0x0B
+
|-
| class="col1 centeralign" | X
+
| <code>minecraft.play_one_minute</code>
| class="col2 centeralign" | double
+
| 1
| class="col3 rightalign" | <code>102.809</code>
+
| Time
| class="col4" | Absolute position
+
|-
|- class="row2"
+
| <code>minecraft.time_since_death</code>
| class="col0 centeralign" | Y
+
| 2
| class="col1 centeralign" | double
+
| Time
| class="col2 centeralign" | <code>70.00</code>
+
|-
| class="col3" | Absolute position
+
| <code>minecraft.sneak_Time</code>
|- class="row3"
+
| 3
| class="col0 centeralign" | Stance
+
| Time
| class="col1 centeralign" | double
+
|-
| class="col2 centeralign" | <code>71.62</code>
+
| <code>minecraft.walk_one_cm</code>
| class="col3" | Used to modify the players bounding box when going up stairs, crouching, etc…
+
| 4
|- class="row4"
+
| Distance
| class="col0 centeralign" | Z
+
|-
| class="col1 centeralign" | double
+
| <code>minecraft.crouch_one_cm</code>
| class="col2 centeralign" | <code>68.30</code>
+
| 5
| class="col3" | Absolute position
+
| Distance
|- class="row5"
+
|-
| class="col0 centeralign" | On Ground
+
| <code>minecraft.sprint_one_cm</code>
| class="col1 centeralign" | boolean
+
| 6
| class="col2 centeralign" | <code>1</code>
+
| Distance
| class="col3" |
+
|-
Derived from packet [[#0x0A|0x0A]]
+
| <code>minecraft.swim_one_cm</code>
|- class="row6"
+
| 7
| class="col0" | Total Size:
+
| Distance
| class="col1 rightalign" colspan="4" | 34 bytes
+
|-
|}
+
| <code>minecraft.fall_one_cm</code>
 +
| 8
 +
| Distance
 +
|-
 +
| <code>minecraft.climb_one_cm</code>
 +
| 9
 +
| Distance
 +
|-
 +
| <code>minecraft.fly_one_cm</code>
 +
| 10
 +
| Distance
 +
|-
 +
| <code>minecraft.dive_one_cm</code>
 +
| 11
 +
| Distance
 +
|-
 +
| <code>minecraft.minecart_one_cm</code>
 +
| 12
 +
| Distance
 +
|-
 +
| <code>minecraft.boat_one_cm</code>
 +
| 13
 +
| Distance
 +
|-
 +
| <code>minecraft.pig_one_cm</code>
 +
| 14
 +
| Distance
 +
|-
 +
| <code>minecraft.horse_one_cm</code>
 +
| 15
 +
| Distance
 +
|-
 +
| <code>minecraft.aviate_one_cm</code>
 +
| 16
 +
| Distance
 +
|-
 +
| <code>minecraft.jump</code>
 +
| 17
 +
| None
 +
|-
 +
| <code>minecraft.drop</code>
 +
| 18
 +
| None
 +
|-
 +
| <code>minecraft.damage_dealt</code>
 +
| 19
 +
| Damage
 +
|-
 +
| <code>minecraft.damage_taken</code>
 +
| 20
 +
| Damage
 +
|-
 +
| <code>minecraft.deaths</code>
 +
| 21
 +
| None
 +
|-
 +
| <code>minecraft.mob_kills</code>
 +
| 22
 +
| None
 +
|-
 +
| <code>minecraft.animals_bred</code>
 +
| 23
 +
| None
 +
|-
 +
| <code>minecraft.player_kills</code>
 +
| 24
 +
| None
 +
|-
 +
| <code>minecraft.fish_caught</code>
 +
| 25
 +
| None
 +
|-
 +
| <code>minecraft.talked_to_villager</code>
 +
| 26
 +
| None
 +
|-
 +
| <code>minecraft.traded_with_villager</code>
 +
| 27
 +
| None
 +
|-
 +
| <code>minecraft.eat_cake_slice</code>
 +
| 28
 +
| None
 +
|-
 +
| <code>minecraft.fill_cauldron</code>
 +
| 29
 +
| None
 +
|-
 +
| <code>minecraft.use_cauldron</code>
 +
| 30
 +
| None
 +
|-
 +
| <code>minecraft.clean_armor</code>
 +
| 31
 +
| None
 +
|-
 +
| <code>minecraft.clean_banner</code>
 +
| 32
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_brewingstand</code>
 +
| 33
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_beacon</code>
 +
| 34
 +
| None
 +
|-
 +
| <code>minecraft.inspect_dropper</code>
 +
| 35
 +
| None
 +
|-
 +
| <code>minecraft.inspect_hopper</code>
 +
| 36
 +
| None
 +
|-
 +
| <code>minecraft.inspect_dispenser</code>
 +
| 37
 +
| None
 +
|-
 +
| <code>minecraft.play_noteblock</code>
 +
| 38
 +
| None
 +
|-
 +
| <code>minecraft.tune_noteblock</code>
 +
| 39
 +
| None
 +
|-
 +
| <code>minecraft.pot_flower</code>
 +
| 40
 +
| None
 +
|-
 +
| <code>minecraft.trigger_trapped_chest</code>
 +
| 41
 +
| None
 +
|-
 +
| <code>minecraft.open_enderchest</code>
 +
| 42
 +
| None
 +
|-
 +
| <code>minecraft.enchant_item</code>
 +
| 43
 +
| None
 +
|-
 +
| <code>minecraft.play_record</code>
 +
| 44
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_furnace</code>
 +
| 45
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_crafting_table</code>
 +
| 46
 +
| None
 +
|-
 +
| <code>minecraft.open_chest</code>
 +
| 47
 +
| None
 +
|-
 +
| <code>minecraft.sleep_in_bed</code>
 +
| 48
 +
| None
 +
|-
 +
| <code>minecraft.open_shulker_box</code>
 +
| 49
 +
| None
 +
|}
  
 +
Units:
 +
 +
* 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
 +
 +
==== Acknowledge Player Digging ====
 +
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="4"| 0x08
 +
|rowspan="4"| Play
 +
|rowspan="4"| Client
 +
| Location
 +
| Position
 +
| Position where the digging was happening
 +
|-
 +
| Block
 +
| VarInt
 +
| Block state ID of the block that should be at that position now.
 +
|-
 +
| Status
 +
| VarInt enum
 +
| Same as Player Digging.  Only Started digging (0), Cancelled digging (1), and Finished digging (2) are used.
 +
|-
 +
| Successful
 +
| Boolean
 +
| True if the digging succeeded; false if the client should undo any changes it made locally.  (How does this work?)
 +
|}
  
{{anchor|0x0C}}
+
==== Block Break Animation ====
=== Player Look (0x0C) ===
 
  
''Client to Server''
+
0–9 are the displayable destroy stages and each other number means that there is no animation on this coordinate.
  
[[File:Minecraft-trig-yaw.png|thumb|The unit circle for yaw]]
+
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)
  
Updates the direction the player is looking in.
+
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.
  
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 backwards towards (-1, 0), or in other words, it turns clockwise instead of counterclockwise. Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="3"| 0x09
 +
|rowspan="3"| Play
 +
|rowspan="3"| Client
 +
| Entity ID
 +
| VarInt
 +
| Entity 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
 +
|}
  
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.
+
==== Block Entity Data ====
  
You can get a unit vector from a given yaw/pitch via:
+
Sets the block entity associated with the block at the given location.
  x = -cos(pitch) * sin(yaw)
 
  y = -sin(pitch)
 
  z =  cos(pitch) * cos(yaw)
 
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="3" | 0x0C
+
|rowspan="3"| 0x0A
| class="col1 centeralign" | Yaw
+
|rowspan="3"| Play
| class="col2 centeralign" | float
+
|rowspan="3"| Client
| class="col3 centeralign" | <code>0.00</code>
+
| Location
| class="col4" | Absolute rotation on the X Axis, in degrees
+
| Position
|- class="row2"
+
|  
| class="col0 centeralign" | Pitch
+
|-
| class="col1 centeralign" | float
+
| Action
| class="col2 centeralign" | <code>0.00</code>
+
| Unsigned Byte
| class="col3" | Absolute rotation on the Y Axis, in degrees
+
| The type of update to perform, see below
|- class="row3"
+
|-
| class="col0 centeralign" | On Ground
+
| NBT Data
| class="col1 centeralign" | boolean
+
| [[NBT|NBT Tag]]
| class="col2 centeralign" | <code>1</code>
+
| 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)
| class="col3" |
+
|}
Derived from packet [[#0x0A|0x0A]]
+
 
|- class="row4"
+
''Action'' field:
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 10 bytes
 
|}
 
  
 +
* '''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''': Declare a conduit
 +
* '''6''': Set base color and patterns on a banner
 +
* '''7''': Set the data for a Structure tile entity
 +
* '''8''': Set the destination for a end gateway
 +
* '''9''': Set the text on a sign
 +
* '''10''': Unused
 +
* '''11''': Declare a bed
 +
* '''12''': Set data of a jigsaw block
 +
* '''13''': Set items in a campfire
 +
* '''14''': Behive information
  
{{anchor|0x0D}}
+
==== Block Action ====
=== Player Position and Look (0x0D) ===
 
  
''Two-Way''
+
This packet is used for a number of actions and animations performed by blocks, usually non-persistent.
  
A combination of [[#0x0C|Player Look]] and [[#0x0B|Player position]].  
+
See [[Block Actions]] for a list of values.
  
'''Note:''' When this packet is sent from the server, the 'Y' and 'Stance' fields are swapped.
+
{{Warning2|This packet uses a block ID, not a block state.  Unfortunately, block IDs are not directly included in the output from [[Data Generators]], but can manually be calculated.}}
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="7" | 0x0D
+
|rowspan="4"| 0x0B
| class="col1 centeralign" | X
+
|rowspan="4"| Play
| class="col2 centeralign" | double
+
|rowspan="4"| Client
| class="col3 centeralign" | <code>6.5</code>
+
| Location
| class="col4" | Absolute position
+
| Position
|- class="row2"
+
| Block coordinates
| class="col0 centeralign" | Y
+
|-
| class="col1 centeralign" | double
+
| Action ID (Byte 1)
| class="col2 centeralign" | <code>65.620000004768372</code>
+
| Unsigned Byte
| class="col3" | Absolute position
+
| Varies depending on block — see [[Block Actions]]
|- class="row3"
+
|-
| class="col0 centeralign" | Stance
+
| Action Param (Byte 2)
| class="col1 centeralign" | double
+
| Unsigned Byte
| class="col2 centeralign" | <code>67.240000009536743</code>
+
| Varies depending on block — see [[Block Actions]]
| class="col3" | Used to modify the players bounding box when going up stairs, crouching, etc…
+
|-
|- class="row4"
+
| Block Type
| class="col0 centeralign" | Z
+
| VarInt
| class="col1 centeralign" | double
+
| The block type ID for the block.  This must match the block at the given coordinates.
| class="col2 centeralign" | <code>7.5</code>
+
|}
| class="col3" | Absolute position
 
|- class="row5"
 
| class="col0 centeralign" | Yaw
 
| class="col1 centeralign" | float
 
| class="col2 centeralign" | <code>0.0</code>
 
| class="col3" | Absolute rotation on the X Axis
 
|- class="row6"
 
| class="col0 centeralign" | Pitch
 
| class="col1 centeralign" | float
 
| class="col2 centeralign" | <code>0.0</code>
 
| class="col3" | Absolute rotation on the Y Axis
 
|- class="row7"
 
| class="col0 centeralign" | On Ground
 
| class="col1 centeralign" | boolean
 
| class="col2 centeralign" | <code>0</code>
 
| class="col3" |
 
Derived from packet [[#0x0A|0x0A]]
 
|- class="row8"
 
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 42 bytes
 
|}
 
  
 +
==== Block Change ====
  
{{anchor|0x0E}}
+
Fired whenever a block is changed within the render distance.
  
=== Player Digging (0x0E) ===
+
{{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.}}
  
''Client to Server''
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="2"| 0x0C
 +
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Location
 +
| Position
 +
| Block Coordinates
 +
|-
 +
| Block ID
 +
| VarInt
 +
| 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.
 +
|}
  
Sent when the player mines a block.  A Notchian server only accepts digging packets with coordinates within a 6-unit radius of the player's position.
+
==== Boss Bar ====
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
!colspan="2"| Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="5" | 0x0E
+
|rowspan="14"| 0x0D
| class="col1 centeralign" | Status
+
|rowspan="14"| Play
| class="col2 centeralign" | byte
+
|rowspan="14"| Client
| class="col3 centeralign" | <code>1</code>
+
|colspan="2"| UUID
| class="col4" | The action the player is taking against the block (see below)
+
| UUID
|- class="row2"
+
| Unique ID for this bar
| class="col0 centeralign" | X
+
|-
| class="col1 centeralign" | int
+
|colspan="2"| Action
| class="col2 centeralign" | <code>32</code>
+
| VarInt Enum
| class="col3" | Block position
+
| Determines the layout of the remaining packet
|- class="row3"
+
|-
| class="col0 centeralign" | Y
+
! Action
| class="col1 centeralign" | byte
+
! Field Name
| class="col2 centeralign" | <code>64</code>
+
!
| class="col3" | Block position
+
!
|- class="row4"
+
|-
| class="col0 centeralign" | Z
+
|rowspan="5"| 0: add
| class="col1 centeralign" | int
+
| Title
| class="col2 centeralign" | <code>32</code>
+
| [[Chat]]
| class="col3 leftalign" | Block position
+
|  
|- class="row5"
+
|-
| class="col0 centeralign" | Face
+
| Health
| class="col1 centeralign" | byte
+
| Float
| class="col2 centeralign" | <code>3</code>
+
| 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.
| class="col3" | The face being hit (see below)
+
|-
|- class="row6"
+
| Color
| class="col0" | Total Size:
+
| VarInt Enum
| class="col1 rightalign" colspan="4" | 12 bytes
+
| Color ID (see below)
|}
+
|-
 +
| Division
 +
| VarInt Enum
 +
| Type of division (see below)
 +
|-
 +
| 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)
 +
|-
 +
| 1: remove
 +
| ''no fields''
 +
| ''no fields''
 +
| Removes this boss bar
 +
|-
 +
| 2: update health
 +
| Health
 +
| Float
 +
| as above
 +
|-
 +
| 3: update title
 +
| Title
 +
| [[Chat]]
 +
|  
 +
|-
 +
|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
 +
|-
 +
|}
  
Status can (currently) be one of six values:
+
{| class="wikitable"
 +
! ID
 +
! Color
 +
|-
 +
| 0
 +
| Pink
 +
|-
 +
| 1
 +
| Blue
 +
|-
 +
| 2
 +
| Red
 +
|-
 +
| 3
 +
| Green
 +
|-
 +
| 4
 +
| Yellow
 +
|-
 +
| 5
 +
| Purple
 +
|-
 +
| 6
 +
| White
 +
|}
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! ID
| class="col0" | Meaning
+
! Type of division
| class="col1" | Value
+
|-
|- class="row1"
+
| 0
| class="col0 leftalign" | Started digging
+
| No division
| class="col1 centeralign" | <code>0</code>
+
|-
|- class="row2"
+
| 1
| class="col0 leftalign" | Cancelled digging
+
| 6 notches
| class="col1 centeralign" | <code>1</code>
+
|-
|- class="row3"
+
| 2
| class="col0 leftalign" | Finished digging
+
| 10 notches
| class="col1 centeralign" | <code>2</code>
+
|-
|- class="row4"
+
| 3
| class="col0 leftalign" | Check block
+
| 12 notches
| class="col1 centeralign" | <code>3</code>
+
|-
|- class="row5"
+
| 4
| class="col0 leftalign" | Drop item
+
| 20 notches
| class="col1 centeralign" | <code>4</code>
+
|}
|- class="row6"
 
| class="col0 leftalign" | Shoot arrow / finish eating
 
| class="col1 centeralign" | <code>5</code>
 
|}
 
  
Notchian clients send a 0 (started digging) when they start digging and a 2 (finished digging) once they think they are finished. If digging is aborted, no notice is sent to the server; the client simply does not send a 2 (finished digging).
+
==== Server Difficulty ====
  
Status code 3 is never sent by a Notchian client, but it is supported by Notchian servers. If the block coordinates are within a 16-unit radius of the player's position, the server responds with a [[#0x35|Block Change]] packet containing that block's current type and metadata. No actual changes occur to the world in this case.
+
Changes the difficulty setting in the client's option menu
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="2"| 0x0E
 +
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Difficulty
 +
| Unsigned Byte
 +
| 0: peaceful, 1: easy, 2: normal, 3: hard
 +
|-
 +
| Difficulty locked?
 +
| Boolean
 +
|
 +
|}
  
Status code 4 (drop item) is a special case.  In-game, when you use the Drop Item command (keypress 'q'), a dig packet with a status of 4, and all other values set to 0, is sent from client to server.
+
==== Chat Message (clientbound) ====
  
Status code 5 (shoot arrow / finish eating) is also a special case. The x, y and z fields are all set to 0 like above, with the exception of the face field, which is set to 255.
+
Identifying the difference between Chat/System Message is important as it helps respect the user's chat visibility options. See [[Chat#Processing chat|processing chat]] for more info about these positions.
  
The face can be one of six values, representing the face being hit:
+
{{warning2|Game info accepts json formatting but does not display it, although the deprecated §-based formatting works.  This is not an issue when using the [[#Title|Title]] packet, so prefer that packet for displaying information in that slot.  See [https://bugs.mojang.com/browse/MC-119145 MC-119145] for more information.}}
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0 leftalign" | Value
+
! State
| class="col1 centeralign" | 0
+
! Bound To
| class="col2 centeralign" | 1
+
! Field Name
| class="col3 centeralign" | 2
+
! Field Type
| class="col4 centeralign" | 3
+
! Notes
| class="col5 centeralign" | 4
+
|-
| class="col6 centeralign" | 5
+
|rowspan="2"| 0x0F
|- class="row1"
+
|rowspan="2"| Play
| class="col0 leftalign" | Offset
+
|rowspan="2"| Client
| class="col1" | -Y
+
| JSON Data
| class="col2" | +Y
+
| [[Chat]]
| class="col3" | -Z
+
| Limited to 32767 bytes
| class="col4" | +Z
+
|-
| class="col5" | -X
+
| Position
| class="col6" | +X
+
| Byte
|}
+
| 0: chat (chat box), 1: system message (chat box), 2: game info (above hotbar).
 +
|}
 +
 
 +
==== 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]]).}}
  
In 1.7.3, when a player opens a door with left click the server receives Packet 0xE+start digging and opens the door.
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
!colspan="2"| Field Name
 +
!colspan="2"| Field Type
 +
! Notes
 +
|-
 +
|rowspan="6"| 0x10
 +
|rowspan="6"| Play
 +
|rowspan="6"| Client
 +
|colspan="2"| Chunk X
 +
|colspan="2"| Int
 +
| Chunk X coordinate
 +
|-
 +
|colspan="2"| Chunk Z
 +
|colspan="2"| Int
 +
| Chunk Z coordinate
 +
|-
 +
|colspan="2"| Record Count
 +
|colspan="2"| VarInt
 +
| Number of elements in the following array, i.e. the number of blocks affected
 +
|-
 +
|rowspan="3"| Record
 +
| Horizontal Position
 +
|rowspan="3"| Array
 +
| Unsigned Byte
 +
| The 4 most significant bits (<code>0xF0</code>) encode the X coordinate, relative to the chunk. The 4 least significant bits (<code>0x0F</code>) encode the Z coordinate, relative to the chunk.
 +
|-
 +
| Y Coordinate
 +
| Unsigned Byte
 +
| Y coordinate of the block
 +
|-
 +
| Block ID
 +
| VarInt
 +
| 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.
 +
|}
  
 +
To decode the position into a world position:
  
{{anchor|0x0F}}
+
<syntaxhighlight lang="java">
 +
worldX = (horizPos >> 4 & 15) + (chunkX * 16);
 +
worldY = vertPos;
 +
worldZ = (horizPos & 15) + (chunkZ * 16);
 +
</syntaxhighlight>
  
=== Player Block Placement (0x0F) ===
+
==== Tab-Complete (clientbound) ====
  
''Client to Server''
+
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"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
!colspan="2"| Field Name
| class="col3" | Example
+
!colspan="2"| Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="8" | 0x0F
+
|rowspan="8"| 0x11
| class="col1 centeralign" | X
+
|rowspan="8"| Play
| class="col2 centeralign" | int
+
|rowspan="8"| Client
| class="col3 centeralign" | <code>32</code>
+
|-
| class="col4" | Block position
+
|colspan="2"| ID
|- class="row2"
+
|colspan="2"| VarInt
| class="col0 centeralign" | Y
+
| Transaction ID
| class="col1 centeralign" | unsigned byte
+
|-
| class="col2 centeralign" | <code>64</code>
+
|colspan="2"| Start
| class="col3" | Block position
+
|colspan="2"| VarInt
|- class="row3"
+
| Start of the text to replace
| class="col0 centeralign" | Z
+
|-
| class="col1 centeralign" | int
+
|colspan="2"| Length
| class="col2 centeralign" | <code>32</code>
+
|colspan="2"| VarInt
| class="col3 leftalign" | Block position
+
| Length of the text to replace
|- class="row4"
+
|-
| class="col0 centeralign" | Direction
+
|colspan="2"| Count
| class="col1 centeralign" | byte
+
|colspan="2"| VarInt
| class="col2 centeralign" | <code>3</code>
+
| Number of elements in the following array
| class="col3" | The offset to use for block/item placement (see below)
+
|-
|- class="row5"
+
|rowspan="3"| Matches
| class="col0 centeralign" | Held item
+
| Match
| class="col1 centeralign" | [[Slot_Data|slot]]
+
|rowspan="3"| Array
| class="col2 centeralign" |
+
| String (32767)
| class="col3" |
+
| 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.
|- class="row6"
+
|-
| class="col0 centeralign" | Cursor position X
+
| Has tooltip
| class="col1 centeralign" | byte
+
| Boolean
| class="col2 centeralign" | 0 - 16
+
| True if the following is present
| class="col3" | The position of the crosshair on the block
+
|-
|- class="row7"
+
| Tooltip
| class="col0 centeralign" | Cursor position Y
+
| Optional [[Chat]]
| class="col1 centeralign" | byte
+
| Tooltip to display; only present if previous boolean is true
| class="col2 centeralign" | 0 - 16
+
|}
| class="col3" |
 
|- class="row8"
 
| class="col0 centeralign" | Cursor position Z
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | 0 - 16
 
| class="col3" |
 
|- class="row9"
 
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 14 bytes + slot data
 
|}
 
In normal operation (ie placing a block), this packet is sent once, with the values set normally.
 
  
This packet has a special case where X, Y, Z, and Direction are all -1. (Note that Y is unsigned so set to 255.) This special packet indicates that the currently held item for the player should have its state updated such as eating food, shooting bows, using buckets, etc.
+
==== Declare Commands ====
  
In a Notchian Beta client, the block or item ID corresponds to whatever the client is currently holding, and the client sends one of these packets any time a right-click is issued on a surface, so no assumptions can be made about the safety of the ID.  However, with the implementation of server-side inventory, a Notchian server seems to ignore the item ID, instead operating on server-side inventory information and holding selection. The client has been observed (1.2.5 and 1.3.2) to send both real item IDs and -1 in a single session.
+
Lists all of the commands on the server, and how they are parsed.
  
Special note on using buckets:  When using buckets, the Notchian client might send two packets:  first a normal and then a special case.  The first normal packet is sent when you're looking at a block (e.g. the water you want to scoop up).  This normal packet does not appear to do anything with a Notchian serverThe second, special case packet appears to perform the action - based on current position/orientation and with a distance check - it appears that buckets can only be used within a radius of 6 units.
+
This is a directed graph, with one root nodeEach redirect or child node must refer only to nodes that have already been declared.
  
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="3"| 0x12
 +
|rowspan="3"| Play
 +
|rowspan="3"| Client
 +
| Count
 +
| VarInt
 +
| 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
 +
|}
  
{{anchor|0x10}}
+
For more information on this packet, see the [[Command Data]] article.
  
=== Held Item Change (0x10) ===
+
==== Window Confirmation (clientbound) ====
  
''Client to Server''
+
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 [[#Window Confirmation (serverbound)|serverbound window confirmation]] packet.
  
Sent when the player changes the slot selection
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="3"| 0x13
 +
|rowspan="3"| Play
 +
|rowspan="3"| Client
 +
| Window ID
 +
| Byte
 +
| The ID of the window that the action occurred in
 +
|-
 +
| Action Number
 +
| Short
 +
| Every action that is to be accepted has a unique number. This number is an incrementing integer (starting at 0) with separate counts for each window ID.
 +
|-
 +
| 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.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" | 0x10
+
| 0x14
| class="col1 centeralign" | Slot ID
+
| Play
| class="col2 centeralign" | short
+
| Client
| class="col3 centeralign" | <code>1</code>
+
| Window ID
| class="col4" | The slot which the player has selected (0-8)
+
| Unsigned Byte
|- class="row2"
+
| This is the ID of the window that was closed. 0 for inventory.
| class="col0" | Total Size:
+
|}
| class="col1 rightalign" colspan="4" | 3 bytes
 
|}
 
  
 +
==== Window Items ====
 +
[[File:Inventory-slots.png|thumb|The inventory slots]]
  
{{anchor|0x11}}
+
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.
=== Use Bed (0x11) ===
 
  
''Server to Client''
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="3"| 0x15
 +
|rowspan="3"| Play
 +
|rowspan="3"| Client
 +
| Window ID
 +
| Unsigned Byte
 +
| The ID of window which items are being sent for. 0 for player inventory.
 +
|-
 +
| Count
 +
| Short
 +
| Number of elements in the following array
 +
|-
 +
| Slot Data
 +
| Array of [[Slot Data|Slot]]
 +
|
 +
|}
  
This packet tells that a player goes to bed.
+
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.
  
The client with the matching  Entity ID will go into bed mode.
+
==== Window Property ====
  
This Packet is sent to all nearby players including the one sent to bed.
+
This packet is used to inform the client that part of a GUI window should be updated.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="5" | 0x11
+
|rowspan="3"| 0x16
| class="col1 centeralign" | Entity ID
+
|rowspan="3"| Play
| class="col2 centeralign" | int
+
|rowspan="3"| Client
| class="col3 centeralign" | 89
+
| Window ID
| class="col4" | Player ID
+
| Unsigned Byte
|- class="row2"
+
|  
| class="col0 centeralign" | Unknown
+
|-
| class="col1 centeralign" | byte
+
| Property
| class="col2 centeralign" | 0
+
| Short
| class="col3" | Only 0 has been observed
+
| The property to be updated, see below
|- class="row1"
+
|-
| class="col0 centeralign" | X coordinate
+
| Value
| class="col1 centeralign" | int
+
| Short
| class="col2 centeralign" | -247
+
| The new value for the property, see below
| class="col3" | Bed headboard X as block coordinate
+
|}
|- class="row2"
 
| class="col0 centeralign" | Y coordinate
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | 78
 
| class="col3" | Bed headboard Y as block coordinate
 
|- class="row1"
 
| class="col0 centeralign" | Z coordinate
 
| class="col1 centeralign" | int
 
| class="col2 centeralign" | 128
 
| class="col3" | Bed headboard Z as block coordinate
 
|- class="row3"
 
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 15 bytes
 
|}
 
  
 +
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"
 +
|-
 +
! Window type
 +
! Property
 +
! Value
 +
|-
 +
|rowspan="4"| Furnace
 +
| 0: Fire icon (fuel left)
 +
| counting from fuel burn time down to 0 (in-game ticks)
 +
|-
 +
| 1: Maximum fuel burn time
 +
| fuel burn time or 0 (in-game ticks)
 +
|-
 +
| 2: Progress arrow
 +
| counting from 0 to maximum progress (in-game ticks)
 +
|-
 +
| 3: Maximum progress
 +
| always 200 on the notchian server
 +
|-
 +
|rowspan="10"| Enchantment Table
 +
| 0: Level requirement for top enchantment slot
 +
|rowspan="3"| The enchantment's xp level requirement
 +
|-
 +
| 1: Level requirement for middle enchantment slot
 +
|-
 +
| 2: Level requirement for bottom enchantment slot
 +
|-
 +
| 3: The enchantment seed
 +
| Used for drawing the enchantment names (in [[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>).
 +
|-
 +
| 4: Enchantment ID shown on mouse hover over top enchantment slot
 +
|rowspan="3"| The enchantment id (set to -1 to hide it), see below for values
 +
|-
 +
| 5: Enchantment ID shown on mouse hover over middle enchantment slot
 +
|-
 +
| 6: Enchantment ID shown on mouse hover over bottom enchantment slot
 +
|-
 +
| 7: Enchantment level shown on mouse hover over the top slot
 +
|rowspan="3"| The enchantment level (1 = I, 2 = II, 6 = VI, etc.), or -1 if no enchant
 +
|-
 +
| 8: Enchantment level shown on mouse hover over the middle slot
 +
|-
 +
| 9: Enchantment level shown on mouse hover over the bottom slot
 +
|-
 +
|rowspan="3"| Beacon
 +
| 0: Power level
 +
| 0-4, controls what effect buttons are enabled
 +
|-
 +
| 1: First potion effect
 +
| {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the first effect, or -1 if no effect
 +
|-
 +
| 2: Second potion effect
 +
| {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the second effect, or -1 if no effect
 +
|-
 +
| Anvil
 +
| 0: Repair cost
 +
| The repair's cost in xp levels
 +
|-
 +
|rowspan="2"| Brewing Stand
 +
| 0: Brew time
 +
| 0 – 400, with 400 making the arrow empty, and 0 making the arrow full
 +
|-
 +
| 1: Fuel time
 +
| 0 - 20, with 0 making the arrow empty, and 20 making the arrow full
 +
|}
  
{{anchor|0x12}}
+
For an enchanting table, the following numerical IDs are used:
=== Animation (0x12) ===
 
  
''Two-Way''
+
{| class="wikitable"
 +
! Numerical ID
 +
! Enchantment ID
 +
! Enchantment Name
 +
|-
 +
| 0
 +
| minecraft:protection
 +
| Protection
 +
|-
 +
| 1
 +
| minecraft:fire_protection
 +
| Fire Protection
 +
|-
 +
| 2
 +
| minecraft:feather_falling
 +
| Feather Falling
 +
|-
 +
| 3
 +
| minecraft:blast_protection
 +
| Blast Protection
 +
|-
 +
| 4
 +
| minecraft:projectile_protection
 +
| Projectile Protection
 +
|-
 +
| 5
 +
| minecraft:respiration
 +
| Respiration
 +
|-
 +
| 6
 +
| minecraft:aqua_affinity
 +
| Aqua Affinity
 +
|-
 +
| 7
 +
| minecraft:thorns
 +
| Thorns
 +
|-
 +
| 8
 +
| minecraft:depth_strider
 +
| Depth Strider
 +
|-
 +
| 9
 +
| minecraft:frost_walker
 +
| Frost Walker
 +
|-
 +
| 10
 +
| minecraft:binding_curse
 +
| Curse of Binding
 +
|-
 +
| 11
 +
| minecraft:sharpness
 +
| Sharpness
 +
|-
 +
| 12
 +
| minecraft:smite
 +
| Smite
 +
|-
 +
| 13
 +
| minecraft:bane_of_arthropods
 +
| Bane of Arthropods
 +
|-
 +
| 14
 +
| minecraft:knockback
 +
| Knockback
 +
|-
 +
| 15
 +
| minecraft:fire_aspect
 +
| Fire Aspect
 +
|-
 +
| 16
 +
| minecraft:looting
 +
| Looting
 +
|-
 +
| 17
 +
| minecraft:sweeping
 +
| Sweeping Edge
 +
|-
 +
| 18
 +
| minecraft:efficiency
 +
| Efficiency
 +
|-
 +
| 19
 +
| minecraft:silk_touch
 +
| Silk Touch
 +
|-
 +
| 20
 +
| minecraft:unbreaking
 +
| Unbreaking
 +
|-
 +
| 21
 +
| minecraft:fortune
 +
| Fortune
 +
|-
 +
| 22
 +
| minecraft:power
 +
| Power
 +
|-
 +
| 23
 +
| minecraft:punch
 +
| Punch
 +
|-
 +
| 24
 +
| minecraft:flame
 +
| Flame
 +
|-
 +
| 25
 +
| minecraft:infinity
 +
| Infinity
 +
|-
 +
| 26
 +
| minecraft:luck_of_the_sea
 +
| Luck of the Sea
 +
|-
 +
| 27
 +
| minecraft:lure
 +
| Lure
 +
|-
 +
| 28
 +
| minecraft:loyalty
 +
| Loyalty
 +
|-
 +
| 29
 +
| minecraft:impaling
 +
| Impaling
 +
|-
 +
| 30
 +
| minecraft:riptide
 +
| Riptide
 +
|-
 +
| 31
 +
| minecraft:channeling
 +
| Channeling
 +
|-
 +
| 32
 +
| minecraft:mending
 +
| Mending
 +
|-
 +
| 33
 +
| minecraft:vanishing_curse
 +
| Curse of Vanishing
 +
|}
  
Sent whenever an entity should change animation.
+
==== Set Slot ====
 +
 
 +
Sent by the server when an item in a slot (in a window) is added/removed.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="2" | 0x12
+
|rowspan="3"| 0x17
| class="col1 centeralign" | EID
+
|rowspan="3"| Play
| class="col2 centeralign" | int
+
|rowspan="3"| Client
| class="col3 centeralign" | <code>55534</code>
+
| Window ID
| class="col4" | Player ID
+
| Byte
|- class="row2"
+
| 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).
| class="col0 centeralign" | Animation
+
|-
| class="col1 centeralign" | byte
+
| Slot
| class="col2 centeralign" | <code>1</code>
+
| Short
| class="col3" | Animation ID
+
| The slot that should be updated
|- class="row3"
+
|-
| class="col0" | Total Size:
+
| Slot Data
| class="col1 rightalign" colspan="4" | 6 bytes
+
| [[Slot Data|Slot]]
|}
+
|  
 +
|}
  
Animation can be one of the following values:
+
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 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.
 +
 
 +
==== Set Cooldown ====
 +
 
 +
Applies a cooldown period to all items with the given type.  Used by the Notchian server with enderpearls.  This packet should be sent when the cooldown starts and also when the cooldown ends (to compensate for lag), although the client will end the cooldown automatically. Can be applied to any item, note that interactions still get sent to the server with the item but the client does not play the animation nor attempt to predict results (i.e block placing).
  
 
{| class="wikitable"
 
{| class="wikitable"
|-
+
! Packet ID
! ID
+
! State
! Animation
+
! Bound To
|-
+
! Field Name
| 0
+
! Field Type
| No animation
+
! Notes
|-
+
|-
| 1
+
|rowspan="2"| 0x18
| Swing arm
+
|rowspan="2"| Play
|-
+
|rowspan="2"| Client
| 2
+
| Item ID
| Damage animation
+
| VarInt
|-
+
| Numeric ID of the item to apply a cooldown to.
| 3
+
|-
| Leave bed
+
| Cooldown Ticks
|-
+
| VarInt
| 5
+
| Number of ticks to apply a cooldown for, or 0 to clear the cooldown.
| Eat food
+
|}
|-
 
| 102
 
| (unknown)
 
|-
 
| 104
 
| Crouch
 
|-
 
| 105
 
| Uncrouch
 
|}
 
  
Only <code>1</code> (swing arm) is sent by notchian clients. Crouching is sent via 0x13. Damage is server-side, and so is not sent by notchian clients. See also 0x26.
+
==== Plugin Message (clientbound) ====
  
 +
{{Main|Plugin channels}}
  
{{anchor|0x13}}
+
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.
  
=== Entity Action (0x13) ===
+
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/]
  
''Client to Server''
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="2"| 0x19
 +
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Channel
 +
| Identifier
 +
| Name of the [[plugin channel]] used to send the data
 +
|-
 +
| Data
 +
| Byte Array
 +
| Any data, depending on the channel. <code>minecraft:</code> channels are documented [[plugin channel|here]].  The length of this array must be inferred from the packet length.
 +
|}
 +
 
 +
==== Named Sound Effect ====
 +
{{See also|#Sound Effect}}
 +
 
 +
Used to play a sound effect on the client. Custom sounds may be added by resource packs.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="7"| 0x1A
 +
|rowspan="7"| Play
 +
|rowspan="7"| Client
 +
| Sound Name
 +
| Identifier
 +
| All sound effect names as of 1.15.2 can be seen [https://pokechu22.github.io/Burger/1.15.2.html#sounds here].
 +
|-
 +
| Sound Category
 +
| VarInt Enum
 +
| The category that this sound will be played from ([https://gist.github.com/konwboj/7c0c380d3923443e9d55 current categories])
 +
|-
 +
| Effect Position X
 +
| Int
 +
| Effect X multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
 +
|-
 +
| Effect Position Y
 +
| Int
 +
| Effect Y multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
 +
|-
 +
| Effect Position Z
 +
| Int
 +
| Effect Z multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
 +
|-
 +
| Volume
 +
| Float
 +
| 1 is 100%, can be more
 +
|-
 +
| Pitch
 +
| Float
 +
| Float between 0.5 and 2.0 by Notchian clients
 +
|}
 +
 
 +
==== Disconnect (play) ====
  
Sent at least when crouching, leaving a bed, or sprinting.
+
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.
To send action animation to client use 0x28.
 
The client will send this with Action ID = 3 when "Leave Bed" is clicked.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="2" | 0x13
+
| 0x1B
| class="col1 centeralign" | EID
+
| Play
| class="col2 centeralign" | int
+
| Client
| class="col3 centeralign" | <code>55534</code>
+
| Reason
| class="col4" | Player ID
+
| [[Chat]]
|- class="row2"
+
| Displayed to the client when the connection terminates.
| class="col0 centeralign" | Action ID
+
|}
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | <code>1</code>
 
| class="col3" | The ID of the action, see below.
 
|- class="row3"
 
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 6 bytes
 
|}
 
  
Action ID can be one of the following values:
+
==== Entity Status ====
 +
 
 +
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"
 
{| class="wikitable"
|-
+
! Packet ID
! ID
+
! State
! Action
+
! Bound To
|-
+
! Field Name
| 1
+
! Field Type
| Crouch
+
! Notes
|-
+
|-
| 2
+
|rowspan="2"| 0x1C
| Uncrouch
+
|rowspan="2"| Play
|-
+
|rowspan="2"| Client
| 3
+
| Entity ID
| Leave bed
+
| Int
|-
+
|  
| 4
+
|-
| Start sprinting
+
| Entity Status
|-
+
| Byte Enum
| 5
+
| See below
| Stop sprinting
+
|}
|}
 
  
 +
See [[Entity statuses]] for a list of which statuses are valid for each type of entity.
  
{{anchor|0x14}}
+
==== Explosion ====
  
=== Spawn Named Entity (0x14) ===
+
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).
  
''Server to Client''
+
Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x
  
The only named entities (at the moment) are players (either real or NPC/Bot). This packet is sent by the server when a player comes into visible range, '''not''' when a player joins.
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="9"| 0x1D
 +
|rowspan="9"| Play
 +
|rowspan="9"| Client
 +
| X
 +
| Float
 +
|
 +
|-
 +
| Y
 +
| Float
 +
|
 +
|-
 +
| Z
 +
| Float
 +
|
 +
|-
 +
| Strength
 +
| 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.
 +
|-
 +
| Record Count
 +
| Int
 +
| Number of elements in the following array
 +
|-
 +
| Records
 +
| Array of (Byte, Byte, Byte)
 +
| Each record is 3 signed bytes long; the 3 bytes are the XYZ (respectively) signed offsets of affected blocks.
 +
|-
 +
| 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
 +
|}
  
Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly.
+
==== Unload Chunk ====
  
At one point, the Notchian client was not okay with receiving player entity packets, including 0x14, that refer to its own username or EID; and would teleport to the absolute origin of the map and fall through the Void any time it received them. However, in more recent versions, it appears to handle them correctly, by spawning a new entity as directed (though future packets referring to the entity ID may be handled incorrectly).
+
Tells the client to unload a chunk column.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0 centeralign" | Packet ID
+
! State
| class="col1 rightalign" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="9" | 0x14
+
|rowspan="2"| 0x1E
| class="col1" | EID
+
|rowspan="2"| Play
| class="col2" | int
+
|rowspan="2"| Client
| class="col3" | <code>94453</code>
+
| Chunk X
| class="col4" | Player ID
+
| Int
|- class="row2"
+
| Block coordinate divided by 16, rounded down
| class="col0" | Player Name
+
|-
| class="col1" | string
+
| Chunk Z
| class="col2" | <code>Twdtwd</code>
+
| Int
| class="col3" | Max length of 16
+
| Block coordinate divided by 16, rounded down
|- class="row3"
+
|}
| class="col0" | X
+
 
| class="col1" | int
+
It is legal to send this packet even if the given chunk is not currently loaded.
| class="col2" | <code>784</code>
+
 
| class="col3" | Player X as Absolute Integer
+
==== Change Game State ====
|- class="row4"
+
 
| class="col0" | Y
+
Used for a wide variety of game state things, from whether to bed use to gamemode to demo messages.
| class="col1" | int
 
| class="col2" | <code>2131</code>
 
| class="col3" | Player Y as Absolute Integer
 
|- class="row5"
 
| class="col0" | Z
 
| class="col1" | int
 
| class="col2" | <code>-752</code>
 
| class="col3" | Player Z as Absolute Integer
 
|- class="row6"
 
| class="col0" | Yaw
 
| class="col1" | byte
 
| class="col2" | <code>0</code>
 
| class="col3" | Player rotation as a packed byte
 
|- class="row7"
 
| class="col0" | Pitch
 
| class="col1" | byte
 
| class="col2" | <code>0</code>
 
| class="col3" | Player rotation as a packed byte
 
|- class="row8"
 
| class="col0" | Current Item
 
| class="col1" | short
 
| class="col2" | <code>0</code>
 
| class="col3" | The item the player is currently holding. Note that this should be 0 for "no item", unlike -1 used in other packets. A negative value crashes clients.
 
|- class="row9"
 
| class="col0" | Metadata
 
| class="col1" | [[Entities#Entity_Metadata_Format|Metadata]]
 
| class="col2" | <code></code>
 
| class="col3" | The 1.3 client crashes on packets with no metadata, but the server can send any metadata key of 0, 1 or 8 and the client is fine.
 
|- class="row10"
 
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 22 bytes + length of strings + metadata (at least 1)
 
|}
 
  
{{anchor|0x15}}
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="2"| 0x1F
 +
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Reason
 +
| Unsigned Byte
 +
| See below
 +
|-
 +
| Value
 +
| Float
 +
| Depends on Reason
 +
|}
  
=== Spawn Dropped Item (0x15) ===
+
''Reason codes'':
  
''Server to Client''
+
{| class="wikitable"
 +
! Reason
 +
! Effect
 +
! Value
 +
|-
 +
| 0
 +
| Invalid Bed
 +
| Would be used to switch between messages, but the only used message is 0 for invalid bed
 +
|-
 +
| 1
 +
| End raining
 +
|
 +
|-
 +
| 2
 +
| Begin raining
 +
|
 +
|-
 +
| 3
 +
| Change gamemode
 +
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator
 +
|-
 +
| 4
 +
| 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?" advancement, while if they do have it 0 is used.
 +
|-
 +
| 5
 +
| Demo message
 +
| 0: Show welcome to demo screen, 101: Tell movement controls, 102: Tell jump control, 103: Tell inventory control, 104: Tell that the demo is over and print a message about how to take a screenshot
 +
|-
 +
| 6
 +
| Arrow hitting player
 +
| Appears to be played when an arrow strikes another player in Multiplayer
 +
|-
 +
| 7
 +
| Fade value
 +
| The current darkness value. 1 = Dark, 0 = Bright, Setting the value higher causes the game to change color and freeze
 +
|-
 +
| 8
 +
| Fade time
 +
| Time in ticks for the sky to fade
 +
|-
 +
| 9
 +
| Play pufferfish sting sound
 +
|-
 +
| 10
 +
| Play elder guardian mob appearance (effect and sound)
 +
|
 +
|-
 +
| 11
 +
| Enable respawn screen
 +
|  0: Enable respawn screen, 1: Immediately respawn (sent when the doImmediateRespawn gamerule changes)
 +
|}
  
An 0x15 packet is sent by the server whenever an item on the ground (say a pickaxe thrown on the ground) comes into range of the player. (note: this means range for item vision, not range for pickup!) It used to be sent by the client when an item is dropped from a tile (chest or furnace) or from inventory, but that is now done with the new packets for server-side inventory (see [[#0x66|Window click (0x66)]]).
+
==== Open Horse Window ====
  
It is completely acceptable for servers to ignore the EID issued by the client in this packet and instead create a new packet with a server-controlled EID when sending this packet out to clients.
+
This packet is used exclusively for opening the horse GUI.  [[#Open Window|Open Window]] is used for all other GUIs.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0 centeralign" | Packet ID
+
! State
| class="col1 rightalign" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="8" | 0x15
+
|rowspan="3"| 0x20
| class="col1" | EID
+
|rowspan="3"| Play
| class="col2" | int
+
|rowspan="3"| Client
| class="col3" | <code>157617</code>
+
| Window ID?
| class="col4" | Unique entity ID
+
| Byte
|- class="row2"
+
|
| class="col0" | Slot
+
|-
| class="col1" | [[Slot Data|slot]]
+
| Number of slots?
| class="col2" |
+
| VarInt
| class="col3" | The item to be spawned
+
|
|- class="row3"
+
|-
| class="col0" | X
+
| Entity ID?
| class="col1" | int
+
| Integer
| class="col2" | <code>133</code>
+
|
| class="col3" | Item X as Absolute Integer
+
|}
|- class="row4"
 
| class="col0" | Y
 
| class="col1" | int
 
| class="col2" | <code>913</code>
 
| class="col3" | Item Y as Absolute Integer
 
|- class="row5"
 
| class="col0" | Z
 
| class="col1" | int
 
| class="col2" | <code>63552</code>
 
| class="col3" | Item Z as Absolute Integer
 
|- class="row6"
 
| class="col0" | Rotation
 
| class="col1" | byte
 
| class="col2" | <code>252</code>
 
| class="col3" | Item rotation as a packed byte
 
|- class="row7"
 
| class="col0" | Pitch
 
| class="col1" | byte
 
| class="col2" | <code>25</code>
 
| class="col3" | Item pitch as a packed byte
 
|- class="row8"
 
| class="col0" | Roll
 
| class="col1" | byte
 
| class="col2" | <code>12</code>
 
| class="col3" | Item roll as a packed byte
 
|- class="row9"
 
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 20 bytes + slot data
 
|}
 
The '''"Damage" field''' inside the slot data structure is also used to store item metadata.  For example: you mined birch wood (its id is the same as normal wood) so you must set damage to the metadata of birch wood (2). The same for wool. Id is the same but data is different.  For example: you mined blue wool so your damage field should send value 0xB.
 
  
 +
==== Keep Alive (clientbound) ====
  
{{anchor|0x16}}
+
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.
 +
 
 +
The Notchian server uses a system-dependent time in milliseconds to generate the keep alive ID value.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="1"| 0x21
 +
|rowspan="1"| Play
 +
|rowspan="1"| Client
 +
| Keep Alive ID
 +
| Long
 +
|
 +
|}
  
=== Collect Item (0x16) ===
+
==== Chunk Data ====
 +
{{Main|Chunk Format}}
 +
{{See also|#Unload Chunk}}
  
''Server to Client''
+
{{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)}}
  
Sent by the server when someone picks up an item lying on the ground - its sole purpose appears to be the animation of the item flying towards you. It doesn't destroy the entity in the client memory ([[#0x1D|0x1D]] does that), and it doesn't add it to your inventory ([[#0x68|0x68]] does that). The server only checks for items to be picked up after each [[#0x0B|Player Position]] and [[#0x0D|Player Position & Look]] packet sent by the client.
+
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"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="2" | 0x16
+
|rowspan="10"| 0x22
| class="col1 centeralign" | Collected EID
+
|rowspan="10"| Play
| class="col2 centeralign" | int
+
|rowspan="10"| Client
| class="col3 centeralign" | <code>38</code>
+
| Chunk X
| class="col4 leftalign" |
+
| Int
|- class="row2"
+
| Chunk coordinate (block coordinate divided by 16, rounded down)
| class="col0 centeralign" | Collector EID
+
|-
| class="col1 centeralign" | int
+
| Chunk Z
| class="col2 centeralign" | <code>20</code>
+
| Int
| class="col3 leftalign" |
+
| Chunk coordinate (block coordinate divided by 16, rounded down)
|- class="row3"
+
|-
| class="col0" | Total Size:
+
| Full chunk
| class="col1 rightalign" colspan="4" | 9 bytes
+
| Boolean
|}
+
| See [[Chunk Format#Full chunk|Chunk Format]]
 +
|-
 +
| Primary Bit Mask
 +
| VarInt
 +
| Bitmask with bits set to 1 for every 16×16×16 chunk section whose data is included in Data. The least significant bit represents the chunk section at the bottom of the chunk column (from y=0 to y=15).
 +
|-
 +
| Heightmaps
 +
| [[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 at 9 bits per entry totaling 36 longs). 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.
 +
|-
 +
| Biomes
 +
| Optional array of Integer
 +
| 1024 biome IDs, ordered by x then z then y, in 4&times;4&times;4 blocks.  Not present if full chunk is false.
 +
|-  
 +
| Size
 +
| VarInt
 +
| Size of Data in bytes
 +
|-
 +
| Data
 +
| Byte array
 +
| See [[Chunk Format#Data structure|data structure]] in Chunk Format
 +
|-
 +
| Number of block entities
 +
| VarInt
 +
| Number of elements in the following array
 +
|-
 +
| Block entities
 +
| Array of [[NBT|NBT Tag]]
 +
| All block entities in the chunk.  Use the x, y, and z tags in the NBT to determine their positions.
 +
|}
 +
 
 +
Note that the Notchian client requires an [[#Update View Position|Update View Position]] packet when it crosses a chunk border, otherwise it'll only display render distance + 2 chunks around the chunk it spawned in.
  
 +
==== Effect ====
 +
 +
Sent when a client is to play a sound or particle effect.
  
{{anchor|0x17}}
+
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.
=== Spawn Object/Vehicle (0x17) ===
 
  
''Server to Client''
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="4"| 0x23
 +
|rowspan="4"| Play
 +
|rowspan="4"| Client
 +
| Effect ID
 +
| Int
 +
| The ID of the effect, see below
 +
|-
 +
| Location
 +
| Position
 +
| The location of the effect
 +
|-
 +
| Data
 +
| Int
 +
| Extra data for certain effects, see below
 +
|-
 +
| Disable Relative Volume
 +
| Boolean
 +
| See above
 +
|}
  
Sent by the server when an Object/Vehicle is created. The throwers entity id is now used for fishing floats too.
+
Effect IDs:
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! ID
| class="col0" | Packet ID
+
! Name
| class="col1" | Field Name
+
! Data
| class="col2" | Field Type
+
|-
| class="col3" | Example
+
!colspan="3"| Sound
| class="col4" | Notes
+
|-
|- class="row1"
+
| 1000
| class="col0 centeralign" rowspan="9" | 0x17
+
| Dispenser dispenses
| class="col1 centeralign" | EID
+
|
| class="col2 centeralign" | int
+
|-
| class="col3 centeralign" | <code>62</code>
+
| 1001
| class="col4" | Entity ID of the Object
+
| Dispenser fails to dispense
|- class="row2"
+
|
| class="col0 centeralign" | Type
+
|-
| class="col1 centeralign" | byte
+
| 1002
| class="col2 centeralign" | <code>11</code>
+
| Dispenser shoots
| class="col3" | The type of object (see [[Entities#Objects]])
+
|  
|- class="row3"
+
|-
| class="col0 centeralign" | X
+
| 1003
| class="col1 centeralign" | int
+
| Ender eye launched
| class="col2 centeralign" | <code>16080</code>
+
|  
| class="col3" | The Absolute Integer X Position of the object
+
|-
|- class="row4"
+
| 1004
| class="col0 centeralign" | Y
+
| Firework shot
| class="col1 centeralign" | int
+
|  
| class="col2 centeralign" | <code>2299</code>
+
|-
| class="col3" | The Absolute Integer Y Position of the object
+
| 1005
|- class="row5"
+
| Iron door opened
| class="col0 centeralign" | Z
+
|  
| class="col1 centeralign" | int
+
|-
| class="col2 centeralign" | <code>592</code>
+
| 1006
| class="col3" | The Absolute Integer Z Position of the object
+
| Wooden door opened
|- class="row6"
+
|  
| class="col0 centeralign" | [[Object Data]]
+
|-
| class="col1 centeralign" |  
+
| 1007
| class="col2 centeralign" |  
+
| Wooden trapdoor opened
| class="col3" | [[Object Data]]
+
|  
|- class="row6"
+
|-
| class="col0" | Total Size:
+
| 1008
| class="col1 rightalign" colspan="4" | 22 or 28 bytes
+
| Fence gate opened
|}
+
|
 +
|-
 +
| 1009
 +
| Fire extinguished
 +
|  
 +
|-
 +
| 1010
 +
| Play record
 +
| Special case, see below for more info
 +
|-
 +
| 1011
 +
| Iron door closed
 +
|
 +
|-
 +
| 1012
 +
| Wooden door closed
 +
|
 +
|-
 +
| 1013
 +
| Wooden trapdoor closed
 +
|
 +
|-
 +
| 1014
 +
| Fence gate closed
 +
|
 +
|-
 +
| 1015
 +
| Ghast warns
 +
|
 +
|-
 +
| 1016
 +
| Ghast shoots
 +
|
 +
|-
 +
| 1017
 +
| Enderdragon shoots
 +
|
 +
|-
 +
| 1018
 +
| Blaze shoots
 +
|
 +
|-
 +
| 1019
 +
| Zombie attacks wood door
 +
|
 +
|-
 +
| 1020
 +
| Zombie attacks iron door
 +
|
 +
|-
 +
| 1021
 +
| Zombie breaks wood door
 +
|
 +
|-
 +
| 1022
 +
| Wither breaks block
 +
|
 +
|-
 +
| 1023
 +
| Wither spawned
 +
|
 +
|-
 +
| 1024
 +
| Wither shoots
 +
|
 +
|-
 +
| 1025
 +
| Bat takes off
 +
|
 +
|-
 +
| 1026
 +
| Zombie infects
 +
|
 +
|-
 +
| 1027
 +
| Zombie villager converted
 +
|
 +
|-
 +
| 1028
 +
| Ender dragon death
 +
|
 +
|-
 +
| 1029
 +
| Anvil destroyed
 +
|
 +
|-
 +
| 1030
 +
| Anvil used
 +
|
 +
|-
 +
| 1031
 +
| Anvil landed
 +
|
 +
|-
 +
| 1032
 +
| Portal travel
 +
|
 +
|-
 +
| 1033
 +
| Chorus flower grown
 +
|
 +
|-
 +
| 1034
 +
| Chorus flower died
 +
|  
 +
|-
 +
| 1035
 +
| Brewing stand brewed
 +
|
 +
|-
 +
| 1036
 +
| Iron trapdoor opened
 +
|  
 +
|-
 +
| 1037
 +
| Iron trapdoor closed
 +
|
 +
|-
 +
!colspan="3"| Particle
 +
|-
 +
| 2000
 +
| Spawns 10 smoke particles, e.g. from a fire
 +
| Direction, see below
 +
|-
 +
| 2001
 +
| Block break + block break sound
 +
| Block state, as an index into the global palette
 +
|-
 +
| 2002
 +
| Splash potion. Particle effect + glass break sound.
 +
| [http://minecraft.gamepedia.com/Data_values#Potions Potion ID]
 +
|-
 +
| 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
 +
|
 +
|-
 +
| 2007
 +
| Instant splash potion
 +
| [http://minecraft.gamepedia.com/Data_values#Potions Potion ID]
 +
|-
 +
| 3000
 +
| End gateway spawn
 +
|
 +
|-
 +
| 3001
 +
| Enderdragon growl
 +
|
 +
|}
  
 +
Smoke directions:
  
{{anchor|0x18}}
+
{| class="wikitable"
 +
! ID
 +
! Direction
 +
|-
 +
| 0
 +
| South-East
 +
|-
 +
| 1
 +
| South
 +
|-
 +
| 2
 +
| South-West
 +
|-
 +
| 3
 +
| East
 +
|-
 +
| 4
 +
| (Up or middle ?)
 +
|-
 +
| 5
 +
| West
 +
|-
 +
| 6
 +
| North-East
 +
|-
 +
| 7
 +
| North
 +
|-
 +
| 8
 +
| North-West
 +
|}
  
=== Spawn Mob (0x18) ===
+
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.
  
''Server to Client''
+
==== Particle ====
  
Sent by the server when a Mob Entity is Spawned
+
Displays the named particle
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="12" | 0x18
+
|rowspan="11"| 0x24
| class="col1 centeralign" | EID
+
|rowspan="11"| Play
| class="col2 centeralign" | int
+
|rowspan="11"| Client
| class="col3 centeralign" | <code>446</code>
+
| Particle ID
| class="col4" | Entity ID
+
| Int
|- class="row2"
+
| The particle ID listed in [[#Particle|the particle data type]].
| class="col0 centeralign" | Type
+
|-
| class="col1 centeralign" | byte
+
| Long Distance
| class="col2 centeralign" | <code>91</code>
+
| Boolean
| class="col3" | The type of mob. See [[Entities#Mobs]]
+
| If true, particle distance increases from 256 to 65536
|- class="row3"
+
|-
| class="col0 centeralign" | X
+
| X
| class="col1 centeralign" | int
+
| Double
| class="col2 centeralign" | <code>13366</code>
+
| X position of the particle
| class="col3" | The Absolute Integer X Position of the object
+
|-
|- class="row4"
+
| Y
| class="col0 centeralign" | Y
+
| Double
| class="col1 centeralign" | int
+
| Y position of the particle
| class="col2 centeralign" | <code>2176</code>
+
|-
| class="col3" | The Absolute Integer Y Position of the object
+
| Z
|- class="row5"
+
| Double
| class="col0 centeralign" | Z
+
| Z position of the particle
| class="col1 centeralign" | int
+
|-
| class="col2 centeralign" | <code>1680</code>
+
| Offset X
| class="col3" | The Absolute Integer Z Position of the object
+
| Float
|- class="row6"
+
| This is added to the X position after being multiplied by random.nextGaussian()
| class="col0 centeralign" | Yaw
+
|-
| class="col1 centeralign" | byte
+
| Offset Y
| class="col2 centeralign" | <code>-27</code>
+
| Float
| class="col3" | The yaw in steps of 2p/256
+
| This is added to the Y position after being multiplied by random.nextGaussian()
|- class="row7"
+
|-
| class="col0 centeralign" | Pitch
+
| Offset Z
| class="col1 centeralign" | byte
+
| Float
| class="col2 centeralign" | <code>0</code>
+
| This is added to the Z position after being multiplied by random.nextGaussian()
| class="col3" | The pitch in steps of 2p/256
+
|-
|- class="row8"
+
| Particle Data
| class="col0 centeralign" | Head Yaw
+
| Float
| class="col1 centeralign" | byte
+
| The data of each particle
| class="col2 centeralign" |
+
|-
| class="col3" | Head yaw in steps of 2p/256
+
| Particle Count
|- class="row9"
+
| Int
| class="col0 centeralign" | Velocity Z
+
| The number of particles to create
| class="col1 centeralign" | short
+
|-
| class="col2 centeralign" | <code>0</code>
+
| Data
| class="col3" |
+
| Varies
|- class="row10"
+
| The variable data listed in [[#Particle|the particle data type]].
| class="col0 centeralign" | Velocity X
+
|}
| class="col1 centeralign" | short
 
| class="col2 centeralign" | <code>0</code>
 
| class="col3" |
 
|- class="row11"
 
| class="col0 centeralign" | Velocity Y
 
| class="col1 centeralign" | short
 
| class="col2 centeralign" | <code>0</code>
 
| class="col3" |
 
|- class="row12"
 
| class="col0 centeralign" | Metadata
 
| class="col1 centeralign" | [[Entities#Entity_Metadata_Format|Metadata]]
 
| class="col2 centeralign" | <code>127</code>
 
| class="col3" | Varies by mob, see [[Entities]]
 
|- class="row13"
 
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 27 bytes + Metadata (at least 1)
 
|}
 
  
 +
==== Update Light ====
  
{{anchor|0x19}}
+
Updates light levels for a chunk.
  
{{anchor|0x19}}
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
!colspan="2"| Field Name
 +
!colspan="2"| Field Type
 +
! Notes
 +
|-
 +
|rowspan="10"| 0x25
 +
|rowspan="10"| Play
 +
|rowspan="10"| Client
 +
|colspan="2"| Chunk X
 +
|colspan="2"| VarInt
 +
| Chunk coordinate (block coordinate divided by 16, rounded down)
 +
|-
 +
|colspan="2"| Chunk Z
 +
|colspan="2"| VarInt
 +
| Chunk coordinate (block coordinate divided by 16, rounded down)
 +
|-
 +
|colspan="2"| Sky Light Mask
 +
|colspan="2"| VarInt
 +
| Mask containing 18 bits, with the lowest bit corresponding to chunk section -1 (in the void, y=-16 to y=-1) and the highest bit for chunk section 16 (above the world, y=256 to y=271)
 +
|-
 +
|colspan="2"| Block Light Mask
 +
|colspan="2"| VarInt
 +
| Mask containing 18 bits, with the same order as sky light
 +
|-
 +
|colspan="2"| Empty Sky Light Mask
 +
|colspan="2"| VarInt
 +
| Mask containing 18 bits, which indicates sections that have 0 for all their sky light values.  If a section is set in both this mask and the main sky light mask, it is ignored for this mask and it is included in the sky light arrays (the notchian server does not create such masks).  If it is only set in this mask, it is not included in the sky light arrays.
 +
|-
 +
|colspan="2"| Empty Block Light Mask
 +
|colspan="2"| VarInt
 +
| Mask containing 18 bits, which indicates sections that have 0 for all their block light values.  If a section is set in both this mask and the main block light mask, it is ignored for this mask and it is included in the block light arrays (the notchian server does not create such masks).  If it is only set in this mask, it is not included in the block light arrays.
 +
|-
 +
|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.
 +
|-
 +
|rowspan="2"| Block Light arrays
 +
| Length
 +
|rowspan="2"| Array
 +
| VarInt
 +
| Length of the following array in bytes (always 2048)
 +
|-
 +
| Block Light array
 +
| 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.
 +
|}
  
=== Spawn Painting (0x19) ===
+
Individual block or sky light arrays are is given for each block with increasing x coordinates, within rows of increasing z coordinates, within layers of increasing y coordinates. Even-indexed items (those with an even x coordinate, starting at 0) are packed into the low bits, odd-indexed into the high bits.
  
''Server to Client''
+
==== Join Game ====
  
This packet shows location, name, and type of painting.
+
See [[Protocol Encryption]] for information on logging in.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="6" | 0x19
+
|rowspan="9"| 0x26
| class="col1 centeralign" | Entity ID
+
|rowspan="9"| Play
| class="col2 centeralign" | int
+
|rowspan="9"| Client
| class="col3 centeralign" | <code>0x00000326</code>
+
| Entity ID
| class="col4 centeralign" | Unique entity ID
+
| Int
|- class="row2"
+
| The player's Entity ID (EID)
| class="col0 centeralign" | Title
+
|-
| class="col1 centeralign" | string
+
| Gamemode
| class="col2 centeralign" | <code>Creepers</code>
+
| Unsigned Byte
| class="col3 centeralign" | Name of the painting; max length 13 (length of "SkullAndRoses")
+
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. Bit 3 (0x8) is the hardcore flag.
|- class="row3"
+
|-
| class="col0 centeralign" | X
+
| Dimension
| class="col1 centeralign" | int
+
| Int Enum
| class="col2 centeralign" | <code>50</code>
+
| -1: Nether, 0: Overworld, 1: End; also, note that this is not a VarInt but instead a regular int.
| class="col3 centeralign" | Center X coordinate
+
|-
|- class="row4"
+
| Hashed seed
| class="col0 centeralign" | Y
+
| Long
| class="col1 centeralign" | int
+
| First 8 bytes of the SHA-256 hash of the world's seed.
| class="col2 centeralign" | <code>66</code>
+
|-
| class="col3 centeralign" | Center Y coordinate
+
| Max Players
|- class="row5"
+
| Unsigned Byte
| class="col0 centeralign" | Z
+
| Was once used by the client to draw the player list, but now is ignored
| class="col1 centeralign" | int
+
|-
| class="col2 centeralign" | <code>-50</code>
+
| Level Type
| class="col3 centeralign" | Center Z coordinate
+
| String Enum (16)
|- class="row6"
+
| default, flat, largeBiomes, amplified, customized, buffet, default_1_1
| class="col0 centeralign" | Direction
+
|-
| class="col1 centeralign" | int
+
| View Distance
| class="col2 centeralign" | <code>0</code>
+
| VarInt
| class="col3 centeralign" | Direction the painting faces (0 -z, 1 -x, 2 +z, 3 +x)
+
| Render distance (2-32)
|- class="row7"
+
|-
| class="col0" | Total Size:
+
| Reduced Debug Info
| class="col1 rightalign" colspan="4" | 23 bytes + length of string
+
| 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
 +
|}
  
Calculating the center of an image: given a (width x height) grid of cells, with (0, 0) being the top left corner, the center is (max(0, width / 2 - 1), height / 2). E.g.
+
==== Map Data ====
  
2x1 (1, 0)
+
Updates a rectangular area on a {{Minecraft Wiki|map}} item.
4x4 (1, 2)
 
  
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
!colspan="2"| Field Name
 +
!colspan="2"| Field Type
 +
! Notes
 +
|-
 +
|rowspan="17"| 0x27
 +
|rowspan="17"| Play
 +
|rowspan="17"| Client
 +
|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"| Tracking Position
 +
|colspan="2"| Boolean
 +
| Specifies whether player and item frame icons are shown
 +
|-
 +
|colspan="2"| Locked
 +
|colspan="2"| Boolean
 +
| True if the map has been locked in a cartography table
 +
|-
 +
|colspan="2"| Icon Count
 +
|colspan="2"| VarInt
 +
| Number of elements in the following array
 +
|-
 +
|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
 +
| Map coordinates: -128 for highest, +127 for lowest
 +
|-
 +
| Direction
 +
| Byte
 +
| 0-15
 +
|-
 +
| Has Display Name
 +
| Boolean
 +
|
 +
|-
 +
| Display Name
 +
| Optional [[Chat]]
 +
| Only present if previous Boolean is true
 +
|-
 +
|colspan="2"| Columns
 +
|colspan="2"| Unsigned Byte
 +
| Number of columns updated
 +
|-
 +
|colspan="2"| Rows
 +
|colspan="2"| Optional Byte
 +
| Only if Columns is more than 0; number of rows updated
 +
|-
 +
|colspan="2"| X
 +
|colspan="2"| Optional Byte
 +
| Only if Columns is more than 0; x offset of the westernmost column
 +
|-
 +
|colspan="2"| Z
 +
|colspan="2"| Optional Byte
 +
| Only if Columns is more than 0; z offset of the northernmost row
 +
|-
 +
|colspan="2"| Length
 +
|colspan="2"| Optional VarInt
 +
| Only if Columns is more than 0; length of the following array
 +
|-
 +
|colspan="2"| Data
 +
|colspan="2"| Optional Array of Unsigned Byte
 +
| Only if Columns is more than 0; see {{Minecraft Wiki|Map item format}}
 +
|}
  
{{anchor|0x1A}}
+
For icons, a direction of 0 is a vertical icon and increments by 22.5&deg; (360/16).
  
=== Spawn Experience Orb (0x1A) ===
+
Types are based off of rows and columns in <code>map_icons.png</code>:
  
''Server to Client''
+
{| class="wikitable"
 +
|-
 +
! Icon type
 +
! Result
 +
|-
 +
| 0
 +
| White arrow (players)
 +
|-
 +
| 1
 +
| Green arrow (item frames)
 +
|-
 +
| 2
 +
| Red arrow
 +
|-
 +
| 3
 +
| Blue arrow
 +
|-
 +
| 4
 +
| White cross
 +
|-
 +
| 5
 +
| Red pointer
 +
|-
 +
| 6
 +
| White circle (off-map players)
 +
|-
 +
| 7
 +
| Small white circle (far-off-map players)
 +
|-
 +
| 8
 +
| Mansion
 +
|-
 +
| 9
 +
| Temple
 +
|-
 +
| 10
 +
| White Banner
 +
|-
 +
| 11
 +
| Orange Banner
 +
|-
 +
| 12
 +
| Magenta Banner
 +
|-
 +
| 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
 +
|}
  
Spawns one or more experience orbs. Coordinates are in absolute units.
+
==== Trade List ====
 +
 
 +
The list of trades a villager NPC is offering.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
!colspan="2"| Field Name
| class="col3" | Example
+
!colspan="2"| Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="5" | 0x1A
+
|rowspan="18"| 0x28
| class="col1 centeralign" | Entity ID
+
|rowspan="18"| Play
| class="col2 centeralign" | int
+
|rowspan="18"| Client
| class="col3 centeralign" | 105668
+
|-
| class="col4" |
+
| colspan="2" | Window ID
|- class="row2"
+
| colspan="2" | VarInt
| class="col1 centeralign" | x
+
| The ID of the window that is open; this is an int rather than a byte.
| class="col2 centeralign" | int
+
|-
| class="col3 centeralign" | -1143
+
| colspan="2" | Size
| class="col4" |
+
| colspan="2" | Byte
|- class="row3"
+
| The number of trades in the following array
| class="col1 centeralign" | y
+
|-
| class="col2 centeralign" | int
+
| rowspan="11" | Trades
| class="col3 centeralign" | 1952
+
| Input item 1
| class="col4" |
+
| rowspan="11" | Array
|- class="row4"
+
| [[Slot]]
| class="col1 centeralign" | z
+
| The first item the villager is buying
| class="col2 centeralign" | int
+
|-
| class="col3 centeralign" | 1166
+
| Output item
| class="col4" |
+
| [[Slot]]
|- class="row5"
+
| The item the villager is selling
| class="col1 centeralign" | count
+
|-
| class="col2 centeralign" | short
+
| Has second item
| class="col3 centeralign" | 7
+
| Boolean
| class="col4" |
+
| Whether there is a second item
|- class="row4"
+
|-
| class="col0" | Total Size:
+
| Input item 2
| class="col1 rightalign" colspan="4" | 19 bytes
+
| Optional [[Slot]]
|}
+
| The second item the villager is buying; only present if they have a second item.
 +
|-
 +
| 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
 +
|-
 +
| Maximum number of trade uses
 +
| Integer
 +
| Number of times this trade can be used
 +
|-
 +
| XP
 +
| Integer
 +
|
 +
|-
 +
| Special Price
 +
| Integer
 +
|
 +
|-
 +
| Price Multiplier
 +
| Float
 +
|
 +
|-
 +
| Demand
 +
| Integer
 +
|
 +
|-
 +
|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.
 +
|}
  
 +
[[File:1.14-merchant-slots.png|thumb|The merchant UI, for reference]]
 +
{{-}}
  
{{anchor|0x1B}}
+
==== Entity Position ====
=== Entity Velocity (0x1C) ===
 
  
''Server to Client''
+
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]] should be sent instead.
  
This packet is new to version 4 of the protocol, and is believed to be Entity Velocity/Motion.
+
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.
  
Velocity is believed to be in units of 1/32000 of a block per server tick (200ms);
+
{| class="wikitable"
for example, -1343 would move (-1343 / 32000) = -0.04196875 blocks per tick (or -0.20984375 blocks per second).
+
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="5"| 0x29
 +
|rowspan="5"| Play
 +
|rowspan="5"| Client
 +
| Entity ID
 +
| VarInt
 +
|
 +
|-
 +
| 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>
 +
|-
 +
| On Ground
 +
| Boolean
 +
|
 +
|}
  
Each axis' velocity is capped between -0.9 and 0.9 blocks per tick (packet values -28800 to 28800).
+
==== Entity Position and Rotation ====
  
(This packet data values are not fully verified)
+
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"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="4" | 0x1C
+
|rowspan="7"| 0x2A
| class="col1 centeralign" | Entity ID
+
|rowspan="7"| Play
| class="col2 centeralign" | int
+
|rowspan="7"| Client
| class="col3 centeralign" | <code>1805</code>
+
| Entity ID
| class="col4" |
+
| VarInt
The entity ID
+
|  
|- class="row2"
+
|-
| class="col0 centeralign" | Velocity X
+
| Delta X
| class="col1 centeralign" | short
+
| Short
| class="col2 centeralign" | <code>-1343</code>
+
| Change in X position as <code>(currentX * 32 - prevX * 32) * 128</code>
| class="col3" |
+
|-
Velocity on the X axis
+
| Delta Y
|- class="row3"
+
| Short
| class="col0 centeralign" | Velocity Y
+
| Change in Y position as <code>(currentY * 32 - prevY * 32) * 128</code>
| class="col1 centeralign" | short
+
|-
| class="col2 centeralign" | <code>0</code>
+
| Delta Z
| class="col3" |
+
| Short
Velocity on the Y axis
+
| Change in Z position as <code>(currentZ * 32 - prevZ * 32) * 128</code>
|- class="row4"
+
|-
| class="col0 centeralign" | Velocity Z
+
| Yaw
| class="col1 centeralign" | short
+
| Angle
| class="col2 centeralign" | <code>0</code>
+
| New angle, not a delta
| class="col3" |
+
|-
Velocity on the Z axis
+
| Pitch
|- class="row5"
+
| Angle
| class="col0" | Total Size:
+
| New angle, not a delta
| class="col1 rightalign" colspan="4" | 11 bytes
+
|-
|}
+
| On Ground
 +
| Boolean
 +
|  
 +
|}
  
 +
==== Entity Rotation ====
 +
 +
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"| 0x2B
 +
|rowspan="4"| Play
 +
|rowspan="4"| Client
 +
| Entity ID
 +
| VarInt
 +
|
 +
|-
 +
| Yaw
 +
| Angle
 +
| New angle, not a delta
 +
|-
 +
| Pitch
 +
| Angle
 +
| New angle, not a delta
 +
|-
 +
| On Ground
 +
| Boolean
 +
|
 +
|}
  
{{anchor|0x1D}}
+
==== Entity Movement ====
=== Destroy Entity (0x1D) ===
 
  
''Server to Client''
+
This packet may be used to initialize an entity.
  
Sent by the server when an list of Entities is to be destroyed on the client.
+
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"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 " rowspan="2" | 0x1D
+
|rowspan="1"| 0x2C
| class="col1 centeralign" | Entity Count
+
|rowspan="1"| Play
| class="col2 centeralign" | byte
+
|rowspan="1"| Client
| class="col3 centeralign" | <code>3</code>
+
| Entity ID
| class="col4 centeralign" | The amount of entities which should be destroyed
+
| VarInt
|- class="row21"
+
|  
| class="col0 centeralign" | Entity IDs
+
|}
| class="col1 centeralign" | array of int
 
| class="col2 centeralign" | <code>452, 546, 123</code>
 
| class="col3 centeralign" | The list of entity ids which should be destroyed
 
|- class="row32"
 
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 2 + (entity count * 4) bytes
 
|}
 
  
 +
==== Vehicle Move (clientbound) ====
  
{{anchor|0x1E}}
+
Note that all fields use absolute positioning and do not allow for relative positioning.
  
{{anchor|0x1E}}
+
{| class="wikitable"
=== Entity (0x1E) ===
+
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="5"| 0x2D
 +
|rowspan="5"| Play
 +
|rowspan="5"| Client
 +
| X
 +
| Double
 +
| Absolute position (X coordinate)
 +
|-
 +
| Y
 +
| Double
 +
| Absolute position (Y coordinate)
 +
|-
 +
| Z
 +
| Double
 +
| Absolute position (Z coordinate)
 +
|-
 +
| Yaw
 +
| Float
 +
| Absolute rotation on the vertical axis, in degrees
 +
|-
 +
| Pitch
 +
| Float
 +
| Absolute rotation on the horizontal axis, in degrees
 +
|}
  
''Server to Client''
+
==== Open Book ====
  
Most entity-related packets are subclasses of this packet. When sent from the server to the client, it may initialize the entry.
+
Sent when a player right clicks with a signed book. This tells the client to open the book GUI.
  
For player entities, either this packet or any move/look packet is sent every game tick.
+
{| class="wikitable"
So the meaning of this packet is basically that the entity did not move/look since the last such packet.
+
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="1"| 0x2E
 +
|rowspan="1"| Play
 +
|rowspan="1"| Client
 +
| Hand
 +
| VarInt enum
 +
| 0: Main hand, 1: Off hand
 +
|}
 +
 
 +
==== Open Window ====
 +
 
 +
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.  For horses, use [[#Open Horse Window|Open Horse Window]].
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" | 0x1E
+
|rowspan="3"| 0x2F
| class="col1 centeralign" | EID
+
|rowspan="3"| Play
| class="col2 centeralign" | int
+
|rowspan="3"| Client
| class="col3 centeralign" | <code>446</code>
+
| Window ID
| class="col4 centeralign" | Entity ID
+
| VarInt
|- class="row2"
+
| A unique id number for the window to be displayed. Notchian server implementation is a counter, starting at 1.
| class="col0" | Total Size:
+
|-
| class="col1 rightalign" colspan="4" | 5 bytes
+
| Window Type
|}
+
| VarInt
 +
| The window type to use for display. Contained in the <code>minecraft:menu</code> regisry; see [[Inventory]] for the different values.
 +
|-
 +
| Window Title
 +
| [[Chat]]
 +
| The title of the window
 +
|}
  
 +
==== Open Sign Editor ====
  
{{anchor|0x1F}}
+
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 Change|Block Change]] first.
=== Entity Relative Move (0x1F) ===
 
  
''Server to Client''
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="1"| 0x30
 +
|rowspan="1"| Play
 +
|rowspan="1"| Client
 +
| Location
 +
| Position
 +
|
 +
|}
  
This packet is sent by the server when an entity moves less then 4 blocks; if an entity moves more than 4 blocks [[#0x22|Entity Teleport]] should be sent instead.
+
==== Craft Recipe Response ====
  
This packet allows at most four blocks movement in any direction, because byte range is from -128 to 127. Movement is an offset of Absolute Int; to convert relative move to block coordinate offset, divide by 32.
+
Response to the serverbound packet ([[#Craft Recipe Request|Craft Recipe Request]]), with the same recipe ID. Appears to be used to notify the UI.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="4" | 0x1F
+
|rowspan="2"| 0x31
| class="col1 centeralign" | EID
+
|rowspan="2"| Play
| class="col2 centeralign" | int
+
|rowspan="2"| Client
| class="col3 centeralign" | <code>459</code>
+
| Window ID
| class="col4" | Entity ID
+
| Byte
|- class="row2"
+
|
| class="col0 centeralign" | dX
+
|-
| class="col1 centeralign" | byte
+
| Recipe
| class="col2 centeralign" | <code>1</code>
+
| Identifier
| class="col3" | X axis Relative movement as an Absolute Integer
+
| A recipe ID
|- class="row3"
+
|}
| class="col0 centeralign" | dY
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | <code>-7</code>
 
| class="col3" | Y axis Relative movement as an Absolute Integer
 
|- class="row4"
 
| class="col0 centeralign" | dZ
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | <code>5</code>
 
| class="col3" | Z axis Relative movement as an Absolute Integer
 
|- class="row5"
 
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 8 bytes
 
|}
 
  
 +
==== Player Abilities (clientbound) ====
  
{{anchor|0x20}}
+
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.
  
=== Entity Look (0x20) ===
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="3"| 0x32
 +
|rowspan="3"| Play
 +
|rowspan="3"| Client
 +
| Flags
 +
| Byte
 +
| Bit field, see below
 +
|-
 +
| Flying Speed
 +
| Float
 +
| 0.05 by default
 +
|-
 +
| Field of View Modifier
 +
| Float
 +
| Modifies the field of view, like a speed potion. A Notchian server will use the same value as the movement speed sent in the [[Protocol#Entity_Properties|Entity Properties]] packet, which defaults to 0.1 for players.
 +
|}
 +
 
 +
About the flags:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Field
 +
! Bit
 +
|-
 +
| Invulnerable
 +
| 0x01
 +
|-
 +
| Flying
 +
| 0x02
 +
|-
 +
| Allow Flying
 +
| 0x04
 +
|-
 +
| Creative Mode (Instant Break)
 +
| 0x08
 +
|}
 +
 
 +
==== Combat Event ====
 +
 
 +
Originally used for metadata for twitch streaming circa 1.8.  Now only used to display the game over screen (with enter combat and end combat completely ignored by the Notchain client)
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
!colspan="2"| Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="8"| 0x33
 +
|rowspan="8"| Play
 +
|rowspan="8"| Client
 +
|colspan="2"| Event
 +
| VarInt Enum
 +
| Determines the layout of the remaining packet
 +
|-
 +
! Event
 +
! Field Name
 +
!
 +
!
 +
|-
 +
| 0: enter combat
 +
| ''no fields''
 +
| ''no fields''
 +
|
 +
|-
 +
|rowspan="2"| 1: end combat
 +
| Duration
 +
| VarInt
 +
| Length of the combat in ticks.
 +
|-
 +
| Entity ID
 +
| Int
 +
| ID of the primary opponent of the ended combat, or -1 if there is no obvious primary opponent.
 +
|-
 +
|rowspan="3"| 2: entity dead
 +
| Player ID
 +
| VarInt
 +
| Entity ID of the player that died (should match the client's entity ID).
 +
|-
 +
| Entity ID
 +
| Int
 +
| The killing entity's ID, or -1 if there is no obvious killer.
 +
|-
 +
| Message
 +
| [[Chat]]
 +
| The death message
 +
|}
 +
 
 +
==== Player Info ====
 +
 
 +
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"| 0x34
 +
|rowspan="19"| Play
 +
|rowspan="19"| Client
 +
|colspan="4"| Action
 +
|colspan="3"| VarInt
 +
| Determines the rest of the Player format after the UUID
 +
|-
 +
|colspan="4"| Number Of Players
 +
|colspan="3"| VarInt
 +
| Number of elements in the following array
 +
|-
 +
|rowspan="17"| Player
 +
|colspan="3"| UUID
 +
|rowspan="17"| Array
 +
|colspan="2"| UUID
 +
|
 +
|-
 +
! Action
 +
!colspan="2"| Field Name
 +
!colspan="2"|
 +
!
 +
|-
 +
|rowspan="10"| 0: add player
 +
|colspan="2"| Name
 +
|colspan="2"| String (16)
 +
|
 +
|-
 +
|colspan="2"| Number Of Properties
 +
|colspan="2"| VarInt
 +
| Number of elements in the following array
 +
|-
 +
|rowspan="4"| Property
 +
| Name
 +
|rowspan="4"| Array
 +
| String (32767)
 +
|
 +
|-
 +
| Value
 +
| String (32767)
 +
|
 +
|-
 +
| Is Signed
 +
| Boolean
 +
|
 +
|-
 +
| Signature
 +
| Optional String (32767)
 +
| Only if Is Signed is true
 +
|-
 +
|colspan="2"| Gamemode
 +
|colspan="2"| VarInt
 +
|
 +
|-
 +
|colspan="2"| Ping
 +
|colspan="2"| VarInt
 +
| Measured in milliseconds
 +
|-
 +
|colspan="2"| Has Display Name
 +
|colspan="2"| Boolean
 +
|
 +
|-
 +
|colspan="2"| Display Name
 +
|colspan="2"| Optional [[Chat]]
 +
| Only if Has Display Name is true
 +
|-
 +
| 1: update gamemode
 +
|colspan="2"| Gamemode
 +
|colspan="2"| VarInt
 +
|
 +
|-
 +
| 2: update latency
 +
|colspan="2"| Ping
 +
|colspan="2"| VarInt
 +
| Measured in milliseconds
 +
|-
 +
|rowspan="2"| 3: update display name
 +
|colspan="2"| Has Display Name
 +
|colspan="2"| Boolean
 +
|
 +
|-
 +
|colspan="2"| Display Name
 +
|colspan="2"| Optional [[Chat]]
 +
| Only send if Has Display Name is true
 +
|-
 +
| 4: remove player
 +
|colspan="2"| ''no fields''
 +
|colspan="2"| ''no fields''
 +
|
 +
|}
  
''Server to Client''
+
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.
  
This packet is sent by the server when an entity rotates.  Example: "Yaw" field 64 means a 90 degree turn.
+
Ping values correspond with icons in the following way:
 +
* A ping that negative (i.e. not known to the server yet) will result in the no connection icon.
 +
* A ping under 150 milliseconds will result in 5 bars
 +
* A ping under 300 milliseconds will result in 4 bars
 +
* A ping under 600 milliseconds will result in 3 bars
 +
* A ping under 1000 milliseconds (1 second) will result in 2 bars
 +
* A ping greater than or equal to 1 second will result in 1 bar.
 +
 
 +
==== Face Player ====
 +
 
 +
Used to rotate the client player to face the given location or entity (for <code>/teleport [<targets>] <x> <y> <z> facing</code>).
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="3" | 0x20
+
|rowspan="8"| 0x35
| class="col1 centeralign" | EID
+
|rowspan="8"| Play
| class="col2 centeralign" | int
+
|rowspan="8"| Client
| class="col3 centeralign" | <code>459</code>
+
|-
| class="col4" | Entity ID
+
| Feet/eyes
|- class="row2"
+
| VarInt enum
| class="col0 centeralign" | Yaw
+
| Values are feet=0, eyes=1.  If set to eyes, aims using the head position; otherwise aims using the feet position.
| class="col1 centeralign" | byte
+
|-
| class="col2 centeralign" | <code>126</code>
+
| Target x
| class="col3" | The X Axis rotation as a fraction of 360
+
| Double
|- class="row3"
+
| x coordinate of the point to face towards
| class="col0 centeralign" | Pitch
+
|-
| class="col1 centeralign" | byte
+
| Target y
| class="col2 centeralign" | <code>0</code>
+
| Double
| class="col3" | The Y Axis rotation as a fraction of 360
+
| y coordinate of the point to face towards
|- class="row4"
+
|-
| class="col0" | Total Size:
+
| Target z
| class="col1 rightalign" colspan="4" | 7 bytes
+
| Double
|}
+
| z coordinate of the point to face towards
 +
|-
 +
| Is entity
 +
| Boolean
 +
| If true, additional information about an entity is provided.
 +
|-
 +
| Entity ID
 +
| Optional VarInt
 +
| Only if is entity is true &mdash; the entity to face towards
 +
|-
 +
| Entity feet/eyes
 +
| Optional VarInt enum
 +
| Whether to look at the entity's eyes or feet.  Same values and meanings as before, just for the entity's head/feet.
 +
|}
 +
 
 +
If the entity given by entity ID cannot be found, this packet should be treated as if is entity was false.
 +
 
 +
==== 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.
  
{{anchor|0x21}}
+
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?)”.
=== Entity Look and Relative Move (0x21) ===
 
  
''Server to Client''
+
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”.
  
This packet is sent by the server when an entity rotates and moves.
+
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.
Since a byte range is limited from -128 to 127, and movement is offset of Absolute Int,
+
 
this packet allows at most four blocks movement in any direction. (-128/32 == -4)
+
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="6" | 0x21
+
|rowspan="7"| 0x36
| class="col1 centeralign" | EID
+
|rowspan="7"| Play
| class="col2 centeralign" | int
+
|rowspan="7"| Client
| class="col3 centeralign" | <code>459</code>
+
| X
| class="col4" | Entity ID
+
| Double
|- class="row2"
+
| Absolute or relative position, depending on Flags
| class="col0 centeralign" | dX
+
|-
| class="col1 centeralign" | byte
+
| Y
| class="col2 centeralign" | <code>1</code>
+
| Double
| class="col3" | X axis Relative movement as an Absolute Integer
+
| Absolute or relative position, depending on Flags
|- class="row3"
+
|-
| class="col0 centeralign" | dY
+
| Z
| class="col1 centeralign" | byte
+
| Double
| class="col2 centeralign" | <code>-7</code>
+
| Absolute or relative position, depending on Flags
| class="col3" | Y axis Relative movement as an Absolute Integer
+
|-
|- class="row4"
+
| Yaw
| class="col0 centeralign" | dZ
+
| Float
| class="col1 centeralign" | byte
+
| Absolute or relative rotation on the X axis, in degrees
| class="col2 centeralign" | <code>5</code>
+
|-
| class="col3" | Z axis Relative movement as an Absolute Integer
+
| Pitch
|- class="row5"
+
| Float
| class="col0 centeralign" | Yaw
+
| Absolute or relative rotation on the Y axis, in degrees
| class="col1 centeralign" | byte
+
|-
| class="col2 centeralign" | <code>126</code>
+
| Flags
| class="col3" | The X Axis rotation as a fraction of 360
+
| Byte
|- class="row6"
+
| Bit field, see below
| class="col0 centeralign" | Pitch
+
|-
| class="col1 centeralign" | byte
+
| Teleport ID
| class="col2 centeralign" | <code>0</code>
+
| VarInt
| class="col3" | The Y Axis rotation as a fraction of 360
+
| Client should confirm this packet with [[#Teleport Confirm|Teleport Confirm]] containing the same Teleport ID
|- class="row7"
+
|}
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 10 bytes
 
|}
 
  
 +
About the Flags field:
  
{{anchor|0x22}}
+
<Dinnerbone> It's a bitfield, X/Y/Z/Y_ROT/X_ROT. If X is set, the x value is relative and not absolute.
=== Entity Teleport (0x22) ===
 
  
''Server to Client''
+
{| class="wikitable"
 +
|-
 +
! Field
 +
! Bit
 +
|-
 +
| X
 +
| 0x01
 +
|-
 +
| Y
 +
| 0x02
 +
|-
 +
| Z
 +
| 0x04
 +
|-
 +
| Y_ROT
 +
| 0x08
 +
|-
 +
| X_ROT
 +
| 0x10
 +
|}
  
This packet is sent by the server when an entity moves more than 4 blocks.
+
==== Unlock Recipes ====
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="6" | 0x22
+
|rowspan="10"| 0x37
| class="col1 centeralign" | EID
+
|rowspan="10"| Play
| class="col2 centeralign" | int
+
|rowspan="10"| Client
| class="col3 centeralign" | <code>459</code>
+
|-
| class="col4" | Entity ID
+
| Action
|- class="row2"
+
| VarInt
| class="col0 centeralign" | X
+
| 0: init, 1: add, 2: remove
| class="col1 centeralign" | int
+
|-
| class="col2 centeralign" | <code>14162</code>
+
| Crafting Recipe Book Open
| class="col3" | X axis position as an Absolute Integer
+
| Boolean
|- class="row3"
+
| If true, then the crafting recipe book will be open when the player opens its inventory.
| class="col0 centeralign" | Y
+
|-
| class="col1 centeralign" | int
+
| Crafting Recipe Book Filter Active
| class="col2 centeralign" | <code>2176</code>
+
| Boolean
| class="col3" | Y axis position as an Absolute Integer
+
| If true, then the filtering option is active when the players opens its inventory.
|- class="row4"
+
|-
| class="col0 centeralign" | Z
+
| Smelting Recipe Book Open
| class="col1 centeralign" | int
+
| Boolean
| class="col2 centeralign" | <code>1111</code>
+
| If true, then the smelting recipe book will be open when the player opens its inventory.
| class="col3" | Z axis position as an Absolute Integer
+
|-
|- class="row5"
+
| Smelting Recipe Book Filter Active
| class="col0 centeralign" | Yaw
+
| Boolean
| class="col1 centeralign" | byte
+
| If true, then the filtering option is active when the players opens its inventory.
| class="col2 centeralign" | <code>126</code>
+
|-
| class="col3" | The X Axis rotation as a fraction of 360
+
| Array size 1
|- class="row6"
+
| VarInt
| class="col0 centeralign" | Pitch
+
| Number of elements in the following array
| class="col1 centeralign" | byte
+
|-
| class="col2 centeralign" | <code>0</code>
+
| Recipe IDs
| class="col3" | The Y Axis rotation as a fraction of 360
+
| Array of Identifier
|- class="row7"
+
|
| class="col0" | Total Size:
+
|-
| class="col1 rightalign" colspan="4" | 19 bytes
+
| Array size 2
|}
+
| Optional VarInt
 +
| Number of elements in the following array, only present if mode is 0 (init)
 +
|-
 +
| Recipe IDs
 +
| Optional Array of Identifier, only present if mode is 0 (init)
 +
|
 +
|}
 +
Action:
 +
* 0 (init) = All the recipes in the list 2 will added to the recipe book. All the recipes in list 1 will be tagged as displayed, recipes that aren't tagged will be shown in the notification. VERIFY LIST ORDER?
 +
* 1 (add) = All the recipes in the list are added and their icon will be shown in the notification.
 +
* 2 (remove) = Remove all the recipes in the list. This allows them to re-displayed when they are readded.
  
 +
==== Destroy Entities ====
  
{{anchor|0x23}}
+
Sent by the server when a list of entities is to be destroyed on the client.
=== Entity Head Look (0x23) ===
 
  
''Server to Client''
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="2"| 0x38
 +
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Count
 +
| VarInt
 +
| Number of elements in the following array
 +
|-
 +
| Entity IDs
 +
| Array of VarInt
 +
| The list of entities of destroy
 +
|}
 +
 
 +
==== Remove Entity Effect ====
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="2"| 0x39
 +
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Entity ID
 +
| VarInt
 +
|
 +
|-
 +
| Effect ID
 +
| Byte
 +
| See {{Minecraft Wiki|Status effect#List of effects|this table}}
 +
|}
 +
 
 +
==== Resource Pack Send ====
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="2"| 0x3A
 +
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| URL
 +
| String (32767)
 +
| The URL to the resource pack.
 +
|-
 +
| Hash
 +
| String (40)
 +
| 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
 +
|}
 +
 
 +
==== Respawn ====
 +
 
 +
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="4"| 0x3B
 +
|rowspan="4"| Play
 +
|rowspan="4"| Client
 +
| Dimension
 +
| Int Enum
 +
| -1: The Nether, 0: The Overworld, 1: The End
 +
|-
 +
| Hashed seed
 +
| Long
 +
| First 8 bytes of the SHA-256 hash of the world's seed.
 +
|-
 +
| Gamemode
 +
| Unsigned Byte
 +
| 0: survival, 1: creative, 2: adventure, 3: spectator. The hardcore flag is not included
 +
|-
 +
| Level Type
 +
| String (16)
 +
| Same as [[#Join Game|Join Game]]
 +
|}
 +
 
 +
{{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.}}
 +
 
 +
==== Entity Head Look ====
  
 
Changes the direction an entity's head is facing.
 
Changes the direction an entity's head is facing.
 +
 +
While sending the Entity Look packet changes the vertical rotation of the head, sending this packet appears to be necessary to rotate the head horizontally.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! Field Name
| class="col3" | Example
+
! Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="2" | 0x23
+
|rowspan="2"| 0x3C
| class="col1 centeralign" | Entity ID
+
|rowspan="2"| Play
| class="col2 centeralign" | int
+
|rowspan="2"| Client
| class="col3 centeralign" |  
+
| Entity ID
| class="col4" |  
+
| VarInt
|- class="row2"
+
|  
| class="col0 centeralign" | Head Yaw
+
|-
| class="col1 centeralign" | byte
+
| Head Yaw
| class="col2 centeralign" |
+
| Angle
| class="col3" | Head yaw in steps of 2p/256
+
| New angle, not a delta
|- class="row3"
+
|}
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 6 bytes
 
|}
 
  
 +
==== Select Advancement Tab ====
  
{{anchor|0x26}}
+
Sent by the server to indicate that the client should switch advancement tab. Sent either when the client switches tab in the GUI or when an advancement in another tab is made.
=== Entity Status (0x26) ===
+
 
 +
{| class="wikitable"
 +
! Packet ID
 +<