Difference between revisions of "Protocol"

From wiki.vg
Jump to navigation Jump to search
(→‎Status: clarified ping/pong payload; formatting)
m (Update compression value)
 
(385 intermediate revisions by 56 users not shown)
Line 1: Line 1:
{{Box|
+
{{Box
BORDER = #9999FF|
+
  |BORDER = #9999FF
BACKGROUND = #99CCFF|
+
  |BACKGROUND = #99CCFF
WIDTH = 100%|
+
  |WIDTH = 100%
ICON = |
+
  |ICON =  
HEADING = Heads up! |
+
  |HEADING = Heads up!
CONTENT =  
+
  |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 article is about the protocol for the latest '''stable''' release of Minecraft computer edition. For the current pre-release protocol, see [[Pre-release protocol]].
 
 
}}
 
}}
  
This page presents a dissection of the current '''[https://minecraft.net/ Minecraft] protocol'''. The protocol for Pocket Minecraft is substantially different, and is documented at [[Pocket Minecraft Protocol]].
+
This page presents a dissection of the current '''[https://minecraft.net/ Minecraft] protocol'''.
  
If you're having trouble, check out the [[Protocol FAQ|FAQ]] or ask for help in the IRC channel ([irc://irc.freenode.net/mcdevs #mcdevs on irc.freenode.net]).
+
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 attribution to #mcdevs if you copy any of the contents of this page for publication elsewhere.
 
'''Note:''' While you may use the contents of this page without restriction to create servers, clients, bots, etc… you still need to provide attribution to #mcdevs if you copy any of the contents of this page for publication elsewhere.
Line 19: Line 18:
 
== Definitions ==
 
== Definitions ==
  
