Difference between revisions of "Protocol"

From wiki.vg
Jump to navigation Jump to search
(→‎Disconnect: Reason must be JSON)
 
(734 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
This page presents a dissection of the current stable [http://minecraft.net/game/ Minecraft] protocol. The current pre-release protocol is documented [[Pre-release_protocol|elsewhere]]. The protocol for Pocket Minecraft is substantially different, and is documented at [[Pocket Minecraft Protocol]].
+
{{Box
 +
  |BORDER = #9999FF
 +
  |BACKGROUND = #99CCFF
 +
  |WIDTH = 100%
 +
  |ICON =
 +
  |HEADING = Heads up!
 +
  |CONTENT = This article is about the protocol for the latest '''stable''' release of Minecraft '''Java Edition''' ([[Protocol version numbers|1.17.1, protocol 756]]). For the Java Edition pre-releases, see [[Pre-release protocol]]. For the incomplete Bedrock Edition docs, see [[Bedrock Protocol]]. For the old Pocket Edition, see [[Pocket Edition Protocol Documentation]].
 +
}}
  
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]).
+
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 [ircs://irc.libera.chat:6697 #mcdevs on irc.libera.chat] ([https://wiki.vg/MCDevs More Information]).
  
 
'''Note:''' While you may use the contents of this page without restriction to create servers, clients, bots, etc… you still need to provide attribution to #mcdevs if you copy any of the contents of this page for publication elsewhere.
 
'''Note:''' While you may use the contents of this page without restriction to create servers, clients, bots, etc… you still need to provide attribution to #mcdevs if you copy any of the contents of this page for publication elsewhere.
  
{{Warning|As of 1.7 strings are now UTF-8 (prefixed with a VarInt giving the string's length in bytes) instead of UTF-16.}}
+
The changes between versions may be viewed at [[Protocol History]].
 +
 
 +
== 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]] and [[#Login Success|Login Success]].
 +
 
 +
=== Data types ===
 +
 
 +
{{:Data types}} <!-- Transcluded contents of Data types article in here — go to that page if you want to edit it -->
 +
 
 +
=== Other definitions ===
  
 
{| class="wikitable"
 
{| class="wikitable"
|-
+
|-
! Term
+
! Term
! Definition
+
! Definition
|-
+
|-
| Player
+
| Player
| When used in the singular, Player always refers to the client connected to the server
+
| When used in the singular, Player always refers to the client connected to the server.
|-
+
|-
| Entity
+
| Entity
| Entity refers to any item, player, mob, minecart or boat in the world. This definition is subject to change as Notch extends the protocol
+
| Entity refers to any item, player, mob, minecart or boat etc. See {{Minecraft Wiki|Entity|the Minecraft Wiki article}} for a full list.
|-
+
|-
| EID
+
| EID
| An EID - or Entity ID - is a unique 4-byte integer used to identify a specific entity
+
| An EID or Entity ID is a 4-byte sequence used to identify a specific entity. An entity's EID is unique on the entire server.
|-
+
|-
| XYZ
+
| XYZ
| In this document, the axis names are the same as those used by Notch. Y points upwards, X points South, and Z points West.
+
| In this document, the axis names are the same as those shown in the debug screen (F3). Y points upwards, X points east, and Z points south.
|-
+
|-
!colspan="2"|See also: [[Data types]], [[Units of Measurement]]
+
| 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.16.5.html burger].
  
The changes between versions may be viewed at [[Protocol History]]
+
Alternatively, the vanilla server now includes an option to export the current block state ID mapping, by running <code>java -cp minecraft_server.jar net.minecraft.data.Main --reports</code>.  See [[Data Generators]] for more information.
 +
|-
 +
| Notchian
 +
| The official implementation of vanilla Minecraft as developed and released by Mojang.
 +
|}
  
== Packets ==
+
== Packet format ==
=== Protocol Version ===
 
1.7.2 - 4
 
  
== Packet format ==
+
Packets cannot be larger than 2097151 bytes (the maximum that can be sent in a 3-byte VarInt).  For compressed packets, this applies to both the compressed length and uncompressed lengths.
 +
 
 +
=== Without compression ===
  
 
{| class="wikitable"
 
{| class="wikitable"
! Field Name !! Field Type !! Notes
+
! Field Name
|-
+
! Field Type
| Length || VarInt || Includes the packet id's length
+
! Notes
|-
+
|-
| Packet ID || VarInt ||
+
| Length
|-
+
| VarInt
| Data || ||
+
| Length of Packet ID + Data
|}
+
|-
 +
| Packet ID
 +
| VarInt
 +
|
 +
|-
 +
| Data
 +
| Byte Array
 +
| Depends on the connection state and packet ID, see the sections below
 +
|}
 +
 
 +
=== With compression ===
 +
 
 +
Once a [[#Set Compression|Set Compression]] packet (with a non-negative threshold) is sent, [[wikipedia:Zlib|zlib]] compression is enabled for all following packets. The format of a packet changes slightly to include the size of the uncompressed packet.
 +
 
 +
{| class=wikitable
 +
! Compressed?
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| No
 +
| Packet Length
 +
| VarInt
 +
| Length of Data Length + compressed length of (Packet ID + Data)
 +
|-
 +
| No
 +
| Data Length
 +
| VarInt
 +
| Length of uncompressed (Packet ID + Data) or 0
 +
|-
 +
|rowspan="2"| Yes
 +
| Packet ID
 +
| VarInt
 +
| zlib compressed packet ID (see the sections below)
 +
|-
 +
| Data
 +
| Byte Array
 +
| zlib compressed packet data (see the sections below)
 +
|}
 +
 
 +
If the size of the buffer containing the packet data and ID (as a VarInt) is smaller than the threshold specified in the packet [[#Set Compression|Set Compression]]. It will be sent as uncompressed. This is done by setting the data length as 0. (Comparable to sending a non-compressed format with an extra 0 between the length, and packet data).
 +
 
 +
If it's larger than the threshold, then it follows the regular compressed protocol format.
 +
 
 +
Compression can be disabled by sending the packet [[#Set Compression|Set Compression]] 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 ===
  
 
==== Handshake ====
 
==== Handshake ====
 +
 
This causes the server to switch into the target state.
 
This causes the server to switch into the target state.
 +
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="4"| 0x00
 +
|rowspan="4"| Handshaking
 +
|rowspan="4"| Server
 +
| Protocol Version
 +
| VarInt
 +
| See [[protocol version numbers]] (currently 756 in Minecraft 1.17.1).
 +
|-
 +
| Server Address
 +
| String (255)
 +
| Hostname or IP, e.g. localhost or 127.0.0.1, that was used to connect. The Notchian server does not use this information. Note that SRV records are a simple redirect, e.g. if _minecraft._tcp.example.com points to mc.example.org, users connecting to example.com will provide example.org as server address in addition to connecting to it.
 +
|-
 +
| Server Port
 +
| Unsigned Short
 +
| Default is 25565. The Notchian server does not use this information.
 +
|-
 +
| Next State
 +
| VarInt Enum
 +
| 1 for [[#Status|status]], 2 for [[#Login|login]].
 +
|}
 +
 +
==== Legacy Server List Ping ====
 +
 +
{{Warning|This packet uses a nonstandard format. It is never length-prefixed, and the packet ID is an Unsigned Byte instead of a VarInt.}}
 +
 +
While not technically part of the current protocol, legacy clients may send this packet to initiate [[Server List Ping]], and modern servers should handle it correctly.
 +
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| 0xFE
 +
| Handshaking
 +
| Server
 +
| Payload
 +
| Unsigned Byte
 +
| always 1 (<code>0x01</code>).
 +
|}
 +
 +
See [[Server List Ping#1.6]] for the details of the protocol that follows this packet.
 +
 +
== Status ==
 +
{{Main|Server List Ping}}
 +
 +
=== Clientbound ===
 +
 +
==== Response ====
 +
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="2"| 0x00
 +
|rowspan="2"| Status
 +
|rowspan="2"| Client
 +
|-
 +
| JSON Response
 +
| String (32767)
 +
| See [[Server List Ping#Response]]; as with all strings this is prefixed by its length as a VarInt.
 +
|}
 +
 +
==== Pong ====
 +
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| 0x01
 +
| Status
 +
| Client
 +
| Payload
 +
| Long
 +
| Should be the same as sent by the client.
 +
|}
 +
 +
=== Serverbound ===
 +
 +
==== Request ====
 +
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| 0x00
 +
| Status
 +
| Server
 +
|colspan="3"| ''no fields''
 +
|}
 +
 +
==== Ping ====
 +
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=4 | 0x00
+
! Bound To
| Protocol Version || VarInt || (4 as of 1.7.2)
+
! Field Name
|-
+
! Field Type
| Server Address (hostname or IP) || String || localhost
+
! Notes
|-
+
|-
| Server Port || Unsigned Short|| 25565
+
| 0x01
|-
+
| Status
| Next state || VarInt || 1 for status, 2 for login
+
| Server
|}
+
| Payload
 +
| Long
 +
| May be any number. Notchian clients use a system-dependent time value which is counted in milliseconds.
 +
|}
 +
 
 +
== Login ==
 +
 
 +
The login process is as follows:
 +
 
 +
# C→S: [[#Handshake|Handshake]] with Next State set to 2 (login)
 +
# C→S: [[#Login Start|Login Start]]
 +
# S→C: [[#Encryption Request|Encryption Request]]
 +
# Client auth
 +
# C→S: [[#Encryption Response|Encryption Response]]
 +
# Server auth, both enable encryption
 +
# S→C: [[#Set Compression|Set Compression]] (optional)
 +
# S→C: [[#Login Success|Login Success]]
 +
 
 +
Set Compression, if present, must be sent before Login Success. Note that anything sent after Set Compression must use the [[#With_compression|Post Compression packet format]].
 +
 
 +
For unauthenticated ("cracked"/offline-mode) and 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]]. The Notchian server uses UUID v3 for offline player UUIDs, with the namespace “OfflinePlayer” and the value as the player’s username. For example, Notch’s offline UUID would be derived from the string “OfflinePlayer:Notch”. This is not a requirement however, the UUID may be anything.
  
== Play ==
+
See [[Protocol Encryption]] for details.
  
 
=== Clientbound ===
 
=== Clientbound ===
  
==== Keep Alive ====
+
==== Disconnect (login) ====
  
The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same packet.
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| 0x00
 +
| Login
 +
| Client
 +
| Reason
 +
| [[Chat]]
 +
|
 +
|}
 +
 
 +
==== Encryption Request ====
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=1 | 0x00
+
! Bound To
| Keep Alive ID || Int ||
+
! Field Name
|}
+
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="5"| 0x01
 +
|rowspan="5"| Login
 +
|rowspan="5"| Client
 +
| Server ID
 +
| String (20)
 +
| Appears to be empty.
 +
|-
 +
| Public Key Length
 +
| VarInt
 +
| Length of Public Key
 +
|-
 +
| Public Key
 +
| Byte Array
 +
| The server's public key in bytes
 +
|-
 +
| Verify Token Length
 +
| VarInt
 +
| Length of Verify Token. Always 4 for Notchian servers.
 +
|-
 +
| Verify Token
 +
| Byte Array
 +
| A sequence of random bytes generated by the server.
 +
|}
  
 +
See [[Protocol Encryption]] for details.
 +
 +
==== Login Success ====
  
==== Join Game ====
 
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=6 | 0x01
+
! Bound To
| Entity ID || Int || The player's Entity ID
+
! Field Name
|-
+
! Field Type
| Gamemode || Unsigned Byte || 0: survival, 1: creative, 2: adventure. Bit 3 (0x8) is the hardcore flag
+
! Notes
|-
+
|-
| Dimension || Byte || -1: nether, 0: overworld, 1: end
+
|rowspan="2"| 0x02
|-
+
|rowspan="2"| Login
| Difficulty || Unsigned Byte || 0 thru 3 for Peaceful, Easy, Normal, Hard
+
|rowspan="2"| Client
|-
+
| UUID
| Max Players || Unsigned Byte || Used by the client to draw the player list
+
| UUID
|-
+
|  
| Level Type || String || default, flat, largeBiomes, amplified, default_1_1
+
|-
|}
+
| Username
{{Warning|If the Dimension isn't valid then the client will crash}}
+
| String (16)
 +
|  
 +
|}
 +
 
 +
This packet switches the connection state to [[#Play|play]].
 +
 
 +
{{Warning2|The (notchian) server might take a bit to fully transition to the Play state, so it's recommended to wait before sending Play packets, either by setting a timeout, or waiting for Play packets from the server (usually [[#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 ====
 +
 
 +
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).
  
==== Chat Message ====
 
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=1 | 0x02
+
! Bound To
| JSON Data || String || https://gist.github.com/thinkofdeath/e882ce057ed83bac0a1c , Limited to 32767 bytes
+
! Field Name
|}
+
! Field Type
{{Warning|Malformed JSON will disconnect the client}}
+
! Notes
 +
|-
 +
| 0x03
 +
| Login
 +
| Client
 +
| Threshold
 +
| VarInt
 +
| Maximum size of a packet before it is compressed.
 +
|}
  
==== Time Update ====
+
==== Login Plugin Request ====
 +
 
 +
Used to implement a custom handshaking flow together with [[#Login_Plugin_Response | Login Plugin Response]].
 +
 
 +
Unlike plugin messages in "play" mode, these messages follow a lock-step request/response scheme, where the client is expected to respond to a request indicating whether it understood. The notchian client always responds that it hasn't understood, and sends an empty payload.
  
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.
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="3"| 0x04
 +
|rowspan="3"| Login
 +
|rowspan="3"| Client
 +
| Message ID
 +
| VarInt
 +
| Generated by the server - should be unique to the connection.
 +
|-
 +
| Channel
 +
| Identifier
 +
| Name of the [[plugin channel]] used to send the data.
 +
|-
 +
| Data
 +
| Byte Array
 +
| Any data, depending on the channel. The length of this array must be inferred from the packet length.
 +
|}
  
The time of day is based on the timestamp modulo 24000. 0 is sunrise, 6000 is noon, 12000 is sunset, and 18000 is midnight.
+
=== Serverbound ===
  
The default SMP server increments the time by <code>20</code> every second.
+
==== Login Start  ====
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=2 | 0x03
+
! Bound To
| Age of the world || Long || In ticks; not changed by server commands
+
! Field Name
|-
+
! Field Type
| 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
+
! Notes
|}
+
|-
 +
| 0x00
 +
| Login
 +
| Server
 +
| Name
 +
| String (16)
 +
| Player's Username.
 +
|}
 +
 
 +
==== Encryption Response ====
  
==== Entity Equipment ====
 
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=3 | 0x04
+
! Bound To
| EntityID || Int || Entity's ID
+
! Field Name
|-
+
! Field Type
| Slot || Short || Equipment slot: 0=held, 1-4=armor slot (1 - boots, 2 - leggings, 3 - chestplate, 4 - helmet)
+
! Notes
|-
+
|-
| Item || [[Slot_Data|Slot]] || Item in slot format
+
|rowspan="4"| 0x01
|}
+
|rowspan="4"| Login
 +
|rowspan="4"| Server
 +
| Shared Secret Length
 +
| VarInt
 +
| Length of Shared Secret.
 +
|-
 +
| Shared Secret
 +
| Byte Array
 +
| Shared Secret value, encrypted with the server's public key.
 +
|-
 +
| Verify Token Length
 +
| VarInt
 +
| Length of Verify Token.
 +
|-
 +
| Verify Token
 +
| Byte Array
 +
| Verify Token value, encrypted with the same public key as the shared secret.
 +
|}
  
==== Spawn Position ====
+
See [[Protocol Encryption]] for details.
  
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.
+
==== Login Plugin Response ====
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=3 | 0x05
+
! Bound To
| X || Int || Spawn X in block coordinates
+
! Field Name
|-
+
! Field Type
| Y || Int || Spawn Y in block coordinates
+
! Notes
|-
+
|-
| Z || Int || Spawn | in block coordinates
+
|rowspan="3"| 0x02
|}
+
|rowspan="3"| Login
 +
|rowspan="3"| Server
 +
| Message ID
 +
| VarInt
 +
| Should match ID from server.
 +
|-
 +
| Successful
 +
| Boolean
 +
| <code>true</code> if the client understands the request, <code>false</code> otherwise. When <code>false</code>, no payload follows.
 +
|-
 +
| Data
 +
| Optional Byte Array
 +
| Any data, depending on the channel. The length of this array must be inferred from the packet length.
 +
|}
 +
 
 +
== Play ==
  
==== Update Health ====
+
=== Clientbound ===
  
Sent by the server to update/set the health of the player it is sent to.
+
==== Spawn Entity ====
  
Food saturation acts as a food "overcharge". Food values will not decrease while the saturation is over zero. Players logging in automatically get a saturation of 5.0. Eating food increases the saturation as well as the food bar.
+
Sent by the server when a vehicle or other non-living entity is created.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=3 | 0x06
+
! Bound To
| Health || Float || 0 or less = dead, 20 = full HP
+
! Field Name
|-
+
! Field Type
| Food || Short || 0 - 20
+
! Notes
|-  
+
|-
| Food Saturation || Float || Seems to vary from 0.0 to 5.0 in integer increments
+
|rowspan="12"| 0x00
|}
+
|rowspan="12"| Play
 +
|rowspan="12"| Client
 +
| Entity ID
 +
| VarInt
 +
| EID of the entity.
 +
|-
 +
| Object UUID
 +
| UUID
 +
|
 +
|-
 +
| Type
 +
| VarInt
 +
| The type of entity (same as in [[#Spawn Living Entity|Spawn Living Entity]]).
 +
|-
 +
| X
 +
| Double
 +
|
 +
|-
 +
| Y
 +
| Double
 +
|  
 +
|-
 +
| Z
 +
| Double
 +
|  
 +
|-
 +
| Pitch
 +
| Angle
 +
|  
 +
|-
 +
| Yaw
 +
| Angle
 +
|
 +
|-
 +
| Data
 +
| Int
 +
| Meaning dependent on the value of the Type field, see [[Object Data]] for details.
 +
|-
 +
| Velocity X
 +
| Short
 +
|rowspan="3"| Same units as [[#Entity Velocity|Entity Velocity]]. Always sent, but only used when Data is greater than 0 (except for some entities which always ignore it; see [[Object Data]] for details).
 +
|-
 +
| Velocity Y
 +
| Short
 +
|-
 +
| Velocity Z
 +
| Short
 +
|}
  
==== Respawn ====
+
==== Spawn Experience Orb ====
  
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.
+
Spawns one or more experience orbs.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=4 | 0x07
+
! Bound To
| Dimension || Int || -1: The Nether, 0: The Overworld, 1: The End
+
! Field Name
|-
+
! Field Type
| Difficulty || Unsigned Byte || 0 thru 3 for Peaceful, Easy, Normal, Hard.
+
! Notes
|-
+
|-
| Gamemode || Unsigned Byte || 0: survival, 1: creative, 2: adventure. The hardcore flag is not included
+
|rowspan="5"| 0x01
|-
+
|rowspan="5"| Play
| Level Type || String || Same as Join Game
+
|rowspan="5"| Client
|}
+
| Entity ID
{{Warning|If the Dimension isn't valid then the client will crash}}
+
| VarInt
 +
|  
 +
|-
 +
| X
 +
| Double
 +
|  
 +
|-
 +
| Y
 +
| Double
 +
|  
 +
|-
 +
| Z
 +
| Double
 +
|  
 +
|-
 +
| Count
 +
| Short
 +
| The amount of experience this orb will reward once collected.
 +
|}
  
{{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)}}
+
==== Spawn Living Entity ====
  
==== Player Position And Look ====  
+
Sent by the server when a living entity is spawned.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="12"| 0x02
 +
|rowspan="12"| Play
 +
|rowspan="12"| Client
 +
| Entity ID
 +
| VarInt
 +
|
 +
|-
 +
| Entity UUID
 +
| UUID
 +
|
 +
|-
 +
| Type
 +
| VarInt
 +
| The type of mob. See [[Entities#Mobs]].
 +
|-
 +
| X
 +
| Double
 +
|
 +
|-
 +
| Y
 +
| Double
 +
|
 +
|-
 +
| Z
 +
| Double
 +
|
 +
|-
 +
| Yaw
 +
| Angle
 +
|
 +
|-
 +
| Pitch
 +
| Angle
 +
|
 +
|-
 +
| Head Pitch
 +
| Angle
 +
|
 +
|-
 +
| Velocity X
 +
| Short
 +
| Same units as [[#Entity Velocity|Entity Velocity]].
 +
|-
 +
| Velocity Y
 +
| Short
 +
| Same units as [[#Entity Velocity|Entity Velocity]].
 +
|-
 +
| Velocity Z
 +
| Short
 +
| Same units as [[#Entity Velocity|Entity Velocity]].
 +
|}
 +
 
 +
==== Spawn Painting ====
  
Updates the players position on the server.
+
This packet shows location, name, and type of painting.
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 backwards towards (-1, 0), or in other words, it turns clockwise instead of counterclockwise. Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="5"| 0x03
 +
|rowspan="5"| Play
 +
|rowspan="5"| Client
 +
| Entity ID
 +
| VarInt
 +
|
 +
|-
 +
| Entity UUID
 +
| UUID
 +
|
 +
|-
 +
| Motive
 +
| VarInt
 +
| Painting's ID, see below.
 +
|-
 +
| Location
 +
| Position
 +
| Center coordinates (see below).
 +
|-
 +
| Direction
 +
| Byte Enum
 +
| Direction the painting faces (North = 2, South = 0, West = 1, East = 3).
 +
|}
  
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.
+
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.
  
You can get a unit vector from a given yaw/pitch via:
+
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):
  x = -cos(pitch) * sin(yaw)
 
  y = -sin(pitch)
 
  z =  cos(pitch) * cos(yaw)
 
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Name
|-
+
! ID
| rowspan=6| 0x08
+
! x
| X || Double || Absolute position
+
! y
|-
+
! width
| Y || Double || Absolute position
+
! height
|-
+
|-
| Z || Double || Absolute position
+
| <code>minecraft:kebab</code>
|-
+
| 0
| Yaw || Float || Absolute rotation on the X Axis, in degrees
+
| 0
|-
+
| 0
| Pitch || Float || Absolute rotation on the Y Axis, in degrees
+
| 16
|-
+
| 16
| On Ground || Bool || True if the client is on the ground, False otherwise
+
|-
|}
+
| <code>minecraft:aztec</code>
 +
| 1
 +
| 16
 +
| 0
 +
| 16
 +
| 16
 +
|-
 +
| <code>minecraft:alban</code>
 +
| 2
 +
| 32
 +
| 0
 +
| 16
 +
| 16
 +
|-
 +
| <code>minecraft:aztec2</code>
 +
| 3
 +
| 48
 +
| 0
 +
| 16
 +
| 16
 +
|-
 +
| <code>minecraft:bomb</code>
 +
| 4
 +
| 64
 +
| 0
 +
| 16
 +
| 16
 +
|-
 +
| <code>minecraft:plant</code>
 +
| 5
 +
| 80
 +
| 0
 +
| 16
 +
| 16
 +
|-
 +
| <code>minecraft:wasteland</code>
 +
| 6
 +
| 96
 +
| 0
 +
| 16
 +
| 16
 +
|-
 +
| <code>minecraft:pool</code>
 +
| 7
 +
| 0
 +
| 32
 +
| 32
 +
| 16
 +
|-
 +
| <code>minecraft:courbet</code>
 +
| 8
 +
| 32
 +
| 32
 +
| 32
 +
| 16
 +
|-
 +
| <code>minecraft:sea</code>
 +
| 9
 +
| 64
 +
| 32
 +
| 32
 +
| 16
 +
|-
 +
| <code>minecraft:sunset</code>
 +
| 10
 +
| 96
 +
| 32
 +
| 32
 +
| 16
 +
|-
 +
| <code>minecraft:creebet</code>
 +
| 11
 +
| 128
 +
| 32
 +
| 32
 +
| 16
 +
|-
 +
| <code>minecraft:wanderer</code>
 +
| 12
 +
| 0
 +
| 64
 +
| 16
 +
| 32
 +
|-
 +
| <code>minecraft:graham</code>
 +
| 13
 +
| 16
 +
| 64
 +
| 16
 +
| 32
 +
|-
 +
| <code>minecraft:match</code>
 +
| 14
 +
| 0
 +
| 128
 +
| 32
 +
| 32
 +
|-
 +
| <code>minecraft:bust</code>
 +
| 15
 +
| 32
 +
| 128
 +
| 32
 +
| 32
 +
|-
 +
| <code>minecraft:stage</code>
 +
| 16
 +
| 64
 +
| 128
 +
| 32
 +
| 32
 +
|-
 +
| <code>minecraft:void</code>
 +
| 17
 +
| 96
 +
| 128
 +
| 32
 +
| 32
 +
|-
 +
| <code>skull_and_roses</code>
 +
| 18
 +
| 128
 +
| 128
 +
| 32
 +
| 32
 +
|-
 +
| <code>minecraft:wither</code>
 +
| 19
 +
| 160
 +
| 128
 +
| 32
 +
| 32
 +
|-
 +
| <code>minecraft:fighters</code>
 +
| 20
 +
| 0
 +
| 96
 +
| 64
 +
| 32
 +
|-
 +
| <code>minecraft:pointer</code>
 +
| 21
 +
| 0
 +
| 192
 +
| 64
 +
| 64
 +
|-
 +
| <code>minecraft:pigscene</code>
 +
| 22
 +
| 64
 +
| 192
 +
| 64
 +
| 64
 +
|-
 +
| <code>minecraft:burning_skull</code>
 +
| 23
 +
| 128
 +
| 192
 +
| 64
 +
| 64
 +
|-
 +
| <code>minecraft:skeleton</code>
 +
| 24
 +
| 192
 +
| 64
 +
| 64
 +
| 48
 +
|-
 +
| <code>minecraft:donkey_kong</code>
 +
| 25
 +
| 192
 +
| 112
 +
| 64
 +
| 48
 +
|}
  
==== Held Item Change ====
+
The {{Minecraft Wiki|Painting#Canvases|Minecraft Wiki article on paintings}} also provides a list of painting names to the actual images.
  
Sent to change the player's slot selection
+
==== 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"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=1 | 0x09
+
! Bound To
| Slot || Byte || The slot which the player has selected (0-8)
+
! Field Name
|}
+
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="7"| 0x04
 +
|rowspan="7"| Play
 +
|rowspan="7"| Client
 +
| Entity ID
 +
| VarInt
 +
| Player's EID.
 +
|-
 +
| Player UUID
 +
| UUID
 +
| See below for notes on {{Minecraft Wiki|Server.properties#online-mode|offline mode}} and NPCs.
 +
|-
 +
| X
 +
| Double
 +
|
 +
|-
 +
| Y
 +
| Double
 +
|
 +
|-
 +
| Z
 +
| Double
 +
|
 +
|-
 +
| Yaw
 +
| Angle
 +
|
 +
|-
 +
| Pitch
 +
| Angle
 +
|
 +
|}
 +
 
 +
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).  The Notchain server uses <code>UUID.nameUUIDFromBytes</code>, implemented by OpenJDK [https://github.com/AdoptOpenJDK/openjdk-jdk8u/blob/9a91972c76ddda5c1ce28b50ca38cbd8a30b7a72/jdk/src/share/classes/java/util/UUID.java#L153-L175 here].
  
==== Use Bed ====
+
For NPCs UUID v2 should be used. Note:
  
This packet tells that a player goes to bed.
+
<+Grum> i will never confirm this as a feature you know that :)
  
The client with the matching  Entity ID will go into bed mode.
+
In an example UUID, <code>xxxxxxxx-xxxx-Yxxx-xxxx-xxxxxxxxxxxx</code>, the UUID version is specified by <code>Y</code>. So, for UUID v3, <code>Y</code> will always be <code>3</code>, and for UUID v2, <code>Y</code> will always be <code>2</code>.
  
This Packet is sent to all nearby players including the one sent to bed.
+
==== Sculk Vibration Signal ====
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=5 | 0x0A
+
! Bound To
| Entity ID || Int || Player ID
+
! Field Name
|-
+
! Field Type
| X || Int || Bed headboard X as block coordinate
+
! Notes
|-
+
|-
| Y || Unsigned Byte || Bed headboard Y as block coordinate
+
|rowspan="4"| 0x05
|-
+
|rowspan="4"| Play
| Z || Int || Bed headboard Z as block coordinate
+
|rowspan="4"| Client
|}
+
| Source Position
 +
| Position
 +
| Source position for the vibration.
 +
|-
 +
| Destination Identifier
 +
| Identifier
 +
| Identifier of the destination codec type.
 +
|-
 +
| Destination
 +
| Varies
 +
| Vanilla default destinations are a block position encoded as a [https://wiki.vg/Protocol#Data_types Position] for "block" or an entity id encoded as a VarInt for "entity".
 +
|-
 +
| Arrival Ticks
 +
| VarInt
 +
| Ticks for the signal to arrive at the destination.
 +
|}
 +
This packet shows a permanent particle.
  
==== Animation ====
+
==== Entity Animation (clientbound) ====
  
 
Sent whenever an entity should change animation.
 
Sent whenever an entity should change animation.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=2 | 0x0B
+
! Bound To
| Entity ID || VarInt || Player ID
+
! Field Name
|-
+
! Field Type
| Animation || Unsigned Byte || Animation ID
+
! Notes
|}
+
|-
 +
|rowspan="2"| 0x06
 +
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Entity ID
 +
| VarInt
 +
| Player ID.
 +
|-
 +
| Animation
 +
| Unsigned Byte
 +
| Animation ID (see below).
 +
|}
  
 
Animation can be one of the following values:
 
Animation can be one of the following values:
  
 
{| class="wikitable"
 
{| class="wikitable"
! ID !! Animation
+
! ID
|-
+
! Animation
| 0 || Swing arm
+
|-
|-
+
| 0
| 1 || Damage animation
+
| Swing main arm
|-
+
|-
| 2 || Leave bed
+
| 1
|-
+
| Take damage
| 3 || Eat food
+
|-
|-
+
| 2
| 4 || Critical effect
+
| Leave bed
|-
+
|-
| 5 || Magic critical effect
+
| 3
|-
+
| Swing offhand
| 102 || (unknown)
+
|-
|-
+
| 4
| 104 || Crouch
+
| Critical effect
|-
+
|-
| 105 || Uncrouch
+
| 5
|}
+
| Magic critical effect
 +
|}
  
==== Spawn Player ====
+
==== Statistics ====
 +
 
 +
Sent as a response to [[#Client_Status|Client Status 0x04]] (id 1). Will only send the changed values if previously requested.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
!colspan="2"| Field Name
 +
!colspan="2"| Field Type
 +
! Notes
 +
|-
 +
|rowspan="4"| 0x07
 +
|rowspan="4"| Play
 +
|rowspan="4"| Client
 +
|colspan="2"| Count
 +
|colspan="2"| VarInt
 +
| Number of elements in the following array.
 +
|-
 +
|rowspan="3"| Statistic
 +
| Category ID
 +
|rowspan="3"| Array
 +
| VarInt
 +
| See below.
 +
|-
 +
| Statistic ID
 +
| VarInt
 +
| See below.
 +
|-
 +
| Value
 +
| VarInt
 +
| The amount to set it to.
 +
|}
 +
 
 +
Categories (these are namespaced, but with <code>:</code> replaced with <code>.</code>):
 +
 
 +
{| class="wikitable"
 +
! Name
 +
! ID
 +
! Registry
 +
|-
 +
| <code>minecraft.mined</code>
 +
| 0
 +
| Blocks
 +
|-
 +
| <code>minecraft.crafted</code>
 +
| 1
 +
| Items
 +
|-
 +
| <code>minecraft.used</code>
 +
| 2
 +
| Items
 +
|-
 +
| <code>minecraft.broken</code>
 +
| 3
 +
| Items
 +
|-
 +
| <code>minecraft.picked_up</code>
 +
| 4
 +
| Items
 +
|-
 +
| <code>minecraft.dropped</code>
 +
| 5
 +
| Items
 +
|-
 +
| <code>minecraft.killed</code>
 +
| 6
 +
| Entities
 +
|-
 +
| <code>minecraft.killed_by</code>
 +
| 7
 +
| Entities
 +
|-
 +
| <code>minecraft.custom</code>
 +
| 8
 +
| Custom
 +
|}
 +
 
 +
Blocks, Items, and Entities use block (not block state), item, and entity ids.
 +
 
 +
Custom has the following (unit only matters for clients):
 +
 
 +
{| class="wikitable"
 +
! Name
 +
! ID
 +
! Unit
 +
|-
 +
| <code>minecraft.leave_game</code>
 +
| 0
 +
| None
 +
|-
 +
| <code>minecraft.play_one_minute</code>
 +
| 1
 +
| Time
 +
|-
 +
| <code>minecraft.time_since_death</code>
 +
| 2
 +
| Time
 +
|-
 +
| <code>minecraft.time_since_rest</code>
 +
| 3
 +
| Time
 +
|-
 +
| <code>minecraft.sneak_time</code>
 +
| 4
 +
| Time
 +
|-
 +
| <code>minecraft.walk_one_cm</code>
 +
| 5
 +
| Distance
 +
|-
 +
| <code>minecraft.crouch_one_cm</code>
 +
| 6
 +
| Distance
 +
|-
 +
| <code>minecraft.sprint_one_cm</code>
 +
| 7
 +
| Distance
 +
|-
 +
| <code>minecraft.walk_on_water_one_cm</code>
 +
| 8
 +
| Distance
 +
|-
 +
| <code>minecraft.fall_one_cm</code>
 +
| 9
 +
| Distance
 +
|-
 +
| <code>minecraft.climb_one_cm</code>
 +
| 10
 +
| Distance
 +
|-
 +
| <code>minecraft.fly_one_cm</code>
 +
| 11
 +
| Distance
 +
|-
 +
| <code>minecraft.walk_under_water_one_cm</code>
 +
| 12
 +
| Distance
 +
|-
 +
| <code>minecraft.minecart_one_cm</code>
 +
| 13
 +
| Distance
 +
|-
 +
| <code>minecraft.boat_one_cm</code>
 +
| 14
 +
| Distance
 +
|-
 +
| <code>minecraft.pig_one_cm</code>
 +
| 15
 +
| Distance
 +
|-
 +
| <code>minecraft.horse_one_cm</code>
 +
| 16
 +
| Distance
 +
|-
 +
| <code>minecraft.aviate_one_cm</code>
 +
| 17
 +
| Distance
 +
|-
 +
| <code>minecraft.swim_one_cm</code>
 +
| 18
 +
| Distance
 +
|-
 +
| <code>minecraft.strider_one_cm</code>
 +
| 19
 +
| Distance
 +
|-
 +
| <code>minecraft.jump</code>
 +
| 20
 +
| None
 +
|-
 +
| <code>minecraft.drop</code>
 +
| 21
 +
| None
 +
|-
 +
| <code>minecraft.damage_dealt</code>
 +
| 22
 +
| Damage
 +
|-
 +
| <code>minecraft.damage_dealt_absorbed</code>
 +
| 23
 +
| Damage
 +
|-
 +
| <code>minecraft.damage_dealt_resisted</code>
 +
| 24
 +
| Damage
 +
|-
 +
| <code>minecraft.damage_taken</code>
 +
| 25
 +
| Damage
 +
|-
 +
| <code>minecraft.damage_blocked_by_shield</code>
 +
| 26
 +
| Damage
 +
|-
 +
| <code>minecraft.damage_absorbed</code>
 +
| 27
 +
| Damage
 +
|-
 +
| <code>minecraft.damage_resisted</code>
 +
| 28
 +
| Damage
 +
|-
 +
| <code>minecraft.deaths</code>
 +
| 29
 +
| None
 +
|-
 +
| <code>minecraft.mob_kills</code>
 +
| 30
 +
| None
 +
|-
 +
| <code>minecraft.animals_bred</code>
 +
| 31
 +
| None
 +
|-
 +
| <code>minecraft.player_kills</code>
 +
| 32
 +
| None
 +
|-
 +
| <code>minecraft.fish_caught</code>
 +
| 33
 +
| None
 +
|-
 +
| <code>minecraft.talked_to_villager</code>
 +
| 34
 +
| None
 +
|-
 +
| <code>minecraft.traded_with_villager</code>
 +
| 35
 +
| None
 +
|-
 +
| <code>minecraft.eat_cake_slice</code>
 +
| 36
 +
| None
 +
|-
 +
| <code>minecraft.fill_cauldron</code>
 +
| 37
 +
| None
 +
|-
 +
| <code>minecraft.use_cauldron</code>
 +
| 38
 +
| None
 +
|-
 +
| <code>minecraft.clean_armor</code>
 +
| 39
 +
| None
 +
|-
 +
| <code>minecraft.clean_banner</code>
 +
| 40
 +
| None
 +
|-
 +
| <code>minecraft.clean_shulker_box</code>
 +
| 41
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_brewingstand</code>
 +
| 42
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_beacon</code>
 +
| 43
 +
| None
 +
|-
 +
| <code>minecraft.inspect_dropper</code>
 +
| 44
 +
| None
 +
|-
 +
| <code>minecraft.inspect_hopper</code>
 +
| 45
 +
| None
 +
|-
 +
| <code>minecraft.inspect_dispenser</code>
 +
| 46
 +
| None
 +
|-
 +
| <code>minecraft.play_noteblock</code>
 +
| 47
 +
| None
 +
|-
 +
| <code>minecraft.tune_noteblock</code>
 +
| 48
 +
| None
 +
|-
 +
| <code>minecraft.pot_flower</code>
 +
| 49
 +
| None
 +
|-
 +
| <code>minecraft.trigger_trapped_chest</code>
 +
| 50
 +
| None
 +
|-
 +
| <code>minecraft.open_enderchest</code>
 +
| 51
 +
| None
 +
|-
 +
| <code>minecraft.enchant_item</code>
 +
| 52
 +
| None
 +
|-
 +
| <code>minecraft.play_record</code>
 +
| 53
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_furnace</code>
 +
| 54
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_crafting_table</code>
 +
| 55
 +
| None
 +
|-
 +
| <code>minecraft.open_chest</code>
 +
| 56
 +
| None
 +
|-
 +
| <code>minecraft.sleep_in_bed</code>
 +
| 57
 +
| None
 +
|-
 +
| <code>minecraft.open_shulker_box</code>
 +
| 58
 +
| None
 +
|-
 +
| <code>minecraft.open_barrel</code>
 +
| 59
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_blast_furnace</code>
 +
| 60
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_smoker</code>
 +
| 61
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_lectern</code>
 +
| 62
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_campfire</code>
 +
| 63
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_cartography_table</code>
 +
| 64
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_loom</code>
 +
| 65
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_stonecutter</code>
 +
| 66
 +
| None
 +
|-
 +
| <code>minecraft.bell_ring</code>
 +
| 67
 +
| None
 +
|-
 +
| <code>minecraft.raid_trigger</code>
 +
| 68
 +
| None
 +
|-
 +
| <code>minecraft.raid_win</code>
 +
| 69
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_anvil</code>
 +
| 70
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_grindstone</code>
 +
| 71
 +
| None
 +
|-
 +
| <code>minecraft.target_hit</code>
 +
| 72
 +
| None
 +
|-
 +
| <code>minecraft.interact_with_smithing_table</code>
 +
| 73
 +
| None
 +
|}
 +
 
 +
Units:
 +
 
 +
* None: just a normal number (formatted with 0 decimal places)
 +
* Damage: value is 10 times the normal amount
 +
* Distance: a distance in centimeters (hundredths of blocks)
 +
* Time: a time span in ticks
 +
 
 +
==== Acknowledge Player Digging ====
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="4"| 0x08
 +
|rowspan="4"| Play
 +
|rowspan="4"| Client
 +
| Location
 +
| Position
 +
| Position where the digging was happening.
 +
|-
 +
| Block
 +
| VarInt
 +
| Block state ID of the block that should be at that position now.
 +
|-
 +
| Status
 +
| VarInt enum
 +
| Same as Player Digging.  Only Started digging (0), Cancelled digging (1), and Finished digging (2) are used.
 +
|-
 +
| Successful
 +
| Boolean
 +
| True if the digging succeeded; false if the client should undo any changes it made locally.
 +
|}
 +
 
 +
==== 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"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="3"| 0x09
 +
|rowspan="3"| Play
 +
|rowspan="3"| Client
 +
| Entity ID
 +
| VarInt
 +
| Entity ID of the entity breaking the block.
 +
|-
 +
| Location
 +
| Position
 +
| Block Position.
 +
|-
 +
| Destroy Stage
 +
| Byte
 +
| 0–9 to set it, any other value to remove it.
 +
|}
 +
 
 +
==== Block Entity Data ====
 +
 
 +
Sets the block entity associated with the block at the given location.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="3"| 0x0A
 +
|rowspan="3"| Play
 +
|rowspan="3"| Client
 +
| Location
 +
| Position
 +
|
 +
|-
 +
| Action
 +
| Unsigned Byte
 +
| 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).
 +
|}
 +
 
 +
''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''': Beehive 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.
 +
 
 +
{{Warning2|This packet uses a block ID, not a block state.}}
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="4"| 0x0B
 +
|rowspan="4"| Play
 +
|rowspan="4"| Client
 +
| Location
 +
| Position
 +
| Block coordinates.
 +
|-
 +
| Action ID (Byte 1)
 +
| Unsigned Byte
 +
| Varies depending on block — see [[Block Actions]].
 +
|-
 +
| Action Param (Byte 2)
 +
| Unsigned Byte
 +
| Varies depending on block — see [[Block Actions]].
 +
|-
 +
| Block Type
 +
| VarInt
 +
| The block type ID for the block.  This must match the block at the given coordinates.
 +
|}
 +
 
 +
==== Block Change ====
  
This packet is sent by the server when a player comes into visible range, '''not''' when a player joins.
+
Fired whenever a block is changed within the render distance.
  
Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly.
+
{{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"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=10 | 0x0C
+
! Bound To
| Entity ID || VarInt || Player's Entity ID
+
! Field Name
|-
+
! Field Type
| Player UUID || String || Player's UUID
+
! Notes
|-
+
|-
| Player Name || String || Player's Name
+
|rowspan="2"| 0x0C
|-
+
|rowspan="2"| Play
| X || Int || Player X as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
|rowspan="2"| Client
|-
+
| Location
| Y || Int || Player X as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
| Position
|-
+
| Block Coordinates.
| Z || Int || Player X as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
|-
|-
+
| Block ID
| Yaw || Byte || Player rotation as a packed byte
+
| VarInt
|-
+
| The new block state ID for the block as given in the {{Minecraft Wiki|Data values#Block IDs|global palette}}. See that section for more information.
| Pitch || Byte || Player rotation as a packet byte
+
|}
|-
 
| Current Item || Short || The item the player is currently holding. Note that this should be 0 for "no item", unlike -1 used in other packets. A negative value crashes clients.
 
|-
 
| Metadata || [[Entities#Entity_Metadata_Format|Metadata]] || The client will crash if no metadata is sent
 
|}
 
{{Warning|The client will crash if no metadata is sent}}
 
{{Warning|The client will disconnect if both UUID and Name are empty}}
 
  
==== Collect Item ====
+
==== Boss Bar ====  
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
!colspan="2"| Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="14"| 0x0D
 +
|rowspan="14"| Play
 +
|rowspan="14"| Client
 +
|colspan="2"| UUID
 +
| UUID
 +
| Unique ID for this bar.
 +
|-
 +
|colspan="2"| Action
 +
| VarInt Enum
 +
| Determines the layout of the remaining packet.
 +
|-
 +
! Action
 +
! Field Name
 +
!
 +
!
 +
|-
 +
|rowspan="5"| 0: add
 +
| Title
 +
| [[Chat]]
 +
|
 +
|-
 +
| Health
 +
| Float
 +
| From 0 to 1. Values greater than 1 do not crash a Notchian client, and start [https://i.johni0702.de/nA.png rendering part of a second health bar] at around 1.5.
 +
|-
 +
| Color
 +
| VarInt Enum
 +
| Color ID (see below).
 +
|-
 +
| Division
 +
| VarInt Enum
 +
| Type of division (see below).
 +
|-
 +
| Flags
 +
| Unsigned Byte
 +
| Bit mask. 0x1: should darken sky, 0x2: is dragon bar (used to play end music), 0x04: create fog (previously was also controlled by 0x02).
 +
|-
 +
| 1: remove
 +
| ''no fields''
 +
| ''no fields''
 +
| Removes this boss bar.
 +
|-
 +
| 2: update health
 +
| Health
 +
| Float
 +
| ''as above''
 +
|-
 +
| 3: update title
 +
| Title
 +
| [[Chat]]
 +
|
 +
|-
 +
|rowspan="2"| 4: update style
 +
| Color
 +
| VarInt Enum
 +
| Color ID (see below).
 +
|-
 +
| Dividers
 +
| VarInt Enum
 +
| ''as above''
 +
|-
 +
| 5: update flags
 +
| Flags
 +
| Unsigned Byte
 +
| ''as above''
 +
|-
 +
|}
  
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 and [Player Position & Look packet sent by the client.
+
{| class="wikitable"
 +
! ID
 +
! Color
 +
|-
 +
| 0
 +
| Pink
 +
|-
 +
| 1
 +
| Blue
 +
|-
 +
| 2
 +
| Red
 +
|-
 +
| 3
 +
| Green
 +
|-
 +
| 4
 +
| Yellow
 +
|-
 +
| 5
 +
| Purple
 +
|-
 +
| 6
 +
| White
 +
|}
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! ID
|-
+
! Type of division
| rowspan=2 | 0x0D
+
|-
| Collected Entity ID || Int ||
+
| 0
|-  
+
| No division
| Collector Entity ID || Int ||
+
|-
|}
+
| 1
 +
| 6 notches
 +
|-
 +
| 2
 +
| 10 notches
 +
|-
 +
| 3
 +
| 12 notches
 +
|-
 +
| 4
 +
| 20 notches
 +
|}
  
==== Spawn Object ====
+
==== Server Difficulty ====
  
Sent by the server when an Object/Vehicle is created.
+
Changes the difficulty setting in the client's option menu
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=8| 0x0E
+
! Bound To
| Entity ID || VarInt || Entity ID of the object
+
! Field Name
|-
+
! Field Type
| Type || Byte || The type of object (See [[Entities#Objects|Objects]])
+
! Notes
|-
+
|-
| X || Int || X position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
|rowspan="2"| 0x0E
|-
+
|rowspan="2"| Play
| Y || Int || Y position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
|rowspan="2"| Client
|-
+
| Difficulty
| Z || Int || Z position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
| Unsigned Byte
|-
+
| 0: peaceful, 1: easy, 2: normal, 3: hard.
| Pitch || Byte || The pitch in steps of 2p/256
+
|-
|-
+
| Difficulty locked?
| Yaw || Byte || The yaw in steps of 2p/256
+
| Boolean
|-
+
|
| Data || [[Object_Data|Object Data]] ||
+
|}
|}
 
  
==== Spawn Mob ====
+
==== Chat Message (clientbound) ====  
  
Sent by the server when a Mob Entity is Spawned
+
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.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=12 | 0x0F
+
! Bound To
| Entity ID || VarInt || Entity's ID
+
! Field Name
|-
+
! Field Type
| Type || Unsigned Byte || The type of mob. See [[Entities#Mobs|Mobs]]
+
! Notes
|-
+
|-
| X || Int || X position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]  
+
|rowspan="3"| 0x0F
|-
+
|rowspan="3"| Play
| Y || Int || Y position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
|rowspan="3"| Client
|-
+
| JSON Data
| Z || Int || Z position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
| [[Chat]]
|-
+
| Limited to 262144 bytes.
| Pitch || Byte || The pitch in steps of 2p/256
+
|-
|-
+
| Position
| Head Pitch || Byte || The pitch in steps of 2p/256
+
| Byte
|-
+
| 0: chat (chat box), 1: system message (chat box), 2: game info (above hotbar).
| Yaw || Byte || The yaw in steps of 2p/256
+
|-
|-
+
| Sender
| Velocity X || Short ||
+
| UUID
|-
+
| Used by the Notchian client for the disableChat launch option. Setting both longs to 0 will always display the message regardless of the setting.
| Velocity Y || Short ||
+
|}
|-
 
| Velocity Z || Short ||
 
|-
 
| Metadata || [[Entities#Entity_Metadata_Format|Metadata]] ||
 
|}
 
  
==== Spawn Painting ====
+
==== Clear Titles====
  
This packet shows location, name, and type of painting.
+
Clear the client's current title information, with the option to also reset it.
  
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.
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="1"| 0x10
 +
|rowspan="1"| Play
 +
|rowspan="1"| Client
 +
| Reset
 +
| Boolean
 +
|
 +
|}
  
2x1 (1, 0)
+
==== Tab-Complete (clientbound) ====
4x4 (1, 2)
 
  
 +
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"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=6 | 0x10
+
! Bound To
| Entity ID || VarInt || Entity's ID
+
!colspan="2"| Field Name
|-
+
!colspan="2"| Field Type
| Title || String || Name of the painting. Max length 13
+
! Notes
|-
+
|-
| X || Int || Center X coordinate
+
|rowspan="8"| 0x11
|-
+
|rowspan="8"| Play
| Y || Int || Center Y coordinate
+
|rowspan="8"| Client
|-
+
|-
| Z || Int || Center Z coordinate
+
|colspan="2"| ID
|-
+
|colspan="2"| VarInt
| Direction || Int || Direction the painting faces (0 -z, 1 -x, 2 +z, 3 +x)
+
| Transaction ID.
|}
+
|-
 +
|colspan="2"| Start
 +
|colspan="2"| VarInt
 +
| Start of the text to replace.
 +
|-
 +
|colspan="2"| Length
 +
|colspan="2"| VarInt
 +
| Length of the text to replace.
 +
|-
 +
|colspan="2"| Count
 +
|colspan="2"| VarInt
 +
| Number of elements in the following array.
 +
|-
 +
|rowspan="3"| Matches
 +
| Match
 +
|rowspan="3"| Array
 +
| String (32767)
 +
| One eligible value to insert, note that each command is sent separately instead of in a single string, hence the need for Count.  Note that for instance this doesn't include a leading <code>/</code> on commands.
 +
|-
 +
| Has tooltip
 +
| Boolean
 +
| True if the following is present.
 +
|-
 +
| Tooltip
 +
| Optional [[Chat]]
 +
| Tooltip to display; only present if previous boolean is true.
 +
|}
  
==== Spawn Experience Orb ====
+
==== Declare Commands ====
 +
 
 +
Lists all of the commands on the server, and how they are parsed.
  
Spawns one or more experience orbs.
+
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"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=5 | 0x11
+
! Bound To
| Entity ID || VarInt || Entity's ID
+
! Field Name
|-
+
! Field Type
| X || Int || X position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
! Notes
|-
+
|-
| Y || Int || Y position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]  
+
|rowspan="3"| 0x12
|-
+
|rowspan="3"| Play
| Z || Int || Z position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
|rowspan="3"| Client
|-
+
| Count
| Count || Short || The amount of experience this orb will reward once collected
+
| VarInt
|}
+
| Number of elements in the following array.
 +
|-
 +
| Nodes
 +
| Array of [[Command Data|Node]]
 +
| An array of nodes.
 +
|-
 +
| Root index
 +
| VarInt
 +
| Index of the <code>root</code> node in the previous array.
 +
|}
 +
 
 +
For more information on this packet, see the [[Command Data]] article.
  
==== Entity Velocity ====
+
==== Close Window (clientbound) ====
  
Velocity is believed to be in units of 1/8000 of a block per server tick (50ms);
+
This packet is sent from the server to the client when a window is forcibly closed, such as when a chest is destroyed while it's open. The notchian client disregards the provided window ID and closes any active window.
for example, -1343 would move (-1343 / 8000) = −0.167875 blocks per tick (or −3,3575 blocks per second).
 
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=4 | 0x12
+
! Bound To
| Entity ID || Int || Entity's ID
+
! Field Name
|-
+
! Field Type
| Velocity X || Short || Velocity on the X axis
+
! Notes
|-
+
|-
| Velocity Y || Short || Velocity on the Y axis
+
| 0x13
|-
+
| Play
| Velocity Z || Short || Velocity on the Z axis
+
| Client
|}
+
| Window ID
 +
| Unsigned Byte
 +
| This is the ID of the window that was closed. 0 for inventory.
 +
|}
  
==== Destroy Entities====
+
==== Window Items ====
 +
[[File:Inventory-slots.png|thumb|The inventory slots]]
  
Sent by the server when an list of Entities is to be destroyed on the client.
+
Sent by the server when items in multiple slots (in a window) are added/removed. This includes the main inventory, equipped armour and crafting slots. This packet with Window ID set to "0" is sent during the player joining sequence to initialise the player's inventory.  
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=2 | 0x13
+
! Bound To
| Count || Byte || Length of following array
+
! Field Name
|-
+
! Field Type
| Entity IDs || Array of Int || The list of entities of destroy
+
! Notes
|}
+
|-
 +
|rowspan="5"| 0x14
 +
|rowspan="5"| Play
 +
|rowspan="5"| Client
 +
| Window ID
 +
| Unsigned Byte
 +
| The ID of window which items are being sent for. 0 for player inventory.
 +
|-
 +
| State ID
 +
| VarInt
 +
| See [[Protocol#Click_Window|State ID]]
 +
|-
 +
| Count
 +
| VarInt
 +
| Number of elements in the following array.
 +
|-
 +
| Slot Data
 +
| Array of [[Slot Data|Slot]]
 +
|-
 +
| Carried Item
 +
| [[Slot Data|Slot]]
 +
| Item held by player.
 +
|}
 +
 
 +
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.
  
==== Entity ====
+
==== Window Property ====
  
Most entity-related packets are subclasses of this packet. When sent from the server to the client, it may initialize the entry.
+
This packet is used to inform the client that part of a GUI window should be updated.
  
For player entities, either this packet or any move/look packet is sent every game tick.
+
{| class="wikitable"
So the meaning of this packet is basically that the entity did not move/look since the last such packet.
+
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="3"| 0x15
 +
|rowspan="3"| Play
 +
|rowspan="3"| Client
 +
| Window ID
 +
| Unsigned Byte
 +
|
 +
|-
 +
| Property
 +
| Short
 +
| The property to be updated, see below.
 +
|-
 +
| Value
 +
| Short
 +
| The new value for the property, see below.
 +
|}
 +
 
 +
The meaning of the Property field depends on the type of the window. The following table shows the known combinations of window type and property, and how the value is to be interpreted.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
|-
|-
+
! Window type
| rowspan=1 | 0x14
+
! Property
| Entity ID || Int || Entity's ID
+
! Value
|}
+
|-
 +
|rowspan="4"| Furnace
 +
| 0: Fire icon (fuel left)
 +
| counting from fuel burn time down to 0 (in-game ticks)
 +
|-
 +
| 1: Maximum fuel burn time
 +
| fuel burn time or 0 (in-game ticks)
 +
|-
 +
| 2: Progress arrow
 +
| counting from 0 to maximum progress (in-game ticks)
 +
|-
 +
| 3: Maximum progress
 +
| always 200 on the notchian server
 +
|-
 +
|rowspan="10"| Enchantment Table
 +
| 0: Level requirement for top enchantment slot
 +
|rowspan="3"| The enchantment's xp level requirement
 +
|-
 +
| 1: Level requirement for middle enchantment slot
 +
|-
 +
| 2: Level requirement for bottom enchantment slot
 +
|-
 +
| 3: The enchantment seed
 +
| Used for drawing the enchantment names (in [[Wikipedia:Standard Galactic Alphabet|SGA]]) clientside.  The same seed ''is'' used to calculate enchantments, but some of the data isn't sent to the client to prevent easily guessing the entire list (the seed value here is the regular seed bitwise and <code>0xFFFFFFF0</code>).
 +
|-
 +
| 4: Enchantment ID shown on mouse hover over top enchantment slot
 +
|rowspan="3"| The enchantment id (set to -1 to hide it), see below for values
 +
|-
 +
| 5: Enchantment ID shown on mouse hover over middle enchantment slot
 +
|-
 +
| 6: Enchantment ID shown on mouse hover over bottom enchantment slot
 +
|-
 +
| 7: Enchantment level shown on mouse hover over the top slot
 +
|rowspan="3"| The enchantment level (1 = I, 2 = II, 6 = VI, etc.), or -1 if no enchant
 +
|-
 +
| 8: Enchantment level shown on mouse hover over the middle slot
 +
|-
 +
| 9: Enchantment level shown on mouse hover over the bottom slot
 +
|-
 +
|rowspan="3"| Beacon
 +
| 0: Power level
 +
| 0-4, controls what effect buttons are enabled
 +
|-
 +
| 1: First potion effect
 +
| {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the first effect, or -1 if no effect
 +
|-
 +
| 2: Second potion effect
 +
| {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the second effect, or -1 if no effect
 +
|-
 +
| Anvil
 +
| 0: Repair cost
 +
| The repair's cost in xp levels
 +
|-
 +
|rowspan="2"| Brewing Stand
 +
| 0: Brew time
 +
| 0 – 400, with 400 making the arrow empty, and 0 making the arrow full
 +
|-
 +
| 1: Fuel time
 +
| 0 - 20, with 0 making the arrow empty, and 20 making the arrow full
 +
|-
 +
| Stonecutter
 +
| 0: Selected recipe
 +
| The index of the selected recipe. -1 means none is selected.
 +
|-
 +
| Loom
 +
| 0: Selected pattern
 +
| The index of the selected pattern. 0 means none is selected, 0 is also the internal id of the "base" pattern.
 +
|-
 +
| Lectern
 +
| 0: Page number
 +
| The current page number, starting from 0.
 +
|}
  
==== Entity Relative Move ====
+
For an enchanting table, the following numerical IDs are used:
 +
 
 +
{| class="wikitable"
 +
! Numerical ID
 +
! Enchantment ID
 +
! Enchantment Name
 +
|-
 +
| 0
 +
| minecraft:protection
 +
| Protection
 +
|-
 +
| 1
 +
| minecraft:fire_protection
 +
| Fire Protection
 +
|-
 +
| 2
 +
| minecraft:feather_falling
 +
| Feather Falling
 +
|-
 +
| 3
 +
| minecraft:blast_protection
 +
| Blast Protection
 +
|-
 +
| 4
 +
| minecraft:projectile_protection
 +
| Projectile Protection
 +
|-
 +
| 5
 +
| minecraft:respiration
 +
| Respiration
 +
|-
 +
| 6
 +
| minecraft:aqua_affinity
 +
| Aqua Affinity
 +
|-
 +
| 7
 +
| minecraft:thorns
 +
| Thorns
 +
|-
 +
| 8
 +
| minecraft:depth_strider
 +
| Depth Strider
 +
|-
 +
| 9
 +
| minecraft:frost_walker
 +
| Frost Walker
 +
|-
 +
| 10
 +
| minecraft:binding_curse
 +
| Curse of Binding
 +
|-
 +
| 11
 +
| minecraft:soul_speed
 +
| Soul Speed
 +
|-
 +
| 12
 +
| minecraft:sharpness
 +
| Sharpness
 +
|-
 +
| 13
 +
| minecraft:smite
 +
| Smite
 +
|-
 +
| 14
 +
| minecraft:bane_of_arthropods
 +
| Bane of Arthropods
 +
|-
 +
| 15
 +
| minecraft:knockback
 +
| Knockback
 +
|-
 +
| 16
 +
| minecraft:fire_aspect
 +
| Fire Aspect
 +
|-
 +
| 17
 +
| minecraft:looting
 +
| Looting
 +
|-
 +
| 18
 +
| minecraft:sweeping
 +
| Sweeping Edge
 +
|-
 +
| 19
 +
| minecraft:efficiency
 +
| Efficiency
 +
|-
 +
| 20
 +
| minecraft:silk_touch
 +
| Silk Touch
 +
|-
 +
| 21
 +
| minecraft:unbreaking
 +
| Unbreaking
 +
|-
 +
| 22
 +
| minecraft:fortune
 +
| Fortune
 +
|-
 +
| 23
 +
| minecraft:power
 +
| Power
 +
|-
 +
| 24
 +
| minecraft:punch
 +
| Punch
 +
|-
 +
| 25
 +
| minecraft:flame
 +
| Flame
 +
|-
 +
| 26
 +
| minecraft:infinity
 +
| Infinity
 +
|-
 +
| 27
 +
| minecraft:luck_of_the_sea
 +
| Luck of the Sea
 +
|-
 +
| 28
 +
| minecraft:lure
 +
| Lure
 +
|-
 +
| 29
 +
| minecraft:loyalty
 +
| Loyalty
 +
|-
 +
| 30
 +
| minecraft:impaling
 +
| Impaling
 +
|-
 +
| 31
 +
| minecraft:riptide
 +
| Riptide
 +
|-
 +
| 32
 +
| minecraft:channeling
 +
| Channeling
 +
|-
 +
| 33
 +
| minecraft:multishot
 +
| Multishot
 +
|-
 +
| 34
 +
| minecraft:quick_charge
 +
| Quick Charge
 +
|-
 +
| 35
 +
| minecraft:piercing
 +
| Piercing
 +
|-
 +
| 36
 +
| minecraft:mending
 +
| Mending
 +
|-
 +
| 37
 +
| minecraft:vanishing_curse
 +
| Curse of Vanishing
 +
|}
  
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 should be sent instead.
+
==== Set Slot ====
  
This packet allows at most four blocks movement in any direction, because byte range is from -128 to 127.
+
Sent by the server when an item in a slot (in a window) is added/removed.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=4| 0x15
+
! Bound To
| Entity ID || Int || Entity's ID
+
! Field Name
|-
+
! Field Type
| DX || Byte || Change in X position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
! Notes
|-
+
|-
| DY || Byte || Change in Y position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
|rowspan="4"| 0x16
|-
+
|rowspan="4"| Play
| DZ || Byte || Change in Z position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
|rowspan="4"| Client
|}
+
| Window ID
 +
| Byte
 +
| The window which is being updated. 0 for player inventory. Note that all known window types include the player inventory. This packet will only be sent for the currently opened window while the player is performing actions, even if it affects the player inventory. After the window is closed, a number of these packets are sent to update the player's inventory window (0).
 +
|-
 +
| State ID
 +
| VarInt
 +
| See [[Protocol#Click_Window|State ID]]
 +
|-
 +
| Slot
 +
| Short
 +
| The slot that should be updated.
 +
|-
 +
| Slot Data
 +
| [[Slot Data|Slot]]
 +
|
 +
|}
  
==== Entity Look ====
+
To set the cursor (the item currently dragged with the mouse), use -1 as Window ID and as Slot.
  
This packet is sent by the server when an entity rotates. Example: "Yaw" field 64 means a 90 degree turn.
+
This packet can only be used to edit the hotbar of the player's inventory if window ID is set to 0 (slots 36 through 44).  If the window ID is set to -2, then any slot in the inventory can be used but no add item animation will be played.
 +
 
 +
==== Set Cooldown ====
 +
 
 +
Applies a cooldown period to all items with the given type.  Used by the Notchian server with enderpearls.  This packet should be sent when the cooldown starts and also when the cooldown ends (to compensate for lag), although the client will end the cooldown automatically. Can be applied to any item, note that interactions still get sent to the server with the item but the client does not play the animation nor attempt to predict results (i.e block placing).
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=3 | 0x16
+
! Bound To
| Entity ID || Int || Entity's ID
+
! Field Name
|-
+
! Field Type
| Yaw || Byte || The X Axis rotation as a fraction of 360
+
! Notes
|-
+
|-
| Pitch || Byte || The Y Axis rotation as a fraction of 360
+
|rowspan="2"| 0x17
|}
+
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Item ID
 +
| VarInt
 +
| Numeric ID of the item to apply a cooldown to.
 +
|-
 +
| Cooldown Ticks
 +
| VarInt
 +
| Number of ticks to apply a cooldown for, or 0 to clear the cooldown.
 +
|}
 +
 
 +
==== Plugin Message (clientbound) ====
 +
 
 +
{{Main|Plugin channels}}
  
==== Entity Look and Relative Move ====
+
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.
  
This packet is sent by the server when an entity rotates and moves.
+
More documentation on this: [https://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/ https://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/]
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)
 
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=6 | 0x17
+
! Bound To
| Entity ID || Int || Entity's ID
+
! Field Name
|-
+
! Field Type
| DX || Byte || Change in X position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
! Notes
|-
+
|-
| DY || Byte || Change in Y position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
|rowspan="2"| 0x18
|-
+
|rowspan="2"| Play
| DZ || Byte || Change in Z position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
|rowspan="2"| Client
|-
+
| Channel
| Yaw || Byte || The X Axis rotation as a fraction of 360
+
| Identifier
|-
+
| Name of the [[plugin channel]] used to send the data.
| Pitch || Byte || The Y Axis rotation as a fraction of 360
+
|-
|}
+
| Data
 +
| Byte Array
 +
| Any data, depending on the channel. <code>minecraft:</code> channels are documented [[plugin channel|here]]The length of this array must be inferred from the packet length.
 +
|}
  
==== Entity Teleport ====
+
==== Named Sound Effect ====
 +
{{See also|#Sound Effect}}
  
This packet is sent by the server when an entity moves more than 4 blocks.
+
Used to play a sound effect on the client. Custom sounds may be added by resource packs.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=6 | 0x18
+
! Bound To
| Entity ID || Int || Entity's ID
+
! Field Name
|-
+
! Field Type
| X || Int || X position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
! Notes
|-
+
|-
| Y || Int || Y position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
|rowspan="7"| 0x19
|-
+
|rowspan="7"| Play
| Z || Int || Z position as a [[Data_Types#Fixed-point_numbers|Fixed-Point number]]
+
|rowspan="7"| Client
|-
+
| Sound Name
| Yaw || Byte || The X Axis rotation as a fraction of 360
+
| Identifier
|-
+
| All sound effect names as of 1.16.5 can be seen [https://pokechu22.github.io/Burger/1.16.5.html#sounds here].
| Pitch || Byte || The Y Axis rotation as a fraction of 360
+
|-
|}
+
| Sound Category
 +
| VarInt Enum
 +
| The category that this sound will be played from ([https://gist.github.com/konwboj/7c0c380d3923443e9d55 current categories]).
 +
|-
 +
| Effect Position X
 +
| Int
 +
| Effect X multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part).
 +
|-
 +
| Effect Position Y
 +
| Int
 +
| Effect Y multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part).
 +
|-
 +
| Effect Position Z
 +
| Int
 +
| Effect Z multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part).
 +
|-
 +
| Volume
 +
| Float
 +
| 1 is 100%, can be more.
 +
|-
 +
| Pitch
 +
| Float
 +
| Float between 0.5 and 2.0 by Notchian clients.
 +
|}
  
==== Entity Head Look ====
+
==== Disconnect (play) ====
  
Changes the direction an entity's head is facing.
+
Sent by the server before it disconnects a client. The client assumes that the server has already closed the connection by the time the packet arrives.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=2 | 0x19
+
! Bound To
| Entity ID || Int || Entity's ID
+
! Field Name
|-
+
! Field Type
| Head Yaw || Byte || Head yaw in steps of 2p/256
+
! Notes
|}
+
|-
 +
| 0x1A
 +
| Play
 +
| Client
 +
| Reason
 +
| [[Chat]]
 +
| Displayed to the client when the connection terminates.
 +
|}
  
 
==== Entity Status ====
 
==== Entity Status ====
 +
 +
Entity statuses generally trigger an animation for an entity.  The available statuses vary by the entity's type (and are available to subclasses of that type as well).
 +
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=2 | 0x1A
+
! Bound To
| Entity ID || Int || Entity's ID
+
! Field Name
|-
+
! Field Type
| Entity Status || Byte || See below
+
! Notes
|}
+
|-
 +
|rowspan="2"| 0x1B
 +
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Entity ID
 +
| Int
 +
|
 +
|-
 +
| Entity Status
 +
| Byte Enum
 +
| See [[Entity statuses]] for a list of which statuses are valid for each type of entity.
 +
|}
 +
 
 +
==== Explosion ====
 +
 
 +
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).
 +
 
 +
Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x
  
 
{| class="wikitable"
 
{| class="wikitable"
|-
+
! Packet ID
! Entity Status !! Meaning
+
! State
|-
+
! Bound To
| 2 || Entity hurt
+
! Field Name
|-
+
! Field Type
| 3 || Entity dead
+
! Notes
|-
+
|-
| 6 || Wolf taming
+
|rowspan="9"| 0x1C
|-
+
|rowspan="9"| Play
| 7 || Wolf tamed
+
|rowspan="9"| Client
|-
+
| X
| 8 || Wolf shaking water off itself
+
| Float
|-
+
|  
| 9 || (of self) Eating accepted by server
+
|-
|-
+
| Y
| 10 || Sheep eating grass
+
| Float
|-
+
|  
| 11 || Iron Golem handing over a rose
+
|-
|-
+
| Z
| 12 || Spawn "heart" particles near a villager
+
| Float
|-
+
|  
| 13 || Spawn particles indicating that a villager is angry and seeking revenge
+
|-
|-
+
| Strength
| 14 || Spawn happy particles near a villager
+
| Float
|-
+
| A strength greater than or equal to 2.0 spawns a <code>minecraft:explosion_emitter</code> particle, while a lesser strength spawns a <code>minecraft:explosion</code> particle.
| 15 || Spawn a "magic" particle near the Witch
+
|-
|-
+
| Record Count
| 16 || Zombie converting into a villager by shaking violently (unused in recent update)
+
| VarInt
|-
+
| Number of elements in the following array.
| 17 || A firework exploding
+
|-
|}
+
| Records
 +
| Array of (Byte, Byte, Byte)
 +
| Each record is 3 signed bytes long; the 3 bytes are the XYZ (respectively) signed offsets of affected blocks.
 +
|-
 +
| Player Motion X
 +
| Float
 +
| X velocity of the player being pushed by the explosion.
 +
|-
 +
| Player Motion Y
 +
| Float
 +
| Y velocity of the player being pushed by the explosion.
 +
|-
 +
| Player Motion Z
 +
| Float
 +
| Z velocity of the player being pushed by the explosion.
 +
|}
  
==== Attach Entity ====
+
==== Unload Chunk ====
 +
 
 +
Tells the client to unload a chunk column.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="2"| 0x1D
 +
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Chunk X
 +
| Int
 +
| Block coordinate divided by 16, rounded down.
 +
|-
 +
| Chunk Z
 +
| Int
 +
| Block coordinate divided by 16, rounded down.
 +
|}
 +
 
 +
It is legal to send this packet even if the given chunk is not currently loaded.
 +
 
 +
==== Change Game State ====
  
This packet is sent when a player has been attached to an entity (e.g. Minecart)
+
Used for a wide variety of game state things, from weather to bed use to gamemode to demo messages.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=3 | 0x1B
+
! Bound To
| Entity ID || Int || Entity's ID
+
! Field Name
|-
+
! Field Type
| Vehicle ID || Int || Vechicle's Entity ID
+
! Notes
|-
+
|-
| Leash || Bool || If true leashes the entity to the vehicle
+
|rowspan="2"| 0x1E
|}
+
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Reason
 +
| Unsigned Byte
 +
| See below.
 +
|-
 +
| Value
 +
| Float
 +
| Depends on Reason.
 +
|}
 +
 
 +
''Reason codes'':
  
==== Entity Metadata ====
 
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Reason
|-
+
! Effect
| rowspan=2 | 0x1C
+
! Value
| Entity ID || Int || Entity's ID
+
|-
|-
+
| 0
| Metadata || [[Entities#Entity_Metadata_Format|Metadata]] ||
+
| No respawn block available
|}
+
| Note: Sends message 'block.minecraft.spawn.not_valid'(You have no home bed or charged respawn anchor, or it was obstructed) to the client.
 +
|-
 +
| 1
 +
| End raining
 +
|
 +
|-
 +
| 2
 +
| Begin raining
 +
|
 +
|-
 +
| 3
 +
| Change gamemode
 +
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 +
|-
 +
| 4
 +
| Win game
 +
| 0: Just respawn player. <br>1: Roll the credits and respawn player. <br> Note that 1 is only sent by notchian server when player has not yet achieved advancement "The end?", else 0 is sent.
 +
|-
 +
| 5
 +
| Demo event
 +
| 0: Show welcome to demo screen<br> 101: Tell movement controls<br> 102: Tell jump control<br> 103: Tell inventory control<br> 104: Tell that the demo is over and print a message about how to take a screenshot.
 +
|-
 +
| 6
 +
| Arrow hit player
 +
| Note: Sent when any player is struck by an arrow.
 +
|-
 +
| 7
 +
| Rain level change
 +
| Note: Seems to change both skycolor and lightning. <strong>[https://imgur.com/a/K6wSrkW You can see some level images here]</strong><br>Rain level starting from 0.
 +
|-
 +
| 8
 +
| Thunder level change
 +
| Note: Seems to change both skycolor and lightning (same as Rain level change, but doesn't start rain). It also requires rain to render by notchian client. <br>Thunder level starting from 0.
 +
|-
 +
| 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).
 +
|}
 +
 
 +
==== Open Horse Window ====
 +
 
 +
This packet is used exclusively for opening the horse GUI.  [[#Open Window|Open Window]] is used for all other GUIs.
  
==== Entity Effect ====
 
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=4 | 0x1D
+
! Bound To
| Entity ID || Int || Entity's ID
+
! Field Name
|-
+
! Field Type
| Effect ID || Byte || See [[http://www.minecraftwiki.net/wiki/Potion_effect#Parameters]]
+
! Notes
|-
+
|-
| Amplifier || Byte ||  
+
|rowspan="3"| 0x1F
|-
+
|rowspan="3"| Play
| Duration || Short ||
+
|rowspan="3"| Client
|}
+
| Window ID?
 +
| Byte
 +
|
 +
|-
 +
| Number of slots?
 +
| VarInt
 +
|
 +
|-
 +
| Entity ID?
 +
| Integer
 +
|
 +
|}
 +
 
 +
==== Initialize World Border ====
  
==== Remove Entity Effect ====
 
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=2 | 0x1E
+
! Bound To
| Entity ID || Int || Entity's ID
+
! Field Name
|-
+
! Field Type
| Effect ID || Byte ||
+
! Notes
|}
+
|-
 +
|rowspan="8"| 0x20
 +
|rowspan="8"| Play
 +
|rowspan="8"| Client
 +
| X
 +
| Double
 +
|
 +
|-
 +
| Z
 +
| Double
 +
|
 +
|-
 +
| Old Diameter
 +
| Double
 +
| Current length of a single side of the world border, in meters.
 +
|-
 +
| New Diameter
 +
| Double
 +
| Target length of a single side of the world border, in meters.
 +
|-
 +
| Speed
 +
| VarLong
 +
| Number of real-time ''milli''seconds until New Diameter is reached. It appears that Notchian server does not sync world border speed to game ticks, so it gets out of sync with server lag. If the world border is not moving, this is set to 0.
 +
|-
 +
| Portal Teleport Boundary
 +
| VarInt
 +
| Resulting coordinates from a portal teleport are limited to ±value. Usually 29999984.
 +
|-
 +
| Warning Blocks
 +
| VarInt
 +
| In meters.
 +
|-
 +
| Warning Time
 +
| VarInt
 +
| In seconds as set by <code>/worldborder warning time</code>.
 +
|-
 +
|}
 +
 
 +
The Notchian client determines how solid to display the warning by comparing to whichever is higher, the warning distance or whichever is lower, the distance from the current diameter to the target diameter or the place the border will be after warningTime seconds. In pseudocode:
 +
 
 +
<syntaxhighlight lang="java">
 +
distance = max(min(resizeSpeed * 1000 * warningTime, abs(targetDiameter - currentDiameter)), warningDistance);
 +
if (playerDistance < distance) {
 +
    warning = 1.0 - playerDistance / distance;
 +
} else {
 +
    warning = 0.0;
 +
}
 +
</syntaxhighlight>
 +
 
 +
==== Keep Alive (clientbound) ====
  
==== Set Experience ====
+
The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same payload (see [[#Keep Alive (serverbound)|serverbound Keep Alive]]). If the client does not respond to them for over 30 seconds, the server kicks the client. Vice versa, if the server does not send any keep-alives for 20 seconds, the client will disconnect and yields a "Timed out" exception.
  
Sent by the server when the client should change experience levels.
+
The Notchian server uses a system-dependent time in milliseconds to generate the keep alive ID value.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=3 | 0x1F
+
! Bound To
| Experience bar || Float || Between 0 and 1
+
! Field Name
|-
+
! Field Type
| Level || Short ||
+
! Notes
|-
+
|-
| Total Experience || Short ||
+
| 0x21
|}
+
| Play
 +
| Client
 +
| Keep Alive ID
 +
| Long
 +
|  
 +
|}
 +
 
 +
==== Chunk Data ====
 +
{{Main|Chunk Format}}
 +
{{See also|#Unload Chunk}}
 +
 
 +
{{Need Info|How do biomes work now?  The biome change happened at the same time as the seed change, but it's not clear how/if biomes could be computed given that it's not the actual seed...  ([https://www.reddit.com/r/Mojira/comments/e5at6i/a_discussion_for_the_changes_to_how_biomes_are/ /r/mojira discussion] which notes that it seems to be some kind of interpolation, and 3D biomes are only used in the nether)}}
 +
 
 +
The server only sends skylight information for chunk pillars in the {{Minecraft Wiki|Overworld}}, it's up to the client to know in which dimension the player is currently located. You can also infer this information from the primary bitmask and the amount of uncompressed bytes sent.  This packet also sends all block entities in the chunk (though sending them is not required; it is still legal to send them with [[#Update Block Entity|Update Block Entity]] later).
  
==== Entity Properties ====
 
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=3 | 0x20
+
! Bound To
| Entity ID || Int || Entity's ID
+
! Field Name
|-
+
! Field Type
| Count || Int || Length of following array
+
! Notes
|-
+
|-
| Properties || Array of Property Data ||
+
|rowspan="11"| 0x22
|}
+
|rowspan="11"| Play
 +
|rowspan="11"| Client
 +
| Chunk X
 +
| Int
 +
| Chunk coordinate (block coordinate divided by 16, rounded down)
 +
|-
 +
| Chunk Z
 +
| Int
 +
| Chunk coordinate (block coordinate divided by 16, rounded down)
 +
|-
 +
| Bit Mask Length
 +
| VarInt
 +
| Length of the following array
 +
|-
 +
| Primary Bit Mask
 +
| Array of Long
 +
| BitSet with bits (world height in blocks / 16) 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 the lowest y to 15 blocks above).
 +
|-
 +
| Heightmaps
 +
| [[NBT]]
 +
| Compound containing one long array named <code>MOTION_BLOCKING</code>, which is a heightmap for the highest solid block at each position in the chunk (as a compacted long array with 256 entries at 9 bits per entry totaling 37 longs). The Notchian server also adds a <code>WORLD_SURFACE</code> long array, the purpose of which is unknown, but it's not required for the chunk to be accepted.
 +
|-
 +
| Biomes length
 +
| VarInt
 +
| Size of the following array
 +
|-
 +
| Biomes
 +
| Array of VarInt
 +
| Biome IDs, ordered by x then z then y, in 4&times;4&times;4 blocks.  See [[Chunk Format#Biomes|Chunk Format § Biomes]].
 +
|-
 +
| Size
 +
| VarInt
 +
| Size of Data in bytes
 +
|-
 +
| Data
 +
| Byte array
 +
| See [[Chunk Format#Data structure|data structure]] in Chunk Format
 +
|-
 +
| Number of block entities
 +
| VarInt
 +
| Number of elements in the following array
 +
|-
 +
| Block entities
 +
| Array of [[NBT|NBT Tag]]
 +
| All block entities in the chunk.  Use the x, y, and z tags in the NBT to determine their positions.
 +
|}
 +
 
 +
Note that the Notchian client requires an [[#Update View Position|Update View Position]] packet when it crosses a chunk border, otherwise it'll only display render distance + 2 chunks around the chunk it spawned in.
 +
 
 +
The compacted array format has been adjusted so that individual entries no longer span across multiple longs, affecting the main data array and heightmaps.
 +
 
 +
New format, 5 bits per block, containing the following references to blocks in a palette (not shown): <span style="border: solid 2px hsl(0, 90%, 60%)">1</span><span style="border: solid 2px hsl(30, 90%, 60%)">2</span><span style="border: solid 2px hsl(60, 90%, 60%)">2</span><span style="border: solid 2px hsl(90, 90%, 60%)">3</span><span style="border: solid 2px hsl(120, 90%, 60%)">4</span><span style="border: solid 2px hsl(150, 90%, 60%)">4</span><span style="border: solid 2px hsl(180, 90%, 60%)">5</span><span style="border: solid 2px hsl(210, 90%, 60%)">6</span><span style="border: solid 2px hsl(240, 90%, 60%)">6</span><span style="border: solid 2px hsl(270, 90%, 60%)">4</span><span style="border: solid 2px hsl(300, 90%, 60%)">8</span><span style="border: solid 2px hsl(330, 90%, 60%)">0</span><span style="border: solid 2px hsl(0, 90%, 30%)">7</span><span style="border: solid 2px hsl(30, 90%, 30%)">4</span><span style="border: solid 2px hsl(60, 90%, 30%)">3</span><span style="border: solid 2px hsl(90, 90%, 30%)">13</span><span style="border: solid 2px hsl(120, 90%, 30%)">15</span><span style="border: solid 2px hsl(150, 90%, 30%)">16</span><span style="border: solid 2px hsl(180, 90%, 30%)">9</span><span style="border: solid 2px hsl(210, 90%, 30%)">14</span><span style="border: solid 2px hsl(240, 90%, 30%)">10</span><span style="border: solid 2px hsl(270, 90%, 30%)">12</span><span style="border: solid 2px hsl(300, 90%, 30%)">0</span><span style="border: solid 2px hsl(330, 90%, 30%)">2</span>
 +
 
 +
<code>0020863148418841</code> <code><span style="outline: dashed 2px black">0000</span><span style="outline: solid 2px hsl(330, 90%, 60%)">00000</span><span style="outline: solid 2px hsl(300, 90%, 60%)">01000</span><span style="outline: solid 2px hsl(270, 90%, 60%)">00100</span><span style="outline: solid 2px hsl(240, 90%, 60%)">00110</span><span style="outline: solid 2px hsl(210, 90%, 60%)">00110</span><span style="outline: solid 2px hsl(180, 90%, 60%)">00101</span><span style="outline: solid 2px hsl(150, 90%, 60%)">00100</span><span style="outline: solid 2px hsl(120, 90%, 60%)">00100</span><span style="outline: solid 2px hsl(90, 90%, 60%)">00011</span><span style="outline: solid 2px hsl(60, 90%, 60%)">00010</span><span style="outline: solid 2px hsl(30, 90%, 60%)">00010</span><span style="outline: solid 2px hsl(0, 90%, 60%)">00001</span></code><br>
 +
<code>01018A7260F68C87</code> <code><span style="outline: dashed 2px black">0000</span><span style="outline: solid 2px hsl(330, 90%, 30%)">00010</span><span style="outline: solid 2px hsl(300, 90%, 30%)">00000</span><span style="outline: solid 2px hsl(270, 90%, 30%)">01100</span><span style="outline: solid 2px hsl(240, 90%, 30%)">01010</span><span style="outline: solid 2px hsl(210, 90%, 30%)">01110</span><span style="outline: solid 2px hsl(180, 90%, 30%)">01001</span><span style="outline: solid 2px hsl(150, 90%, 30%)">10000</span><span style="outline: solid 2px hsl(120, 90%, 30%)">01111</span><span style="outline: solid 2px hsl(90, 90%, 30%)">01101</span><span style="outline: solid 2px hsl(60, 90%, 30%)">00011</span><span style="outline: solid 2px hsl(30, 90%, 30%)">00100</span><span style="outline: solid 2px hsl(0, 90%, 30%)">00111</span></code>
 +
 
 +
==== Effect ====
 +
Sent when a client is to play a sound or particle effect.
 +
 
 +
By default, the Minecraft client adjusts the volume of sound effects based on distance. The final boolean field is used to disable this, and instead the effect is played from 2 blocks away in the correct direction. Currently this is only used for effect 1023 (wither spawn), effect 1028 (enderdragon death), and effect 1038 (end portal opening); it is ignored on other effects.
  
'''Property Data''' structure:
 
 
{| class="wikitable"
 
{| class="wikitable"
|-
+
! Packet ID
! Field Name !! Field Type !! Notes
+
! State
|-
+
! Bound To
| Key || String ||  
+
! Field Name
|-
+
! Field Type
| Value || Double ||  
+
! Notes
|-
+
|-
| List Length || Short || Number of list elements that follow.
+
|rowspan="4"| 0x23
|-
+
|rowspan="4"| Play
| Modifiers || Array of Modifier Data || http://www.minecraftwiki.net/wiki/Attribute#Modifiers
+
|rowspan="4"| Client
|}
+
| Effect ID
 +
| Int
 +
| The ID of the effect, see below.
 +
|-
 +
| Location
 +
| Position
 +
| The location of the effect.
 +
|-
 +
| Data
 +
| Int
 +
| Extra data for certain effects, see below.
 +
|-
 +
| Disable Relative Volume
 +
| Boolean
 +
| See above.
 +
|}
 +
 
 +
Effect IDs:
  
Known key values:
 
 
{| class="wikitable"
 
{| class="wikitable"
|-
+
! ID
! Key !! Default !! Min !! Max !! Label
+
! Name
|-
+
! Data
| generic.maxHealth || 20.0 || 0.0 || Double.MaxValue || Max Health
+
|-
|-
+
!colspan="3"| Sound
| generic.followRange || 32.0 || 0.0 || 2048.0 || Follow Range
+
|-
|-
+
| 1000
| generic.knockbackResistance || 0.0 || 0.0 || 1.0 || Knockback Resistance
+
| Dispenser dispenses
|-
+
|
| generic.movementSpeed || 0.699999988079071 || 0.0 || Double.MaxValue || Movement Speed
+
|-
|-
+
| 1001
| generic.attackDamage || 2.0 || 0.0 || Double.MaxValue ||  
+
| Dispenser fails to dispense
|-
+
|
| horse.jumpStrength || 0.7 || 0.0 || 2.0 || Jump Strength
+
|-
|-
+
| 1002
| zombie.spawnReinforcements || 0.0 || 0.0 || 1.0 || Spawn Reinforcements Chance
+
| Dispenser shoots
|}
+
|
 +
|-
 +
| 1003
 +
| Ender eye launched
 +
|
 +
|-
 +
| 1004
 +
| Firework shot
 +
|
 +
|-
 +
| 1005
 +
| Iron door opened
 +
|
 +
|-
 +
| 1006
 +
| Wooden door opened
 +
|
 +
|-
 +
| 1007
 +
| Wooden trapdoor opened
 +
|
 +
|-
 +
| 1008
 +
| Fence gate opened
 +
|
 +
|-
 +
| 1009
 +
| Fire extinguished
 +
|
 +
|-
 +
| 1010
 +
| Play record
 +
| Special case, see below for more info.
 +
|-
 +
| 1011
 +
| Iron door closed
 +
|
 +
|-
 +
| 1012
 +
| Wooden door closed
 +
|
 +
|-
 +
| 1013
 +
| Wooden trapdoor closed
 +
|
 +
|-
 +
| 1014
 +
| Fence gate closed
 +
|
 +
|-
 +
| 1015
 +
| Ghast warns
 +
|
 +
|-
 +
| 1016
 +
| Ghast shoots
 +
|
 +
|-
 +
| 1017
 +
| Enderdragon shoots
 +
|
 +
|-
 +
| 1018
 +
| Blaze shoots
 +
|
 +
|-
 +
| 1019
 +
| Zombie attacks wood door
 +
|
 +
|-
 +
| 1020
 +
| Zombie attacks iron door
 +
|
 +
|-
 +
| 1021
 +
| Zombie breaks wood door
 +
|
 +
|-
 +
| 1022
 +
| Wither breaks block
 +
|
 +
|-
 +
| 1023
 +
| Wither spawned
 +
|
 +
|-
 +
| 1024
 +
| Wither shoots
 +
|
 +
|-
 +
| 1025
 +
| Bat takes off
 +
|
 +
|-
 +
| 1026
 +
| Zombie infects
 +
|
 +
|-
 +
| 1027
 +
| Zombie villager converted
 +
|
 +
|-
 +
| 1028
 +
| Ender dragon death
 +
|
 +
|-
 +
| 1029
 +
| Anvil destroyed
 +
|
 +
|-
 +
| 1030
 +
| Anvil used
 +
|
 +
|-
 +
| 1031
 +
| Anvil landed
 +
|
 +
|-
 +
| 1032
 +
| Portal travel
 +
|
 +
|-
 +
| 1033
 +
| Chorus flower grown
 +
|
 +
|-
 +
| 1034
 +
| Chorus flower died
 +
|
 +
|-
 +
| 1035
 +
| Brewing stand brewed
 +
|
 +
|-
 +
| 1036
 +
| Iron trapdoor opened
 +
|
 +
|-
 +
| 1037
 +
| Iron trapdoor closed
 +
|
 +
|-
 +
| 1038
 +
| End portal created in overworld
 +
|
 +
|-
 +
| 1039
 +
| Phantom bites
 +
|
 +
|-
 +
| 1040
 +
| Zombie converts to drowned
 +
|
 +
|-
 +
| 1041
 +
| Husk converts to zombie by drowning
 +
|
 +
|-
 +
| 1042
 +
| Grindstone used
 +
|
 +
|-
 +
| 1043
 +
| Book page turned
 +
|
 +
|-
 +
|-
 +
!colspan="3"| Particle
 +
|-
 +
| 1500
 +
| Composter composts
 +
|
 +
|-
 +
| 1501
 +
| Lava converts block (either water to stone, or removes existing blocks such as torches)
 +
|
 +
|-
 +
| 1502
 +
| Redstone torch burns out
 +
|
 +
|-
 +
| 1503
 +
| Ender eye placed
 +
|
 +
|-
 +
| 2000
 +
| Spawns 10 smoke particles, e.g. from a fire
 +
| Direction, see below.
 +
|-
 +
| 2001
 +
| Block break + block break sound
 +
| Block state, as an index into the global palette.
 +
|-
 +
| 2002
 +
| Splash potion. Particle effect + glass break sound.
 +
| RGB color as an integer (e.g. 8364543 for #7FA1FF).
 +
|-
 +
| 2003
 +
| Eye of Ender entity break animation — particles and sound
 +
|  
 +
|-
 +
| 2004
 +
| Mob spawn particle effect: smoke + flames
 +
|  
 +
|-
 +
| 2005
 +
| Bonemeal particles
 +
| How many particles to spawn (if set to 0, 15 are spawned).
 +
|-
 +
| 2006
 +
| Dragon breath
 +
|
 +
|-
 +
| 2007
 +
| Instant splash potion. Particle effect + glass break sound.
 +
| RGB color as an integer (e.g. 8364543 for #7FA1FF).
 +
|-
 +
| 2008
 +
| Ender dragon destroys block
 +
|
 +
|-
 +
| 2009
 +
| Wet sponge vaporizes in nether
 +
|
 +
|-
 +
| 3000
 +
| End gateway spawn
 +
|  
 +
|-
 +
| 3001
 +
| Enderdragon growl
 +
|
 +
|-
 +
| 3002
 +
| Electric spark
 +
|
 +
|-
 +
| 3003
 +
| Copper apply wax
 +
|
 +
|-
 +
| 3004
 +
| Copper remove wax
 +
|
 +
|-
 +
| 3005
 +
| Copper scrape oxidation
 +
|
 +
|}
 +
 
 +
Smoke directions:
  
'''Modifier Data''' structure:
 
 
{| class="wikitable"
 
{| class="wikitable"
|-
+
! ID
! Field Name !! Field Type !! Notes
+
! Direction
|-
+
|-
| UUID || 128-bit integer ||
+
| 0
|-
+
| Down
| Amount || Double ||
+
|-
|-
+
| 1
| Operation || Byte ||
+
| Up
|}
+
|-
 +
| 2
 +
| North
 +
|-
 +
| 3
 +
| South
 +
|-
 +
| 4
 +
| West
 +
|-
 +
| 5
 +
| East
 +
|}
  
==== Chunk Data ====
+
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.
  
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.
+
==== Particle ====
  
See also: [[SMP Map Format]]
+
Displays the named particle
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=7 | 0x21
+
! Bound To
| Chunk X || Int || Chunk X coordinate
+
! Field Name
|-
+
! Field Type
| Chunk Z || Int || Chunk Z coordinate
+
! Notes
|-
+
|-
| Ground-Up continuous || Boolean || This is True if the packet represents all sections in this vertical column, where the primary bit map specifies exactly which sections are included, and which are air
+
|rowspan="11"| 0x24
|-
+
|rowspan="11"| Play
| Primary bit map || Unsigned Short || Bitmask with 1 for every 16x16x16 section which data follows in the compressed data.
+
|rowspan="11"| Client
|-
+
| Particle ID
| Add bit map || Unsigned Short || Same as above, but this is used exclusively for the 'add' portion of the payload
+
| Int
|-  
+
| The particle ID listed in [[#Particle|the particle data type]].
| Compressed size || Int || Size of compressed chunk data
+
|-
|-
+
| Long Distance
| Compressed data || Byte array || The chunk data is compressed using Zlib Deflate
+
| Boolean
|}
+
| If true, particle distance increases from 256 to 65536.
 +
|-
 +
| X
 +
| Double
 +
| X position of the particle.
 +
|-
 +
| Y
 +
| Double
 +
| Y position of the particle.
 +
|-
 +
| Z
 +
| Double
 +
| Z position of the particle.
 +
|-
 +
| Offset X
 +
| Float
 +
| This is added to the X position after being multiplied by <code>random.nextGaussian()</code>.
 +
|-
 +
| Offset Y
 +
| Float
 +
| This is added to the Y position after being multiplied by <code>random.nextGaussian()</code>.
 +
|-
 +
| Offset Z
 +
| Float
 +
| This is added to the Z position after being multiplied by <code>random.nextGaussian()</code>.
 +
|-
 +
| Particle Data
 +
| Float
 +
| The data of each particle.
 +
|-
 +
| Particle Count
 +
| Int
 +
| The number of particles to create.
 +
|-
 +
| Data
 +
| Varies
 +
| The variable data listed in [[#Particle|the particle data type]].
 +
|}
 +
 
 +
==== Update Light ====
 +
 
 +
Updates light levels for a chunk.
  
==== Multi Block Change ====
 
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan=5 | 0x22
+
! Bound To
| Chunk X || Int || Chunk X coordinate
+
!colspan="2"| Field Name
|-
+
!colspan="2"| Field Type
| Chunk Z || Int || Chunk Z Coordinate
+
! Notes
|-
+
|-
| Record count || Short || The number of blocks affected
+
|rowspan="17"| 0x25
|-
+
|rowspan="17"| Play
| Data size || Int ||  The total size of the data, in bytes. Should always be 4*record count
+
|rowspan="17"| Client
|-
+
|colspan="2"| Chunk X
| Records || Array of Records ||  
+
|colspan="2"| VarInt
|}
+
| Chunk coordinate (block coordinate divided by 16, rounded down)
 +
|-
 +
|colspan="2"| Chunk Z
 +
|colspan="2"| VarInt
 +
| Chunk coordinate (block coordinate divided by 16, rounded down)
 +
|-
 +
|colspan="2"| Trust Edges
 +
|colspan="2"| Boolean
 +
| If edges should be trusted for light updates.
 +
|-
 +
|colspan="2"| Length 1
 +
|colspan="2"| VarInt
 +
| Length of the following array
 +
|-
 +
|colspan="2"| Sky Light Mask
 +
|colspan="2"| Array of Long
 +
| BitSet containing bits for each sections in the world + 2 (lowest bit 16-1 blocks below min world height, highest 1-16 above max world height)
 +
|-
 +
|colspan="2"| Length 2
 +
|colspan="2"| VarInt
 +
| Length of the following array
 +
|-
 +
  |colspan="2"| Block Light Mask
 +
|colspan="2"| Array of Long
 +
| BitSet containing bits for each sections in the world + 2, same order as sky light
 +
|-
 +
|colspan="2"| Length 3
 +
|colspan="2"| VarInt
 +
| Length of the following array
 +
|-
 +
|colspan="2"| Empty Sky Light Mask
 +
|colspan="2"| Array of Long
 +
| BitSet containing a variable amount of bits (see sky/block light) which indicates sections that have 0 for all their sky light values
 +
|-
 +
|colspan="2"| Length 4
 +
|colspan="2"| VarInt
 +
| Length of the following array
 +
|-
 +
|colspan="2"| Empty Block Light Mask
 +
|colspan="2"| Array of Long
 +
| BitSet containing a variable amount of bits (see sky/block light) which indicates sections that have 0 for all their block light values
 +
|-
 +
|colspan="2"| Sky Light array count
 +
|colspan="2"| VarInt
 +
| Number of entries in the following array
 +
|-
 +
|rowspan="2"| Sky Light arrays
 +
| Length
 +
|rowspan="2"| Array
 +
| VarInt
 +
| Length of the following array in bytes (always 2048)
 +
|-
 +
| Sky Light array
 +
| Array of 2048 bytes
 +
| There is 1 array for each bit set to true in the sky light mask, starting with the lowest value.  Half a byte per light value.
 +
|-
 +
|colspan="2"| Block Light array count
 +
|colspan="2"| VarInt
 +
| Number of entries in the following array
 +
|-
 +
|rowspan="2"| Block Light arrays
 +
| Length
 +
|rowspan="2"| Array
 +
| VarInt
 +
| Length of the following array in bytes (always 2048)
 +
|-
 +
| Block Light array
 +
| Array of 2048 bytes
 +
| There is 1 array for each bit set to true in the block light mask, starting with the lowest value.  Half a byte per light value.
 +
|}
 +
 
 +
==== Join Game ====
 +
 
 +
See [[Protocol Encryption]] for information on logging in.
  
'''Record'''
 
 
{| class="wikitable"
 
{| class="wikitable"
|-
+
! Packet ID
! Bit mask !! Width !! Meaning
+
! State
|-
+
! Bound To
| 00 00 00 0F || 4 bits || Block metadata
+
! Field Name
|-
+
! Field Type
| 00 00 FF F0 || 12 bits || Block ID
+
! Notes
|-
+
|-
| 00 FF 00 00 || 8 bits || Y co-ordinate
+
|rowspan="16"| 0x26
|-
+
|rowspan="16"| Play
| 0F 00 00 00 || 4 bits || Z co-ordinate, relative to chunk
+
|rowspan="16"| Client
|-
+
| Entity ID
| F0 00 00 00 || 4 bits || X co-ordinate, relative to chunk
+
| Int
|}
+
| The player's Entity ID (EID).
 +
|-
 +
| Is hardcore
 +
| Boolean
 +
|
 +
|-
 +
| Gamemode
 +
| Unsigned Byte
 +
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 +
|-
 +
| Previous Gamemode
 +
| Byte
 +
| 0: survival, 1: creative, 2: adventure, 3: spectator. The hardcore flag is not included. The previous gamemode. Defaults to -1 if there is no previous gamemode. (More information needed)
 +
|-
 +
| World Count
 +
| VarInt
 +
| Size of the following array.
 +
|-
 +
| World Names
 +
| Array of Identifier
 +
| Identifiers for all worlds on the server.
 +
|-
 +
| Dimension Codec
 +
| [[NBT|NBT Tag Compound]]
 +
| The full extent of these is still unknown, but the tag represents a dimension and biome registry. See below for the vanilla default.
 +
|-
 +
| Dimension
 +
| [[NBT|NBT Tag Compound]]
 +
| Valid dimensions are defined per dimension registry sent before this. The structure of this tag is a dimension type (see below).
 +
|-
 +
| World Name
 +
| Identifier
 +
| Name of the world being spawned into.
 +
|-
 +
| Hashed seed
 +
| Long
 +
| First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
 +
|-
 +
| Max Players
 +
| VarInt
 +
| Was once used by the client to draw the player list, but now is ignored.
 +
|-
 +
| View Distance
 +
| VarInt
 +
| Render distance (2-32).
 +
|-
 +
| Reduced Debug Info
 +
| Boolean
 +
| If true, a Notchian client shows reduced information on the {{Minecraft Wiki|debug screen}}.  For servers in development, this should almost always be false.
 +
|-
 +
| Enable respawn screen
 +
| Boolean
 +
| Set to false when the doImmediateRespawn gamerule is true.
 +
|-
 +
| Is Debug
 +
| Boolean
 +
| True if the world is a {{Minecraft Wiki|debug mode}} world; debug mode worlds cannot be modified and have predefined blocks.
 +
|-
 +
| Is Flat
 +
| Boolean
 +
| True if the world is a {{Minecraft Wiki|superflat}} world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
 +
|}
 +
 
 +
 
 +
The '''Dimension Codec''' NBT Tag Compound ([https://gist.githubusercontent.com/BomBardyGamer/c075a7a34b51f2df9d5aabdd2a762f4f/raw/c7352784dfadbca00d2282aeca04ed80081bfb09/dimension_codec.snbt Default value in SNBT]) includes two registries: "minecraft:dimension_type" and "minecraft:worldgen/biome".
  
==== Block Change ====
 
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
!Name
|-
+
!Type
| rowspan=5 | 0x23
+
!style="width: 250px;" colspan="2"| Notes
| X || Int || Block X Coordinate
+
|-
|-
+
| minecraft:dimension_type
| Y || Unsigned Byte || Block Y Coordinate
+
| TAG_Compound
|-
+
| The dimension type registry (see below).
| Z || Int || Block Z Coordinate
+
|-
|-
+
| minecraft:worldgen/biome
| Block Type || VarInt || The new block type for the block
+
| TAG_Compound
|-
+
| The biome registry (see below).
| Block Data || Unsigned Byte || The new data for the block
+
|}
|}
 
  
==== Block Action ====
+
Dimension type registry:
  
This packet is used for a number of things:
+
{| class="wikitable"
* <div class="li">Chests opening and closing
+
!Name
* Pistons pushing and pulling
+
!Type
* Note blocks playing
+
!style="width: 250px;" colspan="2"| Notes
 +
|-
 +
| type
 +
| TAG_String
 +
| The name of the registry. Always "minecraft:dimension_type".
 +
|-
 +
| value
 +
| TAG_List
 +
| List of dimension types registry entries (see below).
 +
|}
  
See Also: [[Block Actions]]
+
Dimension type registry entry:
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
!Name
|-
+
!Type
| rowspan=6 | 0x24
+
!style="width: 250px;" colspan="2"| Notes
| X || Int || Block X Coordinate
+
|-
|-
+
| name
| Y || Short || Block Y Coordinate
+
| TAG_String
|-
+
| The name of the dimension type (for example, "minecraft:overworld").
| Z || Int || Block Z Coordinate
+
|-
|-
+
| id
| Byte 1 || Unsigned Byte || Varies depending on block - see [[Block_Actions]]
+
| TAG_Int
|-
+
| The protocol ID of the dimension (matches the index of the element in the registry list).
| Byte 2 || Unsigned Byte || Varies depending on block - see [[Block_Actions]]
+
|-
|-
+
| element
| Block Type || VarInt || The block type for the block
+
| TAG_Compound
|}
+
| The dimension type (see below).
 +
|}
  
==== Block Break Animation ====
+
Dimension type:
  
0-9 are the displayable destroy stages and each other number means that there is no animation on this coordinate.
+
{| class="wikitable"
 +
! Name
 +
! Type
 +
!style="width: 250px;" colspan="2"| Meaning
 +
! Values
 +
|-
 +
| piglin_safe
 +
| TAG_Byte
 +
|colspan="2"| Whether piglins shake and transform to zombified piglins.
 +
| 1: true, 0: false.
 +
|-
 +
| natural
 +
| TAG_Byte
 +
|colspan="2"| When false, compasses spin randomly. When true, nether portals can spawn zombified piglins.
 +
| 1: true, 0: false.
 +
|-
 +
| ambient_light
 +
| TAG_Float
 +
|colspan="2"| How much light the dimension has.
 +
| 0.0 to 1.0.
 +
|-
 +
| fixed_time
 +
| Optional TAG_Long
 +
|colspan="2"| If set, the time of the day is the specified value.
 +
| If set, 0 to 24000.
 +
|-
 +
| infiniburn
 +
| TAG_String
 +
|colspan="2"| A resource location defining what block tag to use for infiniburn.
 +
| "" or minecraft resource "minecraft:...".
 +
|-
 +
| respawn_anchor_works
 +
| TAG_Byte
 +
|colspan="2"| Whether players can charge and use respawn anchors.
 +
| 1: true, 0: false.
 +
|-
 +
| has_skylight
 +
| TAG_Byte
 +
|colspan="2"| Whether the dimension has skylight access or not.
 +
| 1: true, 0: false.
 +
|-
 +
| bed_works
 +
| TAG_Byte
 +
|colspan="2"| Whether players can use a bed to sleep.
 +
| 1: true, 0: false.
 +
|-
 +
| effects
 +
| TAG_String
 +
|colspan="2"| ?
 +
| "minecraft:overworld", "minecraft:the_nether", "minecraft:the_end" or something else.
 +
|-
 +
| has_raids
 +
| TAG_Byte
 +
|colspan="2"| Whether players with the Bad Omen effect can cause a raid.
 +
| 1: true, 0: false.
 +
|-
 +
| min_y
 +
| TAG_Int
 +
|colspan="2"| The minimum Y level.
 +
|
 +
|-
 +
| height
 +
| TAG_Int
 +
|colspan="2"| The maximum height.
 +
|
 +
|-
 +
| logical_height
 +
| TAG_Int
 +
|colspan="2"| The maximum height to which chorus fruits and nether portals can bring players within this dimension.
 +
| 0-256.
 +
|-
 +
| coordinate_scale
 +
| TAG_Float
 +
|colspan="2"| The multiplier applied to coordinates when traveling to the dimension.
 +
| 0.00001 - 30000000.0
 +
|-
 +
| ultrawarm
 +
| TAG_Byte
 +
|colspan="2"| Whether the dimensions behaves like the nether (water evaporates and sponges dry) or not. Also causes lava to spread thinner.
 +
| 1: true, 0: false.
 +
|-
 +
| has_ceiling
 +
| TAG_Byte
 +
|colspan="2"| Whether the dimension has a bedrock ceiling or not. When true, causes lava to spread faster.
 +
| 1: true, 0: false.
 +
|}
  
You can also set an animation to air! The animation will still be visible.
+
Biome registry:
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
!Name
|-
+
!Type
| rowspan=5 | 0x25
+
!style="width: 250px;" colspan="2"| Notes
| Entity ID || VarInt || Entity's ID
+
|-
|-
+
| type
| X || Int || rowspan=3 | Block Position
+
| TAG_String
|-
+
| The name of the registry. Always "minecraft:worldgen/biome".
| Y || Int
+
|-
|-
+
| value
| Z || Int
+
| TAG_List
|-
+
| List of biome registry entries (see below).
| Destroy Stage || Byte || 0 - 9
+
|}
|}
 
  
==== Map Chunk Bulk ====
+
Biome registry entry:
  
See also: [[SMP Map Format]]
+
{| class="wikitable"
 +
!Name
 +
!Type
 +
!style="width: 250px;" colspan="2"| Notes
 +
|-
 +
| name
 +
| TAG_String
 +
| The name of the biome (for example, "minecraft:ocean").
 +
|-
 +
| id
 +
| TAG_Int
 +
| The protocol ID of the biome (matches the index of the element in the registry list).
 +
|-
 +
| element
 +
| TAG_Compound
 +
| The biome properties (see below).
 +
|}
  
To reduce the number of bytes this packet is used to send chunks together for better compression results.
+
Biome properties:
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
!colspan="2"|Name
|-
+
!colspan="2"|Type
| rowspan=5 | 0x26
+
!style="width: 250px;" colspan="2"| Meaning
| Chunk column count || Short || The number of chunk in this packet
+
!colspan="2"|Values
|-
+
|-
| Data length || Int || The size of the data field
+
|colspan="2"|precipitation
|-
+
|colspan="2"|TAG_String
| Sky light sent || Bool || Whether or not the chunk data contains a light nibble array. This is true in the main world, false in the end + nether
+
|colspan="2"| The type of precipitation in the biome.
|-
+
|colspan="2"|"rain", "snow", or "none".
| Data || Byte Array || Compressed chunk data
+
|-
|-
+
|colspan="2"| depth
| Meta information || Meta || See below
+
|colspan="2"| TAG_Float
|}
+
|colspan="2"| The depth factor of the biome.
 +
|colspan="2"| The default values vary between 1.5 and -1.8.
 +
|-
 +
|colspan="2"| temperature
 +
|colspan="2"| TAG_Float
 +
|colspan="2"| The temperature factor of the biome.
 +
|colspan="2"| The default values vary between 2.0 and -0.5.
 +
|-
 +
|colspan="2"| scale
 +
|colspan="2"| TAG_Float
 +
|colspan="2"| ?
 +
|colspan="2"| The default values vary between 1.225 and 0.0.
 +
|-
 +
|colspan="2"| downfall
 +
|colspan="2"| TAG_Float
 +
|colspan="2"| ?
 +
|colspan="2"| The default values vary between 1.0 and 0.0.
 +
|-
 +
|colspan="2"| category
 +
|colspan="2"| TAG_String
 +
|colspan="2"| The category of the biome.
 +
|colspan="2"| Known values are "ocean", "plains", "desert", "forest", "extreme_hills", "taiga", "swamp", "river", "nether", "the_end", "icy", "mushroom", "beach", "jungle", "mesa", "savanna", and "none".
 +
|-
 +
|colspan="2"| temperature_modifier
 +
|colspan="2"| Optional TAG_String
 +
|colspan="2"| ?
 +
|colspan="2"| The only known value is "frozen".
 +
|-
 +
|rowspan="11"| effects
 +
| sky_color
 +
|rowspan="11"| TAG_Compound
 +
| TAG_Int
 +
|colspan="2"| The color of the sky.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
| water_fog_color
 +
| TAG_Int
 +
|colspan="2"| Possibly the tint color when swimming.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
| fog_color
 +
| TAG_Int
 +
|colspan="2"| Possibly the color of the fog effect when looking past the view distance.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
| water_color
 +
| TAG_Int
 +
|colspan="2"| The tint color of the water blocks.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
| foliage_color
 +
| Optional TAG_Int
 +
|colspan="2"| The tint color of the grass.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
| grass_color
 +
| Optional TAG_Int
 +
| colspan="2"| ?
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
| grass_color_modifier
 +
| Optional TAG_String
 +
|colspan="2"| Unknown, likely affects foliage color.
 +
| If set, known values are "swamp" and "dark_forest".
 +
|-
 +
| music
 +
| Optional TAG_Compound
 +
|colspan="2"| Music properties for the biome.
 +
| If present, contains the fields: replace_current_music (TAG_Byte), sound (TAG_String), max_delay (TAG_Int), min_delay (TAG_Int).
 +
|-
 +
| ambient_sound
 +
| Optional TAG_String
 +
|colspan="2"| Ambient soundtrack.
 +
| If present, the ID of a soundtrack. Example: "minecraft:ambient.basalt_deltas.loop".
 +
|-
 +
| additions_sound
 +
| Optional TAG_Compound
 +
|colspan="2"| Additional ambient sound that plays randomly.
 +
| If present, contains the fields: sound (TAG_String), tick_chance (TAG_Double).
 +
|-
 +
| mood_sound
 +
| Optional TAG_Compound
 +
|colspan="2"| Additional ambient sound that plays at an interval.
 +
| If present, contains the fields: sound (TAG_String), tick_delay (TAG_Int), offset (TAG_Double), block_search_extent (TAG_Int).
 +
|-
 +
|rowspan="2"|particle
 +
| probability
 +
|rowspan="2"|Optional TAG_Compound
 +
| TAG_FLOAT
 +
|rowspan="2"| Particles that appear randomly in the biome.
 +
| Possibly the probability of spawning the particle.
 +
| ?
 +
|-
 +
| options
 +
| TAG_COMPOUND
 +
| The properties of the particle to spawn.
 +
| Contains the field "type" (TAG_String), which identifies the particle type.
 +
|}
 +
 
 +
==== Map Data ====
 +
 
 +
Updates a rectangular area on a {{Minecraft Wiki|map}} item.
  
'''Meta'''
 
 
{| class="wikitable"
 
{| class="wikitable"
! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
|Chunk X || Int || The X Coordinate of the chunk
+
! Bound To
|-
+
!colspan="2"| Field Name
|Chunk Z || Int || The Z Coordinate of the chunk
+
!colspan="2"| Field Type
|-
+
! Notes
|Primary bitmap || Unsigned Short || A bitmap which specifies which sections are not empty in this chunk
+
|-
|-
+
|rowspan="17"| 0x27
|Add bitmap || Unsigned Short || A bitmap which specifies which sections need add information because of very high block ids. not yet used
+
|rowspan="17"| Play
|}
+
|rowspan="17"| Client
{{Warning|If you send this packet to update area surrounding player in the middle of the game, entities within the updated area may become unattackable}}
+
|colspan="2"| Map ID
 +
|colspan="2"| VarInt
 +
| Map ID of the map being modified
 +
|-
 +
|colspan="2"| Scale
 +
|colspan="2"| Byte
 +
| From 0 for a fully zoomed-in map (1 block per pixel) to 4 for a fully zoomed-out map (16 blocks per pixel)
 +
|-
 +
|colspan="2"| Locked
 +
|colspan="2"| Boolean
 +
| True if the map has been locked in a cartography table
 +
|-
 +
|colspan="2"| Tracking Position
 +
|colspan="2"| Boolean
 +
| Specifies whether player and item frame icons are shown
 +
|-
 +
|colspan="2"| Icon Count
 +
|colspan="2"| VarInt
 +
| Number of elements in the following array. Only present if "Tracking Position" is true.
 +
|-
 +
|rowspan="6"| Icon
 +
| Type
 +
|rowspan="6"| Array
 +
| VarInt enum
 +
| See below
 +
|-
 +
| X
 +
| Byte
 +
| Map coordinates: -128 for furthest left, +127 for furthest right
 +
|-
 +
| Z
 +
| Byte
 +
| Map coordinates: -128 for highest, +127 for lowest
 +
|-
 +
| Direction
 +
| Byte
 +
| 0-15
 +
|-
 +
| Has Display Name
 +
| Boolean
 +
|
 +
|-
 +
| Display Name
 +
| Optional [[Chat]]
 +
| Only present if previous Boolean is true
 +
|-
 +
|colspan="2"| Columns
 +
|colspan="2"| Unsigned Byte
 +
| Number of columns updated
 +
|-
 +
|colspan="2"| Rows
 +
|colspan="2"| Optional Byte
 +
| Only if Columns is more than 0; number of rows updated
 +
|-
 +
|colspan="2"| X
 +
|colspan="2"| Optional Byte
 +
| Only if Columns is more than 0; x offset of the westernmost column
 +
|-
 +
|colspan="2"| Z
 +
|colspan="2"| Optional Byte
 +
| Only if Columns is more than 0; z offset of the northernmost row
 +
|-
 +
|colspan="2"| Length
 +
|colspan="2"| Optional VarInt
 +
| Only if Columns is more than 0; length of the following array
 +
|-
 +
|colspan="2"| Data
 +
|colspan="2"| Optional Array of Unsigned Byte
 +
| Only if Columns is more than 0; see {{Minecraft Wiki|Map item format}}
 +
|}
 +
 
 +
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>:
  
==== Explosion ====
+
{| class="wikitable"
 +
|-
 +
! Icon type
 +
! Result
 +
|-
 +
| 0
 +
| White arrow (players)
 +
|-
 +
| 1
 +
| Green arrow (item frames)
 +
|-
 +
| 2
 +
| Red arrow
 +
|-
 +
| 3
 +
| Blue arrow
 +
|-
 +
| 4
 +
| White cross
 +
|-
 +
| 5
 +
| Red pointer
 +
|-
 +
| 6
 +
| White circle (off-map players)
 +
|-
 +
| 7
 +
| Small white circle (far-off-map players)
 +
|-
 +
| 8
 +
| Mansion
 +
|-
 +
| 9
 +
| Temple
 +
|-
 +
| 10
 +
| White Banner
 +
|-
 +
| 11
 +
| Orange Banner
 +
|-
 +
| 12
 +
| Magenta Banner
 +
|-
 +
| 13
 +
| Light Blue Banner
 +
|-
 +
| 14
 +
| Yellow Banner
 +
|-
 +
| 15
 +
| Lime Banner
 +
|-
 +
| 16
 +
| Pink Banner
 +
|-
 +
| 17
 +
| Gray Banner
 +
|-
 +
| 18
 +
| Light Gray Banner
 +
|-
 +
| 19
 +
| Cyan Banner
 +
|-
 +
| 20
 +
| Purple Banner
 +
|-
 +
| 21
 +
| Blue Banner
 +
|-
 +
| 22
 +
| Brown Banner
 +
|-
 +
| 23
 +
| Green Banner
 +
|-
 +
| 24
 +
| Red Banner
 +
|-
 +
| 25
 +
| Black Banner
 +
|-
 +
| 26
 +
| Treasure marker
 +
|}
  
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).
+
==== Trade List ====
  
Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x
+
The list of trades a villager NPC is offering.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan="9" | 0x27
+
! Bound To
| X || Float ||
+
!colspan="2"| Field Name
|-
+
!colspan="2"| Field Type
| Y || Float ||
+
! Notes
|-
+
|-
| Z || Float ||
+
|rowspan="18"| 0x28
|-
+
|rowspan="18"| Play
| Radius || Float || Currently unused in the client
+
|rowspan="18"| Client
|-
+
|-
| Record count || Int || This is the count, not the size. The size is 3 times this value.
+
| colspan="2" | Window ID
|-
+
| colspan="2" | VarInt
| Records || (Byte, Byte, Byte) × count || Each record is 3 signed bytes long, each bytes are the XYZ (respectively) offsets of affected blocks.
+
| The ID of the window that is open; this is an int rather than a byte.
|-
+
|-
| Player Motion X || Float || X velocity of the player being pushed by the explosion
+
| colspan="2" | Size
|-
+
| colspan="2" | Byte
| Player Motion Y || Float || Y velocity of the player being pushed by the explosion
+
| The number of trades in the following array.
|-
+
|-
| Player Motion Z || Float || Z velocity of the player being pushed by the explosion
+
| rowspan="11" | Trades
|}
+
| Input item 1
 +
| rowspan="11" | Array
 +
| [[Slot]]
 +
| The first item the player has to supply for this villager trade. The count of the item stack is the default "price" of this trade.
 +
|-
 +
| Output item
 +
| [[Slot]]
 +
| The item the player will receive from this villager trade.
 +
|-
 +
| Has second item
 +
| Boolean
 +
| Whether there is a second item.
 +
|-
 +
| Input item 2
 +
| Optional [[Slot]]
 +
| The second item the player has to supply for this villager trade; only present if has a second item is true.
 +
|-
 +
| Trade disabled
 +
| Boolean
 +
| True if the trade is disabled; false if the trade is enabled.
 +
|-
 +
| Number of trade uses
 +
| Integer
 +
| Number of times the trade has been used so far. If equal to the maximum number of trades, the client will display a red X.
 +
|-
 +
| Maximum number of trade uses
 +
| Integer
 +
| Number of times this trade can be used before it's exhausted.
 +
|-
 +
| XP
 +
| Integer
 +
| Amount of XP both the player and the villager will earn each time the trade is used.
 +
|-
 +
| Special Price
 +
| Integer
 +
| Can be zero or negative. The number is added to the price when an item is discounted due to player reputation or other effects.
 +
|-
 +
| Price Multiplier
 +
| Float
 +
| Can be low (0.05) or high (0.2). Determines how much demand, player reputation, and temporary effects will adjust the price.
 +
|-
 +
| Demand
 +
| Integer
 +
| Can be zero or a positive number. Causes the price to increase when a trade is used repeatedly.
 +
|-
 +
|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.
 +
|}
 +
 
 +
Modifiers can increase or decrease the number of items for the first input slot. The second input slot and the output slot never change the nubmer of items. The number of items may never be less than 1, and never more than the stack size. If special price and demand are both zero, only the default price is displayed. If either is non-zero, then the adjusted price is displayed next to the crossed-out default price. The adjusted prices is calculated as follows:
 +
 
 +
Adjusted price = default price + floor(default price x multiplier x demand) + special price
  
==== Effect ====
+
[[File:1.14-merchant-slots.png|thumb|The merchant UI, for reference]]
 +
{{-}}
 +
 
 +
==== Entity Position ====
  
Sent when a client is to play a sound or particle effect.
+
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.
  
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.
+
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"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan="6" | 0x28
+
! Bound To
| Effect ID || Int || The ID of the effect, see below.
+
! Field Name
|-
+
! Field Type
| X || Int || The X location of the effect
+
! Notes
|-
+
|-
| Y || Byte || The Y location of the effect
+
|rowspan="5"| 0x29
|-
+
|rowspan="5"| Play
| Z || Int || The Z location of the effect
+
|rowspan="5"| Client
|-
+
| Entity ID
| Data || Int || Extra data for certain effects, see below.
+
| VarInt
|-
+
|
| Disable relative volume || Bool || See above
+
|-
|}
+
| 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
 +
|  
 +
|}
 +
 
 +
==== Entity Position and Rotation ====
  
===== Effects =====
+
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"
! ID !! Name
+
! Packet ID
|-
+
! State
| colspan=2 | '''Sound'''
+
! Bound To
|-
+
! Field Name
| 1000|| <code>random.click</code>
+
! Field Type
|-
+
! Notes
| 1001|| <code>random.click</code>
+
|-
|-
+
|rowspan="7"| 0x2A
| 1002|| <code>random.bow</code>
+
|rowspan="7"| Play
|-
+
|rowspan="7"| Client
| 1003|| <code>random.door_open</code> or <code>random.door_close</code> (50/50 chance)
+
| Entity ID
|-
+
| VarInt
| 1004|| <code>random.fizz</code>
+
|  
|-
+
|-
| 1005|| Play a music disc. '''Data''' [http://www.minecraftwiki.net/wiki/Music_Discs Record ID]
+
| Delta X
|-
+
| Short
| ''(1006 not assigned)'' ||
+
| Change in X position as <code>(currentX * 32 - prevX * 32) * 128</code>.
|-
+
|-
| 1007|| <code>mob.ghast.charge</code>
+
| Delta Y
|-
+
| Short
| 1008|| <code>mob.ghast.fireball</code>
+
| Change in Y position as <code>(currentY * 32 - prevY * 32) * 128</code>.
|-
+
|-
| 1009|| <code>mob.ghast.fireball</code>, but with a lower volume.
+
| Delta Z
|-
+
| Short
| 1010|| <code>mob.zombie.wood</code>
+
| Change in Z position as <code>(currentZ * 32 - prevZ * 32) * 128</code>.
|-
+
|-
| 1011|| <code>mob.zombie.metal</code>
+
| Yaw
|-
+
| Angle
| 1012|| <code>mob.zombie.woodbreak</code>
+
| New angle, not a delta.
|-
+
|-
| 1013|| <code>mob.wither.spawn</code>
+
| Pitch
|-
+
| Angle
| 1014|| <code>mob.wither.shoot</code>
+
| New angle, not a delta.
|-
+
|-
| 1015|| <code>mob.bat.takeoff</code>
+
| On Ground
|-
+
| Boolean
| 1016|| <code>mob.zombie.infect</code>
+
|  
|-
+
|}
| 1017|| <code>mob.zombie.unfect</code>
+
 
|-
+
==== Entity Rotation ====
| 1018|| <code>mob.enderdragon.end</code>
 
|-
 
| 1020|| <code>random.anvil_break</code>
 
|-
 
| 1021|| <code>random.anvil_use</code>
 
|-
 
| 1022|| <code>random.anvil_land</code>
 
|-
 
| colspan=2 | '''Particle'''
 
|-
 
| 2000|| Spawns 10 smoke particles, e.g. from a fire. '''Data''' direction, see below
 
|-
 
| 2001|| Block break. '''Data''' [http://www.minecraftwiki.net/wiki/Data_values Block ID]
 
|-
 
| 2002|| Splash potion. Particle effect + glass break sound. '''Data''' [http://www.lb-stuff.com/Minecraft/PotionDataValues1.9pre3.txt Potion ID]
 
|-
 
| 2003|| Eye of ender entity break animation - particles and sound
 
|-
 
| 2004|| Mob spawn particle effect: smoke + flames
 
|-
 
| 2005|| Spawn "happy villager" effect (hearts).
 
|}
 
  
Smoke directions:
+
This packet is sent by the server when an entity rotates.
  
 
{| class="wikitable"
 
{| class="wikitable"
! ID !! Direction
+
! Packet ID
|-
+
! State
| 0 || South - East
+
! Bound To
|-
+
! Field Name
| 1 || South
+
! Field Type
|-
+
! Notes
| 2 || South - West
+
|-
|-
+
|rowspan="4"| 0x2B
| 3 || East
+
|rowspan="4"| Play
|-
+
|rowspan="4"| Client
| 4 || (Up or middle ?)
+
| Entity ID
|-
+
| VarInt
| 5 || West
+
|  
|-
+
|-
| 6 || North - East
+
| Yaw
|-
+
| Angle
| 7 || North
+
| New angle, not a delta.
|-
+
|-
| 8 || North - West
+
| Pitch
|}
+
| Angle
 +
| New angle, not a delta.
 +
|-
 +
| On Ground
 +
| Boolean
 +
|  
 +
|}
  
==== Sound Effect ====
+
==== Vehicle Move (clientbound) ====
 +
 
 +
Note that all fields use absolute positioning and do not allow for relative positioning.
  
Used to play a sound effect on the client.
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="5"| 0x2C
 +
|rowspan="5"| Play
 +
|rowspan="5"| Client
 +
| X
 +
| Double
 +
| Absolute position (X coordinate).
 +
|-
 +
| Y
 +
| Double
 +
| Absolute position (Y coordinate).
 +
|-
 +
| Z
 +
| Double
 +
| Absolute position (Z coordinate).
 +
|-
 +
| Yaw
 +
| Float
 +
| Absolute rotation on the vertical axis, in degrees.
 +
|-
 +
| Pitch
 +
| Float
 +
| Absolute rotation on the horizontal axis, in degrees.
 +
|}
  
All known sound effect names can be seen [https://github.com/SirCmpwn/Craft.Net/blob/master/source/Craft.Net.Common/SoundEffect.cs here].
+
==== Open Book ====
  
Custom sounds made be added by resource packs
+
Sent when a player right clicks with a signed book. This tells the client to open the book GUI.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan="7" | 0x29
+
! Bound To
| Sound name || String ||
+
! Field Name
|-
+
! Field Type
| Effect position X || Int || Effect X multiplied by 8
+
! Notes
|-
+
|-
| Effect position Y || Int || Effect Y multiplied by 8
+
| 0x2D
|-
+
| Play
| Effect position Z || Int || Effect Z multiplied by 8
+
| Client
|-
+
| Hand
| Volume || Float || 1 is 100%, can be more
+
| VarInt enum
|-
+
| 0: Main hand, 1: Off hand .
| Pitch || Unsigned Byte || 63 is 100%, can be more
+
|}
|}
 
  
==== Particle ====
+
==== Open Window ====
  
Displays the named particle
+
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"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan="9" | 0x2A
+
! Bound To
| Particle name || String || The name of the particle to create. A list can be found [https://gist.github.com/thinkofdeath/5110835 here]
+
! Field Name
|-
+
! Field Type
| X || Float || X position of the particle
+
! Notes
|-
+
|-
| Y || Float || Y position of the particle
+
|rowspan="3"| 0x2E
|-
+
|rowspan="3"| Play
| Z || Float || Z position of the particle
+
|rowspan="3"| Client
|-
+
| Window ID
| Offset X || Float || This is added to the X position after being multiplied by random.nextGaussian()
+
| VarInt
|-
+
| A unique id number for the window to be displayed. Notchian server implementation is a counter, starting at 1.
| Offset Y || Float || This is added to the Y position after being multiplied by random.nextGaussian()
+
|-
|-
+
| Window Type
| Offset Z || Float || This is added to the Z position after being multiplied by random.nextGaussian()  
+
| VarInt
|-
+
| The window type to use for display. Contained in the <code>minecraft:menu</code> registry; see [[Inventory]] for the different values.
| Particle data || Float || The data of each particle
+
|-
|-
+
| Window Title
| Number of particles || Int || The number of particles to create
+
| [[Chat]]
|}
+
| The title of the window.
 +
|}
 +
 
 +
==== Open Sign Editor ====
 +
 
 +
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.
  
==== Change Game State ====
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| 0x2F
 +
| Play
 +
| Client
 +
| Location
 +
| Position
 +
|
 +
|}
  
It appears when a bed can't be used as a spawn point and when the rain state changes.
+
==== Ping ====
  
The class has an array of strings linked to reason codes 0, 1, 2, and 3 but only the codes for 1 and 2 are null.
+
Unknown what this packet does just yet, not used by the Notchian server or client. Most likely added as a replacement to the removed window confirmation packet. When sent to the client, client responds with a Pong packet with the same id.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan="2" | 0x2B
+
! Bound To
| Reason || Unsigned Byte ||
+
! Field Name
|-
+
! Field Type
| Value || Float || Depends on reason
+
! Notes
|}
+
|-
 +
| 0x30
 +
| Play
 +
| Client
 +
| ID
 +
| Int
 +
|
 +
|}
  
'''Reason codes'''
+
==== Craft Recipe Response ====
 +
 
 +
Response to the serverbound packet ([[#Craft Recipe Request|Craft Recipe Request]]), with the same recipe ID.  Appears to be used to notify the UI.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Code !! Effect !! Notes
+
! Packet ID
|-
+
! State
| 0 || Invalid Bed || "tile.bed.notValid"
+
! Bound To
|-
+
! Field Name
| 1 || End raining ||
+
! Field Type
|-
+
! Notes
| 2 || Begin raining ||
+
|-
|-
+
|rowspan="2"| 0x31
| 3 || Change game mode || "gameMode.changed" 0 - Survival, 1 - Creative, 2 - Adventure
+
|rowspan="2"| Play
|-
+
|rowspan="2"| Client
| 4 || Enter credits ||
+
| Window ID
|-
+
| Byte
| 5 || Demo messages || 0 - Show welcome to demo screen, 101 - Tell movement controls, 102 - Tell jump control, 103 - Tell inventory control
+
|
|-  
+
|-
| 6 || Unidentified 'ding!' sound ||
+
| Recipe
|-
+
| Identifier
| 7 || Fade value || The current darkness value. 1 = Dark, 0 = Bright, Setting the value higher causes the game to change color and freeze
+
| A recipe ID.
|-
+
|}
| 8 || Fade time || Time in ticks for the sky to fade
 
|}
 
  
==== Spawn Global Entity ====
+
==== Player Abilities (clientbound) ====
  
With this packet, the server notifies the client of thunderbolts striking within a 512 block radius around the player. The coordinates specify where exactly the thunderbolt strikes.
+
The latter 2 floats are used to indicate the field of view and flying speed respectively, while the first byte is used to determine the value of 4 booleans.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan="5" | 0x2C
+
! Bound To
| Entity ID || VarInt || The entity ID of the thunderbolt
+
! Field Name
|-
+
! Field Type
| Type || Byte || The global entity type, currently always 1 for thunderbolt.
+
! Notes
|-
+
|-
| X || Int || Thunderbolt X a [[Data_Types#Fixed-point_numbers|fixed-point number]]
+
|rowspan="3"| 0x32
|-
+
|rowspan="3"| Play
| Y || Int || Thunderbolt Y a [[Data_Types#Fixed-point_numbers|fixed-point number]]
+
|rowspan="3"| Client
|-
+
| Flags
| Z || Int || Thunderbolt Z a [[Data_Types#Fixed-point_numbers|fixed-point number]]
+
| Byte
|}
+
| Bit field, see below.
 +
|-
 +
| Flying Speed
 +
| Float
 +
| 0.05 by default.
 +
|-
 +
| Field of View Modifier
 +
| Float
 +
| Modifies the field of view, like a speed potion. A Notchian server will use the same value as the movement speed sent in the [[#Entity_Properties|Entity Properties]] packet, which defaults to 0.1 for players.
 +
|}
  
==== Open Window ====
+
About the flags:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Field
 +
! Bit
 +
|-
 +
| Invulnerable
 +
| 0x01
 +
|-
 +
| Flying
 +
| 0x02
 +
|-
 +
| Allow Flying
 +
| 0x04
 +
|-
 +
| Creative Mode (Instant Break)
 +
| 0x08
 +
|}
 +
 
 +
==== End Combat Event ====
  
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.
+
Unused by the Notchain client. This data was once used for twitch.tv metadata circa 1.8.f
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan="6" | 0x2D
+
! Bound To
| Window id || Unsigned Byte || A unique id number for the window to be displayed. Notchian server implementation is a counter, starting at 1.
+
! Field Name
|-
+
! Field Type
| Inventory Type || Unsigned Byte || The window type to use for display. Check below
+
! Notes
|-
+
|-
| Window title || String || The title of the window.
+
|rowspan="2"| 0x33
|-
+
|rowspan="2"| Play
| Number of Slots || Unsigned Byte || Number of slots in the window (excluding the number of slots in the player inventory).
+
|rowspan="2"| Client
|-
+
  | Duration
| Use provided window title || Bool || If false, the client will look up a string like "window.minecart". If true, the client uses what the server provides.
+
  | VarInt
|-
+
| Length of the combat in ticks.
| Entity ID || Int || EntityHorse's entityId. Only sent when window type is equal to 11 (AnimalChest).
+
|-
|}
+
| Entity ID
 +
| Int
 +
| ID of the primary opponent of the ended combat, or -1 if there is no obvious primary opponent.
 +
|}
  
See [[Inventory#Windows|inventory windows]] for further information.
+
==== Enter Combat Event ====
  
==== Close Window ====
+
Unused by the Notchain client.  This data was once used for twitch.tv metadata circa 1.8.
  
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"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="1"| 0x34
 +
|rowspan="1"| Play
 +
|rowspan="1"| Client
 +
|colspan="3"| ''no fields''
 +
|}
  
Note, notchian clients send a close window message with window id 0 to close their inventory even though there is never an Open Window message for inventory.  
+
==== Death Combat Event ====
 +
 
 +
Used to send a respawn screen.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| 0x2E
+
! Bound To
| Window ID || Unsigned Byte || This is the id of the window that was closed. 0 for inventory.
+
! Field Name
|}
+
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="3"| 0x35
 +
|rowspan="3"| Play
 +
|rowspan="3"| Client
 +
| Player ID
 +
| VarInt
 +
| Entity ID of the player that died (should match the client's entity ID).
 +
|-
 +
| Entity ID
 +
| Int
 +
| The killing entity's ID, or -1 if there is no obvious killer.
 +
|-
 +
| Message
 +
| [[Chat]]
 +
| The death message.
 +
|}
  
==== Set Slot ====
+
==== Player Info ====
  
Sent by the server when an item in a slot (in a window) is added/removed.
+
Sent by the server to update the user list (<tab> in the client).
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan="3" | 0x2F
+
! Bound To
| Window ID || Unsigned Byte
+
!colspan="4"| Field Name
| 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).
+
!colspan="3"| Field Type
|-
+
! Notes
| Slot || Short || The slot that should be updated
+
|-
|-
+
|rowspan="19"| 0x36
| Slot data || [[Slot_Data|Slot]] ||
+
|rowspan="19"| Play
|}
+
|rowspan="19"| Client
 +
|colspan="4"| Action
 +
|colspan="3"| VarInt
 +
| Determines the rest of the Player format after the UUID.
 +
|-
 +
|colspan="4"| Number Of Players
 +
|colspan="3"| VarInt
 +
| Number of elements in the following array.
 +
|-
 +
|rowspan="17"| Player
 +
|colspan="3"| UUID
 +
|rowspan="17"| Array
 +
|colspan="2"| UUID
 +
|
 +
|-
 +
! Action
 +
!colspan="2"| Field Name
 +
!colspan="2"|
 +
!
 +
|-
 +
|rowspan="10"| 0: add player
 +
|colspan="2"| Name
 +
|colspan="2"| String (16)
 +
|
 +
|-
 +
|colspan="2"| Number Of Properties
 +
|colspan="2"| VarInt
 +
| Number of elements in the following array.
 +
|-
 +
|rowspan="4"| Property
 +
| Name
 +
|rowspan="4"| Array
 +
| String (32767)
 +
|
 +
|-
 +
| Value
 +
| String (32767)
 +
|
 +
|-
 +
| Is Signed
 +
| Boolean
 +
|
 +
|-
 +
| Signature
 +
| Optional String (32767)
 +
| Only if Is Signed is true.
 +
|-
 +
|colspan="2"| Gamemode
 +
|colspan="2"| VarInt
 +
|
 +
|-
 +
|colspan="2"| Ping
 +
|colspan="2"| VarInt
 +
| Measured in milliseconds.
 +
|-
 +
|colspan="2"| Has Display Name
 +
|colspan="2"| Boolean
 +
|
 +
|-
 +
|colspan="2"| Display Name
 +
|colspan="2"| Optional [[Chat]]
 +
| Only if Has Display Name is true.
 +
|-
 +
| 1: update gamemode
 +
|colspan="2"| Gamemode
 +
|colspan="2"| VarInt
 +
|
 +
|-
 +
| 2: update latency
 +
|colspan="2"| Ping
 +
|colspan="2"| VarInt
 +
| Measured in milliseconds.
 +
|-
 +
|rowspan="2"| 3: update display name
 +
|colspan="2"| Has Display Name
 +
|colspan="2"| Boolean
 +
|  
 +
|-
 +
|colspan="2"| Display Name
 +
|colspan="2"| Optional [[Chat]]
 +
| Only send if Has Display Name is true.
 +
|-
 +
| 4: remove player
 +
|colspan="2"| ''no fields''
 +
|colspan="2"| ''no fields''
 +
|
 +
|}
 +
 
 +
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.
  
==== Window Items ====
+
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.
  
[[File:Inventory-slots.png|thumb|The inventory slots]]
+
==== Face Player ====
  
Sent by the server when an item in a slot (in a window) is added/removed. This includes the main inventory, equipped armour and crafting slots.  
+
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 !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan="3" | 0x30
+
! Bound To
| Window ID || Unsigned Byte || The id of window which items are being sent for. 0 for player inventory.
+
! Field Name
|-
+
! Field Type
| Count || Short || The number of slots (see below)
+
! Notes
|-
+
|-
| Slot data || Array of [[Slot_Data|Slot]]s ||
+
|rowspan="8"| 0x37
|}
+
|rowspan="8"| Play
 +
|rowspan="8"| Client
 +
|-
 +
| Feet/eyes
 +
| VarInt enum
 +
| 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.
 +
|-
 +
| Entity feet/eyes
 +
| Optional VarInt enum
 +
| Whether to look at the entity's eyes or feet.  Same values and meanings as before, just for the entity's head/feet.
 +
|}
 +
 
 +
If the entity given by entity ID cannot be found, this packet should be treated as if is entity was false.
 +
 
 +
==== Player Position And Look (clientbound) ====
 +
 
 +
Updates the player's position on the server. This packet will also close the “Downloading Terrain” screen when joining/respawning.
 +
 
 +
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”.
  
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.
+
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.
  
==== Window Property ====
 
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan="3" | 0x31
+
! Bound To
| Window ID || Unsigned Byte || The id of the window.
+
! Field Name
|-
+
! Field Type
| Property || Short || Which property should be updated.
+
! Notes
|-
+
|-
| Value || Short || The new value for the property.
+
|rowspan="8"| 0x38
|}
+
|rowspan="8"| Play
 +
|rowspan="8"| Client
 +
| X
 +
| Double
 +
| Absolute or relative position, depending on Flags.
 +
|-
 +
| Y
 +
| Double
 +
| Absolute or relative position, depending on Flags.
 +
|-
 +
| Z
 +
| Double
 +
| Absolute or relative position, depending on Flags.
 +
|-
 +
| 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.
 +
|-
 +
| Teleport ID
 +
| VarInt
 +
| Client should confirm this packet with [[#Teleport Confirm|Teleport Confirm]] containing the same Teleport ID.
 +
|-
 +
| Dismount Vehicle
 +
| Boolean
 +
| True if the player should dismount their vehicle.
 +
|}
  
'''Furnace'''
+
About the Flags field:
  
Properties:
+
<Dinnerbone> It's a bitfield, X/Y/Z/Y_ROT/X_ROT. If X is set, the x value is relative and not absolute.
  
* 0: Progress arrow
+
{| class="wikitable"
* 1: Fire icon (fuel)
+
|-
 +
! Field
 +
! Bit
 +
|-
 +
| X
 +
| 0x01
 +
|-
 +
| Y
 +
| 0x02
 +
|-
 +
| Z
 +
| 0x04
 +
|-
 +
| Y_ROT
 +
| 0x08
 +
|-
 +
| X_ROT
 +
| 0x10
 +
|}
  
Values:
+
==== Unlock Recipes ====
  
* 0-200 for progress arrow
+
{| class="wikitable"
* 0-200 for fuel indicator
+
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="14"| 0x39
 +
|rowspan="14"| Play
 +
|rowspan="14"| Client
 +
|-
 +
| Action
 +
| VarInt
 +
| 0: init, 1: add, 2: remove.
 +
|-
 +
| Crafting Recipe Book Open
 +
| Boolean
 +
| If true, then the crafting recipe book will be open when the player opens its inventory.
 +
|-
 +
| Crafting Recipe Book Filter Active
 +
| Boolean
 +
| If true, then the filtering option is active when the players opens its inventory.
 +
|-
 +
| Smelting Recipe Book Open
 +
| Boolean
 +
| If true, then the smelting recipe book will be open when the player opens its inventory.
 +
|-
 +
| Smelting Recipe Book Filter Active
 +
| Boolean
 +
| If true, then the filtering option is active when the players opens its inventory.
 +
|-
 +
| Blast Furnace Recipe Book Open
 +
| Boolean
 +
| If true, then the blast furnace recipe book will be open when the player opens its inventory.
 +
|-
 +
| Blast Furnace Recipe Book Filter Active
 +
| Boolean
 +
| If true, then the filtering option is active when the players opens its inventory.
 +
|-
 +
| Smoker Recipe Book Open
 +
| Boolean
 +
| If true, then the smoker recipe book will be open when the player opens its inventory.
 +
|-
 +
| Smoker Recipe Book Filter Active
 +
| Boolean
 +
| If true, then the filtering option is active when the players opens its inventory.
 +
|-
 +
| Array size 1
 +
| VarInt
 +
| Number of elements in the following array.
 +
|-
 +
| Recipe IDs
 +
| Array of Identifier
 +
|
 +
|-
 +
| Array size 2
 +
| Optional VarInt
 +
| Number of elements in the following array, only present if mode is 0 (init).
 +
|-
 +
| Recipe IDs
 +
| Optional Array of Identifier
 +
| Only present if mode is 0 (init)
 +
|}
 +
Action:
 +
* 0 (init) = All the recipes in list 1 will be tagged as displayed, and all the recipes in list 2 will be added to the recipe book. Recipes that aren't tagged will be shown in the notification.
 +
* 1 (add) = All the recipes in the list are added to the recipe book and their icons will be shown in the notification.
 +
* 2 (remove) = Remove all the recipes in the list. This allows them to be re-displayed when they are re-added.
  
Ranges are presumably in in-game ticks
+
==== Destroy Entities ====
  
'''Enchantment Table'''
+
Sent by the server when an entity is to be destroyed on the client.
  
Properties: 0, 1 or 2 depending on the "enchantment slot" being given.
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="2"| 0x3A
 +
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Count
 +
| VarInt
 +
| Number of elements in the following array.
 +
|-
 +
| Entity IDs
 +
| Array of VarInt
 +
| The list of entities of destroy.
 +
|}
  
Values: The enchantment's level.
+
==== Remove Entity Effect ====
  
==== Confirm Transaction ====
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="2"| 0x3B
 +
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
  | Entity ID
 +
| VarInt
 +
|
 +
|-
 +
| Effect ID
 +
| Byte
 +
| See {{Minecraft Wiki|Status effect#Effect IDs|this table}}.
 +
|}
  
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.
+
==== Resource Pack Send ====
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan="3" | 0x32
+
! Bound To
| Window ID || Unsigned Byte || The id of the window that the action occurred in.
+
! Field Name
|-
+
! Field Type
| Action number || Short || Every action that is to be accepted has a unique number. This field corresponds to that number.
+
! Notes
|-
+
|-
| Accepted || Bool || Whether the action was accepted.
+
|rowspan="5"| 0x3C
|}
+
|rowspan="5"| Play
 +
|rowspan="5"| Client
 +
| URL
 +
| String (32767)
 +
| The URL to the resource pack.
 +
|-
 +
| Hash
 +
| String (40)
 +
| A 40 character hexadecimal and lowercase [[wikipedia:SHA-1|SHA-1]] hash of the resource pack file. (must be lower case in order to work)<br />If it's not a 40 character hexadecimal string, the client will not use it for hash verification and likely waste bandwidth — but it will still treat it as a unique id
 +
|-
 +
| Forced
 +
| Boolean
 +
| The notchian client will be forced to use the resource pack from the server. If they decline they will be kicked from the server.
 +
|-
 +
| Has Prompt Message
 +
| Boolean
 +
| <code>true</code> If the next field will be sent <code>false</code> otherwise. When <code>false</code>, this is the end of the packet
 +
|-
 +
| Prompt Message
 +
| Optional [[Chat]]
 +
| This is shown in the prompt making the client accept or decline the resource pack.
 +
|}
  
==== Update Sign ====
+
==== Respawn ====
  
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.
+
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"
! Packet ID !! Field Name !! Field Type !! Notes
+
! Packet ID
|-
+
! State
| rowspan="7" | 0x33
+
! Bound To
| X || Int || Block X Coordinate
+
! Field Name
|-
+
! Field Type
| Y || Short || Block Y Coordinate
+
! Notes
|-
+
|-
| Z || Int || Block Z Coordinate
+