The Minecraft server accepts connections from TCP clients and communicates with them using ''packets''. A packet is a sequence of bytes sent over the TCP connection. The meaning of a packet depends both on its packet ID and the current state of the connection. The initial state of each connection is [[#Handshaking|Handshaking]], and state is switched using the packets [[#Handshake|Handshake]] ([[#Handshaking|Handshaking]], 0x00, serverbound) and [[#Login Success|Login Success]] ([[#Login|Login]], 0x02, clientbound).
+
The Minecraft server accepts connections from TCP clients and communicates with them using ''packets''. A packet is a sequence of bytes sent over the TCP connection. The meaning of a packet depends both on its packet ID and the current state of the connection. The initial state of each connection is [[#Handshaking|Handshaking]], and state is switched using the packets [[#Handshake|Handshake]] and [[#Login Success|Login Success]].
  
 
=== Data types ===
 
=== Data types ===
  
<!-- Transcluded contents of Data Types article in here - go to that page if you want to edit it -->
+
{{:Data types}} <!-- Transcluded contents of Data types article in here go to that page if you want to edit it -->
 
 
{{:Data Types}}
 
  
 
=== Other definitions ===
 
=== Other definitions ===
Line 44: Line 41:
 
  |-
 
  |-
 
  | XYZ
 
  | XYZ
  | 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.
+
  | 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.
 
  |-
 
  |-
  !colspan="2"| See also: [[Units of Measurement]]
+
  | Notchian
 +
| The official implementation of vanilla Minecraft as developed and released by Mojang.
 
  |}
 
  |}
  
Line 60: Line 66:
 
  | Length
 
  | Length
 
  | VarInt
 
  | VarInt
  | Length of packet data + length of the packet ID
+
  | Length of Packet ID + Data
 
  |-
 
  |-
 
  | Packet ID
 
  | Packet ID
Line 73: Line 79:
 
=== With compression ===
 
=== With compression ===
  
Once a [[#Set Compression|Set Compression]] packet is sent, [[wikipedia:Zlib|zlib]] compression is enabled for all following packets. The format of a packet changes slighty to include the size of the uncompressed packet.
+
Once a [[#Set Compression|Set Compression]] packet (with a non-negative threshold) is sent, [[wikipedia:Zlib|zlib]] compression is enabled for all following packets. The format of a packet changes slighty to include the size of the uncompressed packet.
  
 
{| class=wikitable
 
{| class=wikitable
Line 93: Line 99:
 
  |rowspan="2"| Yes
 
  |rowspan="2"| Yes
 
  | Packet ID
 
  | Packet ID
  | Varint
+
  | VarInt
 
  | zlib compressed packet ID (see the sections below)
 
  | zlib compressed packet ID (see the sections below)
 
  |-
 
  |-
Line 105: Line 111:
 
If Data Length is set to zero, then the packet is uncompressed; otherwise it is the size of the uncompressed packet.
 
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 [[#Set Compression|Set Compression]] packet, otherwise the client/server will disconnect.
+
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 a [[#Set Compression|Set Compression]] packet with a Threshold of -1.
+
Compression can be disabled by sending the packet [[#Set Compression|Set Compression]] with a negative Threshold, or not sending the Set Compression packet at all.
  
 
== Handshaking ==
 
== Handshaking ==
 +
 +
=== 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 ===
 
=== Serverbound ===
Line 126: Line 136:
 
  |-
 
  |-
 
  |rowspan="4"| 0x00
 
  |rowspan="4"| 0x00
  |rowspan="4"| Handshake
+
  |rowspan="4"| Handshaking
 
  |rowspan="4"| Server
 
  |rowspan="4"| Server
 
  | Protocol Version
 
  | Protocol Version
 
  | VarInt
 
  | VarInt
  | See [[protocol version numbers]] (currently 47)
+
  | See [[protocol version numbers]] (currently 578 in Minecraft 1.15.2)
 
  |-
 
  |-
 
  | Server Address
 
  | Server Address
  | String
+
  | String (255)
  | hostname or IP, e.g. localhost or 127.0.0.1<!-- does this support IPv6? -->
+
  | 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
 
  | Server Port
 
  | Unsigned Short
 
  | Unsigned Short
  | default is 25565
+
  | Default is 25565.  The Notchian server does not use this information.
 
  |-
 
  |-
 
  | Next State
 
  | Next State
  | VarInt
+
  | VarInt Enum
 
  | 1 for [[#Status|status]], 2 for [[#Login|login]]
 
  | 1 for [[#Status|status]], 2 for [[#Login|login]]
 
  |}
 
  |}
  
== Play ==
+
==== Legacy Server List Ping ====
  
=== Clientbound ===
+
{{Warning|This packet uses a nonstandard format. It is never length-prefixed, and the packet ID is an Unsigned Byte instead of a VarInt.}}
  
==== Keep Alive ====
+
While not technically part of the current protocol, legacy clients may send this packet to initiate [[Server List Ping]], and modern servers should handle it correctly.
 
 
The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same packet. If the client does not respond to them for over 30 seconds, the server kicks the client. Vice versa, if the server does not send any keep-alives for 20 seconds, the client will disconnect and yields a "Timed out" exception.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 161: Line 169:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="1"| 0x00
+
  | 0xFE
  |rowspan="1"| Play
+
  | Handshaking
  |rowspan="1"| Client
+
  | Server
  | Keep Alive ID
+
  | Payload
  | VarInt
+
  | Unsigned Byte
  |  
+
  | always 1 (<code>0x01</code>)
 
  |}
 
  |}
  
==== Join Game ====
+
See [[Server List Ping#1.6]] for the details of the protocol that follows this packet.
 +
 
 +
== Status ==
 +
{{Main|Server List Ping}}
 +
 
 +
=== Clientbound ===
  
See [[Protocol Encryption]] for information on logging in.
+
==== Response ====
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 181: Line 194:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="7"| 0x01
+
  |rowspan="2"| 0x00
  |rowspan="7"| Play
+
  |rowspan="2"| Status
  |rowspan="7"| Client
+
  |rowspan="2"| Client
  | Entity ID
+
  | JSON Length
  | Int
+
  | VarInt
| The player's Entity ID (EID)
 
 
  |-
 
  |-
  | Gamemode
+
  | JSON Response
  | Unsigned Byte
+
  | String (32767)
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. Bit 3 (0x8) is the hardcore flag.
+
  | See [[Server List Ping#Response]]
|-
+
  |}
| Dimension
+
 
| Byte
+
==== Pong ====
| -1: Nether, 0: Overworld, 1: End
+
 
|-
 
| Difficulty
 
| Unsigned Byte
 
| 0: peaceful, 1: easy, 2: normal, 3: hard
 
|-
 
| Max Players
 
| Unsigned Byte
 
| Used by the client to draw the player list
 
|-
 
| Level Type
 
| String
 
| default, flat, largeBiomes, amplified, default_1_1
 
|-
 
  | Reduced Debug Info
 
| Boolean
 
| If true, a Notchian client shows reduced information on the {{Minecraft Wiki|debug screen}}.
 
  |}
 
 
 
{{Warning|If the Dimension isn't valid then the client will crash}}
 
 
 
==== Chat Message ====  
 
 
 
Identifying the difference between Chat/System Message is important as it helps respect the user's chat visibility options. While Position 2 accepts json formatting it will not display, old style formatting works
 
 
 
 
{| class="wikitable"
 
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
Line 227: Line 215:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x02
+
  |rowspan="1"| 0x01
  |rowspan="2"| Play
+
  |rowspan="1"| Status
  |rowspan="2"| Client
+
  |rowspan="1"| Client
  | JSON Data
+
  | Payload
| [[Chat]]
+
  | Long
| Limited to 32767 bytes
+
  | Should be the same as sent by the client
|-
 
| Position
 
  | Byte
 
  | 0: chat (chat box), 1: system message (chat box), 2: above action bar
 
 
  |}
 
  |}
  
{{Warning|Malformed JSON will disconnect the client}}
+
=== Serverbound ===
  
==== Time Update ====
+
==== Request ====
 
 
Time is based on ticks, where 20 ticks happen every second. There are 24000 ticks in a day, making Minecraft days exactly 20 minutes long.
 
 
 
The time of day is based on the timestamp modulo 24000. 0 is sunrise, 6000 is noon, 12000 is sunset, and 18000 is midnight.
 
 
 
The default SMP server increments the time by <code>20</code> every second.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 257: Line 235:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x03
+
  |rowspan="1"| 0x00
  |rowspan="2"| Play
+
  | Status
  |rowspan="2"| Client
+
| Server
| World Age
+
  |colspan="3"| ''no fields''
| Long
 
| In ticks; not changed by server commands
 
|-
 
| Time of day
 
| Long
 
| The world (or region) time, in ticks. If negative the sun will stop moving at the Math.abs of the time
 
 
  |}
 
  |}
  
==== Entity Equipment ====
+
==== Ping ====
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 279: Line 251:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x04
+
  |rowspan="1"| 0x01
  |rowspan="3"| Play
+
  |rowspan="1"| Status
  |rowspan="3"| Client
+
  |rowspan="1"| Server
| Entity ID
+
  | Payload
| VarInt
+
  | Long
| Entity's EID
+
  | May be any number. Notchian clients use a system-dependent time value which is counted in milliseconds.
|-
 
  | Slot
 
  | Short
 
  | Equipment slot. 0: held, 1–4: armor slot (1: boots, 2: leggings, 3: chestplate, 4: helmet)
 
|-
 
| Item
 
| [[Slot Data|Slot]]
 
| Item in slot format
 
 
  |}
 
  |}
  
==== Spawn Position ====
+
== Login ==
  
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.
+
The login process is as follows:
  
{| class="wikitable"
+
# C→S: [[#Handshake|Handshake]] with Next State set to 2 (login)
! Packet ID
+
# C→S: [[#Login Start|Login Start]]
! State
+
# S→C: [[#Encryption Request|Encryption Request]]
! Bound To
+
# Client auth
! Field Name
+
# C→S: [[#Encryption Response|Encryption Response]]
! Field Type
+
# Server auth, both enable encryption
! Notes
+
# S→C: [[#Set Compression|Set Compression]] (optional)
|-
+
# S→C: [[#Login Success|Login Success]]
|rowspan="1"| 0x05
+
 
|rowspan="1"| Play
+
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]].
|rowspan="1"| Client
+
 
| Location
+
For unauthenticated ("cracked"/offline-mode) 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]].
| Position
 
| Spawn location
 
|}
 
  
==== Update Health ====
+
See [[Protocol Encryption]] for details.
  
Sent by the server to update/set the health of the player it is sent to.
+
=== Clientbound ===
  
Food {{Minecraft Wiki|Food#Hunger vs. Saturation|saturation}} acts as a food “overcharge”. Food values will not decrease while the saturation is over zero. Players logging in automatically get a saturation of 5.0. Eating food increases the saturation as well as the food bar.
+
==== Disconnect (login) ====
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 329: Line 290:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x06
+
  |rowspan="1"| 0x00
  |rowspan="3"| Play
+
  |rowspan="1"| Login
  |rowspan="3"| Client
+
  |rowspan="1"| Client
  | Health
+
  | Reason
  | Float
+
  | [[Chat]]
  | 0 or less = dead, 20 = full HP
+
  |  
|-
 
| Food
 
| VarInt
 
| 0–20
 
|-
 
| Food Saturation
 
| Float
 
| Seems to vary from 0.0 to 5.0 in integer increments
 
 
  |}
 
  |}
  
==== Respawn ====
+
==== Encryption Request ====
 
 
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 357: Line 308:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x07
+
  |rowspan="5"| 0x01
  |rowspan="4"| Play
+
  |rowspan="5"| Login
  |rowspan="4"| Client
+
  |rowspan="5"| Client
  | Dimension
+
  | Server ID
  | Int
+
  | String (20)
  | -1: The Nether, 0: The Overworld, 1: The End
+
| Appears to be empty
 +
  |-
 +
| Public Key Length
 +
| VarInt
 +
| Length of Public Key
 
  |-
 
  |-
  | Difficulty
+
  | Public Key
  | Unsigned Byte
+
  | Byte Array
  | 0: Peaceful, 1: Easy, 2: Normal, 3: Hard
+
  |  
 
  |-
 
  |-
  | Gamemode
+
  | Verify Token Length
  | Unsigned Byte
+
  | VarInt
  | 0: survival, 1: creative, 2: adventure. The hardcore flag is not included
+
  | Length of Verify Token. Always 4 for Notchian servers.
 
  |-
 
  |-
  | Level Type
+
  | Verify Token
  | String
+
  | Byte Array
  | Same as [[#Join Game|Join Game]]
+
  | A sequence of random bytes generated by the server
 
  |}
 
  |}
  
{{Warning|If the Dimension isn't valid then the client will crash}}
+
See [[Protocol Encryption]] for details.
  
{{Warning|Avoid changing player's dimension to same dimension they were already in, weird bugs can occur i.e. such player will be unable to attack other players in new world (fixes after their death and respawn)}}
+
==== Login Success ====
 
 
==== Player Position And Look ====  
 
 
 
Updates the players position on the server.
 
 
 
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 fixed-point number of X or Z is set greater than <code>3.2E7D</code> the client will be kicked for “Illegal position”
 
 
 
Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0, -1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.
 
 
 
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.
 
 
 
The yaw of player (in degrees), standing at point (x0, z0) and looking towards point (x, z) one can be calculated with:
 
 
 
l = x-x0
 
w = z-z0
 
c = sqrt( l*l + w*w )
 
alpha1 = -arcsin(l/c)/PI*180
 
alpha2 =  arccos(w/c)/PI*180
 
if alpha2 > 90 then
 
    yaw = 180 - alpha1
 
else
 
    yaw = alpha1
 
 
 
You can get a unit vector from a given yaw/pitch via:
 
 
 
x = -cos(pitch) * sin(yaw)
 
y = -sin(pitch)
 
z =  cos(pitch) * cos(yaw)
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 419: Line 344:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="6"| 0x08
+
  |rowspan="2"| 0x02
  |rowspan="6"| Play
+
  |rowspan="2"| Login
  |rowspan="6"| Client
+
  |rowspan="2"| Client
  | X
+
  | UUID
  | Double
+
  | String (36)
  | Absolute or relative position, depending on Flags
+
  | Unlike in other packets, this field contains the UUID as a string with hyphens.
 
  |-
 
  |-
  | Y
+
  | Username
  | Double
+
  | String (16)
  | Absolute or relative position, depending on Flags
+
  |  
|-
 
| Z
 
| Double
 
| Absolute or relative position, depending on Flags
 
|-
 
| Yaw
 
| Float
 
| Absolute or relative rotation on the X Axis, in degrees
 
|-
 
| Pitch
 
| Float
 
| Absolute or relative rotation on the Y Axis, in degrees
 
|-
 
| Flags
 
| Byte
 
| Bit field, see below
 
 
  |}
 
  |}
  
About the Flags field:
+
This packet switches the connection state to [[#Play|play]].
 +
 
 +
{{Warning2|The (notchian) server might take a bit to fully transition to the Play state, so it's recommended to wait before sendings Play packets, either by setting a timeout, or waiting for Play packets from the server (usually [[#Player Info|Player Info]]).
 +
 
 +
The notchian client doesn't send any (non-[[#Keep Alive|keep alive]]) packets until the next tick/[[#Time Update|time update]] packet.
 +
}}
 +
 
 +
==== Set Compression ====
  
  <Dinnerbone> It's a bitfield, X/Y/Z/Y_ROT/X_ROT. If X is set, the x value is relative and not absolute.
+
Enables compression. If compression is enabled, all following packets are encoded in the [[#With compression|compressed packet format]]. Negative or zero values will disable compression, meaning the packet format should remain in the [[#Without compression|uncompressed packet format]].  However, this packet is entirely optional, and if not sent, compression will also not be enabled (the notchian server does not send the packet when compression is disabled).
  
 
{| class="wikitable"
 
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
! Field
+
  |rowspan="1"| 0x03
! Bit
+
  |rowspan="1"| Login
|-
+
  |rowspan="1"| Client
| X
+
  | Threshold
| 0x01
+
  | VarInt
|-
+
  | Maximum size of a packet before it is compressed
| Y
 
| 0x02
 
  |-
 
| Z
 
  | 0x04
 
|-
 
  | Y_ROT
 
| 0x08
 
  |-
 
  | X_ROT
 
  | 0x10
 
 
  |}
 
  |}
  
==== Held Item Change ====
+
==== Login Plugin Request ====
  
Sent to change the player's slot selection.
+
Used to implement a custom handshaking flow together with [[#Login_Plugin_Response | Login Plugin Response]].
 +
 
 +
Unlike plugin messages in "play" mode, these messages follow a lock-step request/response scheme, where the client is expected to respond to a request indicating whether it understood. The notchian client always responds that it hasn't understood, and sends an empty payload.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 484: Line 397:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="1"| 0x09
+
  |rowspan="3"| 0x04
  |rowspan="1"| Play
+
  |rowspan="3"| Login
  |rowspan="1"| Client
+
  |rowspan="3"| Client
  | Slot
+
  | Message ID
  | Byte
+
| VarInt
  | The slot which the player has selected (0–8)
+
| 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.
 
  |}
 
  |}
  
==== Use Bed ====  
+
=== Serverbound ===
  
This packet tells that a player goes to bed.
+
==== Login Start  ====
 
 
The client with the matching Entity ID will go into bed mode.
 
 
 
This Packet is sent to all nearby players including the one sent to bed.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 508: Line 425:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x0A
+
  |rowspan="1"| 0x00
  |rowspan="2"| Play
+
  |rowspan="1"| Login
  |rowspan="2"| Client
+
  |rowspan="1"| Server
  | Entity ID
+
  | Name
  | VarInt
+
  | String (16)
  | Sleeping player's EID
+
  | Player's Username
|-
 
| Location
 
| Position
 
| Block location of the head part of the bed
 
 
  |}
 
  |}
  
==== Animation ====
+
==== Encryption Response ====
 
 
Sent whenever an entity should change animation.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 532: Line 443:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x0B
+
  |rowspan="4"| 0x01
  |rowspan="2"| Play
+
  |rowspan="4"| Login
  |rowspan="2"| Client
+
  |rowspan="4"| Server
  | Entity ID
+
  | Shared Secret Length
 +
| VarInt
 +
| Length of Shared Secret
 +
|-
 +
| Shared Secret
 +
| Byte Array
 +
|
 +
|-
 +
| Verify Token Length
 
  | VarInt
 
  | VarInt
  | Player ID
+
  | Length of Verify Token
 
  |-
 
  |-
  | Animation
+
  | Verify Token
  | Unsigned Byte
+
  | Byte Array
  | Animation ID (see below)
+
  |  
 
  |}
 
  |}
  
Animation can be one of the following values:
+
See [[Protocol Encryption]] for details.
 +
 
 +
==== Login Plugin Response ====
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! ID
+
  ! Packet ID
  ! Animation
+
  ! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 0
+
  |rowspan="3"| 0x02
  | Swing arm
+
|rowspan="3"| Login
 +
|rowspan="3"| Server
 +
| Message ID
 +
| VarInt
 +
  | Should match ID from server.
 
  |-
 
  |-
  | 1
+
  | Successful
  | Take damage
+
  | Boolean
 +
| <code>true</code> if the client understands the request, <code>false</code> otherwise. When <code>false</code>, no payload follows.
 
  |-
 
  |-
  | 2
+
  | Data
  | Leave bed
+
  | Optional Byte Array
  |-
+
  | Any data, depending on the channel. The length of this array must be inferred from the packet length.
| 3
 
| Eat food
 
|-
 
| 4
 
| Critical effect
 
|-
 
| 5
 
| Magic critical effect
 
 
  |}
 
  |}
  
==== Spawn Player ====
+
== Play ==
  
This packet is sent by the server when a player comes into visible range, ''not'' when a player joins.
+
=== Clientbound ===
  
This packet must be sent after the [[#Player List Item|Player List Item]] ([[#Play|Play]], 0x38, clientbound) packet that adds the player data for the client to use when spawning a player. The tab includes skin/cape data.
+
==== Spawn Entity ====
  
Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly.
+
Sent by the server when a vehicle or other non-living entity is created.
 
 
When in online-mode the UUIDs must be valid and have valid skin blobs, in offline-mode UUID v3 is used.
 
 
 
For NPCs UUID v2 should be used. Note:
 
 
 
<+Grum> i will never confirm this as a feature you know that :)
 
 
 
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>.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 593: Line 507:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="9"| 0x0C
+
  |rowspan="12"| 0x00
  |rowspan="9"| Play
+
  |rowspan="12"| Play
  |rowspan="9"| Client
+
  |rowspan="12"| Client
 
  | Entity ID
 
  | Entity ID
 
  | VarInt
 
  | VarInt
  | Player's EID
+
  | EID of the entity
 
  |-
 
  |-
  | Player UUID
+
  | Object UUID
 
  | UUID
 
  | UUID
 
  |  
 
  |  
 +
|-
 +
| Type
 +
| VarInt
 +
| The type of entity (same as in [[#Spawn Living Entity|Spawn Living Entity]])
 
  |-
 
  |-
 
  | X
 
  | X
  | Int
+
  | Double
  | Player X as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  |  
 
  |-
 
  |-
 
  | Y
 
  | Y
  | Int
+
  | Double
  | Player Y as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  |  
 
  |-
 
  |-
 
  | Z
 
  | Z
  | Int
+
  | Double
  | Player Z as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  |  
 
  |-
 
  |-
  | Yaw
+
  | Pitch
 
  | Angle
 
  | Angle
 
  |  
 
  |  
 
  |-
 
  |-
  | Pitch
+
  | Yaw
 
  | Angle
 
  | Angle
 
  |  
 
  |  
 
  |-
 
  |-
  | Current Item
+
  | 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
 
  | Short
| The item the player is currently holding. Note that this should be 0 for “no item”, unlike -1 used in other packets.
 
 
  |-
 
  |-
  | Metadata
+
  | Velocity Z
| [[Entities#Entity Metadata Format|Metadata]]
+
  | Short
  |  
 
 
  |}
 
  |}
  
{{Warning|A negative Current Item crashes clients}}
+
==== Spawn Experience Orb ====
  
{{Warning|The client will crash if no Metadata is sent}}
+
Spawns one or more experience orbs.
 
 
==== Collect Item ====
 
 
 
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, and it doesn't add it to your inventory. The server only checks for items to be picked up after each [[#Player Position|Player Position]] (and [[#Player Position And Look|Player Position And Look]]) packet sent by the client.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 649: Line 569:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x0D
+
  |rowspan="5"| 0x01
  |rowspan="2"| Play
+
  |rowspan="5"| Play
  |rowspan="2"| Client
+
  |rowspan="5"| Client
  | Collected Entity ID
+
  | Entity ID
 
  | VarInt
 
  | VarInt
 
  |  
 
  |  
  |-  
+
  |-
  | Collector Entity ID
+
  | X
  | VarInt
+
  | Double
 +
|
 +
|-
 +
| Y
 +
| Double
 +
|
 +
|-
 +
| Z
 +
| Double
 
  |  
 
  |  
 +
|-
 +
| Count
 +
| Short
 +
| The amount of experience this orb will reward once collected
 
  |}
 
  |}
  
==== Spawn Object ====
+
==== Spawn Weather Entity ====
  
Sent by the server when an Object/Vehicle is created.
+
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"
Line 673: Line 605:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="8"| 0x0E
+
  |rowspan="5"| 0x02
  |rowspan="8"| Play
+
  |rowspan="5"| Play
  |rowspan="8"| Client
+
  |rowspan="5"| Client
  | Entity ID  
+
  | Entity ID
 
  | VarInt
 
  | VarInt
  | EID of the object
+
  | The EID of the thunderbolt
 
  |-
 
  |-
 
  | Type
 
  | Type
  | Byte
+
  | Byte Enum
  | The type of object (See [[Entities#Objects|Objects]])
+
  | The global entity type, currently always 1 for thunderbolt
 
  |-
 
  |-
 
  | X
 
  | X
  | Int
+
  | Double
  | X position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  |  
 
  |-
 
  |-
 
  | Y
 
  | Y
  | Int
+
  | Double
  | Y position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  |  
 
  |-
 
  |-
 
  | Z
 
  | Z
  | Int
+
  | Double
| Z position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
 
|-
 
| Pitch
 
| Angle
 
|
 
|-
 
| Yaw
 
| Angle
 
|
 
|-
 
| Data
 
| [[Object Data]]
 
 
  |  
 
  |  
 
  |}
 
  |}
  
==== Spawn Mob ====
+
==== Spawn Living Entity ====
  
Sent by the server when a Mob Entity is Spawned
+
Sent by the server when a living entity is spawned.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 721: Line 641:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="12"| 0x0F
+
  |rowspan="12"| 0x03
 
  |rowspan="12"| Play
 
  |rowspan="12"| Play
 
  |rowspan="12"| Client
 
  |rowspan="12"| Client
 
  | Entity ID
 
  | Entity ID
 
  | VarInt
 
  | VarInt
 +
|
 +
|-
 +
| Entity UUID
 +
| UUID
 
  |  
 
  |  
 
  |-
 
  |-
 
  | Type
 
  | Type
  | Unsigned Byte
+
  | VarInt
  | The type of mob. See [[Entities#Mobs|Mobs]]
+
  | The type of mob. See [[Entities#Mobs]]
 
  |-
 
  |-
 
  | X
 
  | X
  | Int
+
  | Double
  | X position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  |  
 
  |-
 
  |-
 
  | Y
 
  | Y
  | Int
+
  | Double
  | Y position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  |  
 
  |-
 
  |-
 
  | Z
 
  | Z
  | Int
+
  | Double
  | Z position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  |  
 
  |-
 
  |-
 
  | Yaw
 
  | Yaw
Line 767: Line 691:
 
  | Short
 
  | Short
 
  | Same units as [[#Entity Velocity|Entity Velocity]]
 
  | Same units as [[#Entity Velocity|Entity Velocity]]
|-
 
| Metadata
 
| [[Entities#Entity Metadata Format|Metadata]]
 
|
 
 
  |}
 
  |}
  
Line 776: Line 696:
  
 
This packet shows location, name, and type of painting.
 
This packet shows location, name, and type of painting.
 
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.
 
 
2x1 (1, 0)
 
4x4 (1, 2)
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 790: Line 705:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x10
+
  |rowspan="5"| 0x04
  |rowspan="4"| Play
+
  |rowspan="5"| Play
  |rowspan="4"| Client
+
  |rowspan="5"| Client
 
  | Entity ID
 
  | Entity ID
 
  | VarInt
 
  | VarInt
 
  |  
 
  |  
 
  |-
 
  |-
  | Title
+
  | Entity UUID
  | String
+
  | UUID
  | Name of the painting. Max length 13
+
  |  
 +
|-
 +
| Motive
 +
| VarInt
 +
| Panting's ID, see below
 
  |-
 
  |-
 
  | Location
 
  | Location
 
  | Position
 
  | Position
  | Center coordinates
+
  | Center coordinates (see below)
 
  |-
 
  |-
 
  | Direction
 
  | Direction
  | Unsigned Byte
+
  | Byte Enum
  | Direction the painting faces. 0: north (-z), 1: west (-x), 2: south (+z), 3: east (+x)
+
  | Direction the painting faces (North = 2, South = 0, West = 1, East = 3)
 
  |}
 
  |}
  
==== Spawn Experience Orb ====
+
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.
  
Spawns one or more experience orbs.
+
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"
  ! Packet ID
+
  ! Name
  ! State
+
  ! ID
  ! Bound To
+
  ! x
  ! Field Name
+
  ! y
  ! Field Type
+
  ! width
  ! Notes
+
  ! height
 
  |-
 
  |-
  |rowspan="5"| 0x11
+
  | <code>minecraft:kebab</code>
  |rowspan="5"| Play
+
  | 0
  |rowspan="5"| Client
+
  | 0
  | Entity ID
+
  | 0
  | VarInt
+
  | 16
  | Entity's ID
+
  | 16
 
  |-
 
  |-
  | X
+
  | <code>minecraft:aztec</code>
  | Int
+
  | 1
  | X position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  | 16
 +
| 0
 +
| 16
 +
| 16
 
  |-
 
  |-
  | Y
+
  | <code>minecraft:alban</code>
  | Int
+
  | 2
  | Y position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  | 32
  |-
+
  | 0
  | Z
+
  | 16
  | Int
+
  | 16
| Z position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
 
 
  |-
 
  |-
  | Count
+
  | <code>minecraft:aztec2</code>
  | Short
+
  | 3
  | The amount of experience this orb will reward once collected
+
  | 48
  |}
+
  | 0
 
+
| 16
==== Entity Velocity ====
+
  | 16
 
 
Velocity is believed to be in units of 1/8000 of a block per server tick (50ms); for example, -1343 would move (-1343 / 8000) = −0.167875 blocks per tick (or −3,3575 blocks per second).
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="4"| 0x12
+
  | <code>minecraft:bomb</code>
  |rowspan="4"| Play
+
  | 4
  |rowspan="4"| Client
+
  | 64
  | Entity ID
+
  | 0
  | VarInt
+
  | 16
  |  
+
  | 16
 
  |-
 
  |-
  | Velocity X
+
  | <code>minecraft:plant</code>
  | Short
+
  | 5
  | Velocity on the X axis
+
  | 80
 +
| 0
 +
| 16
 +
| 16
 
  |-
 
  |-
  | Velocity Y
+
  | <code>minecraft:wasteland</code>
  | Short
+
  | 6
  | Velocity on the Y axis
+
  | 96
 +
| 0
 +
| 16
 +
| 16
 +
|-
 +
| <code>minecraft:pool</code>
 +
| 7
 +
| 0
 +
| 32
 +
| 32
 +
| 16
 
  |-
 
  |-
  | Velocity Z
+
  | <code>minecraft:courbet</code>
  | Short
+
  | 8
  | Velocity on the Z axis
+
  | 32
  |}
+
  | 32
 
+
| 32
==== Destroy Entities ====
+
  | 16
 
 
Sent by the server when a list of entities is to be destroyed on the client.
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x13
+
  | <code>minecraft:sea</code>
  |rowspan="2"| Play
+
  | 9
  |rowspan="2"| Client
+
  | 64
  | Count
+
  | 32
  | VarInt
+
  | 32
  | Number of elements in the following array
+
  | 16
 
  |-
 
  |-
  | Entity IDs
+
  | <code>minecraft:sunset</code>
  | Array of VarInt
+
  | 10
  | The list of entities of destroy
+
  | 96
  |}
+
  | 32
 
+
| 32
==== Entity ====
+
  | 16
 
 
Most entity-related packets are subclasses of this packet. When sent from the server to the client, it may initialize the entry.
 
 
 
For player entities, either this packet or any move/look packet is sent every game tick. So the meaning of this packet is basically that the entity did not move/look since the last such packet.
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="1"| 0x14
+
  | <code>minecraft:creebet</code>
  |rowspan="1"| Play
+
  | 11
  |rowspan="1"| Client
+
  | 128
| Entity ID
+
  | 32
  | VarInt
+
  | 32
  |  
+
  | 16
  |}
 
 
 
==== Entity Relative Move ====
 
 
 
This packet is sent by the server when an entity moves less then 4 blocks; if an entity moves more than 4 blocks [[#Entity Teleport|Entity Teleport]] should be sent instead.
 
 
 
This packet allows at most four blocks movement in any direction, because byte range is from -128 to 127.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="5"| 0x15
+
  | <code>minecraft:wanderer</code>
  |rowspan="5"| Play
+
  | 12
  |rowspan="5"| Client
+
  | 0
  | Entity ID
+
  | 64
  | VarInt
+
  | 16
  |  
+
  | 32
 
  |-
 
  |-
  | Delta X
+
  | <code>minecraft:graham</code>
  | Byte
+
  | 13
  | Change in X position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  | 16
 +
| 64
 +
| 16
 +
| 32
 
  |-
 
  |-
  | Delta Y
+
  | <code>minecraft:match</code>
  | Byte
+
  | 14
  | Change in Y position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  | 0
 +
| 128
 +
| 32
 +
| 32
 
  |-
 
  |-
  | Delta Z
+
  | <code>minecraft:bust</code>
  | Byte
+
  | 15
  | Change in Z position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  | 32
 +
| 128
 +
| 32
 +
| 32
 
  |-
 
  |-
  | On Ground
+
  | <code>minecraft:stage</code>
  | Boolean
+
  | 16
  |  
+
  | 64
  |}
+
  | 128
 
+
| 32
==== Entity Look ====
+
  | 32
 
 
This packet is sent by the server when an entity rotates.
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="5"| 0x16
+
  | <code>minecraft:void</code>
  |rowspan="5"| Play
+
  | 17
  |rowspan="5"| Client
+
  | 96
  | Entity ID
+
  | 128
  | VarInt
+
  | 32
  |  
+
  | 32
 
  |-
 
  |-
  | Yaw
+
  | <code>skull_and_roses</code>
  | Angle
+
  | 18
  | New angle, not a delta
+
  | 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
 
  |-
 
  |-
  | Pitch
+
  | <code>minecraft:skeleton</code>
  | Angle
+
  | 24
  | New angle, not a delta
+
  | 192
 +
| 64
 +
| 64
 +
| 48
 
  |-
 
  |-
  | On Ground
+
  | <code>minecraft:donkey_kong</code>
  | Boolean
+
  | 25
  |  
+
  | 192
 +
| 112
 +
| 64
 +
| 48
 
  |}
 
  |}
  
==== Entity Look And Relative Move ====
+
The {{Minecraft Wiki|Painting#Canvases|Minecraft Wiki article on paintings}} also provides a list of painting names to the actual images.
  
This packet is sent by the server when an entity rotates and moves. Since a byte range is limited from -128 to 127, and movement is offset of fixed-point numbers, this packet allows at most four blocks movement in any direction. (-128/32 == -4)
+
==== Spawn Player ====
 +
 
 +
This packet is sent by the server when a player comes into visible range, ''not'' when a player joins.
 +
 
 +
This packet must be sent after the [[#Player Info|Player Info]] packet that adds the player data for the client to use when spawning a player. If the Player Info for the player spawned by this packet is not present when this packet arrives, Notchian clients will not spawn the player entity. The Player Info packet includes skin/cape data.
 +
 
 +
Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,006: Line 942:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="7"| 0x17
+
  |rowspan="7"| 0x05
 
  |rowspan="7"| Play
 
  |rowspan="7"| Play
 
  |rowspan="7"| Client
 
  |rowspan="7"| Client
 
  | Entity ID
 
  | Entity ID
 
  | VarInt
 
  | VarInt
  |  
+
  | Player's EID
 
  |-
 
  |-
  | Delta X
+
  | Player UUID
  | Byte
+
  | UUID
  | Change in X position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  | See below for notes on {{Minecraft Wiki|Server.properties#online-mode|offline mode}} and NPCs
 
  |-
 
  |-
  | Delta Y
+
  | X
  | Byte
+
  | Double
  | Change in Y position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  |  
 
  |-
 
  |-
  | Delta Z
+
  | Y
  | Byte
+
| Double
  | Change in Z position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
|
 +
  |-
 +
  | Z
 +
| Double
 +
|  
 
  |-
 
  |-
 
  | Yaw
 
  | Yaw
 
  | Angle
 
  | Angle
  | New angle, not a delta
+
  |  
 
  |-
 
  |-
 
  | Pitch
 
  | Pitch
 
  | Angle
 
  | Angle
| New angle, not a delta
 
|-
 
| On Ground
 
| Boolean
 
 
  |  
 
  |  
 
  |}
 
  |}
  
==== Entity Teleport ====
+
When in {{Minecraft Wiki|Server.properties#online-mode|online mode}}, the UUIDs must be valid and have valid skin blobs.
 +
 
 +
In offline mode, [[Wikipedia:Universally unique identifier#Versions 3 and 5 (namespace name-based)|UUID v3]] is used with the String <code>OfflinePlayer:&lt;player name&gt;</code>, encoded in UTF-8 (and case-sensitive).
 +
 
 +
For NPCs UUID v2 should be used. Note:
 +
 
 +
<+Grum> i will never confirm this as a feature you know that :)
 +
 
 +
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>.
 +
 
 +
==== Entity Animation (clientbound) ====
  
This packet is sent by the server when an entity moves more than 4 blocks.
+
Sent whenever an entity should change animation.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,050: Line 996:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="7"| 0x18
+
  |rowspan="2"| 0x06
  |rowspan="7"| Play
+
  |rowspan="2"| Play
  |rowspan="7"| Client
+
  |rowspan="2"| Client
 
  | Entity ID
 
  | Entity ID
 
  | VarInt
 
  | VarInt
  |  
+
  | Player ID
 
  |-
 
  |-
  | X
+
  | Animation
  | Int
+
  | Unsigned Byte
  | X position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  | Animation ID (see below)
 +
|}
 +
 
 +
Animation can be one of the following values:
 +
 
 +
{| class="wikitable"
 +
! ID
 +
! Animation
 
  |-
 
  |-
  | Y
+
  | 0
  | Int
+
  | Swing main arm
  | Y position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
+
  |-
 +
| 1
 +
| Take damage
 
  |-
 
  |-
  | Z
+
  | 2
  | Int
+
  | Leave bed
| Z position as a [[Data Types#Fixed-point numbers|Fixed-Point number]]
 
 
  |-
 
  |-
  | Yaw
+
  | 3
  | Angle
+
  | Swing offhand
| New angle, not a delta
 
 
  |-
 
  |-
  | Pitch
+
  | 4
  | Angle
+
  | Critical effect
| New angle, not a delta
 
 
  |-
 
  |-
  | On Ground
+
  | 5
| Boolean
+
  | Magic critical effect
  |  
 
 
  |}
 
  |}
  
==== Entity Head Look ====
+
==== Statistics ====
  
Changes the direction an entity's head is facing.
+
Sent as a response to [[#Client_Status|Client Status 0x04]] (id 1).
  
 
{| class="wikitable"
 
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
  ! Bound To
+
  ! Bound To  
  ! Field Name
+
  !colspan="2"| Field Name
  ! Field Type
+
  !colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x19
+
  |rowspan="4"| 0x07
  |rowspan="2"| Play
+
  |rowspan="4"| Play
  |rowspan="2"| Client
+
  |rowspan="4"| Client
  | Entity ID
+
  |colspan="2"| Count
  | VarInt
+
  |colspan="2"| VarInt
  |  
+
  | Number of elements in the following array
 
  |-
 
  |-
  | Head Yaw
+
  |rowspan="2"| Statistic
| Angle
+
  | Category ID
  | New angle, not a delta
+
  |rowspan="2"| Array
  |}
+
  | VarInt
 
+
  | See below
==== Entity Status ====
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
  ! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x1A
+
  | Statistic ID
|rowspan="2"| Play
+
  | VarInt
|rowspan="2"| Client
+
  | See below
| Entity ID
 
  | Int
 
  |  
 
 
  |-
 
  |-
  | Entity Status
+
  |colspan="2"| Value
  | Byte
+
  |colspan="2"| VarInt
  | See below
+
  | The amount to set it to
 
  |}
 
  |}
 +
 +
Categories (these are namespaced, but with <code>:</code> replaced with <code>.</code>):
  
 
{| class="wikitable"
 
{| class="wikitable"
 +
! Name
 +
! ID
 +
! Registry
 
  |-
 
  |-
  ! Entity Status
+
  | <code>minecraft.mined</code>
  ! Meaning
+
  | 0
 +
| Blocks
 
  |-
 
  |-
 +
| <code>minecraft.crafted</code>
 
  | 1
 
  | 1
  | Sent when resetting a mob spawn minecart's timer - appears to be unused by the client
+
  | Items
 
  |-
 
  |-
 +
| <code>minecraft.used</code>
 
  | 2
 
  | 2
  | Living Entity hurt
+
  | Items
 
  |-
 
  |-
 +
| <code>minecraft.broken</code>
 
  | 3
 
  | 3
  | Living Entity dead
+
  | Items
 
  |-
 
  |-
 +
| <code>minecraft.picked_up</code>
 
  | 4
 
  | 4
  | Iron Golem throwing up arms
+
  | Items
 +
|-
 +
| <code>minecraft.dropped</code>
 +
| 5
 +
| Items
 
  |-
 
  |-
 +
| <code>minecraft.killed</code>
 
  | 6
 
  | 6
  | Wolf/Ocelot/Horse taming — Spawn “heart” particles
+
  | Entities
 
  |-
 
  |-
 +
| <code>minecraft.killed_by</code>
 
  | 7
 
  | 7
  | Wolf/Ocelot/Horse tamed — Spawn “smoke” particles
+
  | Entities
 
  |-
 
  |-
 +
| <code>minecraft.custom</code>
 
  | 8
 
  | 8
  | Wolf shaking water — Trigger the shaking animation
+
  | 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"
 +
! Name
 +
! ID
 +
! Unit
 
  |-
 
  |-
  | 9
+
  | <code>minecraft.leave_game</code>
  | (of self) Eating accepted by server
+
  | 0
 +
| None
 
  |-
 
  |-
  | 10
+
  | <code>minecraft.play_one_minute</code>
  | Sheep eating grass
+
  | 1
 +
| Time
 +
|-
 +
| <code>minecraft.time_since_death</code>
 +
| 2
 +
| Time
 +
|-
 +
| <code>minecraft.sneak_Time</code>
 +
| 3
 +
| Time
 +
|-
 +
| <code>minecraft.walk_one_cm</code>
 +
| 4
 +
| Distance
 +
|-
 +
| <code>minecraft.crouch_one_cm</code>
 +
| 5
 +
| Distance
 +
|-
 +
| <code>minecraft.sprint_one_cm</code>
 +
| 6
 +
| Distance
 +
|-
 +
| <code>minecraft.swim_one_cm</code>
 +
| 7
 +
| Distance
 +
|-
 +
| <code>minecraft.fall_one_cm</code>
 +
| 8
 +
| Distance
 +
|-
 +
| <code>minecraft.climb_one_cm</code>
 +
| 9
 +
| Distance
 
  |-
 
  |-
 +
| <code>minecraft.fly_one_cm</code>
 
  | 10
 
  | 10
  | Play TNT ignite sound
+
  | Distance
 
  |-
 
  |-
 +
| <code>minecraft.dive_one_cm</code>
 
  | 11
 
  | 11
  | Iron Golem handing over a rose
+
  | Distance
 
  |-
 
  |-
 +
| <code>minecraft.minecart_one_cm</code>
 
  | 12
 
  | 12
  | Villager mating — Spawn “heart” particles
+
  | Distance
 
  |-
 
  |-
 +
| <code>minecraft.boat_one_cm</code>
 
  | 13
 
  | 13
  | Spawn particles indicating that a villager is angry and seeking revenge
+
  | Distance
 
  |-
 
  |-
 +
| <code>minecraft.pig_one_cm</code>
 
  | 14
 
  | 14
  | Spawn happy particles near a villager
+
  | Distance
 
  |-
 
  |-
 +
| <code>minecraft.horse_one_cm</code>
 
  | 15
 
  | 15
  | Witch animation — Spawn “magic” particles
+
  | Distance
 
  |-
 
  |-
 +
| <code>minecraft.aviate_one_cm</code>
 
  | 16
 
  | 16
  | Play zombie converting into a villager sound
+
  | Distance
 
  |-
 
  |-
 +
| <code>minecraft.jump</code>
 
  | 17
 
  | 17
  | Firework exploding
+
  | None
 
  |-
 
  |-
 +
| <code>minecraft.drop</code>
 
  | 18
 
  | 18
  | Animal in love (ready to mate) — Spawn “heart” particles
+
  | None
 
  |-
 
  |-
 +
| <code>minecraft.damage_dealt</code>
 
  | 19
 
  | 19
  | Reset squid rotation
+
  | Damage
 
  |-
 
  |-
 +
| <code>minecraft.damage_taken</code>
 
  | 20
 
  | 20
  | Spawn explosion particle — works for some living entities
+
  | Damage
 
  |-
 
  |-
 +
| <code>minecraft.deaths</code>
 
  | 21
 
  | 21
  | Play guardian sound — works for every entity
+
  | None
 
  |-
 
  |-
 +
| <code>minecraft.mob_kills</code>
 
  | 22
 
  | 22
  | Enables reduced debug for players
+
  | None
 
  |-
 
  |-
 +
| <code>minecraft.animals_bred</code>
 
  | 23
 
  | 23
  | Disables reduced debug for players
+
  | None
  |}
+
  |-
 
+
| <code>minecraft.player_kills</code>
==== Attach Entity ====
+
| 24
 
+
  | None
This packet is sent when a player has been attached to an entity (e.g. Minecart).
+
  |-
 
+
  | <code>minecraft.fish_caught</code>
{| class="wikitable"
+
  | 25
  ! Packet ID
+
  | None
  ! State
 
  ! Bound To
 
  ! Field Name
 
  ! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x1B
+
  | <code>minecraft.talked_to_villager</code>
|rowspan="3"| Play
+
  | 26
  |rowspan="3"| Client
+
  | None
  | Entity ID
 
| Int
 
| Attached entity's EID. Set to -1 to detach.
 
 
  |-
 
  |-
  | Vehicle ID
+
  | <code>minecraft.traded_with_villager</code>
  | Int
+
  | 27
  | Vechicle's Entity ID
+
  | None
 
  |-
 
  |-
  | Leash
+
  | <code>minecraft.eat_cake_slice</code>
  | Boolean
+
  | 28
  | If true leashes the entity to the vehicle
+
  | None
  |}
+
|-
 
+
| <code>minecraft.fill_cauldron</code>
==== Entity Metadata ====
+
| 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"
 
{| class="wikitable"
Line 1,241: Line 1,338:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x1C
+
  |rowspan="4"| 0x08
  |rowspan="2"| Play
+
  |rowspan="4"| Play
  |rowspan="2"| Client
+
  |rowspan="4"| Client
  | Entity ID
+
  | Location
 +
| Position
 +
| Position where the digging was happening
 +
|-
 +
| Block
 
  | VarInt
 
  | 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.
 
  |-
 
  |-
  | Metadata
+
  | Successful
  | [[Entities#Entity Metadata Format|Metadata]]
+
  | Boolean
  |  
+
  | True if the digging succeeded; false if the client should undo any changes it made locally.  (How does this work?)
 
  |}
 
  |}
  
==== Entity Effect ====
+
==== Block Break Animation ====
 +
 
 +
0–9 are the displayable destroy stages and each other number means that there is no animation on this coordinate.
 +
 
 +
Block break animations can still be applied on air; the animation will remain visible although there is no block being broken.  However, if this is applied to a transparent block, odd graphical effects may happen, including water losing its transparency.  (An effect similar to this can be seen in normal gameplay when breaking ice blocks)
 +
 
 +
If you need to display several break animations at the same time you have to give each of them a unique Entity ID. The entity ID does not need to correspond to an actual entity on the client. It is valid to use a randomly generated number.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,263: Line 1,374:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| 0x1D
+
  |rowspan="3"| 0x09
  |rowspan="5"| Play
+
  |rowspan="3"| Play
  |rowspan="5"| Client
+
  |rowspan="3"| Client
 
  | Entity ID
 
  | Entity ID
 
  | VarInt
 
  | VarInt
  |  
+
  | Entity ID of the entity breaking the block
 
  |-
 
  |-
  | Effect ID
+
  | Location
  | Byte
+
  | Position
  | See {{Minecraft Wiki|Status effect#List of effects|this table}}
+
  | Block Position
 
  |-
 
  |-
  | Amplifier
+
  | Destroy Stage
 
  | Byte
 
  | Byte
  | Notchian client displays effect level as Amplifier + 1
+
  | 0–9 to set it, any other value to remove it
|-
 
| Duration
 
| VarInt
 
| Seconds
 
|-
 
| Hide Particles
 
| Boolean
 
|
 
 
  |}
 
  |}
  
==== Remove Entity Effect ====
+
==== Block Entity Data ====
 +
 
 +
Sets the block entity associated with the block at the given location.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,297: Line 1,402:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x1E
+
  |rowspan="3"| 0x0A
  |rowspan="2"| Play
+
  |rowspan="3"| Play
  |rowspan="2"| Client
+
  |rowspan="3"| Client
  | Entity ID
+
  | Location
  | VarInt
+
  | Position
 
  |  
 
  |  
 
  |-
 
  |-
  | Effect ID
+
  | Action
  | Byte
+
  | Unsigned Byte
  | See {{Minecraft Wiki|Status effect#List of effects|this table}}
+
  | The type of update to perform, see below
 +
|-
 +
| NBT Data
 +
| [[NBT|NBT Tag]]
 +
| Data to set.  May be a TAG_END (0), in which case the block entity at the given location is removed (though this is not required since the client will remove the block entity automatically on chunk unload or block removal)
 
  |}
 
  |}
  
==== Set Experience ====
+
''Action'' field:
 +
 
 +
* '''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
 +
 
 +
==== Block Action ====
 +
 
 +
This packet is used for a number of actions and animations performed by blocks, usually non-persistent.
 +
 
 +
See [[Block Actions]] for a list of values.
  
Sent by the server when the client should change experience levels.
+
{{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"
Line 1,321: Line 1,451:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x1F
+
  |rowspan="4"| 0x0B
  |rowspan="3"| Play
+
  |rowspan="4"| Play
  |rowspan="3"| Client
+
  |rowspan="4"| Client
  | Experience bar
+
  | Location
  | Float
+
  | Position
  | Between 0 and 1
+
  | Block coordinates
 +
|-
 +
| Action ID (Byte 1)
 +
| Unsigned Byte
 +
| Varies depending on block — see [[Block Actions]]
 
  |-
 
  |-
  | Level
+
  | Action Param (Byte 2)
  | VarInt
+
  | Unsigned Byte
  |  
+
  | Varies depending on block — see [[Block Actions]]
 
  |-
 
  |-
  | Total Experience
+
  | Block Type
 
  | VarInt
 
  | VarInt
  | See {{Minecraft Wiki|Experience#Leveling up}} on the Minecraft Wiki for Total Experience to Level conversion
+
  | The block type ID for the block.  This must match the block at the given coordinates.
 
  |}
 
  |}
  
==== Entity Properties ====
+
==== Block Change ====
 +
 
 +
Fired whenever a block is changed within the render distance.
 +
 
 +
{{Warning2|Changing a block in a chunk that is not loaded is not a stable action.  The Notchian client currently uses a ''shared'' empty chunk which is modified for all block changes in unloaded chunks; while in 1.9 this chunk never renders in older versions the changed block will appear in all copies of the empty chunk.  Servers should avoid sending block changes in unloaded chunks and clients should ignore such packets.}}
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,343: Line 1,481:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
  !colspan="2"| Field Type
+
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="6"| 0x20
+
  |rowspan="2"| 0x0C
  |rowspan="6"| Play
+
  |rowspan="2"| Play
  |rowspan="6"| Client
+
  |rowspan="2"| Client
  |colspan="2"| Entity ID
+
  | Location
  |colspan="2"| VarInt
+
  | Position
  |  
+
  | Block Coordinates
 
  |-
 
  |-
  |colspan="2"| Number Of Properties
+
  | Block ID
|colspan="2"| Int
 
| Number of elements in the following array
 
|-
 
|rowspan="4"| Property
 
| Key
 
|rowspan="4"| Array
 
| String
 
| See below
 
|-
 
| Value
 
| Double
 
| See below
 
|-
 
| Number Of Modifiers
 
 
  | VarInt
 
  | VarInt
  | Number of elements in the following array
+
  | 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.
|-
 
| Modifiers
 
| Array of Modifier Data
 
| See {{Minecraft Wiki|Attribute#Modifiers}}
 
 
  |}
 
  |}
  
Known Key values:
+
==== Boss Bar ====
  
 
{| class="wikitable"
 
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
!colspan="2"| Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  ! Key
+
  |rowspan="14"| 0x0D
  ! Default
+
  |rowspan="14"| Play
  ! Min
+
  |rowspan="14"| Client
  ! Max
+
  |colspan="2"| UUID
  ! Label
+
  | UUID
 +
| Unique ID for this bar
 
  |-
 
  |-
  | generic.maxHealth
+
  |colspan="2"| Action
| 20.0
+
  | VarInt Enum
| 0.0
+
  | Determines the layout of the remaining packet
  | Double.MaxValue
 
  | Max Health
 
 
  |-
 
  |-
  | generic.followRange
+
  ! Action
  | 32.0
+
  ! Field Name
  | 0.0
+
  !
  | 2048.0
+
  !
| Follow Range
 
 
  |-
 
  |-
  | generic.knockbackResistance
+
  |rowspan="5"| 0: add
| 0.0
+
  | Title
  | 0.0
+
  | [[Chat]]
  | 1.0
+
  |  
  | Knockback Resistance
 
 
  |-
 
  |-
  | generic.movementSpeed
+
  | Health
  | 0.699999988079071
+
  | Float
  | 0.0
+
  | 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.
| Double.MaxValue
 
| Movement Speed
 
 
  |-
 
  |-
  | generic.attackDamage
+
  | Color
  | 2.0
+
  | VarInt Enum
| 0.0
+
  | Color ID (see below)
| Double.MaxValue
 
  |  
 
 
  |-
 
  |-
  | horse.jumpStrength
+
  | Division
  | 0.7
+
  | VarInt Enum
  | 0.0
+
  | Type of division (see below)
| 2.0
 
| Jump Strength
 
 
  |-
 
  |-
  | zombie.spawnReinforcements
+
  | Flags
  | 0.0
+
| Unsigned Byte
  | 0.0
+
  | 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.0
+
  |-
  | Spawn Reinforcements Chance
+
  | 1: remove
  |}
+
  | ''no fields''
 
+
  | ''no fields''
''Modifier Data'' structure:
+
| Removes this boss bar
 
 
{| class="wikitable"
 
 
  |-
 
  |-
  ! Field Name
+
  | 2: update health
  ! Field Type
+
  | Health
  ! Notes
+
  | Float
 +
| as above
 
  |-
 
  |-
  | UUID
+
  | 3: update title
  | UUID
+
  | Title
 +
| [[Chat]]
 
  |  
 
  |  
 
  |-
 
  |-
  | Amount
+
  |rowspan="2"| 4: update style
  | Double
+
| Color
  |  
+
| VarInt Enum
 +
| Color ID (see below)
 +
|-
 +
| Dividers
 +
| VarInt Enum
 +
| as above
 +
|-
 +
| 5: update flags
 +
| Flags
 +
  | Unsigned Byte
 +
  | as above
 
  |-
 
  |-
| Operation
 
| Byte
 
|
 
 
  |}
 
  |}
 
==== Chunk Data ====
 
 
Chunks are not unloaded by the client automatically. To unload chunks, send this packet with Ground-Up Continuous=true and no 16^3 chunks (eg. Primary Bit Mask=0). The server does not send skylight information for nether-chunks, it's up to the client to know if the player is currently in the nether. You can also infer this information from the primary bitmask and the amount of uncompressed bytes sent.
 
 
See also: [[SMP Map Format]]
 
 
Changes in 1.8:
 
 
* Data value section removed
 
* Extended id section removed
 
* Block id section is now a unsigned short (little endian) per a block
 
* The block id is equal to <code>(id << 4) | data</code>
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  ! ID
  ! State
+
  ! Color
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="6"| 0x21
+
  | 0
  |rowspan="6"| Play
+
| Pink
  |rowspan="6"| Client
+
  |-
  | Chunk X
+
| 1
  | Int
+
  | Blue
  | Chunk X coordinate
+
  |-
 +
  | 2
 +
  | Red
 
  |-
 
  |-
  | Chunk Z
+
  | 3
  | Int
+
  | Green
| Chunk Z coordinate
 
 
  |-
 
  |-
  | Ground-Up Continuous
+
  | 4
  | Boolean
+
  | Yellow
| This is true if the packet represents all sections in this vertical column, where the Primary Bit Mask specifies exactly which sections are included, and which are air
 
 
  |-
 
  |-
  | Primary Bit Mask
+
  | 5
  | Unsigned Short
+
  | Purple
| Bitmask with 1 for every 16x16x16 section whose data follows in the compressed data
 
|-
 
| Size
 
| VarInt
 
| Size of Data
 
 
  |-
 
  |-
  | Data
+
  | 6
| [[SMP Map Format#Data|Chunk]]
+
  | White
  |  
 
 
  |}
 
  |}
  
==== Multi Block Change ====
 
Fired whenever 2 or more blocks are changed within the render distance.
 
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  ! ID
  ! State
+
  ! Type of division
  ! Bound To
+
  |-
  !colspan="2"| Field Name
+
  | 0
  !colspan="2"| Field Type
+
  | No division
! Notes
 
 
  |-
 
  |-
  |rowspan="6"| 0x22
+
  | 1
|rowspan="6"| Play
+
  | 6 notches
  |rowspan="6"| Client
 
|colspan="2"| Chunk X
 
|colspan="2"| Int
 
| Chunk X coordinate
 
 
  |-
 
  |-
  |colspan="2"| Chunk Z
+
  | 2
|colspan="2"| Int
+
  | 10 notches
  | Chunk Z coordinate
 
 
  |-
 
  |-
  |colspan="2"| Record Count
+
  | 3
|colspan="2"| VarInt
+
  | 12 notches
  | Number of elements in the following array, a.k.a. the number of blocks affected
 
 
  |-
 
  |-
  |rowspan="3"| Record
+
  | 4
| Horizontal Position
+
  | 20 notches
|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
 
  |  
 
|-
 
| Block ID
 
| VarInt
 
| The new block ID for the block. <code><nowiki>id &lt;&lt; 4 | data</nowiki></code>
 
 
  |}
 
  |}
  
==== Block Change ====
+
==== Server Difficulty ====
Fired whenever a block is changed within the render distance.
+
 
 +
Changes the difficulty setting in the client's option menu
 +
 
 
{| class="wikitable"
 
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
Line 1,550: Line 1,633:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x23
+
  |rowspan="2"| 0x0E
 
  |rowspan="2"| Play
 
  |rowspan="2"| Play
 
  |rowspan="2"| Client
 
  |rowspan="2"| Client
  | Location
+
  | Difficulty
  | Position
+
  | Unsigned Byte
  | Block Coordinates
+
  | 0: peaceful, 1: easy, 2: normal, 3: hard
 
  |-
 
  |-
  | Block ID
+
  | Difficulty locked?
  | VarInt
+
  | Boolean
  | The new block ID for the block. <code><nowiki>id &lt;&lt; 4 | data</nowiki></code>
+
  |
 
  |}
 
  |}
  
==== Block Action ====
+
==== Chat Message (clientbound) ====  
  
This packet is used for a number of things:
+
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.
  
* Chests opening and closing
+
{{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.}}
* Pistons pushing and pulling
 
* Note blocks playing
 
* Updating beacons
 
 
 
See Also: [[Block Actions]]  
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,581: Line 1,659:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x24
+
  |rowspan="2"| 0x0F
  |rowspan="4"| Play
+
  |rowspan="2"| Play
  |rowspan="4"| Client
+
  |rowspan="2"| Client
  | Location
+
  | JSON Data
 +
| [[Chat]]
 +
| Limited to 32767 bytes
 +
|-
 
  | Position
 
  | Position
  | Block Coordinates
+
  | Byte
  |-
+
| 0: chat (chat box), 1: system message (chat box), 2: game info (above hotbar).
  | Byte 1
+
|}
 +
 
 +
==== Multi Block Change ====
 +
 
 +
Fired whenever 2 or more blocks are changed within the same chunk on the same tick.
 +
 
 +
{{Warning|Changing blocks in chunks not loaded by the client is unsafe (see note on [[#Block Change|Block Change]]).}}
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
!colspan="2"| Field Name
 +
!colspan="2"| Field Type
 +
! Notes
 +
|-
 +
|rowspan="6"| 0x10
 +
|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
 
  | Unsigned Byte
  | Varies depending on block — see [[Block Actions]]
+
  | 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.
 
  |-
 
  |-
  | Byte 2
+
  | Y Coordinate
 
  | Unsigned Byte
 
  | Unsigned Byte
  | Varies depending on block — see [[Block Actions]]
+
  | Y coordinate of the block
 
  |-
 
  |-
  | Block Type
+
  | Block ID
 
  | VarInt
 
  | VarInt
  | The block type for the block
+
  | 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.
 
  |}
 
  |}
  
==== Block Break Animation ====
+
To decode the position into a world position:
 
 
0–9 are the displayable destroy stages and each other number means that there is no animation on this coordinate.
 
  
You can also set an animation to air! The animation will still be visible.
+
<syntaxhighlight lang="java">
 +
worldX = (horizPos >> 4 & 15) + (chunkX * 16);
 +
worldY = vertPos;
 +
worldZ = (horizPos & 15) + (chunkZ * 16);
 +
</syntaxhighlight>
  
If you need to display several break animations at the same time you have to give each of them a unique Entity ID.
+
==== Tab-Complete (clientbound) ====
  
Also if you set the coordinates to a special block like water etc. it won't show the actual break animation but some other interesting effects. (Water will lose it's transparency)
+
The server responds with a list of auto-completions of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported. The client sorts these alphabetically before listing them.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,615: Line 1,731:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  !colspan="2"| Field Name
  ! Field Type
+
  !colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x25
+
  |rowspan="8"| 0x11
  |rowspan="3"| Play
+
  |rowspan="8"| Play
  |rowspan="3"| Client
+
  |rowspan="8"| Client
| Entity ID
 
| VarInt
 
| EID for the animation
 
 
  |-
 
  |-
  | Location
+
  |colspan="2"| ID
  | Position
+
  |colspan="2"| VarInt
  | Block Position
+
  | Transaction ID
 
  |-
 
  |-
  | Destroy Stage
+
  |colspan="2"| Start
| Byte
+
  |colspan="2"| VarInt
| 0–9 to set it, any other value to remove it
+
  | Start of the text to replace
|}
 
 
 
==== Map Chunk Bulk ====
 
 
 
1.8 changes at [[#Chunk Data|Chunk Data]]
 
 
 
To reduce the number of bytes, this packet is used to send chunks together for better compression results.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
!colspan="2"| Field Name
 
  !colspan="2"| Field Type
 
  ! Notes
 
 
  |-
 
  |-
|rowspan="7"| 0x26
+
  |colspan="2"| Length
|rowspan="7"| Play
+
  |colspan="2"| VarInt
|rowspan="7"| Client
+
  | Length of the text to replace
  |colspan="2"| Sky Light Sent
 
  |colspan="2"| Boolean
 
  | Whether or not Chunk Data contains light nibble arrays. This is true in the Overworld, false in the End + Nether
 
 
  |-
 
  |-
  |colspan="2"| Chunk Column Count
+
  |colspan="2"| Count
 
  |colspan="2"| VarInt
 
  |colspan="2"| VarInt
  | Number of elements in each of the following arrays
+
  | Number of elements in the following array
 
  |-
 
  |-
  |rowspan="3"| Chunk Meta
+
  |rowspan="3"| Matches
  | Chunk X
+
  | Match
 
  |rowspan="3"| Array
 
  |rowspan="3"| Array
  | Int
+
  | String (32767)
  | The X coordinate of the chunk
+
  | 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.
 
  |-
 
  |-
  | Chunk Z
+
  | Has tooltip
  | Int
+
  | Boolean
  | The Z coordinate of the chunk
+
  | True if the following is present
 
  |-
 
  |-
  | Primary Bit Mask
+
  | Tooltip
  | Unsigned Short
+
  | Optional [[Chat]]
| A bit mask which specifies which sections are not empty in this chunk
+
  | Tooltip to display; only present if previous boolean is true
|-
 
|colspan="2"| Chunk Data
 
|colspan="2"| Array of [[SMP Map Format#Data|Chunk]]
 
  | Each chunk in this array corresponds to the data at the same position in Chunk Meta
 
 
  |}
 
  |}
  
==== Explosion ====
+
==== Declare Commands ====
  
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).
+
Lists all of the commands on the server, and how they are parsed.
  
Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x
+
This is a directed graph, with one root node.  Each redirect or child node must refer only to nodes that have already been declared.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,693: Line 1,784:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="9"| 0x27
+
  |rowspan="3"| 0x12
  |rowspan="9"| Play
+
  |rowspan="3"| Play
  |rowspan="9"| Client
+
  |rowspan="3"| Client
  | X
+
  | Count
| Float
+
  | VarInt
|
 
|-
 
| Y
 
| Float
 
|
 
|-
 
| Z
 
| Float
 
|
 
|-
 
| Radius
 
| Float
 
| Currently unused in the client
 
|-
 
| Record Count
 
  | Int
 
 
  | Number of elements in the following array
 
  | Number of elements in the following array
 
  |-
 
  |-
  | Records
+
  | Nodes
  | Array of (Byte, Byte, Byte)
+
  | Array of [[Command Data|Node]]
  | Each record is 3 signed bytes long, each bytes are the XYZ (respectively) offsets of affected blocks.
+
  | An array of nodes
 
  |-
 
  |-
  | Player Motion X
+
  | Root index
  | Float
+
  | VarInt
  | X velocity of the player being pushed by the explosion
+
  | Index of the <code>root</code> node in the previous array
|-
 
| 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
 
 
  |}
 
  |}
  
==== Effect ====
+
For more information on this packet, see the [[Command Data]] article.
  
Sent when a client is to play a sound or particle effect.
+
==== Window Confirmation (clientbound) ====
  
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 1013 (mob.wither.spawn), and is ignored for any other value by the client.
+
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.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,747: Line 1,814:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x28
+
  |rowspan="3"| 0x13
  |rowspan="4"| Play
+
  |rowspan="3"| Play
  |rowspan="4"| Client
+
  |rowspan="3"| Client
  | Effect ID
+
  | Window ID
  | Int
+
  | Byte
  | The ID of the effect, see below
+
  | The ID of the window that the action occurred in
 
  |-
 
  |-
  | Location
+
  | Action Number
  | Position
+
  | Short
  | The location of the effect
+
  | 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.
 
  |-
 
  |-
  | Data
+
  | Accepted
| Int
 
| Extra data for certain effects, see below
 
|-
 
| Disable Relative Volume
 
 
  | Boolean
 
  | Boolean
  | See above
+
  | Whether the action was accepted
 
  |}
 
  |}
  
Effect IDs:
+
==== 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"
  ! ID
+
  ! Packet ID
  ! Name
+
  ! State
  ! Data
+
! Bound To
 +
! Field Name
 +
  ! Field Type
 +
! Notes
 
  |-
 
  |-
  !colspan="3"| Sound
+
  | 0x14
 +
| Play
 +
| Client
 +
| Window ID
 +
| Unsigned Byte
 +
| This is the ID of the window that was closed. 0 for inventory.
 +
|}
 +
 
 +
==== Window Items ====
 +
[[File:Inventory-slots.png|thumb|The inventory slots]]
 +
 
 +
Sent by the server when items in multiple slots (in a window) are added/removed. This includes the main inventory, equipped armour and crafting slots.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 1000
+
  |rowspan="3"| 0x15
  | <code>random.click</code>
+
|rowspan="3"| Play
  |  
+
  |rowspan="3"| Client
 +
| Window ID
 +
| Unsigned Byte
 +
  | The ID of window which items are being sent for. 0 for player inventory.
 
  |-
 
  |-
  | 1001
+
  | Count
  | <code>random.click</code>
+
  | Short
  |  
+
  | Number of elements in the following array
 
  |-
 
  |-
  | 1002
+
  | Slot Data
  | <code>random.bow</code>
+
  | Array of [[Slot Data|Slot]]
 
  |  
 
  |  
 +
|}
 +
 +
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.
 +
 +
==== Window Property ====
 +
 +
This packet is used to inform the client that part of a GUI window should be updated.
 +
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 1003
+
  |rowspan="3"| 0x16
  | <code>random.door_open</code> or <code>random.door_close</code> (50/50 chance)
+
|rowspan="3"| Play
 +
|rowspan="3"| Client
 +
| Window ID
 +
  | Unsigned Byte
 
  |  
 
  |  
 
  |-
 
  |-
  | 1004
+
  | Property
  | <code>random.fizz</code>
+
  | Short
  |  
+
  | The property to be updated, see below
 
  |-
 
  |-
  | 1005
+
  | Value
  | Play a music disc.
+
  | Short
  | {{Minecraft Wiki|Music Discs|Record ID}}
+
  | The new value for the property, see below
|-
+
|}
| 1006
+
 
| ''not assigned''
+
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"
 
  |-
 
  |-
  | 1007
+
  ! Window type
  | <code>mob.ghast.charge</code>
+
  ! Property
  |
+
  ! Value
 
  |-
 
  |-
  | 1008
+
  |rowspan="4"| Furnace
  | <code>mob.ghast.fireball</code>
+
  | 0: Fire icon (fuel left)
  |  
+
  | counting from fuel burn time down to 0 (in-game ticks)
 
  |-
 
  |-
  | 1009
+
  | 1: Maximum fuel burn time
| <code>mob.ghast.fireball</code>, but with a lower volume
+
  | fuel burn time or 0 (in-game ticks)
  |  
 
 
  |-
 
  |-
  | 1010
+
  | 2: Progress arrow
| <code>mob.zombie.wood</code>
+
  | counting from 0 to maximum progress (in-game ticks)
  |  
 
 
  |-
 
  |-
  | 1011
+
  | 3: Maximum progress
| <code>mob.zombie.metal</code>
+
  | always 200 on the notchian server
  |  
 
 
  |-
 
  |-
  | 1012
+
  |rowspan="10"| Enchantment Table
  | <code>mob.zombie.woodbreak</code>
+
  | 0: Level requirement for top enchantment slot
  |  
+
  |rowspan="3"| The enchantment's xp level requirement
 
  |-
 
  |-
  | 1013
+
  | 1: Level requirement for middle enchantment slot
| <code>mob.wither.spawn</code>
 
|
 
 
  |-
 
  |-
  | 1014
+
  | 2: Level requirement for bottom enchantment slot
| <code>mob.wither.shoot</code>
 
|
 
 
  |-
 
  |-
  | 1015
+
  | 3: The enchantment seed
  | <code>mob.bat.takeoff</code>
+
  | 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>).
|
 
 
  |-
 
  |-
  | 1016
+
  | 4: Enchantment ID shown on mouse hover over top enchantment slot
  | <code>mob.zombie.infect</code>
+
  |rowspan="3"| The enchantment id (set to -1 to hide it), see below for values
|  
 
 
  |-
 
  |-
  | 1017
+
  | 5: Enchantment ID shown on mouse hover over middle enchantment slot
| <code>mob.zombie.unfect</code>
 
|
 
 
  |-
 
  |-
  | 1018
+
  | 6: Enchantment ID shown on mouse hover over bottom enchantment slot
| <code>mob.enderdragon.end</code>
 
|
 
 
  |-
 
  |-
  | 1020
+
  | 7: Enchantment level shown on mouse hover over the top slot
  | <code>random.anvil_break</code>
+
  |rowspan="3"| The enchantment level (1 = I, 2 = II, 6 = VI, etc.), or -1 if no enchant
|
 
 
  |-
 
  |-
  | 1021
+
  | 8: Enchantment level shown on mouse hover over the middle slot
| <code>random.anvil_use</code>
 
|
 
 
  |-
 
  |-
  | 1022
+
  | 9: Enchantment level shown on mouse hover over the bottom slot
| <code>random.anvil_land</code>
 
|
 
 
  |-
 
  |-
  !colspan="3"| Particle
+
  |rowspan="3"| Beacon
 +
| 0: Power level
 +
| 0-4, controls what effect buttons are enabled
 
  |-
 
  |-
  | 2000
+
  | 1: First potion effect
  | Spawns 10 smoke particles, e.g. from a fire
+
  | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the first effect, or -1 if no effect
| Direction, see below
 
 
  |-
 
  |-
  | 2001
+
  | 2: Second potion effect
| Block break
+
  | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the second effect, or -1 if no effect
  | {{Minecraft Wiki|Data values|Block ID}}
 
 
  |-
 
  |-
  | 2002
+
  | Anvil
  | Splash potion. Particle effect + glass break sound.
+
  | 0: Repair cost
  | [http://www.lb-stuff.com/Minecraft/PotionDataValues1.9pre3.txt Potion ID]
+
  | The repair's cost in xp levels
 
  |-
 
  |-
  | 2003
+
  |rowspan="2"| Brewing Stand
  | Eye of Ender entity break animation — particles and sound
+
  | 0: Brew time
  |  
+
  | 0 – 400, with 400 making the arrow empty, and 0 making the arrow full
 
  |-
 
  |-
  | 2004
+
  | 1: Fuel time
| Mob spawn particle effect: smoke + flames
+
  | 0 - 20, with 0 making the arrow empty, and 20 making the arrow full
|
 
  |-
 
| 2005
 
| Spawn “happy villager” effect (green crosses), used for bonemealing vegetation
 
|
 
 
  |}
 
  |}
  
Smoke directions:
+
For an enchanting table, the following numerical IDs are used:
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! ID
+
  ! Numerical ID
  ! Direction
+
  ! Enchantment ID
 +
! Enchantment Name
 
  |-
 
  |-
 
  | 0
 
  | 0
  | South-East
+
  | minecraft:protection
 +
| Protection
 
  |-
 
  |-
 
  | 1
 
  | 1
  | South
+
  | minecraft:fire_protection
 +
| Fire Protection
 
  |-
 
  |-
 
  | 2
 
  | 2
  | South-West
+
  | minecraft:feather_falling
 +
| Feather Falling
 
  |-
 
  |-
 
  | 3
 
  | 3
  | East
+
  | minecraft:blast_protection
 +
| Blast Protection
 
  |-
 
  |-
 
  | 4
 
  | 4
  | (Up or middle ?)
+
  | minecraft:projectile_protection
 +
| Projectile Protection
 
  |-
 
  |-
 
  | 5
 
  | 5
  | West
+
  | minecraft:respiration
 +
| Respiration
 
  |-
 
  |-
 
  | 6
 
  | 6
  | North-East
+
  | minecraft:aqua_affinity
 +
| Aqua Affinity
 
  |-
 
  |-
 
  | 7
 
  | 7
  | North
+
  | minecraft:thorns
 +
| Thorns
 
  |-
 
  |-
 
  | 8
 
  | 8
  | North-West
+
  | minecraft:depth_strider
  |}
+
  | Depth Strider
 
+
|-
==== Sound Effect ====
+
| 9
 
+
| minecraft:frost_walker
Used to play a sound effect on the client.
+
| Frost Walker
 
+
|-
Custom sounds may be added by resource packs.
+
| 10
 
+
  | minecraft:binding_curse
{| class="wikitable"
+
  | Curse of Binding
  ! Packet ID
+
  |-
  ! State
+
  | 11
  ! Bound To
+
  | minecraft:sharpness
  ! Field Name
+
  | Sharpness
  ! Field Type
 
  ! Notes
 
 
  |-
 
  |-
  |rowspan="6"| 0x29
+
  | 12
  |rowspan="6"| Play
+
  | minecraft:smite
|rowspan="6"| Client
+
  | Smite
| Sound name
 
  | String
 
| All known sound effect names can be seen [https://github.com/SirCmpwn/Craft.Net/blob/master/source/Craft.Net.Common/SoundEffect.cs here]
 
 
  |-
 
  |-
  | Effect position X
+
  | 13
  | Int
+
  | minecraft:bane_of_arthropods
  | Effect X multiplied by 8
+
  | Bane of Arthropods
 
  |-
 
  |-
  | Effect position Y
+
  | 14
  | Int
+
  | minecraft:knockback
  | Effect Y multiplied by 8
+
  | Knockback
 
  |-
 
  |-
  | Effect position Z
+
  | 15
  | Int
+
  | minecraft:fire_aspect
  | Effect Z multiplied by 8
+
  | Fire Aspect
 
  |-
 
  |-
  | Volume
+
  | 16
  | Float
+
  | minecraft:looting
  | 1 is 100%, can be more
+
  | Looting
 
  |-
 
  |-
  | Pitch
+
  | 17
  | Unsigned Byte
+
  | minecraft:sweeping
  | 63 is 100%, can be more
+
  | Sweeping Edge
|}
 
 
 
==== Particle ====
 
 
 
Displays the named particle
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="11"| 0x2A
+
  | 18
|rowspan="11"| Play
+
  | minecraft:efficiency
|rowspan="11"| Client
+
  | Efficiency
| Particle ID
 
  | Int
 
  | See below
 
 
  |-
 
  |-
  | Long Distance
+
  | 19
  | Boolean
+
  | minecraft:silk_touch
  | If true, particle distance increases from 256 to 65536
+
  | Silk Touch
 
  |-
 
  |-
  | X
+
  | 20
  | Float
+
  | minecraft:unbreaking
  | X position of the particle
+
  | Unbreaking
 
  |-
 
  |-
  | Y
+
  | 21
  | Float
+
  | minecraft:fortune
  | Y position of the particle
+
  | Fortune
 
  |-
 
  |-
  | Z
+
  | 22
  | Float
+
  | minecraft:power
  | Z position of the particle
+
  | Power
 
  |-
 
  |-
  | Offset X
+
  | 23
  | Float
+
  | minecraft:punch
  | This is added to the X position after being multiplied by random.nextGaussian()
+
  | Punch
 
  |-
 
  |-
  | Offset Y
+
  | 24
  | Float
+
  | minecraft:flame
  | This is added to the Y position after being multiplied by random.nextGaussian()
+
  | Flame
 
  |-
 
  |-
  | Offset Z
+
  | 25
  | Float
+
  | minecraft:infinity
  | This is added to the Z position after being multiplied by random.nextGaussian()
+
  | Infinity
 
  |-
 
  |-
  | Particle Data
+
  | 26
  | Float
+
  | minecraft:luck_of_the_sea
  | The data of each particle
+
  | Luck of the Sea
 
  |-
 
  |-
  | Particle Count
+
  | 27
  | Int
+
  | minecraft:lure
  | The number of particles to create
+
  | Lure
 
  |-
 
  |-
  | Data
+
  | 28
  | Array of VarInt
+
  | minecraft:loyalty
  | Length depends on particle. "iconcrack" has length of 2, "blockcrack", and "blockdust" have lengths of 1, the rest have 0.
+
  | Loyalty
|}
 
 
 
Particle IDs:
 
 
 
{| class="wikitable"
 
 
  |-
 
  |-
  ! Particle Name
+
  | 29
  ! Particle ID
+
  | minecraft:impaling
 +
| Impaling
 
  |-
 
  |-
  | explode
+
  | 30
  | 0
+
  | minecraft:riptide
 +
| Riptide
 
  |-
 
  |-
  | largeexplosion
+
  | 31
  | 1
+
  | minecraft:channeling
 +
| Channeling
 
  |-
 
  |-
  | hugeexplosion
+
  | 32
  | 2
+
  | minecraft:mending
 +
| Mending
 
  |-
 
  |-
  | fireworksSpark
+
  | 33
  | 3
+
  | minecraft:vanishing_curse
 +
| Curse of Vanishing
 +
|}
 +
 
 +
==== Set Slot ====
 +
 
 +
Sent by the server when an item in a slot (in a window) is added/removed.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | bubble
+
  |rowspan="3"| 0x17
  | 4
+
|rowspan="3"| Play
 +
|rowspan="3"| Client
 +
| Window ID
 +
| Byte
 +
  | The window which is being updated. 0 for player inventory. Note that all known window types include the player inventory. This packet will only be sent for the currently opened window while the player is performing actions, even if it affects the player inventory. After the window is closed, a number of these packets are sent to update the player's inventory window (0).
 
  |-
 
  |-
  | splash
+
  | Slot
  | 5
+
  | Short
 +
| The slot that should be updated
 
  |-
 
  |-
  | wake
+
  | Slot Data
  | 6
+
| [[Slot Data|Slot]]
  |-
+
  |  
  | suspended
+
  |}
  | 7
+
 
  |-
+
To set the cursor (the item currently dragged with the mouse), use -1 as Window ID and as Slot.
  | depthsuspend
+
 
  | 8
+
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.
  |-
+
 
  | crit
+
==== Set Cooldown ====
  | 9
+
 
 +
Applies a cooldown period to all items with the given type. Used by the Notchian server with enderpearls.  This packet should be sent when the cooldown starts and also when the cooldown ends (to compensate for lag), although the client will end the cooldown automatically. Can be applied to any item, note that interactions still get sent to the server with the item but the client does not play the animation nor attempt to predict results (i.e block placing).
 +
 
 +
{| class="wikitable"
 +
  ! Packet ID
 +
  ! State
 +
  ! Bound To
 +
  ! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | magicCrit
+
  |rowspan="2"| 0x18
  | 10
+
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Item ID
 +
| VarInt
 +
  | Numeric ID of the item to apply a cooldown to.
 
  |-
 
  |-
  | smoke
+
  | Cooldown Ticks
  | 11
+
  | VarInt
 +
| Number of ticks to apply a cooldown for, or 0 to clear the cooldown.
 +
|}
 +
 
 +
==== Plugin Message (clientbound) ====
 +
 
 +
{{Main|Plugin channels}}
 +
 
 +
Mods and plugins can use this to send their data. Minecraft itself uses several [[plugin channel]]s. These internal channels are in the <code>minecraft</code> namespace.
 +
 
 +
More 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/]
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | largesmoke
+
  |rowspan="2"| 0x19
  | 12
+
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Channel
 +
| Identifier
 +
  | Name of the [[plugin channel]] used to send the data
 
  |-
 
  |-
  | spell
+
  | Data
  | 13
+
  | 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.
  | instantSpell
+
  |}
  | 14
+
 
  |-
+
==== Named Sound Effect ====
  | mobSpell
+
{{See also|#Sound Effect}}
  | 15
+
 
 +
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
 
  |-
 
  |-
  | mobSpellAmbient
+
  |rowspan="7"| 0x1A
  | 16
+
|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].
 
  |-
 
  |-
  | witchMagic
+
  | Sound Category
  | 17
+
  | VarInt Enum
 +
| The category that this sound will be played from ([https://gist.github.com/konwboj/7c0c380d3923443e9d55 current categories])
 
  |-
 
  |-
  | dripWater
+
  | Effect Position X
  | 18
+
  | Int
 +
| Effect X multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
 
  |-
 
  |-
  | dripLava
+
  | Effect Position Y
  | 19
+
  | Int
 +
| Effect Y multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
 
  |-
 
  |-
  | angryVillager
+
  | Effect Position Z
  | 20
+
  | Int
 +
| Effect Z multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
 
  |-
 
  |-
  | happyVillager
+
  | Volume
  | 21
+
  | Float
 +
| 1 is 100%, can be more
 
  |-
 
  |-
  | townaura
+
  | Pitch
  | 22
+
  | Float
 +
| Float between 0.5 and 2.0 by Notchian clients
 +
|}
 +
 
 +
==== Disconnect (play) ====
 +
 
 +
Sent by the server before it disconnects a client. The client assumes that the server has already closed the connection by the time the packet arrives.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | note
+
  | 0x1B
  | 23
+
  | Play
  |-
+
  | Client
  | portal
+
  | Reason
  | 24
+
  | [[Chat]]
  |-
+
  | Displayed to the client when the connection terminates.
| enchantmenttable
+
  |}
| 25
+
 
|-
+
==== Entity Status ====
| flame
 
| 26
 
|-
 
| lava
 
| 27
 
|-
 
| footstep
 
| 28
 
|-
 
| cloud
 
| 29
 
|-
 
| reddust
 
| 30
 
|-
 
| snowballpoof
 
| 31
 
|-
 
| snowshovel
 
| 32
 
|-
 
| slime
 
| 33
 
|-
 
| heart
 
| 34
 
|-
 
| barrier
 
| 35
 
|-
 
| iconcrack_(id)_(data)
 
| 36
 
|-
 
| blockcrack_(id+(data<<12))
 
| 37
 
|-
 
| blockdust_(id)
 
| 38
 
|-
 
| droplet
 
| 39
 
|-
 
| take
 
| 40
 
|-
 
| mobappearance
 
| 41
 
  |}
 
 
 
==== Change Game State ====
 
  
It appears when a bed can't be used as a spawn point and when the rain state changes.
+
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"
Line 2,173: Line 2,282:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x2B
+
  |rowspan="2"| 0x1C
 
  |rowspan="2"| Play
 
  |rowspan="2"| Play
 
  |rowspan="2"| Client
 
  |rowspan="2"| Client
  | Reason
+
  | Entity ID
  | Unsigned Byte
+
| Int
 +
|
 +
|-
 +
| Entity Status
 +
  | Byte Enum
 
  | See below
 
  | See below
|-
 
| Value
 
| Float
 
| Depends on reason
 
 
  |}
 
  |}
  
''Reason codes'':
+
See [[Entity statuses]] for a list of which statuses are valid for each type of entity.
 +
 
 +
==== Explosion ====
 +
 
 +
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).
 +
 
 +
Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Code
+
  ! Packet ID
  ! Effect
+
  ! State
  ! Value
+
  ! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 0
+
  |rowspan="9"| 0x1D
  | Invalid Bed
+
|rowspan="9"| Play
 +
|rowspan="9"| Client
 +
| X
 +
  | Float
 
  |  
 
  |  
 
  |-
 
  |-
  | 1
+
  | Y
  | End raining
+
  | Float
 
  |  
 
  |  
 
  |-
 
  |-
  | 2
+
  | Z
  | Begin raining
+
  | Float
 
  |  
 
  |  
 
  |-
 
  |-
  | 3
+
  | Strength
  | Change game mode
+
  | Float
  | 0: Survival, 1: Creative, 2: Adventure, 3: Spectator
+
  | 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
 
  |-
 
  |-
  | 4
+
  | Records
  | Enter credits
+
  | Array of (Byte, Byte, Byte)
  |  
+
  | Each record is 3 signed bytes long; the 3 bytes are the XYZ (respectively) signed offsets of affected blocks.
 
  |-
 
  |-
  | 5
+
  | Player Motion X
  | Demo message
+
  | Float
  | 0: Show welcome to demo screen, 101: Tell movement controls, 102: Tell jump control, 103: Tell inventory control
+
  | X velocity of the player being pushed by the explosion
|-
 
| 6
 
| Arrow hitting player
 
| Appears to be played when an arrow strikes another player in Multiplayer
 
 
  |-
 
  |-
  | 7
+
  | Player Motion Y
  | Fade value
+
  | Float
  | The current darkness value. 1 = Dark, 0 = Bright, Setting the value higher causes the game to change color and freeze
+
  | Y velocity of the player being pushed by the explosion
 
  |-
 
  |-
  | 8
+
  | Player Motion Z
  | Fade time
+
  | Float
  | Time in ticks for the sky to fade
+
  | Z velocity of the player being pushed by the explosion
|-
 
| 10
 
| Play mob appearance (effect and sound)
 
 
  |}
 
  |}
  
==== Spawn Global Entity ====
+
==== Unload Chunk ====
  
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.
+
Tells the client to unload a chunk column.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,244: Line 2,362:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| 0x2C
+
  |rowspan="2"| 0x1E
  |rowspan="5"| Play
+
  |rowspan="2"| Play
  |rowspan="5"| Client
+
  |rowspan="2"| Client
  | Entity ID
+
  | Chunk X
| VarInt
 
| The EID of the thunderbolt
 
|-
 
| Type
 
| Byte
 
| The global entity type, currently always 1 for thunderbolt
 
|-
 
| X
 
 
  | Int
 
  | Int
  | Thunderbolt X, a [[Data Types#Fixed-point numbers|fixed-point number]]
+
  | Block coordinate divided by 16, rounded down
 
  |-
 
  |-
  | Y
+
  | Chunk Z
 
  | Int
 
  | Int
  | Thunderbolt Y, a [[Data Types#Fixed-point numbers|fixed-point number]]
+
  | Block coordinate divided by 16, rounded down
|-
 
| Z
 
| Int
 
| Thunderbolt Z, a [[Data Types#Fixed-point numbers|fixed-point number]]
 
 
  |}
 
  |}
  
==== Open Window ====
+
It is legal to send this packet even if the given chunk is not currently loaded.
 +
 
 +
==== Change Game State ====
  
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.
+
Used for a wide variety of game state things, from whether to bed use to gamemode to demo messages.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,280: Line 2,388:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| 0x2D
+
  |rowspan="2"| 0x1F
  |rowspan="5"| Play
+
  |rowspan="2"| Play
  |rowspan="5"| Client
+
  |rowspan="2"| Client
  | Window ID
+
  | Reason
 
  | Unsigned Byte
 
  | Unsigned Byte
  | A unique id number for the window to be displayed. Notchian server implementation is a counter, starting at 1.
+
  | See below
 
  |-
 
  |-
  | Window Type
+
  | Value
  | String
+
  | Float
  | The window type to use for display. See below
+
  | Depends on Reason
|-
 
| Window Title
 
| [[Chat]]
 
| The title of the window
 
|-
 
| Number Of Slots
 
| Unsigned Byte
 
| Number of slots in the window (excluding the number of slots in the player inventory)
 
|-
 
| Entity ID
 
| Optional Int
 
| EntityHorse's EID. Only sent when Window Type is “EntityHorse”
 
 
  |}
 
  |}
  
See [[Inventory#Windows|inventory windows]] for further information.
+
''Reason codes'':
 
 
==== Close Window ====
 
 
 
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.
 
 
 
Note, notchian clients send a close window packet with Window ID 0 to close their inventory even though there is never an [[#Open Window|Open Window]] packet for inventory.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  ! Reason
  ! State
+
  ! Effect
  ! Bound To
+
  ! Value
  ! Field Name
+
  |-
  ! Field Type
+
| 0
  ! Notes
+
  | Invalid Bed
 +
  | Would be used to switch between messages, but the only used message is 0 for invalid bed
 
  |-
 
  |-
  | 0x2E
+
  | 1
  |rowspan="1"| Play
+
| End raining
  |rowspan="1"| Client
+
|
  | Window ID
+
|-
  | Unsigned Byte
+
| 2
  | This is the ID of the window that was closed. 0 for inventory.
+
| 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)
 +
  |}
  
==== Set Slot ====
+
==== Open Horse Window ====
  
Sent by the server when an item in a slot (in a window) is added/removed.
+
This packet is used exclusively for opening the horse GUI.  [[#Open Window|Open Window]] is used for all other GUIs.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,340: Line 2,467:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x2F
+
  |rowspan="3"| 0x20
 
  |rowspan="3"| Play
 
  |rowspan="3"| Play
 
  |rowspan="3"| Client
 
  |rowspan="3"| Client
  | Window ID
+
  | Window ID?
 
  | Byte
 
  | Byte
  | The window which is being updated. 0 for player inventory. Note that all known window types include the player inventory. This packet will only be sent for the currently opened window while the player is performing actions, even if it affects the player inventory. After the window is closed, a number of these packets are sent to update the player's inventory window (0).
+
  |
 
  |-
 
  |-
  | Slot
+
  | Number of slots?
  | Short
+
  | VarInt
  | The slot that should be updated
+
  |
 
  |-
 
  |-
  | Slot Data
+
  | Entity ID?
  | [[Slot Data|Slot]]
+
  | Integer
  |  
+
  |
 
  |}
 
  |}
  
==== Window Items ====
+
==== Keep Alive (clientbound) ====
  
[[File:Inventory-slots.png|thumb|The inventory slots]]
+
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.
  
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.
+
The Notchian server uses a system-dependent time in milliseconds to generate the keep alive ID value.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,370: Line 2,497:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x30
+
  |rowspan="1"| 0x21
  |rowspan="3"| Play
+
  |rowspan="1"| Play
  |rowspan="3"| Client
+
  |rowspan="1"| Client
  | Window ID
+
  | Keep Alive ID
  | Unsigned Byte
+
  | Long
| 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]]
 
 
  |  
 
  |  
 
  |}
 
  |}
  
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.
+
==== Chunk Data ====
 +
{{Main|Chunk Format}}
 +
{{See also|#Unload Chunk}}
  
==== Window Property ====
+
{{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)}}
  
This packet is used to inform the client that part of a GUI window should be updated.
+
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"
Line 2,400: Line 2,521:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x31
+
  |rowspan="10"| 0x22
  |rowspan="3"| Play
+
  |rowspan="10"| Play
  |rowspan="3"| Client
+
  |rowspan="10"| Client
  | Window ID
+
  | Chunk X
  | Unsigned Byte
+
  | Int
  |  
+
  | Chunk coordinate (block coordinate divided by 16, rounded down)
 +
|-
 +
| Chunk Z
 +
| Int
 +
| Chunk coordinate (block coordinate divided by 16, rounded down)
 
  |-
 
  |-
  | Property
+
  | Full chunk
  | Short
+
  | Boolean
  | The property to be updated, see below
+
  | See [[Chunk Format#Full chunk|Chunk Format]]
 
  |-
 
  |-
  | Value
+
  | Primary Bit Mask
  | Short
+
  | VarInt
  | The new value for the property, see below
+
  | 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).
|}
 
 
 
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
+
  | Heightmaps
  ! Property
+
  | [[NBT]]
  ! Value
+
  | 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.
 
  |-
 
  |-
  |rowspan="2"| Furnace
+
  | Biomes
  | 0: Progress arrow
+
| Optional array of Integer
  | 0–200 (presumably in in-game ticks)
+
| 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
 
  |-
 
  |-
  | 1: Fire icon (fuel)
+
  | Data
  | 0–200 (presumably in in-game ticks)
+
  | Byte array
 +
| See [[Chunk Format#Data structure|data structure]] in Chunk Format
 
  |-
 
  |-
  |rowspan="7"| Enchantment Table
+
  | Number of block entities
| 0: Level requirement for top enchantment slot
+
  | VarInt
|rowspan="3"| The enchantment's xp level requirement
+
  | Number of elements in the following array
  |-
 
  | 1: Level requirement for middle enchantment slot
 
 
  |-
 
  |-
  | 2: Level requirement for bottom enchantment slot
+
  | Block entities
  |-
+
  | Array of [[NBT|NBT Tag]]
| 3: The seed for generating the enchantments view for the client
+
  | All block entities in the chunk. Use the x, y, and z tags in the NBT to determine their positions.
| Unknown
 
|-
 
| 4: tooltip shown on mouse hover over top enchantment slot
 
|rowspan="3"| Unknown (set to -1 to hide it)
 
|-
 
| 5: tooltip shown on mouse hover over middle enchantment slot
 
|-
 
| 6: tooltip shown on mouse hover over bottom enchantment slot
 
|-
 
|rowspan="3"| Beacon
 
  | 0: Power level
 
| Unknown
 
|-
 
| 1: First potion effect
 
| Unknown
 
|-
 
| 2: Second potion effect
 
| Unknown
 
|-
 
| Anvil
 
| 0: Repair cost
 
| The repair's cost in xp levels
 
  |-
 
| Brewing Stand
 
| 0: Brew time
 
| 0–400, with 400 making the arrow empty, and 0 making the arrow full
 
 
  |}
 
  |}
  
==== Confirm Transaction ====
+
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.
  
A packet from the server indicating whether a request from the client was accepted, or whether there was a conflict (due to lag). This packet is also sent from the client to the server in response to a server transaction rejection packet.
+
By default, the Minecraft client adjusts the volume of sound effects based on distance. The final boolean field is used to disable this, and instead the effect is played from 2 blocks away in the correct direction. Currently this is only used for effect 1023 (wither spawn) and effect 1028 (enderdragon death); it is ignored on other effects.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,480: Line 2,581:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x32
+
  |rowspan="4"| 0x23
  |rowspan="3"| Play
+
  |rowspan="4"| Play
  |rowspan="3"| Client
+
  |rowspan="4"| Client
  | Window ID
+
  | Effect ID
  | Byte
+
  | Int
  | The ID of the window that the action occurred in
+
  | The ID of the effect, see below
 +
|-
 +
| Location
 +
| Position
 +
| The location of the effect
 
  |-
 
  |-
  | Action Number
+
  | Data
  | Short
+
  | Int
  | Every action that is to be accepted has a unique number. This field corresponds to that number.
+
  | Extra data for certain effects, see below
 
  |-
 
  |-
  | Accepted
+
  | Disable Relative Volume
 
  | Boolean
 
  | Boolean
  | Whether the action was accepted
+
  | See above
 
  |}
 
  |}
  
==== Update Sign ====
+
Effect IDs:
 
 
This message is sent from the server to the client whenever a sign is discovered or created. This message is NOT sent when a sign is destroyed or unloaded.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  ! ID
  ! State
+
  ! Name
! Bound To
+
  ! Data
  ! Field Name
+
  |-
  ! Field Type
+
  !colspan="3"| Sound
  ! Notes
 
 
  |-
 
  |-
  |rowspan="5"| 0x33
+
  | 1000
|rowspan="5"| Play
+
  | Dispenser dispenses
|rowspan="5"| Client
 
| Location
 
  | Position
 
 
  |  
 
  |  
 
  |-
 
  |-
  | Line 1
+
  | 1001
  | [[Chat]]
+
  | Dispenser fails to dispense
  | First line of text in the sign
+
  |  
 
  |-
 
  |-
  | Line 2
+
  | 1002
  | [[Chat]]
+
  | Dispenser shoots
  | Second line of text in the sign
+
  |  
 
  |-
 
  |-
  | Line 3
+
  | 1003
  | [[Chat]]
+
  | Ender eye launched
  | Third line of text in the sign
+
  |  
 
  |-
 
  |-
  | Line 4
+
  | 1004
  | [[Chat]]
+
  | Firework shot
  | Fourth line of text in the sign
+
  |  
|}
 
 
 
==== Maps ====
 
 
 
Updates a rectangular area on a map.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
!colspan="2"| Field Name
 
!colspan="2"| Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="12"| 0x34
+
  | 1005
|rowspan="12"| Play
+
  | Iron door opened
|rowspan="12"| Client
+
  |  
  |colspan="2"| Item Damage
 
|colspan="2"| VarInt
 
  | The damage value (map ID) of the map being modified
 
 
  |-
 
  |-
  |colspan="2"| Scale
+
  | 1006
  |colspan="2"| Byte
+
  | Wooden door opened
 
  |  
 
  |  
|-
 
|colspan="2"| Icon Count
 
|colspan="2"| VarInt
 
| Number of elements in the following array
 
 
  |-
 
  |-
  |rowspan="3"| Icon
+
  | 1007
| Direction And Type
+
  | Wooden trapdoor opened
|rowspan="3"| Array
+
  |  
  | Byte
 
  | 0xF0 = Direction, 0x0F = Type
 
 
  |-
 
  |-
  | X
+
  | 1008
  | Byte
+
  | Fence gate opened
 
  |  
 
  |  
 
  |-
 
  |-
  | Z
+
  | 1009
  | Byte
+
  | Fire extinguished
 
  |  
 
  |  
|-
 
|colspan="2"| Columns
 
|colspan="2"| Byte
 
| Number of columns updated
 
 
  |-
 
  |-
  |colspan="2"| Rows
+
  | 1010
  |colspan="2"| Optional Byte
+
  | Play record
  | Only if Columns is more than 0; number of rows updated
+
  | Special case, see below for more info
 
  |-
 
  |-
  |colspan="2"| X
+
  | 1011
  |colspan="2"| Optional Byte
+
  | Iron door closed
  | Only if Columns is more than 0; x offset of the westernmost column
+
  |  
 
  |-
 
  |-
  |colspan="2"| Z
+
  | 1012
  |colspan="2"| Optional Byte
+
  | Wooden door closed
  | Only if Columns is more than 0; z offset of the northernmost row
+
  |  
 
  |-
 
  |-
  |colspan="2"| Length
+
  | 1013
  |colspan="2"| Optional VarInt
+
  | Wooden trapdoor closed
  | Only if Columns is more than 0; length of the following array
+
  |  
 
  |-
 
  |-
  |colspan="2"| Data
+
  | 1014
  |colspan="2"| Optional Array of Unsigned Byte
+
  | Fence gate closed
  | Only if Columns is more than 0; see {{Minecraft Wiki|Map item format}}
+
  |  
|}
 
 
 
==== Update Block Entity ====
 
 
 
Essentially a block update on a block entity.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x35
+
  | 1015
|rowspan="3"| Play
+
  | Ghast warns
|rowspan="3"| Client
 
| Location
 
  | Position
 
 
  |  
 
  |  
 
  |-
 
  |-
  | Action
+
  | 1016
  | Unsigned Byte
+
  | Ghast shoots
  | The type of update to perform, see below
+
|
 +
|-
 +
| 1017
 +
| Enderdragon shoots
 +
  |  
 
  |-
 
  |-
  | NBT Data
+
  | 1018
  | Optional [[NBT|NBT Tag]]
+
  | Blaze shoots
| If not present then it's a TAG_END (0)
+
  |  
  |}
 
 
 
''Action'' field:
 
 
 
* '''1''': Set SpawnPotentials of a mob spawner
 
* '''2''': Set command block text (command and last execution status)
 
* '''3''': Set the level, primary, and secondary powers of a beacon
 
* '''4''': Set rotation and skin of mob head
 
* '''5''': Set type of flower in flower pot
 
* '''6''': Set base color and patterns on a banner
 
 
 
==== Sign Editor Open ====
 
 
 
Sent on placement of sign.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="1"| 0x36
+
  | 1019
|rowspan="1"| Play
+
  | Zombie attacks wood door
|rowspan="1"| Client
 
| Location
 
  | Position
 
 
  |  
 
  |  
|}
 
 
==== Statistics ====
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
!colspan="2"| Field Name
 
!colspan="2"| Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x37
+
  | 1020
  |rowspan="3"| Play
+
| Zombie attacks iron door
  |rowspan="3"| Client
+
|
  |colspan="2"| Count
+
|-
  |colspan="2"| VarInt
+
| 1021
  | Number of elements in the following array
+
| Zombie breaks wood door
 +
|
 +
  |-
 +
| 1022
 +
  | Wither breaks block
 +
|
 +
  |-
 +
| 1023
 +
| Wither spawned
 +
  |  
 +
|-
 +
| 1024
 +
| Wither shoots
 +
  |
 
  |-
 
  |-
  |rowspan="2"| Statistic
+
  | 1025
| Name
+
  | Bat takes off
|rowspan="2"| Array
+
  |
  | String
 
  | [https://gist.github.com/thinkofdeath/a1842c21a0cf2e1fb5e0 https://gist.github.com/thinkofdeath/a1842c21a0cf2e1fb5e0]
 
 
  |-
 
  |-
  | Value
+
  | 1026
  | VarInt
+
  | Zombie infects
  | The amount to set it to
+
  |
|}
 
 
 
==== Player List Item ====
 
 
 
Sent by the notchian 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"| 0x38
+
  | 1027
|rowspan="19"| Play
+
  | Zombie villager converted
|rowspan="19"| Client
+
  |
  |colspan="4"| Action
 
|colspan="3"| VarInt
 
  | Determines the rest of the Player format after the UUID
 
 
  |-
 
  |-
  |colspan="4"| Number Of Players
+
  | 1028
  |colspan="3"| VarInt
+
  | Ender dragon death
  | Number of elements in the following array
+
  |
 
  |-
 
  |-
  |rowspan="17"| Player
+
  | 1029
|colspan="3"| UUID
+
  | Anvil destroyed
  |rowspan="17"| Array
 
|colspan="2"| UUID
 
 
  |  
 
  |  
 
  |-
 
  |-
  ! Action
+
  | 1030
  !colspan="2"| Field Name
+
| Anvil used
  !colspan="2"|  
+
  |  
  !
+
  |-
 +
  | 1031
 +
| Anvil landed
 +
|
 
  |-
 
  |-
  |rowspan="10"| 0: add player
+
  | 1032
|colspan="2"| Name
+
  | Portal travel
  |colspan="2"| String
 
 
  |  
 
  |  
 
  |-
 
  |-
  |colspan="2"| Number Of Properties
+
  | 1033
  |colspan="2"| VarInt
+
  | Chorus flower grown
  | Number of elements in the following array
+
  |
 
  |-
 
  |-
  |rowspan="4"| Property
+
  | 1034
| Name
+
  | Chorus flower died
|rowspan="4"| Array
 
  | String
 
 
  |  
 
  |  
 
  |-
 
  |-
  | Value
+
  | 1035
  | String
+
  | Brewing stand brewed
  |  
+
  |
  |-  
+
  |-
  | Is Signed
+
  | 1036
  | Boolean
+
  | Iron trapdoor opened
 
  |  
 
  |  
 
  |-
 
  |-
  | Signature
+
  | 1037
  | Optional String
+
  | Iron trapdoor closed
  | Only if Is Signed is true
+
  |
 +
|-
 +
!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
 
  |-
 
  |-
  |colspan="2"| Gamemode
+
  | 2002
  |colspan="2"| VarInt
+
  | Splash potion. Particle effect + glass break sound.
  |  
+
  | [http://minecraft.gamepedia.com/Data_values#Potions Potion ID]
 
  |-
 
  |-
  |colspan="2"| Ping
+
  | 2003
  |colspan="2"| VarInt
+
  | Eye of Ender entity break animation — particles and sound
 
  |  
 
  |  
 
  |-
 
  |-
  |colspan="2"| Has Display Name
+
  | 2004
  |colspan="2"| Boolean
+
  | Mob spawn particle effect: smoke + flames
 
  |  
 
  |  
 
  |-
 
  |-
  |colspan="2"| Display Name
+
  | 2005
  |colspan="2"| Optional [[Chat]]
+
| Bonemeal particles
  | Only if Has Display Name is true
+
| How many particles to spawn (if set to 0, 15 are spawned)
 +
|-
 +
  | 2006
 +
| Dragon breath
 +
  |
 
  |-
 
  |-
  | 1: update gamemode
+
  | 2007
|colspan="2"| Gamemode
+
  | Instant splash potion
|colspan="2"| VarInt
+
  | [http://minecraft.gamepedia.com/Data_values#Potions Potion ID]
  |  
 
  |-
 
| 2: update latency
 
|colspan="2"| Ping
 
|colspan="2"| VarInt
 
|
 
 
  |-
 
  |-
  |rowspan="2"| 3: update display name
+
  | 3000
|colspan="2"| Has Display Name
+
  | End gateway spawn
  |colspan="2"| Boolean
 
 
  |  
 
  |  
 
  |-
 
  |-
  |colspan="2"| Display Name
+
  | 3001
|colspan="2"| Optional [[Chat]]
+
  | Enderdragon growl
  | Only send if Has Display Name is true
+
  |
|-
 
| 4: remove player
 
|colspan="2"| ''no fields''
 
|colspan="2"|
 
  |  
 
 
  |}
 
  |}
  
==== Player Abilities ====
+
Smoke directions:
 
 
The latter 2 floats are used to indicate the walking and flying speeds respectively, while the first byte is used to determine the value of 4 booleans.
 
 
 
The flags are whether damage is disabled (god mode, 8, bit 3), whether the player can fly (4, bit 2), whether the player is flying (2, bit 1), and whether the player is in creative mode (1, bit 0).
 
 
 
To get the values of these booleans, simply AND (&) the byte with 1,2,4 and 8 respectively, to get the 0 or 1 bitwise value. To set them OR (|) them with their repspective masks.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  ! ID
  ! State
+
  ! Direction
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x39
+
  | 0
|rowspan="3"| Play
+
  | South-East
|rowspan="3"| Client
 
| Flags
 
| Byte
 
  | Bit mask, see above
 
 
  |-
 
  |-
  | Flying Speed
+
  | 1
| Float
+
  | South
  |  
 
 
  |-
 
  |-
  | Walking Speed
+
  | 2
  | Float
+
  | South-West
  |  
+
  |-
  |}
+
  | 3
 
+
| East
==== Tab-Complete ====
+
|-
 
+
| 4
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.
+
| (Up or middle ?)
 
+
  |-
{| class="wikitable"
+
  | 5
  ! Packet ID
+
  | West
  ! State
+
  |-
  ! Bound To
+
  | 6
  ! Field Name
+
  | North-East
  ! Field Type
 
  ! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x3A
+
  | 7
|rowspan="2"| Play
+
  | North
|rowspan="2"| Client
 
| Count
 
| VarInt
 
  | Number of elements in the following array
 
 
  |-
 
  |-
  | Matches
+
  | 8
  | Array of String
+
  | North-West
| One eligible command, note that each command is sent separately instead of in a single string, hence the need for Count
 
 
  |}
 
  |}
  
==== Scoreboard Objective ====
+
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.
 +
 
 +
==== Particle ====
  
This is sent to the client when it should create a new {{Minecraft Wiki|scoreboard}} objective or remove one.
+
Displays the named particle
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,853: Line 2,853:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x3B
+
  |rowspan="11"| 0x24
  |rowspan="4"| Play
+
  |rowspan="11"| Play
  |rowspan="4"| Client
+
  |rowspan="11"| Client
  | Objective Name
+
  | Particle ID
  | String
+
  | Int
  | An unique name for the objective
+
  | The particle ID listed in [[#Particle|the particle data type]].
 
  |-
 
  |-
  | Mode
+
  | Long Distance
  | Byte
+
  | Boolean
  | 0 to create the scoreboard. 1 to remove the scoreboard. 2 to update the display text.
+
  | If true, particle distance increases from 256 to 65536
 
  |-
 
  |-
  | Objective Value
+
  | X
  | Optional String
+
  | Double
  | Only if mode is 0 or 2. The text to be displayed for the score
+
  | X position of the particle
 
  |-
 
  |-
  | Type
+
  | Y
  | Optional String
+
  | Double
  | Only if mode is 0 or 2. “integer” or “hearts”
+
  | Y position of the particle
|}
 
 
 
==== Update Score ====
 
 
 
This is sent to the client when it should update a scoreboard item.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="4"| 0x3C
+
  | Z
|rowspan="4"| Play
+
  | Double
|rowspan="4"| Client
+
  | Z position of the particle
| Score Name
 
  | String
 
  | The name of the score to be updated or removed
 
 
  |-
 
  |-
  | Action
+
  | Offset X
  | Byte
+
  | Float
  | 0 to create/update an item. 1 to remove an item.
+
  | This is added to the X position after being multiplied by random.nextGaussian()
 +
|-
 +
| Offset Y
 +
| Float
 +
| This is added to the Y position after being multiplied by random.nextGaussian()
 +
|-
 +
| Offset Z
 +
| Float
 +
| This is added to the Z position after being multiplied by random.nextGaussian()
 +
|-
 +
| Particle Data
 +
| Float
 +
| The data of each particle
 
  |-
 
  |-
  | Objective Name
+
  | Particle Count
  | String
+
  | Int
  | The name of the objective the score belongs to
+
  | The number of particles to create
 
  |-
 
  |-
  | Value
+
  | Data
  | Optional VarInt
+
  | Varies
  | The score to be displayed next to the entry. Only sent when Action does not equal 1.
+
  | The variable data listed in [[#Particle|the particle data type]].
 
  |}
 
  |}
  
==== Display Scoreboard ====
+
==== Update Light ====
  
This is sent to the client when it should display a scoreboard.
+
Updates light levels for a chunk.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,913: Line 2,909:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  !colspan="2"| Field Name
  ! Field Type
+
  !colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x3D
+
  |rowspan="10"| 0x25
  |rowspan="2"| Play
+
  |rowspan="10"| Play
  |rowspan="2"| Client
+
  |rowspan="10"| Client
  | Position
+
  |colspan="2"| Chunk X
  | Byte
+
  |colspan="2"| VarInt
  | The position of the scoreboard. 0: list, 1: sidebar, 2: below name.
+
  | Chunk coordinate (block coordinate divided by 16, rounded down)
 
  |-
 
  |-
  | Score Name
+
  |colspan="2"| Chunk Z
| String
+
  |colspan="2"| VarInt
  | The unique name for the scoreboard to be displayed.
+
  | Chunk coordinate (block coordinate divided by 16, rounded down)
|}
 
 
 
==== Teams ====
 
 
 
Creates and updates teams.
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="10"| 0x3E
+
  |colspan="2"| Sky Light Mask
  |rowspan="10"| Play
+
  |colspan="2"| VarInt
  |rowspan="10"| Client
+
  | 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)
| Team Name
 
| String
 
| A unique name for the team. (Shared with scoreboard).
 
 
  |-
 
  |-
  | Mode
+
  |colspan="2"| Block Light Mask
  | Byte
+
  |colspan="2"| VarInt
  | If 0 then the team is created.
+
  | Mask containing 18 bits, with the same order as sky light
 
 
If 1 then the team is removed.
 
 
 
If 2 the team team information is updated.
 
 
 
If 3 then new players are added to the team.
 
 
 
If 4 then players are removed from the team.
 
 
  |-
 
  |-
  | Team Display Name
+
  |colspan="2"| Empty Sky Light Mask
  | Optional String
+
  |colspan="2"| VarInt
  | Only if Mode = 0 or 2.
+
  | 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.
 
  |-
 
  |-
  | Team Prefix
+
  |colspan="2"| Empty Block Light Mask
  | Optional String
+
  |colspan="2"| VarInt
  | Only if Mode = 0 or 2. Displayed before the players' name that are part of this team
+
  | 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.
 
  |-
 
  |-
  | Team Suffix
+
  |rowspan="2"| Sky Light arrays
  | Optional String
+
  | Length
  | Only if Mode = 0 or 2. Displayed after the players' name that are part of this team
+
  |rowspan="2"| Array
 +
| VarInt
 +
| Length of the following array in bytes (always 2048)
 
  |-
 
  |-
  | Friendly Fire
+
  | Sky Light array
  | Optional Byte
+
  | Array of 2048 bytes
  | Only if Mode = 0 or 2. 0 for off, 1 for on, 3 for seeing friendly invisibles
+
  | 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.
 
  |-
 
  |-
  | Name Tag Visibility
+
  |rowspan="2"| Block Light arrays
  | Optional String
+
  | Length
  | Only if Mode = 0 or 2. always, hideForOtherTeams, hideForOwnTeam, never
+
  |rowspan="2"| Array
 +
| VarInt
 +
| Length of the following array in bytes (always 2048)
 
  |-
 
  |-
  | Color
+
  | Block Light array
| Optional Byte
+
  | Array of 2048 bytes
| Only if Mode = 0 or 2. Same as [[Chat]] colors
+
  | 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.
|-
 
| Player Count
 
| Optional VarInt
 
| Only if Mode = 0 or 3 or 4. Number of players in the array
 
  |-
 
| Players
 
| Optional Array of String
 
  | Only if Mode = 0 or 3 or 4. Players to be added/remove from the team. Max 40 characters so may be uuid's later
 
 
  |}
 
  |}
  
==== Plugin Message ====
+
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.
  
Mods and plugins can use this to send their data. Minecraft itself uses a number of [[plugin channel]]s. These internal channels are prefixed with <code>MC|</code>.
+
==== Join Game ====
  
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/]
+
See [[Protocol Encryption]] for information on logging in.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,007: Line 2,975:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x3F
+
  |rowspan="9"| 0x26
  |rowspan="2"| Play
+
  |rowspan="9"| Play
  |rowspan="2"| Client
+
  |rowspan="9"| Client
  | Channel
+
  | Entity ID
  | String
+
  | Int
  | Name of the [[plugin channel]] used to send the data
+
| The player's Entity ID (EID)
 +
|-
 +
| Gamemode
 +
| Unsigned Byte
 +
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. Bit 3 (0x8) is the hardcore flag.
 +
|-
 +
| Dimension
 +
| Int Enum
 +
| -1: Nether, 0: Overworld, 1: End; also, note that this is not a VarInt but instead a regular int.
 +
|-
 +
| Hashed seed
 +
| Long
 +
  | First 8 bytes of the SHA-256 hash of the world's seed.
 +
|-
 +
| Max Players
 +
| Unsigned Byte
 +
| Was once used by the client to draw the player list, but now is ignored
 +
|-
 +
| Level Type
 +
| String Enum (16)
 +
| default, flat, largeBiomes, amplified, customized, buffet, default_1_1
 +
|-
 +
| View Distance
 +
| VarInt
 +
| Render distance (2-32)
 +
|-
 +
| Reduced Debug Info
 +
| Boolean
 +
| If true, a Notchian client shows reduced information on the {{Minecraft Wiki|debug screen}}.  For servers in development, this should almost always be false.
 
  |-
 
  |-
  | Data
+
  | Enable respawn screen
  | Byte Array
+
  | Boolean
  | Any data, depending on the channel. <code><nowiki>MC|</nowiki></code> channels are documented [[plugin channel|here]].
+
  | Set to false when the doImmediateRespawn gamerule is true
 
  |}
 
  |}
  
==== Disconnect ====
+
==== Map Data ====
  
Sent by the server before it disconnects a client. The server assumes that the sender has already closed the connection by the time the packet arrives.
+
Updates a rectangular area on a {{Minecraft Wiki|map}} item.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,027: Line 3,023:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  !colspan="2"| Field Name
  ! Field Type
+
  !colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  | 0x40
+
  |rowspan="17"| 0x27
  |rowspan="1"| Play
+
  |rowspan="17"| Play
  |rowspan="1"| Client
+
  |rowspan="17"| Client
  | Reason
+
  |colspan="2"| Map ID
  | [[Chat]]
+
  |colspan="2"| VarInt
  | Displayed to the client when the connection terminates.
+
  | Map ID of the map being modified
  |}
+
  |-
 
+
|colspan="2"| Scale
==== Server Difficulty ====
+
|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)
Changes the difficulty setting in the client's option menu
+
  |-
 
+
  |colspan="2"| Tracking Position
{| class="wikitable"
+
  |colspan="2"| Boolean
  ! Packet ID
+
  | Specifies whether player and item frame icons are shown
  ! State
 
  ! Bound To
 
  ! Field Name
 
  ! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="1"| 0x41
+
  |colspan="2"| Locked
  |rowspan="1"| Play
+
  |colspan="2"| Boolean
  |rowspan="1"| Client
+
  | True if the map has been locked in a cartography table
  | Difficulty
+
  |-
  | Unsigned Byte
+
  |colspan="2"| Icon Count
| 0: peaceful, 1: easy, 2: normal, 3: hard
+
  |colspan="2"| VarInt
  |}
+
  | Number of elements in the following array
 
 
==== Combat Event ====
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="6"| 0x42
+
  |rowspan="6"| Icon
  |rowspan="6"| Play
+
  | Type
  |rowspan="6"| Client
+
  |rowspan="6"| Array
| Event
+
  | VarInt enum
  | VarInt
+
  | See below
  | 0: enter combat, 1: end combat, 2: entity dead
 
 
  |-
 
  |-
  | Duration
+
  | X
  | Optional VarInt
+
  | Byte
  | Only for end combat
+
  | Map coordinates: -128 for furthest left, +127 for furthest right
 
  |-
 
  |-
  | Player ID
+
  | Z
  | Optional VarInt
+
| Byte
  | Only for entity dead
+
| 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
 
  |-
 
  |-
  | Entity ID
+
  |colspan="2"| Length
  | Optional Int
+
  |colspan="2"| Optional VarInt
  | Only for end combat and entity dead
+
  | Only if Columns is more than 0; length of the following array
 
  |-
 
  |-
  | Message
+
  |colspan="2"| Data
  | String
+
  |colspan="2"| Optional Array of Unsigned Byte
  | Only for entity dead
+
  | Only if Columns is more than 0; see {{Minecraft Wiki|Map item format}}
 
  |}
 
  |}
  
==== Camera ====
+
For icons, a direction of 0 is a vertical icon and increments by 22.5&deg; (360/16).
 +
 
 +
Types are based off of rows and columns in <code>map_icons.png</code>:
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="1"| 0x43
+
  ! Icon type
  |rowspan="1"| Play
+
  ! Result
  |rowspan="1"| Client
+
  |-
  | Camera ID
+
  | 0
  | VarInt
+
  | White arrow (players)
  |  
+
  |-
  |}
+
  | 1
 
+
  | Green arrow (item frames)
==== World Border ====
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
  !colspan="2"| Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="18"| 0x44
+
  | 2
|rowspan="18"| Play
+
  | Red arrow
|rowspan="18"| Client
 
|colspan="2"| Action
 
| VarInt
 
  | Determines the format of the rest of the packet
 
 
  |-
 
  |-
  ! Action
+
  | 3
  ! Field Name
+
  | Blue arrow
!
 
!
 
 
  |-
 
  |-
  | 0: set size
+
  | 4
  | Radius
+
  | White cross
| Double
 
| meters
 
 
  |-
 
  |-
  |rowspan="3"| 1: lerp size
+
  | 5
| Old Radius
+
  | Red pointer
| Double
 
  | meters
 
 
  |-
 
  |-
  | New Radius
+
  | 6
  | Double
+
  | White circle (off-map players)
| meters
 
 
  |-
 
  |-
  | Speed
+
  | 7
  | VarLong
+
  | Small white circle (far-off-map players)
| number of real-time ticks/seconds (?) until New Radius is reached. From experiments, it appears that Notchian server does not sync world border speed to game ticks, so it gets out of sync with server lag
 
 
  |-
 
  |-
  |rowspan="2"| 2: set center
+
  | 8
| X
+
  | Mansion
| Double
 
  |  
 
 
  |-
 
  |-
  | Z
+
  | 9
  | Double
+
  | Temple
  |  
+
  |-
 +
| 10
 +
| White Banner
 +
|-
 +
| 11
 +
| Orange Banner
 
  |-
 
  |-
  |rowspan="8"| 3: initialize
+
  | 12
| X
+
  | Magenta Banner
| Double
 
  |  
 
 
  |-
 
  |-
  | Z
+
  | 13
| Double
+
  | Light Blue Banner
  |  
 
 
  |-
 
  |-
  | Old Radius
+
  | 14
| Double
+
  | Yellow Banner
  |  
 
 
  |-
 
  |-
  | New Radius
+
  | 15
| Double
+
  | Lime Banner
  |  
 
 
  |-
 
  |-
  | Speed
+
  | 16
| VarLong
+
  | Pink Banner
  |  
 
 
  |-
 
  |-
  | Portal Teleport Boundary
+
  | 17
  | VarInt
+
  | Gray Banner
| Resulting coordinates from a portal teleport are limited to +-value. Usually 29999984.
 
 
  |-
 
  |-
  | Warning Time
+
  | 18
| VarInt
+
  | Light Gray Banner
  |  
 
 
  |-
 
  |-
  | Warning Blocks
+
  | 19
| VarInt
+
  | Cyan Banner
  |  
 
 
  |-
 
  |-
  |rowspan="1"| 4: set warning time
+
  | 20
| Warning Time
+
  | Purple Banner
| VarInt
 
  | unit?
 
 
  |-
 
  |-
  |rowspan="1"| 5: set warning blocks
+
  | 21
  | Warning Blocks
+
| Blue Banner
  | VarInt
+
|-
  |  
+
| 22
 +
| Brown Banner
 +
|-
 +
| 23
 +
| Green Banner
 +
|-
 +
| 24
 +
| Red Banner
 +
|-
 +
| 25
 +
| Black Banner
 +
  |-
 +
  | 26
 +
  | Treasure marker
 
  |}
 
  |}
  
==== Title ====  
+
==== Trade List ====
 +
 
 +
The list of trades a villager NPC is offering.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,211: Line 3,201:
 
  ! Bound To
 
  ! Bound To
 
  !colspan="2"| Field Name
 
  !colspan="2"| Field Name
  ! Field Type
+
  !colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="9"| 0x45
+
  |rowspan="18"| 0x28
  |rowspan="9"| Play
+
  |rowspan="18"| Play
  |rowspan="9"| Client
+
  |rowspan="18"| Client
  |colspan="2"| Action
+
|-
  | VarInt
+
  | colspan="2" | Window ID
  |  
+
  | colspan="2" | VarInt
 +
  | The ID of the window that is open; this is an int rather than a byte.
 
  |-
 
  |-
  ! Action
+
  | colspan="2" | Size
  ! Field Name
+
  | colspan="2" | Byte
  !
+
  | The number of trades in the following array
!
 
 
  |-
 
  |-
  | 0: set title
+
  | rowspan="11" | Trades
  | Title Text
+
  | Input item 1
  | [[Chat]]
+
| rowspan="11" | Array
  |  
+
  | [[Slot]]
 +
  | The first item the villager is buying
 
  |-
 
  |-
  | 1: set subtitle
+
  | Output item
| Subtitle Text
+
  | [[Slot]]
  | [[Chat]]
+
  | The item the villager is selling
  |  
 
 
  |-
 
  |-
  |rowspan="3"| 2: set times and display
+
  | Has second item
| Fade In
+
  | Boolean
  | Int
+
  | Whether there is a second item
  | ticks
 
 
  |-
 
  |-
  | Stay
+
  | Input item 2
  | Int
+
  | Optional [[Slot]]
  | ticks
+
  | The second item the villager is buying; only present if they have a second item.
 
  |-
 
  |-
  | Fade Out
+
  | Trade disabled
  | Int
+
  | Boolean
  | ticks
+
  | True if the trade is disabled; false if the trade is enabled.
 
  |-
 
  |-
  | 3: hide
+
  | Number of trade uses
| ''no fields''
+
  | Integer
  |  
+
  | Number of times the trade has been used so far
  |  
 
 
  |-
 
  |-
  | 4: reset
+
  | Maximum number of trade uses
  | ''no fields''
+
| 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.
 
  |}
 
  |}
  
“Hide” makes the title disappear, but if you run times again the same title will appear. “Reset” erases the text.
+
[[File:1.14-merchant-slots.png|thumb|The merchant UI, for reference]]
 +
{{-}}
 +
 
 +
==== Entity Position ====
 +
 
 +
This packet is sent by the server when an entity moves less then 8 blocks; if an entity moves more than 8 blocks [[#Entity Teleport|Entity Teleport]] should be sent instead.
  
==== Set Compression ====
+
This packet allows at most 8 blocks movement in any direction, because short range is from -32768 to 32767. And <code>32768 / (128 * 32)</code> = 8.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,272: Line 3,297:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="1"| 0x46
+
  |rowspan="5"| 0x29
  |rowspan="1"| Play
+
  |rowspan="5"| Play
  |rowspan="1"| Client
+
  |rowspan="5"| Client
  | Threshold
+
  | Entity ID
 
  | VarInt
 
  | VarInt
  | Packets of this size or higher may be compressed
+
  |  
 +
|-
 +
| 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
 +
|
 
  |}
 
  |}
  
==== Player List Header/Footer ====
+
==== Entity Position and Rotation ====
 +
 
 +
This packet is sent by the server when an entity rotates and moves. Since a short range is limited from -32768 to 32767, and movement is offset of fixed-point numbers, this packet allows at most 8 blocks movement in any direction. (<code>-32768 / (32 * 128) == -8</code>)
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,290: Line 3,333:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x47
+
  |rowspan="7"| 0x2A
  |rowspan="2"| Play
+
  |rowspan="7"| Play
  |rowspan="2"| Client
+
  |rowspan="7"| Client
  | Header
+
  | Entity ID
  | [[Chat]]
+
  | VarInt
 
  |  
 
  |  
 
  |-
 
  |-
  | Footer
+
  | Delta X
  | [[Chat]]
+
  | Short
 +
| Change in X position as <code>(currentX * 32 - prevX * 32) * 128</code>
 +
|-
 +
| Delta Y
 +
| Short
 +
| Change in Y position as <code>(currentY * 32 - prevY * 32) * 128</code>
 +
|-
 +
| Delta Z
 +
| Short
 +
| Change in Z position as <code>(currentZ * 32 - prevZ * 32) * 128</code>
 +
|-
 +
| Yaw
 +
| Angle
 +
| New angle, not a delta
 +
|-
 +
| Pitch
 +
| Angle
 +
| New angle, not a delta
 +
|-
 +
| On Ground
 +
| Boolean
 
  |  
 
  |  
 
  |}
 
  |}
  
==== Resource Pack Send ====  
+
==== Entity Rotation ====
 +
 
 +
This packet is sent by the server when an entity rotates.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,312: Line 3,377:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x48
+
  |rowspan="4"| 0x2B
  |rowspan="2"| Play
+
  |rowspan="4"| Play
  |rowspan="2"| Client
+
  |rowspan="4"| Client
  | URL
+
  | Entity ID
  | String
+
  | VarInt
  | The URL to the resource pack.
+
  |  
 +
|-
 +
| Yaw
 +
| Angle
 +
| New angle, not a delta
 
  |-
 
  |-
  | Hash
+
  | Pitch
  | String
+
  | Angle
  | 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
+
  | New angle, not a delta
 +
|-
 +
| On Ground
 +
| Boolean
 +
|
 
  |}
 
  |}
  
==== Update Entity NBT ====  
+
==== Entity Movement ====
 +
 
 +
This packet may be used to initialize an entity.
 +
 
 +
For player entities, either this packet or any move/look packet is sent every game tick. So the meaning of this packet is basically that the entity did not move/look since the last such packet.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,334: Line 3,411:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x49
+
  |rowspan="1"| 0x2C
  |rowspan="2"| Play
+
  |rowspan="1"| Play
  |rowspan="2"| Client
+
  |rowspan="1"| Client
 
  | Entity ID
 
  | Entity ID
 
  | VarInt
 
  | VarInt
|
 
|-
 
| Tag
 
| [[NBT|NBT Tag]]
 
 
  |  
 
  |  
 
  |}
 
  |}
  
=== Serverbound ===
+
==== Vehicle Move (clientbound) ====
  
==== Keep Alive ====
+
Note that all fields use absolute positioning and do not allow for relative positioning.
 
 
The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same packet.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,360: Line 3,431:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="1"| 0x00
+
  |rowspan="5"| 0x2D
  |rowspan="1"| Play
+
  |rowspan="5"| Play
  |rowspan="1"| Server
+
  |rowspan="5"| Client
  | Keep Alive ID
+
  | X
  | VarInt
+
  | 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
 
  |}
 
  |}
  
==== Chat Message ====
+
==== Open Book ====
  
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. This change was initially done by allowing the client to not slice the message up to 119 (the previous limit), without changes to the server. For this reason, the vanilla server kept the code to cut messages at 119, but this isn't a protocol limitation and can be ignored.
+
Sent when a player right clicks with a signed book. This tells the client to open the book GUI.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,380: Line 3,467:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="1"| 0x01
+
  |rowspan="1"| 0x2E
 
  |rowspan="1"| Play
 
  |rowspan="1"| Play
  |rowspan="1"| Server
+
  |rowspan="1"| Client
  | Message
+
  | Hand
  | String
+
  | VarInt enum
  | The client sends the raw input, not [[Chat]]
+
  | 0: Main hand, 1: Off hand
 
  |}
 
  |}
  
==== Use Entity ====
+
==== Open Window ====
 
 
This packet is sent from the client to the server when the client attacks or right-clicks another entity (a player, minecart, etc).
 
 
 
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.
 
  
Note that middle-click in creative mode is interpreted by the client and sent as a [[#Creative Inventory Action|Creative Inventory Action]] packet instead.
+
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"
Line 3,404: Line 3,487:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| 0x02
+
  |rowspan="3"| 0x2F
  |rowspan="5"| Play
+
  |rowspan="3"| Play
  |rowspan="5"| Server
+
  |rowspan="3"| Client
  | Target
+
  | Window ID
 
  | VarInt
 
  | VarInt
  |  
+
  | A unique id number for the window to be displayed. Notchian server implementation is a counter, starting at 1.
 
  |-
 
  |-
  | Type
+
  | Window Type
 
  | VarInt
 
  | VarInt
  | 0: interact, 1: attack, 2: interact at
+
  | The window type to use for display. Contained in the <code>minecraft:menu</code> regisry; see [[Inventory]] for the different values.
 
  |-
 
  |-
  | Target X
+
  | Window Title
  | Optional Float
+
  | [[Chat]]
  | Only if Type is interact at
+
  | The title of the window
|-
 
| Target Y
 
| Optional Float
 
| Only if Type is interact at
 
|-
 
| Target Z
 
| Optional Float
 
| Only if Type is interact at
 
 
  |}
 
  |}
  
==== Player ====
+
==== Open Sign Editor ====
 
 
This packet is used to indicate whether the player is on ground (walking/swimming), or airborne (jumping/falling).
 
  
When dropping from sufficient height, fall damage is applied when this state goes from false to true. The amount of damage applied is based on the point where it last changed from true to false. Note that there are several movement related packets containing this state.
+
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.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,442: Line 3,515:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="1"| 0x03
+
  |rowspan="1"| 0x30
 
  |rowspan="1"| Play
 
  |rowspan="1"| Play
  |rowspan="1"| Server
+
  |rowspan="1"| Client
  | On Ground
+
  | Location
  | Boolean
+
  | Position
  | True if the client is on the ground, false otherwise
+
  |  
 
  |}
 
  |}
  
==== Player Position ====
+
==== Craft Recipe Response ====
 
 
Updates the player's XYZ position on the server.
 
 
 
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, this will result in the client being kicked for “You moved too quickly :( (Hacking?)”
 
 
 
If the distance is greater than 10 units, the server will log the warning message "<name> moved too quickly!", followed by two coordinate triples (maybe movement delta?), but will not kick the client.
 
  
Also if the fixed-point number of X or Z is set greater than 3.2×10<sup>7</sup> the client will be kicked for “Illegal position”.
+
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"
Line 3,468: Line 3,535:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x04
+
  |rowspan="2"| 0x31
  |rowspan="4"| Play
+
  |rowspan="2"| Play
  |rowspan="4"| Server
+
  |rowspan="2"| Client
  | X
+
  | Window ID
  | Double
+
  | Byte
  | Absolute position
+
  |
 
  |-
 
  |-
  | Feet Y
+
  | Recipe
  | Double
+
  | Identifier
  | Absolute position, normally Head Y - 1.62
+
  | A recipe ID
|-
 
| Z
 
| Double
 
| Absolute position
 
|-
 
| On Ground
 
| Boolean
 
| True if the client is on the ground, false otherwise
 
 
  |}
 
  |}
  
==== Player Look ====
+
==== Player Abilities (clientbound) ====
[[File:Minecraft-trig-yaw.png|thumb|The unit circle for yaw]]
 
[[File:Yaw.png|thumb|The unit circle of yaw, redrawn]]
 
 
 
Updates the direction the player is looking in.
 
 
 
Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0,-1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.
 
 
 
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.
 
 
 
The yaw of player (in degrees), standing at point (x0, z0) and looking towards point (x, z) one can be calculated with:
 
  
l = x-x0
+
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.
w = z-z0
 
c = sqrt( l*l + w*w )
 
alpha1 = -arcsin(l/c)/PI*180
 
alpha2 =  arccos(w/c)/PI*180
 
if alpha2 > 90 then
 
    yaw = 180 - alpha1
 
else
 
    yaw = alpha1
 
 
 
You can get a unit vector from a given yaw/pitch via:
 
 
 
x = -cos(pitch) * sin(yaw)
 
y = -sin(pitch)
 
z =  cos(pitch) * cos(yaw)
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,524: Line 3,559:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x05
+
  |rowspan="3"| 0x32
 
  |rowspan="3"| Play
 
  |rowspan="3"| Play
  |rowspan="3"| Server
+
  |rowspan="3"| Client
  | Yaw
+
  | Flags
 +
| Byte
 +
| Bit field, see below
 +
|-
 +
| Flying Speed
 
  | Float
 
  | Float
  | Absolute rotation on the X Axis, in degrees
+
  | 0.05 by default
 
  |-
 
  |-
  | Pitch
+
  | Field of View Modifier
 
  | Float
 
  | Float
  | Absolute rotation on the Y Axis, in degrees
+
  | 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
 
  |-
 
  |-
  | On Ground
+
  | Creative Mode (Instant Break)
  | Boolean
+
  | 0x08
| True if the client is on the ground, False otherwise
 
 
  |}
 
  |}
  
==== Player Position And Look ====
+
==== Combat Event ====
  
A combination of [[#Player Look|Player Look]] and [[#Player Position|Player Position]].
+
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"
 
{| class="wikitable"
Line 3,548: Line 3,603:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  !colspan="2"| Field Name
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="6"| 0x06
+
  |rowspan="8"| 0x33
  |rowspan="6"| Play
+
  |rowspan="8"| Play
  |rowspan="6"| Server
+
  |rowspan="8"| Client
  | X
+
  |colspan="2"| Event
  | Double
+
  | VarInt Enum
  | Absolute position
+
  | Determines the layout of the remaining packet
 
  |-
 
  |-
  | Feet Y
+
  ! Event
  | Double
+
  ! Field Name
  | Absolute feet position, normally Head Y - 1.62
+
  !
 +
!
 
  |-
 
  |-
  | Z
+
  | 0: enter combat
  | Double
+
  | ''no fields''
  | Absolute position
+
  | ''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.
 
  |-
 
  |-
  | Yaw
+
  |rowspan="3"| 2: entity dead
  | Float
+
  | Player ID
  | Absolute rotation on the X Axis, in degrees
+
  | VarInt
 +
| Entity ID of the player that died (should match the client's entity ID).
 
  |-
 
  |-
  | Pitch
+
  | Entity ID
  | Float
+
  | Int
  | Absolute rotation on the Y Axis, in degrees
+
  | The killing entity's ID, or -1 if there is no obvious killer.
 
  |-
 
  |-
  | On Ground
+
  | Message
  | Boolean
+
  | [[Chat]]
  | True if the client is on the ground, false otherwise
+
  | The death message
 
  |}
 
  |}
  
==== Player Digging ====
+
==== Player Info ====
  
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.
+
Sent by the server to update the user list (<tab> in the client).
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,588: Line 3,655:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  !colspan="4"| Field Name
  ! Field Type
+
  !colspan="3"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x07
+
  |rowspan="19"| 0x34
  |rowspan="3"| Play
+
  |rowspan="19"| Play
  |rowspan="3"| Server
+
  |rowspan="19"| Client
  | Status
+
  |colspan="4"| Action
  | Byte
+
  |colspan="3"| VarInt
  | The action the player is taking against the block (see below)
+
  | Determines the rest of the Player format after the UUID
 
  |-
 
  |-
  | Location
+
  |colspan="4"| Number Of Players
  | Position
+
  |colspan="3"| VarInt
  | Block position
+
  | Number of elements in the following array
 
  |-
 
  |-
  | Face
+
  |rowspan="17"| Player
  | Byte
+
  |colspan="3"| UUID
  | The face being hit (see below)
+
  |rowspan="17"| Array
  |}
+
  |colspan="2"| UUID
 
+
|
Status can (currently) be one of six values:
+
|-
 
+
! Action
{| class="wikitable"
+
!colspan="2"| Field Name
  ! Meaning
+
  !colspan="2"|
  ! Value
+
  !  
 
  |-
 
  |-
  | Started digging
+
  |rowspan="10"| 0: add player
  | <code>0</code>
+
|colspan="2"| Name
 +
|colspan="2"| String (16)
 +
  |  
 
  |-
 
  |-
  | Cancelled digging
+
  |colspan="2"| Number Of Properties
  | <code>1</code>
+
|colspan="2"| VarInt
 +
  | Number of elements in the following array
 
  |-
 
  |-
  | Finished digging
+
  |rowspan="4"| Property
  | <code>2</code>
+
| Name
 +
|rowspan="4"| Array
 +
| String (32767)
 +
  |  
 
  |-
 
  |-
  | Drop item stack
+
  | Value
  | <code>3</code>
+
| String (32767)
 +
|
 +
|-
 +
| Is Signed
 +
| Boolean
 +
  |  
 
  |-
 
  |-
  | Drop item
+
  | Signature
  | <code>4</code>
+
  | Optional String (32767)
 +
| Only if Is Signed is true
 
  |-
 
  |-
  | Shoot arrow / finish eating
+
  |colspan="2"| Gamemode
  | <code>5</code>
+
|colspan="2"| VarInt
  |}
+
|
 
+
|-
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, the client simply send a 1 (cancel digging).
+
|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''
 +
|
 +
|}
  
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. Status code 3 is similar, but drops the entire stack.
+
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.
  
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.
+
Ping values correspond with icons in the following way:
 +
* A ping that negative (i.e. not known to the server yet) will result in the no connection icon.
 +
* A ping under 150 milliseconds will result in 5 bars
 +
* A ping under 300 milliseconds will result in 4 bars
 +
* A ping under 600 milliseconds will result in 3 bars
 +
* A ping under 1000 milliseconds (1 second) will result in 2 bars
 +
* A ping greater than or equal to 1 second will result in 1 bar.
  
The face can be one of six values, representing the face being hit:
+
==== 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"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  ! Value
+
  |rowspan="8"| 0x35
  | 0
+
|rowspan="8"| Play
  | 1
+
|rowspan="8"| Client
  | 2
+
|-
  | 3
+
| Feet/eyes
  | 4
+
| VarInt enum
  | 5
+
  | Values are feet=0, eyes=1.  If set to eyes, aims using the head position; otherwise aims using the feet position.
 +
  |-
 +
| Target x
 +
| Double
 +
| x coordinate of the point to face towards
 +
|-
 +
| Target y
 +
| Double
 +
| y coordinate of the point to face towards
 +
|-
 +
| Target z
 +
| 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
 
  |-
 
  |-
! Offset
+
  | Entity feet/eyes
| -Y
+
  | Optional VarInt enum
  | +Y
+
  | Whether to look at the entity's eyes or feet. Same values and meanings as before, just for the entity's head/feet.
  | -Z
 
  | +Z
 
  | -X
 
| +X
 
 
  |}
 
  |}
  
==== Player Block Placement ====
+
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.
 +
 
 +
If the distance between the last known position of the player on the server and the new position set by this packet is greater than 100 meters, the client will be kicked for “You moved too quickly :( (Hacking?)”.
 +
 
 +
Also if the fixed-point number of X or Z is set greater than <code>3.2E7D</code> the client will be kicked for “Illegal position”.
 +
 
 +
Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0, -1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.
 +
 
 +
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.
  
 
{| class="wikitable"
 
{| class="wikitable"
|-
 
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 3,671: Line 3,826:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="6"| 0x08
+
  |rowspan="7"| 0x36
  |rowspan="6"| Play
+
  |rowspan="7"| Play
  |rowspan="6"| Server
+
  |rowspan="7"| Client
  | Location
+
  | X
  | Position
+
  | Double
  | Block position
+
  | Absolute or relative position, depending on Flags
 +
|-
 +
| Y
 +
| Double
 +
| Absolute or relative position, depending on Flags
 
  |-
 
  |-
  | Face
+
  | Z
  | Byte
+
  | Double
  | The face on which the block is placed (see above)
+
  | Absolute or relative position, depending on Flags
 
  |-
 
  |-
  | Held Item
+
  | Yaw
  | [[Slot Data|Slot]]
+
  | Float
  |  
+
  | Absolute or relative rotation on the X axis, in degrees
 
  |-
 
  |-
  | Cursor Position X
+
  | Pitch
  | Byte
+
  | Float
  | The position of the crosshair on the block
+
  | Absolute or relative rotation on the Y axis, in degrees
 
  |-
 
  |-
  | Cursor Position Y
+
  | Flags
 
  | Byte
 
  | Byte
  |  
+
  | Bit field, see below
 
  |-
 
  |-
  | Cursor Position Z
+
  | Teleport ID
  | Byte
+
  | VarInt
  |  
+
  | Client should confirm this packet with [[#Teleport Confirm|Teleport Confirm]] containing the same Teleport ID
 
  |}
 
  |}
  
In normal operation (i.e. placing a block), this packet is sent once, with the values set normally.
+
About the Flags field:
  
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, pulling back bows, using buckets, etc.
+
<Dinnerbone> It's a bitfield, X/Y/Z/Y_ROT/X_ROT. If X is set, the x value is relative and not absolute.
 
 
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.
 
 
 
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 server. The 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.
 
 
 
==== Held Item Change ====
 
 
 
Sent when the player changes the slot selection
 
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="1"| 0x09
+
  ! Field
  |rowspan="1"| Play
+
  ! Bit
  |rowspan="1"| Server
+
  |-
  | Slot
+
  | X
  | Short
+
  | 0x01
  | The slot which the player has selected (0–8)
+
  |-
  |}
+
  | Y
 
+
| 0x02
==== Animation ====
+
  |-
 
+
  | Z
Sent when the player's arm swings
+
  | 0x04
 
+
  |-
{| class="wikitable"
+
  | Y_ROT
  ! Packet ID
+
  | 0x08
  ! State
 
  ! Bound To
 
  ! Field Name
 
  ! Field Type
 
  ! Notes
 
 
  |-
 
  |-
  |rowspan="1"| 0x0A
+
  | X_ROT
|rowspan="1"| Play
+
  | 0x10
|rowspan="1"| Server
 
| ''no fields''
 
|
 
  |  
 
 
  |}
 
  |}
  
==== Entity Action ====
+
==== Unlock Recipes ====
 
 
Sent at least when crouching, leaving a bed, or sprinting. 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"
Line 3,759: Line 3,893:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x0B
+
  |rowspan="10"| 0x37
  |rowspan="3"| Play
+
  |rowspan="10"| Play
  |rowspan="3"| Server
+
  |rowspan="10"| Client
| Entity ID
 
| VarInt
 
| Player ID
 
 
  |-
 
  |-
  | Action ID
+
  | Action
 
  | VarInt
 
  | VarInt
  | The ID of the action, see below
+
  | 0: init, 1: add, 2: remove
 
  |-
 
  |-
  | Jump Boost
+
  | Crafting Recipe Book Open
  | VarInt
+
  | Boolean
  | Horse jump boost. Ranged from 0 -> 100.
+
  | If true, then the crafting recipe book will be open when the player opens its inventory.
|}
 
 
 
Action ID can be one of the following values:
 
 
 
{| class="wikitable"
 
! ID
 
! Action
 
 
  |-
 
  |-
  | 0
+
  | Crafting Recipe Book Filter Active
  | Crouch
+
  | Boolean
 +
| If true, then the filtering option is active when the players opens its inventory.
 
  |-
 
  |-
  | 1
+
  | Smelting Recipe Book Open
  | Uncrouch
+
  | Boolean
 +
| If true, then the smelting recipe book will be open when the player opens its inventory.
 
  |-
 
  |-
  | 2
+
  | Smelting Recipe Book Filter Active
  | Leave bed
+
  | Boolean
 +
| If true, then the filtering option is active when the players opens its inventory.
 
  |-
 
  |-
  | 3
+
  | Array size 1
  | Start sprinting
+
  | VarInt
 +
| Number of elements in the following array
 
  |-
 
  |-
  | 4
+
  | Recipe IDs
  | Stop sprinting
+
| Array of Identifier
 +
  |
 
  |-
 
  |-
  | 5
+
  | Array size 2
  | Jump with horse
+
  | Optional VarInt
 +
| Number of elemen