Difference between revisions of "Protocol"

From wiki.vg
Jump to navigation Jump to search
 
(133 intermediate revisions by 56 users not shown)
Line 3: Line 3:
 
   |BACKGROUND = #99CCFF
 
   |BACKGROUND = #99CCFF
 
   |WIDTH = 100%
 
   |WIDTH = 100%
   |ICON =  
+
   |ICON =
 
   |HEADING = Heads up!
 
   |HEADING = Heads up!
   |CONTENT = This article is about the protocol for the latest '''stable''' release of Minecraft '''Java Edition''' ([[Protocol version numbers|1.17, protocol 755]]). 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]].
+
   |CONTENT = This article is about the protocol for the latest '''stable''' release of Minecraft '''Java Edition''' ([[Protocol version numbers|1.19, protocol 759]]). For the Java Edition pre-releases, see [[Pre-release protocol]]. For the incomplete Bedrock Edition docs, see [[Bedrock Protocol]]. For the old Pocket Edition, see [[Pocket Edition Protocol Documentation]].
 
}}
 
}}
  
Line 12: Line 12:
 
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]).
 
If you're having trouble, check out the [[Protocol FAQ|FAQ]] or ask for help in the IRC channel [ircs://irc.libera.chat:6697 #mcdevs on irc.libera.chat] ([https://wiki.vg/MCDevs More Information]).
  
'''Note:''' While you may use the contents of this page without restriction to create servers, clients, bots, etc… you still need to provide attribution to #mcdevs if you copy any of the contents of this page for publication elsewhere.
+
'''Note:''' While you may use the contents of this page without restriction to create servers, clients, bots, etc; substantial reproductions of this page must be attributed IAW [https://creativecommons.org/licenses/by-sa/4.0/ CC BY-SA 4.0].
  
 
The changes between versions may be viewed at [[Protocol History]].
 
The changes between versions may be viewed at [[Protocol History]].
Line 47: Line 47:
 
  |-
 
  |-
 
  | Global palette
 
  | 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].
+
  | A table/dictionary/palette mapping nonnegative integers to block states. Block state IDs are created in a linear fashion based off of order of assignment.  One block state ID allocated for each unique block state for a block; if a block has multiple properties then the number of allocated states is the product of the number of values for each property.  A current list of properties and state ID ranges is found on [https://pokechu22.github.io/Burger/1.19.html burger].
  
 
Alternatively, the vanilla server now includes an option to export the current block state ID mapping, by running <code>java -cp minecraft_server.jar net.minecraft.data.Main --reports</code>.  See [[Data Generators]] for more information.
 
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.
Line 53: Line 53:
 
  | Notchian
 
  | Notchian
 
  | The official implementation of vanilla Minecraft as developed and released by Mojang.
 
  | The official implementation of vanilla Minecraft as developed and released by Mojang.
 +
|-
 +
| Sequence
 +
| The action number counter for local block changes, incremented by one when clicking a block with a hand, right clicking an item, or starting or finishing digging a block. Counter handles latency to avoid applying outdated block changes to the local world.  Also is used to revert ghost blocks created when placing blocks, using buckets, or breaking blocks.
 
  |}
 
  |}
  
Line 72: Line 75:
 
  | Packet ID
 
  | Packet ID
 
  | VarInt
 
  | VarInt
  |  
+
  |
 
  |-
 
  |-
 
  | Data
 
  | Data
Line 109: Line 112:
 
  |}
 
  |}
  
The length given by the Packet Length field is the number of bytes that remain in that packet, including the Data Length field.
+
If the size of the buffer containing the packet data and ID (as a VarInt) is smaller than the threshold specified in the packet [[#Set Compression|Set Compression]]. It will be sent as uncompressed. This is done by setting the data length as 0. (Comparable to sending a non-compressed format with an extra 0 between the length, and packet data).
 
 
If Data Length is set to zero, then the packet is uncompressed; otherwise it is the size of the uncompressed packet.
 
  
If compressed, the uncompressed length of (Packet ID + Data) must be equal to or over the threshold set in the packet [[#Set Compression|Set Compression]], otherwise the receiving party will disconnect.
+
If it's larger than the threshold, then it follows the regular compressed protocol format.
  
 
Compression can be disabled by sending the packet [[#Set Compression|Set Compression]] with a negative Threshold, or not sending the Set Compression packet at all.
 
Compression can be disabled by sending the packet [[#Set Compression|Set Compression]] with a negative Threshold, or not sending the Set Compression packet at all.
Line 142: Line 143:
 
  | Protocol Version
 
  | Protocol Version
 
  | VarInt
 
  | VarInt
  | See [[protocol version numbers]] (currently 755 in Minecraft 1.17).
+
  | See [[protocol version numbers]] (currently 759 in Minecraft 1.19).
 
  |-
 
  |-
 
  | Server Address
 
  | Server Address
 
  | String (255)
 
  | String (255)
 
  | Hostname or IP, e.g. localhost or 127.0.0.1, that was used to connect. The Notchian server does not use this information. 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.
 
  | Hostname or IP, e.g. localhost or 127.0.0.1, that was used to connect. The Notchian server does not use this information. Note that SRV records are a simple redirect, e.g. if _minecraft._tcp.example.com points to mc.example.org, users connecting to example.com will provide example.org as server address in addition to connecting to it.
  |-  
+
  |-
 
  | Server Port
 
  | Server Port
 
  | Unsigned Short
 
  | Unsigned Short
Line 154: Line 155:
 
  | Next State
 
  | Next State
 
  | VarInt Enum
 
  | VarInt Enum
  | 1 for [[#Status|status]], 2 for [[#Login|login]].
+
  | 1 for [[#Status|Status]], 2 for [[#Login|Login]].
 
  |}
 
  |}
  
Line 186: Line 187:
 
=== Clientbound ===
 
=== Clientbound ===
  
==== Response ====
+
==== Status Response ====
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 205: Line 206:
 
  |}
 
  |}
  
==== Pong ====
+
==== Pong Response ====
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 225: Line 226:
 
=== Serverbound ===
 
=== Serverbound ===
  
==== Request ====
+
==== Status Request ====
 +
 
 +
The status can only be requested once immediately after the handshake, before any ping. The server won't respond otherwise.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 241: Line 244:
 
  |}
 
  |}
  
==== Ping ====
+
==== Ping Request ====
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 272: Line 275:
 
# S→C: [[#Login Success|Login Success]]
 
# 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]].
+
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.
+
For unauthenticated ("cracked"/offline-mode) and integrated servers (either of the two conditions is enough for an unencrypted connection) there is no encryption. In that case [[#Login Start|Login Start]] is directly followed by [[#Login Success|Login Success]]. The Notchian server uses UUID v3 for offline player UUIDs, with the namespace “OfflinePlayer” and the value as the player’s username. For example, Notch’s offline UUID would be derived from the string “OfflinePlayer:Notch”. This is not a requirement however, the UUID may be anything.
  
 
See [[Protocol Encryption]] for details.
 
See [[Protocol Encryption]] for details.
Line 295: Line 298:
 
  | Reason
 
  | Reason
 
  | [[Chat]]
 
  | [[Chat]]
  |  
+
  |
 
  |}
 
  |}
  
Line 340: Line 343:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  !colspan="2"| Field Name
  ! Field Type
+
  !colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x02
+
  |rowspan="7"| 0x02
  |rowspan="2"| Login
+
  |rowspan="7"| Login
  |rowspan="2"| Client
+
  |rowspan="7"| Client
  | UUID
+
  |colspan="2"| UUID
  | UUID
+
  |colspan="2"| UUID
  |  
+
  |colspan="2"|
 +
|-
 +
|colspan="2"| Username
 +
|colspan="2"| String (16)
 +
|colspan="2"|
 +
|-
 +
|colspan="2"| Number Of Properties
 +
|colspan="2"| VarInt
 +
| Number of elements in the following array.
 +
|-
 +
|rowspan="4"| Property
 +
| Name
 +
|rowspan="4"| Array
 +
| String (32767)
 +
|colspan="2"|
 +
|-
 +
| Value
 +
| String (32767)
 +
|colspan="1"|
 +
|-
 +
| Is Signed
 +
| Boolean
 +
|colspan="2"|
 
  |-
 
  |-
  | Username
+
  | Signature
  | String (16)
+
  | Optional String (32767)
  |  
+
  | Only if Is Signed is true.
 
  |}
 
  |}
  
Line 360: Line 385:
 
{{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]]).
 
{{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.
+
The notchian client doesn't send any (non-[[#Keep Alive|keep alive]]) packets until the next tick/[[#Set Time|Set Time]] packet.
 
}}
 
}}
  
Line 385: Line 410:
 
==== Login Plugin Request ====
 
==== Login Plugin Request ====
  
Used to implement a custom handshaking flow together with [[#Login_Plugin_Response | Login Plugin Response]].
+
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.
 
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.
Line 425: Line 450:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  | 0x00
+
  |rowspan="7"| 0x00
  | Login
+
  |rowspan="7"| Login
  | Server
+
  |rowspan="7"| Server
 
  | Name
 
  | Name
 
  | String (16)
 
  | String (16)
 
  | Player's Username.
 
  | Player's Username.
|}
 
 
==== Encryption Response ====
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="4"| 0x01
+
| Has Sig Data
  |rowspan="4"| Login
+
| Boolean
  |rowspan="4"| Server
+
| Whether or not the next 5 fields should be sent.
 +
|-
 +
| Timestamp
 +
| Long
 +
| When the key data will expire. Optional. Only sent if Has Sig Data is true.
 +
|-
 +
| Public Key Length
 +
| VarInt
 +
| Length of Public Key. Optional. Only sent if Has Sig Data is true.
 +
|-
 +
| Public Key
 +
| Byte Array
 +
| The encoded bytes of the public key the client received from Mojang. Optional. Only sent if Has Sig Data is true.
 +
|-
 +
| Signature Length
 +
| VarInt
 +
| Length of Signature. Optional. Only sent if Has Sig Data is true.
 +
|-
 +
| Signature
 +
| Byte Array
 +
| The bytes of the public key signature the client received from Mojang. Optional. Only sent if Has Sig Data is true.
 +
|}
 +
 
 +
==== Encryption Response ====
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
  |rowspan="8"| 0x01
 +
  |rowspan="8"| Login
 +
  |rowspan="8"| Server
 
  | Shared Secret Length
 
  | Shared Secret Length
 
  | VarInt
 
  | VarInt
Line 454: Line 503:
 
  | Shared Secret value, encrypted with the server's public key.
 
  | Shared Secret value, encrypted with the server's public key.
 
  |-
 
  |-
  | Verify Token Length
+
  | Has Verify Token
 +
| Boolean
 +
| Whether or not the Verify Token should be sent. If not, then the salt and signature will be sent.
 +
|-
 +
| Optional Verify Token Length
 +
| VarInt
 +
| Length of Verify Token. Optional and only sent if Has Verify Token is true.
 +
|-
 +
| Optional Verify Token
 +
| Byte Array
 +
| Verify Token value, encrypted with the same public key as the shared secret. Optional and only sent if Has Verify Token is true.
 +
|-
 +
| Optional Salt
 +
| Long
 +
| Cryptography, used for validating the message signature. Optional and only sent if Has Verify Token is false.
 +
|-
 +
| Optional Message Signature Length
 
  | VarInt
 
  | VarInt
  | Length of Verify Token.
+
  | Array Length. Optional and only sent if Has Verify Token is false.
 
  |-
 
  |-
  | Verify Token
+
  | Optional Message Signature
 
  | Byte Array
 
  | Byte Array
  | Verify Token value, encrypted with the same public key as the shared secret.
+
  | The bytes of the public key signature the client received from Mojang. Optional and only sent if Has Verify Token is false.
 
  |}
 
  |}
  
Line 495: Line 560:
 
=== Clientbound ===
 
=== Clientbound ===
  
==== Spawn Entity ====
+
==== Add Entity ====
  
 
Sent by the server when a vehicle or other non-living entity is created.
 
Sent by the server when a vehicle or other non-living entity is created.
Line 507: Line 572:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="12"| 0x00
+
  |rowspan="13"| 0x00
  |rowspan="12"| Play
+
  |rowspan="13"| Play
  |rowspan="12"| Client
+
  |rowspan="13"| Client
 
  | Entity ID
 
  | Entity ID
 
  | VarInt
 
  | VarInt
  | EID of the entity.
+
  | Entity ID.
 
  |-
 
  |-
 
  | Object UUID
 
  | Object UUID
 
  | UUID
 
  | UUID
  |  
+
  |
 
  |-
 
  |-
 
  | Type
 
  | Type
Line 524: Line 589:
 
  | X
 
  | X
 
  | Double
 
  | Double
  |  
+
  |
 
  |-
 
  |-
 
  | Y
 
  | Y
 
  | Double
 
  | Double
  |  
+
  |
 
  |-
 
  |-
 
  | Z
 
  | Z
 
  | Double
 
  | Double
  |  
+
  |
 
  |-
 
  |-
 
  | Pitch
 
  | Pitch
 
  | Angle
 
  | Angle
  |  
+
  | To get the real pitch, you must divide this by (256.0F / 360.0F)
 
  |-
 
  |-
 
  | Yaw
 
  | Yaw
 
  | Angle
 
  | Angle
  |  
+
  | To get the real yaw, you must divide this by (256.0F / 360.0F)
 
  |-
 
  |-
 +
| Head Yaw
 +
| Angle
 +
|- Used by LivingEntities only
 
  | Data
 
  | Data
  | Int
+
  | VarInt
 
  | Meaning dependent on the value of the Type field, see [[Object Data]] for details.
 
  | Meaning dependent on the value of the Type field, see [[Object Data]] for details.
 
  |-
 
  |-
 
  | Velocity X
 
  | Velocity X
 
  | Short
 
  | 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).
+
  |rowspan="3"| Same units as [[#Set Entity Motion|Set Entity Motion]].  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
 
  | Velocity Y
Line 557: Line 625:
 
  |}
 
  |}
  
==== Spawn Experience Orb ====
+
==== Add Experience Orb ====
  
 
Spawns one or more experience orbs.
 
Spawns one or more experience orbs.
Line 574: Line 642:
 
  | Entity ID
 
  | Entity ID
 
  | VarInt
 
  | VarInt
  |  
+
  |
 
  |-
 
  |-
 
  | X
 
  | X
 
  | Double
 
  | Double
  |  
+
  |
 
  |-
 
  |-
 
  | Y
 
  | Y
 
  | Double
 
  | Double
  |  
+
  |
 
  |-
 
  |-
 
  | Z
 
  | Z
 
  | Double
 
  | Double
  |  
+
  |
 
  |-
 
  |-
 
  | Count
 
  | Count
Line 593: Line 661:
 
  |}
 
  |}
  
==== Spawn Living Entity ====
+
==== Add Player ====
  
Sent by the server when a living entity is spawned.
+
This packet is sent by the server when a player comes into visible range, ''not'' when a player joins.
 +
 
 +
This packet must be sent after the [[#Player Info|Player Info]] packet that adds the player data for the client to use when spawning a player. If the Player Info for the player spawned by this packet is not present when this packet arrives, Notchian clients will not spawn the player entity. The Player Info packet includes skin/cape data.
 +
 
 +
Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 605: Line 677:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="12"| 0x02
+
  |rowspan="7"| 0x02
  |rowspan="12"| Play
+
  |rowspan="7"| Play
  |rowspan="12"| Client
+
  |rowspan="7"| Client
 
  | Entity ID
 
  | Entity ID
 
  | VarInt
 
  | VarInt
  |  
+
  | Player's EID.
 
  |-
 
  |-
  | Entity UUID
+
  | Player UUID
 
  | UUID
 
  | UUID
  |  
+
  | See below for notes on {{Minecraft Wiki|Server.properties#online-mode|offline mode}} and NPCs.
|-
 
| Type
 
| VarInt
 
| The type of mob. See [[Entities#Mobs]].
 
 
  |-
 
  |-
 
  | X
 
  | X
 
  | Double
 
  | Double
  |  
+
  |
 
  |-
 
  |-
 
  | Y
 
  | Y
 
  | Double
 
  | Double
  |  
+
  |
 
  |-
 
  |-
 
  | Z
 
  | Z
 
  | Double
 
  | Double
  |  
+
  |
 
  |-
 
  |-
 
  | Yaw
 
  | Yaw
 
  | Angle
 
  | Angle
  |  
+
  |
 
  |-
 
  |-
 
  | Pitch
 
  | Pitch
 
  | Angle
 
  | 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 ====
+
When in {{Minecraft Wiki|Server.properties#online-mode|online mode}}, the UUIDs must be valid and have valid skin blobs.
  
This packet shows location, name, and type of painting.
+
In offline mode, [[Wikipedia:Universally unique identifier#Versions 3 and 5 (namespace name-based)|UUID v3]] is used with the String <code>OfflinePlayer:&lt;player name&gt;</code>, encoded in UTF-8 (and case-sensitive).  The Notchain server uses <code>UUID.nameUUIDFromBytes</code>, implemented by OpenJDK [https://github.com/AdoptOpenJDK/openjdk-jdk8u/blob/9a91972c76ddda5c1ce28b50ca38cbd8a30b7a72/jdk/src/share/classes/java/util/UUID.java#L153-L175 here].
 +
 
 +
For NPCs UUID v2 should be used. Note:
 +
 
 +
<+Grum> i will never confirm this as a feature you know that :)
 +
 
 +
In an example UUID, <code>xxxxxxxx-xxxx-Yxxx-xxxx-xxxxxxxxxxxx</code>, the UUID version is specified by <code>Y</code>. So, for UUID v3, <code>Y</code> will always be <code>3</code>, and for UUID v2, <code>Y</code> will always be <code>2</code>.
 +
 
 +
==== Animate ====
 +
 
 +
Sent whenever an entity should change animation.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 669: Line 731:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| 0x03
+
  |rowspan="2"| 0x03
  |rowspan="5"| Play
+
  |rowspan="2"| Play
  |rowspan="5"| Client
+
  |rowspan="2"| Client
 
  | Entity ID
 
  | Entity ID
 
  | VarInt
 
  | VarInt
  |  
+
  | Player ID.
 
  |-
 
  |-
  | Entity UUID
+
  | Animation
| UUID
+
  | Unsigned Byte
  |  
+
  | Animation ID (see below).
  |-
 
| 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).
 
 
  |}
 
  |}
  
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.
+
Animation can be one of the following values:
 
 
List of paintings by coordinates in <code>paintings_kristoffer_zetterstrand.png</code> (where x and y are in pixels from the top left and width and height are in pixels or 16ths of a block):
 
  
 
{| class="wikitable"
 
{| class="wikitable"
! Name
 
 
  ! ID
 
  ! ID
  ! x
+
  ! Animation
! y
 
! width
 
! height
 
 
  |-
 
  |-
| <code>minecraft:kebab</code>
 
 
  | 0
 
  | 0
  | 0
+
  | Swing main arm
| 0
 
| 16
 
| 16
 
 
  |-
 
  |-
| <code>minecraft:aztec</code>
 
 
  | 1
 
  | 1
  | 16
+
  | Take damage
| 0
 
| 16
 
| 16
 
 
  |-
 
  |-
| <code>minecraft:alban</code>
 
 
  | 2
 
  | 2
  | 32
+
  | Leave bed
| 0
 
| 16
 
| 16
 
 
  |-
 
  |-
| <code>minecraft:aztec2</code>
 
 
  | 3
 
  | 3
  | 48
+
  | Swing offhand
| 0
 
| 16
 
| 16
 
 
  |-
 
  |-
| <code>minecraft:bomb</code>
 
 
  | 4
 
  | 4
  | 64
+
  | Critical effect
| 0
 
| 16
 
| 16
 
 
  |-
 
  |-
| <code>minecraft:plant</code>
 
 
  | 5
 
  | 5
  | 80
+
  | Magic critical effect
  | 0
+
  |}
  | 16
+
 
  | 16
+
==== Award Stats ====
 +
 
 +
Sent as a response to [[#Client Command|Client Command]] (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
 
  |-
 
  |-
  | <code>minecraft:wasteland</code>
+
  |rowspan="4"| 0x04
  | 6
+
  |rowspan="4"| Play
  | 96
+
  |rowspan="4"| Client
  | 0
+
  |colspan="2"| Count
  | 16
+
  |colspan="2"| VarInt
  | 16
+
  | Number of elements in the following array.
 
  |-
 
  |-
  | <code>minecraft:pool</code>
+
  |rowspan="3"| Statistic
  | 7
+
  | Category ID
  | 0
+
  |rowspan="3"| Array
| 32
+
  | VarInt
  | 32
+
  | See below.
  | 16
 
 
  |-
 
  |-
  | <code>minecraft:courbet</code>
+
  | Statistic ID
  | 8
+
  | VarInt
  | 32
+
  | See below.
| 32
 
| 32
 
| 16
 
 
  |-
 
  |-
  | <code>minecraft:sea</code>
+
  | Value
| 9
+
| VarInt
| 64
+
| The amount to set it to.
  | 32
+
|}
  | 32
+
 
  | 16
+
Categories (these are namespaced, but with <code>:</code> replaced with <code>.</code>):
 +
 
 +
{| class="wikitable"
 +
  ! Name
 +
  ! ID
 +
  ! Registry
 
  |-
 
  |-
  | <code>minecraft:sunset</code>
+
  | <code>minecraft.mined</code>
  | 10
+
  | 0
  | 96
+
  | Blocks
| 32
 
| 32
 
| 16
 
 
  |-
 
  |-
  | <code>minecraft:creebet</code>
+
  | <code>minecraft.crafted</code>
  | 11
+
  | 1
  | 128
+
  | Items
| 32
 
| 32
 
| 16
 
 
  |-
 
  |-
  | <code>minecraft:wanderer</code>
+
  | <code>minecraft.used</code>
  | 12
+
  | 2
  | 0
+
  | Items
| 64
 
| 16
 
| 32
 
 
  |-
 
  |-
  | <code>minecraft:graham</code>
+
  | <code>minecraft.broken</code>
  | 13
+
  | 3
  | 16
+
  | Items
| 64
 
| 16
 
| 32
 
 
  |-
 
  |-
  | <code>minecraft:match</code>
+
  | <code>minecraft.picked_up</code>
  | 14
+
  | 4
  | 0
+
  | Items
| 128
 
| 32
 
| 32
 
 
  |-
 
  |-
  | <code>minecraft:bust</code>
+
  | <code>minecraft.dropped</code>
  | 15
+
  | 5
  | 32
+
  | Items
| 128
 
| 32
 
| 32
 
 
  |-
 
  |-
  | <code>minecraft:stage</code>
+
  | <code>minecraft.killed</code>
  | 16
+
  | 6
  | 64
+
  | Entities
| 128
 
| 32
 
| 32
 
 
  |-
 
  |-
  | <code>minecraft:void</code>
+
  | <code>minecraft.killed_by</code>
  | 17
+
  | 7
  | 96
+
  | Entities
| 128
 
| 32
 
| 32
 
 
  |-
 
  |-
  | <code>skull_and_roses</code>
+
  | <code>minecraft.custom</code>
  | 18
+
  | 8
  | 128
+
  | Custom
  | 128
+
  |}
  | 32
+
 
  | 32
+
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:wither</code>
+
  | <code>minecraft.leave_game</code>
  | 19
+
  | 0
  | 160
+
  | None
| 128
 
| 32
 
| 32
 
 
  |-
 
  |-
  | <code>minecraft:fighters</code>
+
  | <code>minecraft.play_one_minute</code>
  | 20
+
  | 1
  | 0
+
  | Time
  | 96
+
  |-
  | 64
+
  | <code>minecraft.time_since_death</code>
  | 32
+
| 2
 +
| Time
 +
|-
 +
| <code>minecraft.time_since_rest</code>
 +
| 3
 +
  | Time
 
  |-
 
  |-
  | <code>minecraft:pointer</code>
+
  | <code>minecraft.sneak_time</code>
  | 21
+
  | 4
  | 0
+
  | Time
| 192
 
| 64
 
| 64
 
 
  |-
 
  |-
  | <code>minecraft:pigscene</code>
+
  | <code>minecraft.walk_one_cm</code>
  | 22
+
  | 5
  | 64
+
  | Distance
| 192
 
| 64
 
| 64
 
 
  |-
 
  |-
  | <code>minecraft:burning_skull</code>
+
  | <code>minecraft.crouch_one_cm</code>
  | 23
+
  | 6
  | 128
+
  | Distance
| 192
 
| 64
 
| 64
 
 
  |-
 
  |-
  | <code>minecraft:skeleton</code>
+
  | <code>minecraft.sprint_one_cm</code>
  | 24
+
  | 7
  | 192
+
  | Distance
| 64
 
| 64
 
| 48
 
 
  |-
 
  |-
  | <code>minecraft:donkey_kong</code>
+
  | <code>minecraft.walk_on_water_one_cm</code>
  | 25
+
  | 8
  | 192
+
  | Distance
  | 112
+
  |-
  | 64
+
  | <code>minecraft.fall_one_cm</code>
  | 48
+
  | 9
  |}
+
  | Distance
 
 
The {{Minecraft Wiki|Painting#Canvases|Minecraft Wiki article on paintings}} also provides a list of painting names to the actual images.
 
 
 
==== Spawn Player ====
 
 
 
This packet is sent by the server when a player comes into visible range, ''not'' when a player joins.
 
 
 
This packet must be sent after the [[#Player Info|Player Info]] packet that adds the player data for the client to use when spawning a player. If the Player Info for the player spawned by this packet is not present when this packet arrives, Notchian clients will not spawn the player entity. The Player Info packet includes skin/cape data.
 
 
 
Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="7"| 0x04
+
  | <code>minecraft.climb_one_cm</code>
|rowspan="7"| Play
+
  | 10
|rowspan="7"| Client
+
  | Distance
  | Entity ID
 
  | VarInt
 
| Player's EID.
 
 
  |-
 
  |-
  | Player UUID
+
  | <code>minecraft.fly_one_cm</code>
  | UUID
+
  | 11
  | See below for notes on {{Minecraft Wiki|Server.properties#online-mode|offline mode}} and NPCs.
+
  | Distance
 
  |-
 
  |-
  | X
+
  | <code>minecraft.walk_under_water_one_cm</code>
  | Double
+
  | 12
  |  
+
  | Distance
 
  |-
 
  |-
  | Y
+
  | <code>minecraft.minecart_one_cm</code>
  | Double
+
  | 13
  |  
+
  | Distance
 
  |-
 
  |-
  | Z
+
  | <code>minecraft.boat_one_cm</code>
  | Double
+
  | 14
  |  
+
  | Distance
 
  |-
 
  |-
  | Yaw
+
  | <code>minecraft.pig_one_cm</code>
  | Angle
+
  | 15
  |  
+
  | Distance
 
  |-
 
  |-
  | Pitch
+
  | <code>minecraft.horse_one_cm</code>
  | Angle
+
  | 16
  |  
+
  | Distance
  |}
+
  |-
 
+
| <code>minecraft.aviate_one_cm</code>
When in {{Minecraft Wiki|Server.properties#online-mode|online mode}}, the UUIDs must be valid and have valid skin blobs.
+
  | 17
 
+
  | Distance
In offline mode, [[Wikipedia:Universally unique identifier#Versions 3 and 5 (namespace name-based)|UUID v3]] is used with the String <code>OfflinePlayer:&lt;player name&gt;</code>, encoded in UTF-8 (and case-sensitive). The Notchain server uses <code>UUID.nameUUIDFromBytes</code>, implemented by OpenJDK [https://github.com/AdoptOpenJDK/openjdk-jdk8u/blob/9a91972c76ddda5c1ce28b50ca38cbd8a30b7a72/jdk/src/share/classes/java/util/UUID.java#L153-L175 here].
 
 
 
For NPCs UUID v2 should be used. Note:
 
 
 
  <+Grum> i will never confirm this as a feature you know that :)
 
 
 
In an example UUID, <code>xxxxxxxx-xxxx-Yxxx-xxxx-xxxxxxxxxxxx</code>, the UUID version is specified by <code>Y</code>. So, for UUID v3, <code>Y</code> will always be <code>3</code>, and for UUID v2, <code>Y</code> will always be <code>2</code>.
 
 
 
==== Sculk Vibration Signal ====
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="4"| 0x05
+
  | <code>minecraft.swim_one_cm</code>
|rowspan="4"| Play
+
  | 18
|rowspan="4"| Client
+
  | Distance
  | Source Position
 
  | Position
 
| Source position for the vibration.
 
 
  |-
 
  |-
  | Destination Identifier
+
  | <code>minecraft.strider_one_cm</code>
  | Identifier
+
  | 19
  | Identifier of the destination codec type.
+
  | Distance
 
  |-
 
  |-
  | Destination
+
  | <code>minecraft.jump</code>
  | Varies
+
  | 20
  | 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".
+
  | None
 
  |-
 
  |-
  | Arrival Ticks
+
  | <code>minecraft.drop</code>
  | VarInt
+
  | 21
  | Ticks for the signal to arrive at the destination.
+
  | None
|}
 
This packet shows a permanent particle.
 
 
 
==== Entity Animation (clientbound) ====
 
 
 
Sent whenever an entity should change animation.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x06
+
  | <code>minecraft.damage_dealt</code>
  |rowspan="2"| Play
+
| 22
  |rowspan="2"| Client
+
  | Damage
  | Entity ID
+
  |-
  | VarInt
+
  | <code>minecraft.damage_dealt_absorbed</code>
  | Player ID.
+
  | 23
 +
  | Damage
 
  |-
 
  |-
  | Animation
+
  | <code>minecraft.damage_dealt_resisted</code>
  | Unsigned Byte
+
  | 24
  | Animation ID (see below).
+
  | Damage
|}
 
 
 
Animation can be one of the following values:
 
 
 
{| class="wikitable"
 
! ID
 
! Animation
 
 
  |-
 
  |-
  | 0
+
  | <code>minecraft.damage_taken</code>
  | Swing main arm
+
  | 25
 +
| Damage
 
  |-
 
  |-
  | 1
+
  | <code>minecraft.damage_blocked_by_shield</code>
  | Take damage
+
  | 26
 +
| Damage
 
  |-
 
  |-
  | 2
+
  | <code>minecraft.damage_absorbed</code>
  | Leave bed
+
  | 27
 +
| Damage
 
  |-
 
  |-
  | 3
+
  | <code>minecraft.damage_resisted</code>
  | Swing offhand
+
  | 28
 +
| Damage
 
  |-
 
  |-
  | 4
+
  | <code>minecraft.deaths</code>
  | Critical effect
+
  | 29
 +
| None
 
  |-
 
  |-
  | 5
+
  | <code>minecraft.mob_kills</code>
| Magic critical effect
+
  | 30
|}
+
  | None
 
 
==== 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
+
  | <code>minecraft.animals_bred</code>
|rowspan="4"| Play
+
  | 31
|rowspan="4"| Client
+
  | None
|colspan="2"| Count
 
  |colspan="2"| VarInt
 
  | Number of elements in the following array.
 
 
  |-
 
  |-
  |rowspan="3"| Statistic
+
  | <code>minecraft.player_kills</code>
| Category ID
+
  | 32
  |rowspan="3"| Array
+
  | None
  | VarInt
 
| See below.
 
 
  |-
 
  |-
  | Statistic ID
+
  | <code>minecraft.fish_caught</code>
  | VarInt
+
  | 33
  | See below.
+
  | None
 
  |-
 
  |-
  | Value
+
  | <code>minecraft.talked_to_villager</code>
| VarInt
+
| 34
| The amount to set it to.
+
  | None
|}
 
 
 
Categories (these are namespaced, but with <code>:</code> replaced with <code>.</code>):
 
 
 
{| class="wikitable"
 
  ! Name
 
! ID
 
! Registry
 
 
  |-
 
  |-
  | <code>minecraft.mined</code>
+
  | <code>minecraft.traded_with_villager</code>
  | 0
+
  | 35
  | Blocks
+
  | None
 
  |-
 
  |-
  | <code>minecraft.crafted</code>
+
  | <code>minecraft.eat_cake_slice</code>
  | 1
+
  | 36
  | Items
+
  | None
 
  |-
 
  |-
  | <code>minecraft.used</code>
+
  | <code>minecraft.fill_cauldron</code>
  | 2
+
  | 37
  | Items
+
  | None
 
  |-
 
  |-
  | <code>minecraft.broken</code>
+
  | <code>minecraft.use_cauldron</code>
  | 3
+
  | 38
  | Items
+
  | None
 
  |-
 
  |-
  | <code>minecraft.picked_up</code>
+
  | <code>minecraft.clean_armor</code>
  | 4
+
  | 39
  | Items
+
  | None
 
  |-
 
  |-
  | <code>minecraft.dropped</code>
+
  | <code>minecraft.clean_banner</code>
  | 5
+
  | 40
  | Items
+
  | None
 
  |-
 
  |-
  | <code>minecraft.killed</code>
+
  | <code>minecraft.clean_shulker_box</code>
  | 6
+
  | 41
  | Entities
+
  | None
 
  |-
 
  |-
  | <code>minecraft.killed_by</code>
+
  | <code>minecraft.interact_with_brewingstand</code>
  | 7
+
  | 42
  | Entities
+
  | None
 
  |-
 
  |-
  | <code>minecraft.custom</code>
+
  | <code>minecraft.interact_with_beacon</code>
  | 8
+
  | 43
| 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
 
  | None
 
  |-
 
  |-
  | <code>minecraft.play_one_minute</code>
+
  | <code>minecraft.inspect_dropper</code>
  | 1
+
  | 44
  | Time
+
  | None
 
  |-
 
  |-
  | <code>minecraft.time_since_death</code>
+
  | <code>minecraft.inspect_hopper</code>
  | 2
+
  | 45
  | Time
+
  | None
 
  |-
 
  |-
  | <code>minecraft.time_since_rest</code>
+
  | <code>minecraft.inspect_dispenser</code>
  | 3
+
  | 46
  | Time
+
  | None
 
  |-
 
  |-
  | <code>minecraft.sneak_time</code>
+
  | <code>minecraft.play_noteblock</code>
  | 4
+
  | 47
  | Time
+
  | None
 
  |-
 
  |-
  | <code>minecraft.walk_one_cm</code>
+
  | <code>minecraft.tune_noteblock</code>
  | 5
+
  | 48
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.crouch_one_cm</code>
+
  | <code>minecraft.pot_flower</code>
  | 6
+
  | 49
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.sprint_one_cm</code>
+
  | <code>minecraft.trigger_trapped_chest</code>
  | 7
+
  | 50
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.walk_on_water_one_cm</code>
+
  | <code>minecraft.open_enderchest</code>
  | 8
+
  | 51
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.fall_one_cm</code>
+
  | <code>minecraft.enchant_item</code>
  | 9
+
  | 52
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.climb_one_cm</code>
+
  | <code>minecraft.play_record</code>
  | 10
+
  | 53
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.fly_one_cm</code>
+
  | <code>minecraft.interact_with_furnace</code>
  | 11
+
  | 54
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.walk_under_water_one_cm</code>
+
  | <code>minecraft.interact_with_crafting_table</code>
  | 12
+
  | 55
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.minecart_one_cm</code>
+
  | <code>minecraft.open_chest</code>
  | 13
+
  | 56
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.boat_one_cm</code>
+
  | <code>minecraft.sleep_in_bed</code>
  | 14
+
  | 57
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.pig_one_cm</code>
+
  | <code>minecraft.open_shulker_box</code>
  | 15
+
  | 58
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.horse_one_cm</code>
+
  | <code>minecraft.open_barrel</code>
  | 16
+
  | 59
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.aviate_one_cm</code>
+
  | <code>minecraft.interact_with_blast_furnace</code>
  | 17
+
  | 60
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.swim_one_cm</code>
+
  | <code>minecraft.interact_with_smoker</code>
  | 18
+
  | 61
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.strider_one_cm</code>
+
  | <code>minecraft.interact_with_lectern</code>
  | 19
+
  | 62
  | Distance
+
  | None
 
  |-
 
  |-
  | <code>minecraft.jump</code>
+
  | <code>minecraft.interact_with_campfire</code>
  | 20
+
  | 63
 
  | None
 
  | None
 
  |-
 
  |-
  | <code>minecraft.drop</code>
+
  | <code>minecraft.interact_with_cartography_table</code>
  | 21
+
  | 64
 
  | None
 
  | None
 
  |-
 
  |-
  | <code>minecraft.damage_dealt</code>
+
  | <code>minecraft.interact_with_loom</code>
  | 22
+
  | 65
  | Damage
+
  | None
 
  |-
 
  |-
  | <code>minecraft.damage_dealt_absorbed</code>
+
  | <code>minecraft.interact_with_stonecutter</code>
  | 23
+
  | 66
  | Damage
+
  | None
 
  |-
 
  |-
  | <code>minecraft.damage_dealt_resisted</code>
+
  | <code>minecraft.bell_ring</code>
  | 24
+
  | 67
  | Damage
+
  | None
 
  |-
 
  |-
  | <code>minecraft.damage_taken</code>
+
  | <code>minecraft.raid_trigger</code>
  | 25
+
  | 68
  | Damage
+
  | None
 
  |-
 
  |-
  | <code>minecraft.damage_blocked_by_shield</code>
+
  | <code>minecraft.raid_win</code>
  | 26
+
  | 69
| Damage
 
|-
 
| <code>minecraft.damage_absorbed</code>
 
| 27
 
| Damage
 
|-
 
| <code>minecraft.damage_resisted</code>
 
| 28
 
| Damage
 
|-
 
| <code>minecraft.deaths</code>
 
| 29
 
 
  | None
 
  | None
 
  |-
 
  |-
  | <code>minecraft.mob_kills</code>
+
  | <code>minecraft.interact_with_anvil</code>
  | 30
+
  | 70
 
  | None
 
  | None
 
  |-
 
  |-
  | <code>minecraft.animals_bred</code>
+
  | <code>minecraft.interact_with_grindstone</code>
  | 31
+
  | 71
 
  | None
 
  | None
 
  |-
 
  |-
  | <code>minecraft.player_kills</code>
+
  | <code>minecraft.target_hit</code>
  | 32
+
  | 72
 
  | None
 
  | None
 
  |-
 
  |-
  | <code>minecraft.fish_caught</code>
+
  | <code>minecraft.interact_with_smithing_table</code>
  | 33
+
  | 73
 
  | None
 
  | 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
 +
 +
==== Block Changed Ack ====
 +
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | <code>minecraft.talked_to_villager</code>
+
  |rowspan="4"| 0x05
  | 34
+
|rowspan="4"| Play
  | None
+
|rowspan="4"| Client
 +
| Sequence ID
 +
  | VarInt
 +
  | Represents the sequence to acknowledge, this is used for properly syncing block changes to the client after interactions.
 
  |-
 
  |-
  | <code>minecraft.traded_with_villager</code>
+
  |}
  | 35
+
 
| None
+
 
|-
+
==== Block Destruction ====
| <code>minecraft.eat_cake_slice</code>
+
 
  | 36
+
0–9 are the displayable destroy stages and each other number means that there is no animation on this coordinate.
  | None
+
 
  |-
+
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)
  | <code>minecraft.fill_cauldron</code>
+
 
  | 37
+
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.
  | None
+
 
 +
{| class="wikitable"
 +
  ! Packet ID
 +
  ! State
 +
  ! Bound To
 +
  ! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | <code>minecraft.use_cauldron</code>
+
  |rowspan="3"| 0x06
  | 38
+
|rowspan="3"| Play
  | None
+
|rowspan="3"| Client
 +
| Entity ID
 +
  | VarInt
 +
  | Entity ID of the entity breaking the block.
 
  |-
 
  |-
  | <code>minecraft.clean_armor</code>
+
  | Location
  | 39
+
  | Position
  | None
+
  | Block Position.
 
  |-
 
  |-
  | <code>minecraft.clean_banner</code>
+
  | Destroy Stage
  | 40
+
| Byte
  | None
+
| 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
 
  |-
 
  |-
  | <code>minecraft.clean_shulker_box</code>
+
  |rowspan="3"| 0x07
  | 41
+
|rowspan="3"| Play
  | None
+
|rowspan="3"| Client
 +
| Location
 +
  | Position
 +
  |
 
  |-
 
  |-
  | <code>minecraft.interact_with_brewingstand</code>
+
  | Type
  | 42
+
  | VarInt
  | None
+
  | The type of the block entity
 
  |-
 
  |-
  | <code>minecraft.interact_with_beacon</code>
+
  | NBT Data
  | 43
+
| [[NBT|NBT Tag]]
  | None
+
| 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).
 +
  |}
 +
 
 +
==== Block Event ====
 +
 
 +
This packet is used for a number of actions and animations performed by blocks, usually non-persistent. The client ignores the provided block type and instead uses the block state in their world.
 +
 
 +
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
 
  |-
 
  |-
  | <code>minecraft.inspect_dropper</code>
+
  |rowspan="4"| 0x08
  | 44
+
|rowspan="4"| Play
  | None
+
|rowspan="4"| Client
 +
| Location
 +
  | Position
 +
  | Block coordinates.
 
  |-
 
  |-
  | <code>minecraft.inspect_hopper</code>
+
  | Action ID (Byte 1)
  | 45
+
  | Unsigned Byte
  | None
+
  | Varies depending on block — see [[Block Actions]].
 
  |-
 
  |-
  | <code>minecraft.inspect_dispenser</code>
+
  | Action Param (Byte 2)
  | 46
+
  | Unsigned Byte
  | None
+
  | Varies depending on block — see [[Block Actions]].
 
  |-
 
  |-
  | <code>minecraft.play_noteblock</code>
+
  | Block Type
  | 47
+
  | VarInt
  | None
+
  | The block type ID for the block.  This must match the block at the given coordinates.
  |-
+
  |}
  | <code>minecraft.tune_noteblock</code>
+
 
  | 48
+
 
  | None
+
==== Block Update ====
 +
 
 +
Fired whenever a block is changed within the render distance.
 +
 
 +
{{Warning2|Changing a block in a chunk that is not loaded is not a stable action.  The Notchian client currently uses a ''shared'' empty chunk which is modified for all block changes in unloaded chunks; while in 1.9 this chunk never renders in older versions the changed block will appear in all copies of the empty chunk. Servers should avoid sending block changes in unloaded chunks and clients should ignore such packets.}}
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | <code>minecraft.pot_flower</code>
+
  |rowspan="2"| 0x09
  | 49
+
|rowspan="2"| Play
  | None
+
|rowspan="2"| Client
 +
| Location
 +
  | Position
 +
  | Block Coordinates.
 
  |-
 
  |-
  | <code>minecraft.trigger_trapped_chest</code>
+
  | Block ID
  | 50
+
| VarInt
  | None
+
| 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.
 +
  |}
 +
 
 +
==== Boss Event ====
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
  !colspan="2"| Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | <code>minecraft.open_enderchest</code>
+
  |rowspan="14"| 0x0A
  | 51
+
|rowspan="14"| Play
  | None
+
|rowspan="14"| Client
 +
|colspan="2"| UUID
 +
  | UUID
 +
  | Unique ID for this bar.
 
  |-
 
  |-
  | <code>minecraft.enchant_item</code>
+
  |colspan="2"| Action
  | 52
+
  | VarInt Enum
  | None
+
  | Determines the layout of the remaining packet.
 
  |-
 
  |-
  | <code>minecraft.play_record</code>
+
  ! Action
  | 53
+
  ! Field Name
  | None
+
  !
 +
!
 
  |-
 
  |-
  | <code>minecraft.interact_with_furnace</code>
+
  |rowspan="5"| 0: add
  | 54
+
| Title
  | None
+
  | [[Chat]]
 +
  |
 
  |-
 
  |-
  | <code>minecraft.interact_with_crafting_table</code>
+
  | Health
  | 55
+
  | Float
  | None
+
  | 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.
 
  |-
 
  |-
  | <code>minecraft.open_chest</code>
+
  | Color
  | 56
+
  | VarInt Enum
  | None
+
  | Color ID (see below).
 
  |-
 
  |-
  | <code>minecraft.sleep_in_bed</code>
+
  | Division
  | 57
+
  | VarInt Enum
  | None
+
  | Type of division (see below).
 
  |-
 
  |-
  | <code>minecraft.open_shulker_box</code>
+
  | Flags
  | 58
+
  | Unsigned Byte
  | None
+
  | Bit mask. 0x1: should darken sky, 0x2: is dragon bar (used to play end music), 0x04: create fog (previously was also controlled by 0x02).
 
  |-
 
  |-
  | <code>minecraft.open_barrel</code>
+
  | 1: remove
  | 59
+
| ''no fields''
  | None
+
  | ''no fields''
 +
  | Removes this boss bar.
 
  |-
 
  |-
  | <code>minecraft.interact_with_blast_furnace</code>
+
  | 2: update health
  | 60
+
  | Health
  | None
+
  | Float
 +
| ''as above''
 
  |-
 
  |-
  | <code>minecraft.interact_with_smoker</code>
+
  | 3: update title
  | 61
+
  | Title
  | None
+
| [[Chat]]
 +
  |
 
  |-
 
  |-
  | <code>minecraft.interact_with_lectern</code>
+
  |rowspan="2"| 4: update style
  | 62
+
| Color
  | None
+
  | VarInt Enum
 +
  | Color ID (see below).
 
  |-
 
  |-
  | <code>minecraft.interact_with_campfire</code>
+
  | Dividers
  | 63
+
  | VarInt Enum
  | None
+
  | ''as above''
 
  |-
 
  |-
  | <code>minecraft.interact_with_cartography_table</code>
+
  | 5: update flags
  | 64
+
  | Flags
  | None
+
  | Unsigned Byte
 +
| ''as above''
 
  |-
 
  |-
  | <code>minecraft.interact_with_loom</code>
+
  |}
  | 65
+
 
  | None
+
{| class="wikitable"
 +
  ! ID
 +
  ! Color
 
  |-
 
  |-
  | <code>minecraft.interact_with_stonecutter</code>
+
  | 0
  | 66
+
  | Pink
| None
 
 
  |-
 
  |-
  | <code>minecraft.bell_ring</code>
+
  | 1
  | 67
+
  | Blue
| None
 
 
  |-
 
  |-
  | <code>minecraft.raid_trigger</code>
+
  | 2
  | 68
+
  | Red
| None
 
 
  |-
 
  |-
  | <code>minecraft.raid_win</code>
+
  | 3
  | 69
+
  | Green
| None
 
 
  |-
 
  |-
  | <code>minecraft.interact_with_anvil</code>
+
  | 4
  | 70
+
  | Yellow
| None
 
 
  |-
 
  |-
  | <code>minecraft.interact_with_grindstone</code>
+
  | 5
  | 71
+
  | Purple
| None
 
 
  |-
 
  |-
  | <code>minecraft.target_hit</code>
+
  | 6
  | 72
+
  | White
| 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"
 
{| class="wikitable"
  ! Packet ID
+
  ! ID
  ! State
+
  ! Type of division
! Bound To
+
  |-
  ! Field Name
+
  | 0
  ! Field Type
+
  | No division
  ! Notes
 
 
  |-
 
  |-
  |rowspan="4"| 0x08
+
  | 1
|rowspan="4"| Play
+
  | 6 notches
|rowspan="4"| Client
 
| Location
 
| Position
 
  | Position where the digging was happening.
 
 
  |-
 
  |-
  | Block
+
  | 2
  | VarInt
+
  | 10 notches
| Block state ID of the block that should be at that position now.
 
 
  |-
 
  |-
  | Status
+
  | 3
  | VarInt enum
+
  | 12 notches
| Same as Player Digging.  Only Started digging (0), Cancelled digging (1), and Finished digging (2) are used.
 
 
  |-
 
  |-
  | Successful
+
  | 4
  | Boolean
+
  | 20 notches
| True if the digging succeeded; false if the client should undo any changes it made locally.
 
 
  |}
 
  |}
  
==== Block Break Animation ====
+
==== Change Difficulty ====
  
0–9 are the displayable destroy stages and each other number means that there is no animation on this coordinate.
+
Changes the difficulty setting in the client's option menu
 
 
Block break animations can still be applied on air; the animation will remain visible although there is no block being broken.  However, if this is applied to a transparent block, odd graphical effects may happen, including water losing its transparency.  (An effect similar to this can be seen in normal gameplay when breaking ice blocks)
 
 
 
If you need to display several break animations at the same time you have to give each of them a unique Entity ID. The entity ID does not need to correspond to an actual entity on the client. It is valid to use a randomly generated number.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,465: Line 1,438:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x09
+
  |rowspan="2"| 0x0B
  |rowspan="3"| Play
+
  |rowspan="2"| Play
  |rowspan="3"| Client
+
  |rowspan="2"| Client
  | Entity ID
+
  | Difficulty
  | VarInt
+
  | Unsigned Byte
  | Entity ID of the entity breaking the block.
+
  | 0: peaceful, 1: easy, 2: normal, 3: hard.
 
  |-
 
  |-
  | Location
+
  | Difficulty locked?
  | Position
+
  | Boolean
  | Block Position.
+
  |
|-
 
| Destroy Stage
 
| Byte
 
| 0–9 to set it, any other value to remove it.
 
 
  |}
 
  |}
  
==== Block Entity Data ====
+
==== Chat Preview (clientbound) ====
  
Sets the block entity associated with the block at the given location.
+
Sets the message to preview on the client.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,493: Line 1,462:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x0A
+
  |rowspan="3"| 0x0C
 
  |rowspan="3"| Play
 
  |rowspan="3"| Play
 
  |rowspan="3"| Client
 
  |rowspan="3"| Client
  | Location
+
  | Query ID
  | Position
+
  | Integer
  |  
+
  |
 
  |-
 
  |-
  | Action
+
  | Component is Present
  | Unsigned Byte
+
  | Boolean
  | The type of update to perform, see below.
+
  |
 
  |-
 
  |-
  | NBT Data
+
  | Message to Preview
  | [[NBT|NBT Tag]]
+
  | Component
  | 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:
+
==== Clear Titles ====
  
* '''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.)
+
Clear the client's current title information, with the option to also reset it.
* '''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 ====
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="1"| 0x0D
 +
|rowspan="1"| Play
 +
|rowspan="1"| Client
 +
| Reset
 +
| Boolean
 +
|
 +
|}
  
This packet is used for a number of actions and animations performed by blocks, usually non-persistent.
+
==== Command Suggestions ====
  
See [[Block Actions]] for a list of values.
+
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.
 
 
{{Warning2|This packet uses a block ID, not a block state.}}
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,538: Line 1,506:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  !colspan="2"| Field Name
  ! Field Type
+
  !colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x0B
+
  |rowspan="8"| 0x0E
  |rowspan="4"| Play
+
  |rowspan="8"| Play
  |rowspan="4"| Client
+
  |rowspan="8"| Client
  | Location
+
  |-
  | Position
+
  |colspan="2"| ID
  | Block coordinates.
+
|colspan="2"| VarInt
 +
| 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.
 
  |-
 
  |-
  | Action ID (Byte 1)
+
  |rowspan="3"| Matches
  | Unsigned Byte
+
| Match
  | Varies depending on block — see [[Block Actions]].
+
|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.
 
  |-
 
  |-
  | Action Param (Byte 2)
+
  | Has tooltip
  | Unsigned Byte
+
  | Boolean
  | Varies depending on block — see [[Block Actions]].
+
  | True if the following is present.
 
  |-
 
  |-
  | Block Type
+
  | Tooltip
  | VarInt
+
  | Optional [[Chat]]
  | The block type ID for the block.  This must match the block at the given coordinates.
+
  | Tooltip to display; only present if previous boolean is true.
 
  |}
 
  |}
  
==== Block Change ====
+
==== Commands ====
  
Fired whenever a block is changed within the render distance.
+
Lists all of the commands on the server, and how they are parsed.
  
{{Warning2|Changing a block in a chunk that is not loaded is not a stable actionThe Notchian client currently uses a ''shared'' empty chunk which is modified for all block changes in unloaded chunks; while in 1.9 this chunk never renders in older versions the changed block will appear in all copies of the empty chunk.  Servers should avoid sending block changes in unloaded chunks and clients should ignore such packets.}}
+
This is a directed graph, with one root nodeEach redirect or child node must refer only to nodes that have already been declared.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,576: Line 1,559:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x0C
+
  |rowspan="3"| 0x0F
  |rowspan="2"| Play
+
  |rowspan="3"| Play
  |rowspan="2"| Client
+
  |rowspan="3"| Client
  | Location
+
  | Count
  | Position
+
  | VarInt
  | Block Coordinates.
+
  | Number of elements in the following array.
 +
|-
 +
| Nodes
 +
| Array of [[Command Data|Node]]
 +
| An array of nodes.
 
  |-
 
  |-
  | Block ID
+
  | Root index
 
  | VarInt
 
  | 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.
+
  | Index of the <code>root</code> node in the previous array.
 
  |}
 
  |}
  
==== Boss Bar ====  
+
For more information on this packet, see the [[Command Data]] article.
 +
 
 +
==== Container Close (clientbound) ====
 +
 
 +
This packet is sent from the server to the client when a window is forcibly closed, such as when a chest is destroyed while it's open. The notchian client disregards the provided window ID and closes any active window.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,594: Line 1,585:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="14"| 0x0D
+
  | 0x10
  |rowspan="14"| Play
+
| Play
  |rowspan="14"| Client
+
| Client
|colspan="2"| UUID
+
| Window ID
  | UUID
+
  | Unsigned Byte
  | Unique ID for this bar.
+
| This is the ID of the window that was closed. 0 for inventory.
 +
  |}
 +
 
 +
==== Container Set Content ====
 +
[[File:Inventory-slots.png|thumb|The inventory slots]]
 +
 
 +
Sent by the server when items in multiple slots (in a window) are added/removed. This includes the main inventory, equipped armour and crafting slots. This packet with Window ID set to "0" is sent during the player joining sequence to initialise the player's inventory.
 +
 
 +
{| class="wikitable"
 +
  ! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
  ! Notes
 
  |-
 
  |-
  |colspan="2"| Action
+
  |rowspan="5"| 0x11
  | VarInt Enum
+
  |rowspan="5"| Play
  | Determines the layout of the remaining packet.
+
|rowspan="5"| Client
 +
| Window ID
 +
| Unsigned Byte
 +
  | The ID of window which items are being sent for. 0 for player inventory.
 
  |-
 
  |-
  ! Action
+
  | State ID
  ! Field Name
+
  | VarInt
  !
+
  | See [[#Container Click|State ID]]
!
 
 
  |-
 
  |-
  |rowspan="5"| 0: add
+
  | Count
| Title
+
  | VarInt
  | [[Chat]]
+
  | Number of elements in the following array.
  |  
 
 
  |-
 
  |-
  | Health
+
  | Slot Data
  | Float
+
  | Array of [[Slot Data|Slot]]
| 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
+
  | Carried Item
  | VarInt Enum
+
  | [[Slot Data|Slot]]
  | Color ID (see below).
+
| Item held by player.
 +
  |}
 +
 
 +
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.
 +
 
 +
==== Container Set Data ====
 +
 
 +
This packet is used to inform the client that part of a GUI window should be updated.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | Division
+
  |rowspan="3"| 0x12
  | VarInt Enum
+
  |rowspan="3"| Play
  | Type of division (see below).
+
  |rowspan="3"| Client
|-
+
  | Window ID
  | Flags
 
 
  | Unsigned Byte
 
  | 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
+
  | Property
  | ''no fields''
+
  | Short
  | ''no fields''
+
  | The property to be updated, see below.
| Removes this boss bar.
 
 
  |-
 
  |-
  | 2: update health
+
  | Value
  | Health
+
  | Short
  | Float
+
  | The new value for the property, see below.
  | ''as above''
+
  |}
 +
 
 +
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"
 
  |-
 
  |-
  | 3: update title
+
  ! Window type
  | Title
+
  ! Property
  | [[Chat]]
+
  ! Value
|
 
 
  |-
 
  |-
  |rowspan="2"| 4: update style
+
  |rowspan="4"| Furnace
  | Color
+
  | 0: Fire icon (fuel left)
| VarInt Enum
+
  | counting from fuel burn time down to 0 (in-game ticks)
  | Color ID (see below).
 
 
  |-
 
  |-
  | Dividers
+
  | 1: Maximum fuel burn time
  | VarInt Enum
+
  | fuel burn time or 0 (in-game ticks)
| ''as above''
 
 
  |-
 
  |-
  | 5: update flags
+
  | 2: Progress arrow
  | Flags
+
  | counting from 0 to maximum progress (in-game ticks)
| Unsigned Byte
 
| ''as above''
 
 
  |-
 
  |-
  |}
+
  | 3: Maximum progress
 
+
| always 200 on the notchian server
{| class="wikitable"
 
! ID
 
! Color
 
 
  |-
 
  |-
  | 0
+
|rowspan="10"| Enchantment Table
  | Pink
+
  | 0: Level requirement for top enchantment slot
 +
  |rowspan="3"| The enchantment's xp level requirement
 
  |-
 
  |-
  | 1
+
  | 1: Level requirement for middle enchantment slot
| Blue
 
 
  |-
 
  |-
  | 2
+
  | 2: Level requirement for bottom enchantment slot
| Red
 
 
  |-
 
  |-
  | 3
+
  | 3: The enchantment seed
  | Green
+
  | 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
+
  | 4: Enchantment ID shown on mouse hover over top enchantment slot
  | Yellow
+
  |rowspan="3"| The enchantment id (set to -1 to hide it), see below for values
 
  |-
 
  |-
  | 5
+
  | 5: Enchantment ID shown on mouse hover over middle enchantment slot
| Purple
 
 
  |-
 
  |-
  | 6
+
  | 6: Enchantment ID shown on mouse hover over bottom enchantment slot
  | White
+
  |-
 +
| 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.
 
  |}
 
  |}
 +
 +
For an enchanting table, the following numerical IDs are used:
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! ID
+
  ! Numerical ID
  ! Type of division
+
  ! Enchantment ID
 +
! Enchantment Name
 
  |-
 
  |-
 
  | 0
 
  | 0
  | No division
+
  | minecraft:protection
 +
| Protection
 
  |-
 
  |-
 
  | 1
 
  | 1
  | 6 notches
+
  | minecraft:fire_protection
 +
| Fire Protection
 
  |-
 
  |-
 
  | 2
 
  | 2
  | 10 notches
+
  | minecraft:feather_falling
 +
| Feather Falling
 
  |-
 
  |-
 
  | 3
 
  | 3
  | 12 notches
+
  | minecraft:blast_protection
 +
| Blast Protection
 
  |-
 
  |-
 
  | 4
 
  | 4
  | 20 notches
+
  | minecraft:projectile_protection
  |}
+
  | Projectile Protection
 
+
|-
==== Server Difficulty ====
+
  | 5
 
+
  | minecraft:respiration
Changes the difficulty setting in the client's option menu
+
  | Respiration
 
 
{| class="wikitable"
 
  ! Packet ID
 
  ! State
 
  ! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x0E
+
  | 6
  |rowspan="2"| Play
+
  | minecraft:aqua_affinity
  |rowspan="2"| Client
+
  | Aqua Affinity
| Difficulty
 
| Unsigned Byte
 
| 0: peaceful, 1: easy, 2: normal, 3: hard.
 
 
  |-
 
  |-
  | Difficulty locked?
+
  | 7
  | Boolean
+
  | minecraft:thorns
  |
+
  | Thorns
|}
 
 
 
==== Chat Message (clientbound) ====
 
 
 
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"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x0F
+
  | 8
|rowspan="3"| Play
+
  | minecraft:depth_strider
|rowspan="3"| Client
+
  | Depth Strider
| JSON Data
 
  | [[Chat]]
 
  | Limited to 262144 bytes.
 
 
  |-
 
  |-
  | Position
+
  | 9
  | Byte
+
  | minecraft:frost_walker
  | 0: chat (chat box), 1: system message (chat box), 2: game info (above hotbar).
+
  | Frost Walker
 
  |-
 
  |-
  | Sender
+
  | 10
  | UUID
+
  | minecraft:binding_curse
  | Used by the Notchian client for the disableChat launch option. Setting both longs to 0 will always display the message regardless of the setting.
+
  | Curse of Binding
|}
 
 
 
==== Clear Titles====
 
 
 
Clear the client's current title information, with the option to also reset it.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="1"| 0x10
+
  | 11
|rowspan="1"| Play
+
  | minecraft:soul_speed
|rowspan="1"| Client
+
  | Soul Speed
| Reset
 
| Boolean
 
|
 
|}
 
 
 
==== Tab-Complete (clientbound) ====
 
 
 
The server responds with a list of auto-completions of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported. The client sorts these alphabetically before listing them.
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
! State
 
! Bound To
 
!colspan="2"| Field Name
 
  !colspan="2"| Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="8"| 0x11
+
  | 12
  |rowspan="8"| Play
+
  | minecraft:sharpness
  |rowspan="8"| Client
+
  | Sharpness
 
  |-
 
  |-
  |colspan="2"| ID
+
  | 13
  |colspan="2"| VarInt
+
  | minecraft:smite
  | Transaction ID.
+
  | Smite
 
  |-
 
  |-
  |colspan="2"| Start
+
  | 14
  |colspan="2"| VarInt
+
  | minecraft:bane_of_arthropods
  | Start of the text to replace.
+
  | Bane of Arthropods
 
  |-
 
  |-
  |colspan="2"| Length
+
  | 15
  |colspan="2"| VarInt
+
  | minecraft:knockback
  | Length of the text to replace.
+
  | Knockback
 
  |-
 
  |-
  |colspan="2"| Count
+
  | 16
  |colspan="2"| VarInt
+
  | minecraft:fire_aspect
  | Number of elements in the following array.
+
  | Fire Aspect
 
  |-
 
  |-
  |rowspan="3"| Matches
+
  | 17
  | Match
+
  | minecraft:looting
  |rowspan="3"| Array
+
  | Looting
| 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
+
  | 18
  | Boolean
+
  | minecraft:sweeping
  | True if the following is present.
+
  | Sweeping Edge
 
  |-
 
  |-
  | Tooltip
+
  | 19
  | Optional [[Chat]]
+
  | minecraft:efficiency
  | Tooltip to display; only present if previous boolean is true.
+
  | Efficiency
|}
 
 
 
==== Declare Commands ====
 
 
 
Lists all of the commands on the server, and how they are parsed.
 
 
 
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"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x12
+
  | 20
|rowspan="3"| Play
+
  | minecraft:silk_touch
|rowspan="3"| Client
+
  | Silk Touch
| Count
 
  | VarInt
 
  | Number of elements in the following array.
 
 
  |-
 
  |-
  | Nodes
+
  | 21
  | Array of [[Command Data|Node]]
+
  | minecraft:unbreaking
  | An array of nodes.
+
  | Unbreaking
 
  |-
 
  |-
  | Root index
+
  | 22
  | VarInt
+
  | minecraft:fortune
  | Index of the <code>root</code> node in the previous array.
+
  | Fortune
|}
 
 
 
For more information on this packet, see the [[Command Data]] article.
 
 
 
==== Close Window (clientbound) ====
 
 
 
This packet is sent from the server to the client when a window is forcibly closed, such as when a chest is destroyed while it's open. The notchian client disregards the provided window ID and closes any active window.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  | 0x13
+
  | 23
  | Play
+
  | minecraft:power
| Client
+
  | Power
| Window ID
 
| Unsigned Byte
 
  | This is the ID of the window that was closed. 0 for inventory.
 
|}
 
 
 
==== Window Items ====
 
[[File:Inventory-slots.png|thumb|The inventory slots]]
 
 
 
Sent by the server when items in multiple slots (in a window) are added/removed. This includes the main inventory, equipped armour and crafting slots. This packet with Window ID set to "0" is sent during the player joining sequence to initialise the player's inventory.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x14
+
  | 24
  |rowspan="3"| Play
+
| minecraft:punch
  |rowspan="3"| Client
+
  | Punch
  | Window ID
+
  |-
  | Unsigned Byte
+
  | 25
  | The ID of window which items are being sent for. 0 for player inventory.
+
  | minecraft:flame
 +
  | Flame
 
  |-
 
  |-
  | Count
+
  | 26
  | Short
+
  | minecraft:infinity
  | Number of elements in the following array.
+
  | Infinity
 
  |-
 
  |-
  | Slot Data
+
  | 27
  | Array of [[Slot Data|Slot]]
+
  | minecraft:luck_of_the_sea
  |  
+
  | Luck of the Sea
|}
 
 
 
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.
 
 
 
==== Window Property ====
 
 
 
This packet is used to inform the client that part of a GUI window should be updated.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x15
+
  | 28
|rowspan="3"| Play
+
  | minecraft:lure
|rowspan="3"| Client
+
  | Lure
| Window ID
 
  | Unsigned Byte
 
  |  
 
 
  |-
 
  |-
  | Property
+
  | 29
  | Short
+
  | minecraft:loyalty
  | The property to be updated, see below.
+
  | Loyalty
 
  |-
 
  |-
  | Value
+
  | 30
  | Short
+
  | minecraft:impaling
  | The new value for the property, see below.
+
  | Impaling
|}
 
 
 
The meaning of the Property field depends on the type of the window. The following table shows the known combinations of window type and property, and how the value is to be interpreted.
 
 
 
{| class="wikitable"
 
 
  |-
 
  |-
  ! Window type
+
  | 31
  ! Property
+
  | minecraft:riptide
  ! Value
+
  | Riptide
 
  |-
 
  |-
  |rowspan="4"| Furnace
+
  | 32
  | 0: Fire icon (fuel left)
+
  | minecraft:channeling
  | counting from fuel burn time down to 0 (in-game ticks)
+
  | Channeling
 
  |-
 
  |-
  | 1: Maximum fuel burn time
+
  | 33
  | fuel burn time or 0 (in-game ticks)
+
| minecraft:multishot
 +
  | Multishot
 
  |-
 
  |-
  | 2: Progress arrow
+
  | 34
  | counting from 0 to maximum progress (in-game ticks)
+
| minecraft:quick_charge
 +
  | Quick Charge
 
  |-
 
  |-
  | 3: Maximum progress
+
  | 35
  | always 200 on the notchian server
+
| minecraft:piercing
 +
  | Piercing
 
  |-
 
  |-
  |rowspan="10"| Enchantment Table
+
  | 36
  | 0: Level requirement for top enchantment slot
+
  | minecraft:mending
  |rowspan="3"| The enchantment's xp level requirement
+
  | Mending
 
  |-
 
  |-
  | 1: Level requirement for middle enchantment slot
+
  | 37
 +
| minecraft:vanishing_curse
 +
| Curse of Vanishing
 +
|}
 +
 
 +
==== Container Set Slot ====
 +
 
 +
Sent by the server when an item in a slot (in a window) is added/removed.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 2: Level requirement for bottom enchantment slot
+
  |rowspan="4"| 0x13
 +
|rowspan="4"| Play
 +
|rowspan="4"| Client
 +
| Window ID
 +
| Byte
 +
| The window which is being updated. 0 for player inventory. Note that all known window types include the player inventory. This packet will only be sent for the currently opened window while the player is performing actions, even if it affects the player inventory. After the window is closed, a number of these packets are sent to update the player's inventory window (0).
 
  |-
 
  |-
  | 3: The enchantment seed
+
  | State ID
  | 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>).
+
  | VarInt
 +
| See [[#Container Click|State ID]]
 
  |-
 
  |-
  | 4: Enchantment ID shown on mouse hover over top enchantment slot
+
  | Slot
  |rowspan="3"| The enchantment id (set to -1 to hide it), see below for values
+
  | Short
 +
| The slot that should be updated.
 
  |-
 
  |-
  | 5: Enchantment ID shown on mouse hover over middle enchantment slot
+
  | Slot Data
 +
| [[Slot Data|Slot]]
 +
|
 +
|}
 +
 
 +
To set the cursor (the item currently dragged with the mouse), use -1 as Window ID and as Slot.
 +
 
 +
This packet can only be used to edit the hotbar of the player's inventory if window ID is set to 0 (slots 36 through 45) if the player is in creative, with their inventory open, and not in their survival inventory tab.  Otherwise, when window ID is 0, it can edit any slot in the player's inventory.  If the window ID is set to -2, then any slot in the inventory can be used but no add item animation will be played.
 +
 
 +
==== Cooldown ====
 +
 
 +
Applies a cooldown period to all items with the given type.  Used by the Notchian server with enderpearls.  This packet should be sent when the cooldown starts and also when the cooldown ends (to compensate for lag), although the client will end the cooldown automatically. Can be applied to any item, note that interactions still get sent to the server with the item but the client does not play the animation nor attempt to predict results (i.e block placing).
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 6: Enchantment ID shown on mouse hover over bottom enchantment slot
+
  |rowspan="2"| 0x14
 +
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
| Item ID
 +
| VarInt
 +
| Numeric ID of the item to apply a cooldown to.
 
  |-
 
  |-
  | 7: Enchantment level shown on mouse hover over the top slot
+
  | Cooldown Ticks
  |rowspan="3"| The enchantment level (1 = I, 2 = II, 6 = VI, etc.), or -1 if no enchant
+
| VarInt
|-
+
| Number of ticks to apply a cooldown for, or 0 to clear the cooldown.
| 8: Enchantment level shown on mouse hover over the middle slot
+
  |}
  |-
+
 
  | 9: Enchantment level shown on mouse hover over the bottom slot
+
==== Custom Payload (clientbound) ====
  |-
+
 
  |rowspan="3"| Beacon
+
{{Main|Plugin channels}}
  | 0: Power level
+
 
  | 0-4, controls what effect buttons are enabled
+
Mods and plugins can use this to send their data. Minecraft itself uses several [[plugin channel]]s. These internal channels are in the <code>minecraft</code> namespace.
 +
 
 +
More documentation on this: [https://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/ https://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/]
 +
 
 +
{| class="wikitable"
 +
  ! Packet ID
 +
  ! State
 +
  ! Bound To
 +
  ! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | 1: First potion effect
+
  |rowspan="2"| 0x15
  | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the first effect, or -1 if no effect
+
|rowspan="2"| Play
 +
|rowspan="2"| Client
 +
  | Channel
 +
| Identifier
 +
| Name of the [[plugin channel]] used to send the data.
 
  |-
 
  |-
  | 2: Second potion effect
+
  | Data
| {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the second effect, or -1 if no effect
+
  | 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.
  | 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.
 
 
  |}
 
  |}
  
For an enchanting table, the following numerical IDs are used:
+
==== Custom Sound ====
 +
{{See also|#Sound}}
 +
 
 +
Used to play a sound effect on the client. Custom sounds may be added by resource packs.
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Numerical ID
+
  ! Packet ID
  ! Enchantment ID
+
  ! State
  ! Enchantment Name
+
! Bound To
 +
  ! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 0
+
  |rowspan="8"| 0x16
  | minecraft:protection
+
|rowspan="8"| Play
  | Protection
+
|rowspan="8"| Client
 +
  | Sound Name
 +
| Identifier
 +
  | All sound effect names can be seen [https://pokechu22.github.io/Burger/1.19.html#sounds here].
 
  |-
 
  |-
  | 1
+
  | Sound Category
  | minecraft:fire_protection
+
  | VarInt Enum
  | Fire Protection
+
  | The category that this sound will be played from ([https://gist.github.com/konwboj/7c0c380d3923443e9d55 current categories]).
 
  |-
 
  |-
  | 2
+
  | Effect Position X
  | minecraft:feather_falling
+
  | Int
  | Feather Falling
+
  | Effect X multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part).
 
  |-
 
  |-
  | 3
+
  | Effect Position Y
  | minecraft:blast_protection
+
  | Int
  | Blast Protection
+
  | Effect Y multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part).
 
  |-
 
  |-
  | 4
+
  | Effect Position Z
  | minecraft:projectile_protection
+
  | Int
  | Projectile Protection
+
  | Effect Z multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part).
 
  |-
 
  |-
  | 5
+
  | Volume
  | minecraft:respiration
+
  | Float
  | Respiration
+
  | 1 is 100%, can be more.
 
  |-
 
  |-
  | 6
+
  | Pitch
  | minecraft:aqua_affinity
+
  | Float
  | Aqua Affinity
+
  | Float between 0.5 and 2.0 by Notchian clients.
 
  |-
 
  |-
  | 7
+
  | Seed
  | minecraft:thorns
+
  | long
  | Thorns
+
  | Seed used to pick sound variant.
 +
|}
 +
 
 +
==== Disconnect (play) ====
 +
 
 +
Sent by the server before it disconnects a client. The client assumes that the server has already closed the connection by the time the packet arrives.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 8
+
  | 0x17
  | minecraft:depth_strider
+
  | Play
  | Depth Strider
+
  | Client
 +
| Reason
 +
| [[Chat]]
 +
| Displayed to the client when the connection terminates.
 +
|}
 +
 
 +
==== Entity Event ====
 +
 
 +
Entity statuses generally trigger an animation for an entity.  The available statuses vary by the entity's type (and are available to subclasses of that type as well).
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 9
+
  |rowspan="2"| 0x18
  | minecraft:frost_walker
+
|rowspan="2"| Play
  | Frost Walker
+
|rowspan="2"| Client
 +
| Entity ID
 +
  | Int
 +
  |
 
  |-
 
  |-
  | 10
+
  | Entity Status
  | minecraft:binding_curse
+
  | Byte Enum
  | Curse of Binding
+
  | See [[Entity statuses]] for a list of which statuses are valid for each type of entity.
  |-
+
  |}
| 11
+
 
  | minecraft:soul_speed
+
==== Explode ====
  | Soul Speed
+
 
  |-
+
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).
  | 12
+
 
  | minecraft:sharpness
+
Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x
  | Sharpness
+
 
 +
{| class="wikitable"
 +
  ! Packet ID
 +
  ! State
 +
  ! Bound To
 +
  ! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | 13
+
  |rowspan="9"| 0x19
  | minecraft:smite
+
|rowspan="9"| Play
  | Smite
+
|rowspan="9"| Client
 +
| X
 +
  | Double
 +
  |
 
  |-
 
  |-
  | 14
+
  | Y
  | minecraft:bane_of_arthropods
+
  | Double
  | Bane of Arthropods
+
  |
 
  |-
 
  |-
  | 15
+
  | Z
  | minecraft:knockback
+
  | Double
  | Knockback
+
  |
 
  |-
 
  |-
  | 16
+
  | Strength
  | minecraft:fire_aspect
+
  | Float
  | Fire Aspect
+
  | 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.
 
  |-
 
  |-
  | 17
+
  | Record Count
  | minecraft:looting
+
  | VarInt
  | Looting
+
  | Number of elements in the following array.
 
  |-
 
  |-
  | 18
+
  | Records
  | minecraft:sweeping
+
  | Array of (Byte, Byte, Byte)
  | Sweeping Edge
+
  | Each record is 3 signed bytes long; the 3 bytes are the XYZ (respectively) signed offsets of affected blocks.
 
  |-
 
  |-
  | 19
+
  | Player Motion X
  | minecraft:efficiency
+
  | Float
  | Efficiency
+
  | X velocity of the player being pushed by the explosion.
 
  |-
 
  |-
  | 20
+
  | Player Motion Y
  | minecraft:silk_touch
+
  | Float
  | Silk Touch
+
  | Y velocity of the player being pushed by the explosion.
 
  |-
 
  |-
  | 21
+
  | Player Motion Z
  | minecraft:unbreaking
+
  | Float
  | Unbreaking
+
  | Z velocity of the player being pushed by the explosion.
 +
|}
 +
 
 +
==== Forget Level Chunk ====
 +
 
 +
Tells the client to unload a chunk column.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 22
+
  |rowspan="2"| 0x1A
  | minecraft:fortune
+
|rowspan="2"| Play
  | Fortune
+
|rowspan="2"| Client
 +
| Chunk X
 +
  | Int
 +
  | Block coordinate divided by 16, rounded down.
 
  |-
 
  |-
  | 23
+
  | Chunk Z
  | minecraft:power
+
  | Int
  | Power
+
  | Block coordinate divided by 16, rounded down.
 +
|}
 +
 
 +
It is legal to send this packet even if the given chunk is not currently loaded.
 +
 
 +
==== Game Event ====
 +
 
 +
Used for a wide variety of game state things, from weather to bed use to gamemode to demo messages.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 24
+
  |rowspan="2"| 0x1B
  | minecraft:punch
+
|rowspan="2"| Play
  | Punch
+
|rowspan="2"| Client
 +
| Reason
 +
  | Unsigned Byte
 +
  | See below.
 
  |-
 
  |-
  | 25
+
  | Value
  | minecraft:flame
+
  | Float
  | Flame
+
| Depends on Reason.
 +
|}
 +
 
 +
''Reason codes'':
 +
 
 +
{| class="wikitable"
 +
! Reason
 +
! Effect
 +
  ! Value
 
  |-
 
  |-
  | 26
+
  | 0
  | minecraft:infinity
+
  | No respawn block available
  | Infinity
+
  | Note: Sends message 'block.minecraft.spawn.not_valid'(You have no home bed or charged respawn anchor, or it was obstructed) to the client.
 
  |-
 
  |-
  | 27
+
  | 1
  | minecraft:luck_of_the_sea
+
  | End raining
  | Luck of the Sea
+
  |
 
  |-
 
  |-
  | 28
+
  | 2
  | minecraft:lure
+
  | Begin raining
  | Lure
+
  |
 
  |-
 
  |-
  | 29
+
  | 3
  | minecraft:loyalty
+
  | Change gamemode
  | Loyalty
+
  | 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 
  |-
 
  |-
  | 30
+
  | 4
  | minecraft:impaling
+
  | Win game
  | Impaling
+
  | 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.
 
  |-
 
  |-
  | 31
+
  | 5
  | minecraft:riptide
+
  | Demo event
  | Riptide
+
  | 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.
 
  |-
 
  |-
  | 32
+
  | 6
  | minecraft:channeling
+
  | Arrow hit player
  | Channeling
+
  | Note: Sent when any player is struck by an arrow.
 
  |-
 
  |-
  | 33
+
  | 7
  | minecraft:multishot
+
  | Rain level change
  | Multishot
+
  | Note: Seems to change both skycolor and lightning.<br>Rain level starting from 0 to 1.
 
  |-
 
  |-
  | 34
+
  | 8
  | minecraft:quick_charge
+
  | Thunder level change
  | Quick Charge
+
  | Note: Seems to change both skycolor and lightning (same as Rain level change, but doesn't start rain). It also requires rain to render by notchian client.<br>Thunder level starting from 0 to 1.
 
  |-
 
  |-
  | 35
+
  | 9
  | minecraft:piercing
+
  | Play pufferfish sting sound.
| Piercing
 
 
  |-
 
  |-
  | 36
+
  | 10
  | minecraft:mending
+
  | Play elder guardian mob appearance (effect and sound).
  | Mending
+
  |
 
  |-
 
  |-
  | 37
+
  | 11
  | minecraft:vanishing_curse
+
  | Enable respawn screen
  | Curse of Vanishing
+
  | 0: Enable respawn screen, 1: Immediately respawn (sent when the doImmediateRespawn gamerule changes).
 
  |}
 
  |}
  
==== Set Slot ====
+
==== Horse Screen Open ====
  
Sent by the server when an item in a slot (in a window) is added/removed.
+
This packet is used exclusively for opening the horse GUI.  [[#Open Screen|Open Screen]] is used for all other GUIs.  The client will not open the inventory if the Entity ID does not point to an horse-like animal.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,194: Line 2,255:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x16
+
  |rowspan="3"| 0x1C
 
  |rowspan="3"| Play
 
  |rowspan="3"| Play
 
  |rowspan="3"| Client
 
  |rowspan="3"| Client
 
  | Window ID
 
  | Window ID
  | Byte
+
  | Unsigned Byte
  | The window which is being updated. 0 for player inventory. Note that all known window types include the player inventory. This packet will only be sent for the currently opened window while the player is performing actions, even if it affects the player inventory. After the window is closed, a number of these packets are sent to update the player's inventory window (0).
+
  |
 
  |-
 
  |-
  | Slot
+
  | Slot count
  | Short
+
  | VarInt
  | The slot that should be updated.
+
  |
 
  |-
 
  |-
  | Slot Data
+
  | Entity ID
  | [[Slot Data|Slot]]
+
  | Integer
  |  
+
  |
 
  |}
 
  |}
  
To set the cursor (the item currently dragged with the mouse), use -1 as Window ID and as Slot.
+
==== Initialize World Border ====
 
 
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"
Line 2,226: Line 2,281:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x17
+
  |rowspan="8"| 0x1D
  |rowspan="2"| Play
+
  |rowspan="8"| Play
  |rowspan="2"| Client
+
  |rowspan="8"| Client
  | Item ID
+
  | 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
 
  | VarInt
  | Numeric ID of the item to apply a cooldown to.
+
  | In meters.
 
  |-
 
  |-
  | Cooldown Ticks
+
  | Warning Time
 
  | VarInt
 
  | VarInt
  | Number of ticks to apply a cooldown for, or 0 to clear the cooldown.
+
  | In seconds as set by <code>/worldborder warning time</code>.
 +
|-
 
  |}
 
  |}
  
==== Plugin Message (clientbound) ====
+
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:
  
{{Main|Plugin channels}}
+
<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) ====
  
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.
+
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.
  
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/]
+
The Notchian server uses a system-dependent time in milliseconds to generate the keep alive ID value.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,254: Line 2,343:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x18
+
  | 0x1E
  |rowspan="2"| Play
+
  | Play
  |rowspan="2"| Client
+
  | Client
  | Channel
+
  | Keep Alive ID
  | Identifier
+
  | Long
  | Name of the [[plugin channel]] used to send the data.
+
  |
|-
 
| Data
 
| Byte Array
 
| Any data, depending on the channel. <code>minecraft:</code> channels are documented [[plugin channel|here]].  The length of this array must be inferred from the packet length.
 
 
  |}
 
  |}
  
==== Named Sound Effect ====
+
==== Level Chunk With Light ====
{{See also|#Sound Effect}}
+
{{Main|Chunk Format}}
 +
{{See also|#Forget Level 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)}}
  
Used to play a sound effect on the client. Custom sounds may be added by resource packs.
+
The server only sends skylight information for chunk pillars in the {{Minecraft Wiki|Overworld}}, it's up to the client to know in which dimension the player is currently located. You can also infer this information from the primary bitmask and the amount of uncompressed bytes sent. This packet also sends all block entities in the chunk (though sending them is not required; it is still legal to send them with [[#Block Entity Data|Block Entity Data]] later).
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,275: Line 2,363:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  !colspan="2"| Field Name
  ! Field Type
+
  !colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="7"| 0x19
+
  |rowspan="25"| 0x1F
  |rowspan="7"| Play
+
  |rowspan="25"| Play
  |rowspan="7"| Client
+
  |rowspan="25"| Client
  | Sound Name
+
  |colspan="2"| Chunk X
  | Identifier
+
  |colspan="2"| Int
  | All sound effect names as of 1.16.5 can be seen [https://pokechu22.github.io/Burger/1.16.5.html#sounds here].
+
  | Chunk coordinate (block coordinate divided by 16, rounded down)
 +
|-
 +
|colspan="2"| Chunk Z
 +
|colspan="2"| Int
 +
| Chunk coordinate (block coordinate divided by 16, rounded down)
 
  |-
 
  |-
  | Sound Category
+
  |colspan="2"| Heightmaps
  | VarInt Enum
+
  |colspan="2"| [[NBT]]
  | The category that this sound will be played from ([https://gist.github.com/konwboj/7c0c380d3923443e9d55 current categories]).
+
  | Compound containing one long array named <code>MOTION_BLOCKING</code>, which is a heightmap for the highest solid block at each position in the chunk (as a compacted long array with 256 entries, with the number of bits per entry varying depending on the world's height, defined by the formula <code>ceil(log2(height + 1))</code>). The Notchian server also adds a <code>WORLD_SURFACE</code> long array, the purpose of which is unknown, but it's not required for the chunk to be accepted.
 
  |-
 
  |-
  | Effect Position X
+
  |colspan="2"| Size
  | Int
+
  |colspan="2"| VarInt
  | Effect X multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part).
+
  | Size of Data in bytes
 
  |-
 
  |-
  | Effect Position Y
+
  |colspan="2"| Data
  | Int
+
  |colspan="2"| Byte array
  | Effect Y multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part).
+
  | See [[Chunk Format#Data structure|data structure]] in Chunk Format
 
  |-
 
  |-
  | Effect Position Z
+
  |colspan="2"| Number of block entities
  | Int
+
  |colspan="2"| VarInt
  | Effect Z multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part).
+
  | Number of elements in the following array
 
  |-
 
  |-
  | Volume
+
  |rowspan="4" | Block Entity
  | Float
+
  | Packed XZ
  | 1 is 100%, can be more.
+
  |rowspan="4" | Array
 +
| Byte
 +
| The packed section coordinates, calculated from <code><nowiki>((blockX & 15) << 4) | (blockZ & 15)</nowiki></code>
 
  |-
 
  |-
  | Pitch
+
  | Y
  | Float
+
  | Short
  | Float between 0.5 and 2.0 by Notchian clients.
+
  | The height relative to the world
 +
|-
 +
| Type
 +
| VarInt
 +
| The type of block entity
 +
|-
 +
| Data
 +
| [[NBT]]
 +
| The block entity's data, without the X, Y, and Z values
 +
|-
 +
|colspan="2"| Trust Edges
 +
|colspan="2"| Boolean
 +
| If edges should be trusted for light updates.
 +
|-
 +
|colspan="2"| Sky Light Mask
 +
|colspan="2"| BitSet
 +
| BitSet containing bits for each section in the world + 2. Each set bit indicates that the corresponding 16×16×16 chunk section has data in the Sky Light array below.  The least significant bit is for blocks 16 blocks to 1 block below the min world height (one section below the world), while the most significant bit covers blocks 1 to 16 blocks above the max world height (one section above the world).
 +
|-
 +
|colspan="2"| Block Light Mask
 +
|colspan="2"| BitSet
 +
| BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has data in the Block Light array below.  The order of bits is the same as in Sky Light Mask.
 +
|-
 +
|colspan="2"| Empty Sky Light Mask
 +
|colspan="2"| BitSet
 +
| BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has all zeros for its Sky Light data.  The order of bits is the same as in Sky Light Mask.
 +
|-
 +
|colspan="2"| Empty Block Light Mask
 +
|colspan="2"| BitSet
 +
| BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has all zeros for its Block Light data.  The order of bits is the same as in Sky Light Mask.
 +
|-
 +
|colspan="2"| Sky Light array count
 +
|colspan="2"| VarInt
 +
| Number of entries in the following array; should match the number of bits set in Sky Light Mask
 +
|-
 +
|rowspan="2"| Sky Light arrays
 +
| Length
 +
|rowspan="2"| Array
 +
| VarInt
 +
| Length of the following array in bytes (always 2048)
 +
|-
 +
| Sky Light array
 +
| Array of 2048 bytes
 +
| There is 1 array for each bit set to true in the sky light mask, starting with the lowest value.  Half a byte per light value. Indexed <code><nowiki>((y<<8) | (z<<4) | x) / 2 </nowiki></code> If there's a remainder, masked 0xF0 else 0x0F.
 +
|-
 +
|colspan="2"| Block Light array count
 +
|colspan="2"| VarInt
 +
| Number of entries in the following array; should match the number of bits set in Block Light Mask
 +
|-
 +
|rowspan="2"| 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. Indexed <code><nowiki>((y<<8) | (z<<4) | x) / 2 </nowiki></code> If there's a remainder, masked 0xF0 else 0x0F.
 
  |}
 
  |}
  
==== Disconnect (play) ====
+
Note that the Notchian client requires an [[#Set Chunk Cache Center|Set Chunk Cache Center]] 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.
  
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.
+
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>
  
{| class="wikitable"
+
<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>
! Packet ID
+
<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>
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
| 0x1A
 
| Play
 
| Client
 
| Reason
 
| [[Chat]]
 
| Displayed to the client when the connection terminates.
 
|}
 
  
==== Entity Status ====
+
==== Level Event ====
 +
Sent when a client is to play a sound or particle effect.
  
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).
+
By default, the Minecraft client adjusts the volume of sound effects based on distance. The final boolean field is used to disable this, and instead the effect is played from 2 blocks away in the correct direction. Currently this is only used for effect 1023 (wither spawn), effect 1028 (enderdragon death), and effect 1038 (end portal opening); it is ignored on other effects.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,343: Line 2,483:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x1B
+
  |rowspan="4"| 0x20
  |rowspan="2"| Play
+
  |rowspan="4"| Play
  |rowspan="2"| Client
+
  |rowspan="4"| Client
  | Entity ID
+
  | Effect ID
 +
| Int
 +
| The ID of the effect, see below.
 +
|-
 +
| Location
 +
| Position
 +
| The location of the effect.
 +
|-
 +
| Data
 
  | Int
 
  | Int
  |  
+
  | Extra data for certain effects, see below.
 
  |-
 
  |-
  | Entity Status
+
  | Disable Relative Volume
  | Byte Enum
+
  | Boolean
  | See [[Entity statuses]] for a list of which statuses are valid for each type of entity.
+
  | See above.
 
  |}
 
  |}
  
==== Explosion ====
+
Effect IDs:
 
 
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
+
  ! ID
  ! State
+
  ! Name
! Bound To
+
  ! Data
! Field Name
 
  ! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="9"| 0x1C
+
  !colspan="3"| Sound
|rowspan="9"| Play
 
|rowspan="9"| Client
 
| X
 
| Float
 
|
 
 
  |-
 
  |-
  | Y
+
  | 1000
  | Float
+
  | Dispenser dispenses
  |  
+
|
 +
|-
 +
| 1001
 +
| Dispenser fails to dispense
 +
|
 +
|-
 +
| 1002
 +
| Dispenser shoots
 +
  |
 
  |-
 
  |-
  | Z
+
  | 1003
  | Float
+
  | Ender eye launched
  |  
+
  |
 
  |-
 
  |-
  | Strength
+
  | 1004
  | Float
+
  | Firework shot
  | A strength greater than or equal to 2.0 spawns a <code>minecraft:explosion_emitter</code> particle, while a lesser strength spawns a <code>minecraft:explosion</code> particle.
+
  |
 
  |-
 
  |-
  | Record Count
+
  | 1005
  | VarInt
+
  | Iron door opened
  | Number of elements in the following array.
+
  |
 
  |-
 
  |-
  | Records
+
  | 1006
  | Array of (Byte, Byte, Byte)
+
  | Wooden door opened
  | Each record is 3 signed bytes long; the 3 bytes are the XYZ (respectively) signed offsets of affected blocks.
+
  |
 
  |-
 
  |-
  | Player Motion X
+
  | 1007
  | Float
+
  | Wooden trapdoor opened
  | X velocity of the player being pushed by the explosion.
+
  |
 
  |-
 
  |-
  | Player Motion Y
+
  | 1008
  | Float
+
  | Fence gate opened
  | Y velocity of the player being pushed by the explosion.
+
  |
 
  |-
 
  |-
  | Player Motion Z
+
  | 1009
  | Float
+
  | Fire extinguished
  | Z velocity of the player being pushed by the explosion.
+
  |
  |}
+
  |-
 
+
| 1010
==== Unload Chunk ====
+
  | Play record
 
+
  | Special case, see below for more info.
Tells the client to unload a chunk column.
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
  ! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x1D
+
  | 1011
|rowspan="2"| Play
+
  | Iron door closed
|rowspan="2"| Client
+
  |
| Chunk X
 
  | Int
 
  | Block coordinate divided by 16, rounded down.
 
 
  |-
 
  |-
  | Chunk Z
+
  | 1012
  | Int
+
  | Wooden door closed
  | Block coordinate divided by 16, rounded down.
+
  |
|}
 
 
 
It is legal to send this packet even if the given chunk is not currently loaded.
 
 
 
==== Change Game State ====
 
 
 
Used for a wide variety of game state things, from weather to bed use to gamemode to demo messages.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="2"| 0x1E
+
  | 1013
|rowspan="2"| Play
+
  | Wooden trapdoor closed
|rowspan="2"| Client
+
  |
| Reason
 
  | Unsigned Byte
 
  | See below.
 
 
  |-
 
  |-
  | Value
+
  | 1014
  | Float
+
  | Fence gate closed
  | Depends on Reason.
+
  |
|}
 
 
 
''Reason codes'':
 
 
 
{| class="wikitable"
 
! Reason
 
! Effect
 
! Value
 
 
  |-
 
  |-
  | 0
+
  | 1015
  | No respawn block available
+
  | Ghast warns
  | 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
+
  | 1016
  | End raining
+
  | Ghast shoots
  |  
+
  |
 
  |-
 
  |-
  | 2
+
  | 1017
  | Begin raining
+
  | Enderdragon shoots
  |  
+
  |
 
  |-
 
  |-
  | 3
+
  | 1018
  | Change gamemode
+
  | Blaze shoots
  | 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
+
  |
 
  |-
 
  |-
  | 4
+
  | 1019
  | Win game
+
  | Zombie attacks wood door
  | 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
+
  | 1020
  | Demo event
+
  | Zombie attacks iron door
  | 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
+
  | 1021
  | Rain level change
+
  | Zombie breaks wood door
  | 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
+
  | 1022
  | Thunder level change
+
  | Wither breaks block
  | 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
+
  | 1023
  | Play pufferfish sting sound.
+
| Wither spawned
 +
  |
 
  |-
 
  |-
  | 10
+
  | 1024
  | Play elder guardian mob appearance (effect and sound).
+
  | Wither shoots
  |  
+
  |
 
  |-
 
  |-
  | 11
+
  | 1025
  | Enable respawn screen
+
  | Bat takes off
  | 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.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x1F
+
  | 1026
|rowspan="3"| Play
+
  | Zombie infects
|rowspan="3"| Client
 
| Window ID?
 
  | Byte
 
 
  |
 
  |
 
  |-
 
  |-
  | Number of slots?
+
  | 1027
  | VarInt
+
  | Zombie villager converted
 
  |
 
  |
 
  |-
 
  |-
  | Entity ID?
+
  | 1028
  | Integer
+
  | Ender dragon death
 
  |
 
  |
|}
 
 
==== Initialize World Border ====
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="8"| 0x20
+
  | 1029
  |rowspan="8"| Play
+
| Anvil destroyed
  |rowspan="8"| Client
+
  |
  | X
+
  |-
  | Double
+
  | 1030
  |  
+
  | Anvil used
 +
  |
 
  |-
 
  |-
  | Z
+
  | 1031
  | Double
+
  | Anvil landed
  |  
+
  |
 
  |-
 
  |-
  | Old Diameter
+
  | 1032
  | Double
+
  | Portal travel
  | Current length of a single side of the world border, in meters.
+
  |
 
  |-
 
  |-
  | New Diameter
+
  | 1033
  | Double
+
  | Chorus flower grown
  | Target length of a single side of the world border, in meters.
+
  |
 
  |-
 
  |-
  | Speed
+
  | 1034
  | VarLong
+
  | Chorus flower died
  | 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
+
  | 1035
  | VarInt
+
  | Brewing stand brewed
  | Resulting coordinates from a portal teleport are limited to ±value. Usually 29999984.
+
  |
 
  |-
 
  |-
  | Warning Blocks
+
  | 1036
  | VarInt
+
  | Iron trapdoor opened
  | In meters.
+
  |
 
  |-
 
  |-
  | Warning Time
+
  | 1037
  | VarInt
+
  | Iron trapdoor closed
  | In seconds as set by <code>/worldborder warning time</code>.
+
  |
 
  |-
 
  |-
  |}
+
  | 1038
 
+
| End portal created in overworld
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) ====
 
 
 
The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same payload (see [[#Keep Alive (serverbound)|serverbound Keep Alive]]). If the client does not respond to them for over 30 seconds, the server kicks the client. Vice versa, if the server does not send any keep-alives for 20 seconds, the client will disconnect and yields a "Timed out" exception.
 
 
 
The Notchian server uses a system-dependent time in milliseconds to generate the keep alive ID value.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  | 0x21
+
  | 1039
  | Play
+
  | Phantom bites
  | 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).
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="11"| 0x22
+
  | 1040
|rowspan="11"| Play
+
  | Zombie converts to drowned
|rowspan="11"| Client
+
  |
| Chunk X
 
  | Int
 
  | Chunk coordinate (block coordinate divided by 16, rounded down)
 
 
  |-
 
  |-
  | Chunk Z
+
  | 1041
  | Int
+
  | Husk converts to zombie by drowning
  | Chunk coordinate (block coordinate divided by 16, rounded down)
+
|
 +
|-
 +
| 1042
 +
| Grindstone used
 +
  |
 
  |-
 
  |-
  | Bit Mask Length
+
  | 1043
  | VarInt
+
  | Book page turned
  | 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
+
  !colspan="3"| Particle
| [[NBT]]
 
| Compound containing one long array named <code>MOTION_BLOCKING</code>, which is a heightmap for the highest solid block at each position in the chunk (as a compacted long array with 256 entries at 9 bits per entry totaling 36 longs). The Notchian server also adds a <code>WORLD_SURFACE</code> long array, the purpose of which is unknown, but it's not required for the chunk to be accepted.
 
|-
 
| Biomes length
 
| VarInt
 
| Size of the following array; should always be 1024.
 
 
  |-
 
  |-
  | Biomes
+
  | 1500
  | Array of VarInt
+
  | Composter composts
  | 1024 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
+
  | 1501
  | Byte array
+
  | Lava converts block (either water to stone, or removes existing blocks such as torches)
  | See [[Chunk Format#Data structure|data structure]] in Chunk Format
+
  |
 
  |-
 
  |-
  | Number of block entities
+
  | 1502
  | VarInt
+
  | Redstone torch burns out
  | Number of elements in the following array
+
  |
 
  |-
 
  |-
  | Block entities
+
  | 1503
  | Array of [[NBT|NBT Tag]]
+
  | Ender eye placed
  | 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.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="4"| 0x23
+
  | 2000
|rowspan="4"| Play
+
  | Spawns 10 smoke particles, e.g. from a fire
|rowspan="4"| Client
+
  | Direction, see below.
| Effect ID
 
  | Int
 
  | The ID of the effect, see below.
 
 
  |-
 
  |-
  | Location
+
  | 2001
  | Position
+
  | Block break + block break sound
  | The location of the effect.
+
  | Block state, as an index into the global palette.
 
  |-
 
  |-
  | Data
+
  | 2002
  | Int
+
  | Splash potion. Particle effect + glass break sound.
  | Extra data for certain effects, see below.
+
  | RGB color as an integer (e.g. 8364543 for #7FA1FF).
 
  |-
 
  |-
  | Disable Relative Volume
+
  | 2003
  | Boolean
+
  | Eye of Ender entity break animation — particles and sound
  | See above.
+
  |
|}
 
 
 
Effect IDs:
 
 
 
{| class="wikitable"
 
! ID
 
! Name
 
! Data
 
 
  |-
 
  |-
  !colspan="3"| Sound
+
  | 2004
 +
| Mob spawn particle effect: smoke + flames
 +
|
 
  |-
 
  |-
  | 1000
+
  | 2005
  | Dispenser dispenses
+
  | Bonemeal particles
  |  
+
  | How many particles to spawn (if set to 0, 15 are spawned).
 
  |-
 
  |-
  | 1001
+
  | 2006
  | Dispenser fails to dispense
+
  | Dragon breath
  |  
+
  |
 
  |-
 
  |-
  | 1002
+
  | 2007
  | Dispenser shoots
+
  | Instant splash potion. Particle effect + glass break sound.
  |  
+
  | RGB color as an integer (e.g. 8364543 for #7FA1FF).
 
  |-
 
  |-
  | 1003
+
  | 2008
  | Ender eye launched
+
  | Ender dragon destroys block
  |  
+
  |
 
  |-
 
  |-
  | 1004
+
  | 2009
  | Firework shot
+
  | Wet sponge vaporizes in nether
  |  
+
  |
 
  |-
 
  |-
  | 1005
+
  | 3000
  | Iron door opened
+
  | End gateway spawn
  |  
+
  |
 
  |-
 
  |-
  | 1006
+
  | 3001
  | Wooden door opened
+
  | Enderdragon growl
  |  
+
  |
 
  |-
 
  |-
  | 1007
+
  | 3002
  | Wooden trapdoor opened
+
  | Electric spark
  |  
+
  |
 
  |-
 
  |-
  | 1008
+
  | 3003
  | Fence gate opened
+
  | Copper apply wax
  |  
+
  |
 
  |-
 
  |-
  | 1009
+
  | 3004
  | Fire extinguished
+
  | Copper remove wax
  |  
+
  |
 
  |-
 
  |-
  | 1010
+
  | 3005
  | Play record
+
  | Copper scrape oxidation
  | Special case, see below for more info.
+
  |
 +
|}
 +
 
 +
Smoke directions:
 +
 
 +
{| class="wikitable"
 +
! ID
 +
! Direction
 
  |-
 
  |-
  | 1011
+
  | 0
| Iron door closed
+
  | Down
  |  
 
 
  |-
 
  |-
  | 1012
+
  | 1
| Wooden door closed
+
  | Up
  |  
 
 
  |-
 
  |-
  | 1013
+
  | 2
| Wooden trapdoor closed
+
  | North
  |  
 
 
  |-
 
  |-
  | 1014
+
  | 3
| Fence gate closed
+
  | South
  |  
 
 
  |-
 
  |-
  | 1015
+
  | 4
| Ghast warns
+
  | West
  |  
 
 
  |-
 
  |-
  | 1016
+
  | 5
  | Ghast shoots
+
  | East
  |  
+
  |}
 +
 
 +
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.
 +
 
 +
==== Level Particle ====
 +
 
 +
Displays the named particle
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 1017
+
  |rowspan="12"| 0x21
  | Enderdragon shoots
+
  |rowspan="12"| Play
  |  
+
  |rowspan="12"| Client
 +
| Particle ID
 +
| VarInt
 +
| The particle ID listed in [[#Level Particle|the particle data type]].
 
  |-
 
  |-
  | 1018
+
  | Long Distance
  | Blaze shoots
+
  | Boolean
  |  
+
  | If true, particle distance increases from 256 to 65536.
 
  |-
 
  |-
  | 1019
+
  | X
  | Zombie attacks wood door
+
  | Double
  |  
+
  | X position of the particle.
 
  |-
 
  |-
  | 1020
+
  | Y
  | Zombie attacks iron door
+
  | Double
  |  
+
  | Y position of the particle.
 
  |-
 
  |-
  | 1021
+
  | Z
  | Zombie breaks wood door
+
  | Double
  |
+
  | Z position of the particle.
 
  |-
 
  |-
  | 1022
+
  | Offset X
  | Wither breaks block
+
  | Float
  |
+
  | This is added to the X position after being multiplied by <code>random.nextGaussian()</code>.
 
  |-
 
  |-
  | 1023
+
  | Offset Y
  | Wither spawned
+
  | Float
  |  
+
  | This is added to the Y position after being multiplied by <code>random.nextGaussian()</code>.
 
  |-
 
  |-
  | 1024
+
  | Offset Z
  | Wither shoots
+
  | Float
  |
+
  | This is added to the Z position after being multiplied by <code>random.nextGaussian()</code>.
 
  |-
 
  |-
  | 1025
+
  | Max Speed
  | Bat takes off
+
  | Float
 
  |
 
  |
 
  |-
 
  |-
  | 1026
+
  | Particle Count
  | Zombie infects
+
  | Int
  |
+
  | The number of particles to create.
 
  |-
 
  |-
  | 1027
+
  | Data
  | Zombie villager converted
+
  | Varies
  |
+
  | The variable data listed in [[#Level Particle|the particle data type]].
 +
|}
 +
 
 +
==== Light Update ====
 +
 
 +
Updates light levels for a chunk.  See {{Minecraft Wiki|Light}} for information on how lighting works in Minecraft.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
!colspan="2"| Field Name
 +
!colspan="2"| Field Type
 +
! Notes
 
  |-
 
  |-
  | 1028
+
  |rowspan="13"| 0x22
  | Ender dragon death
+
|rowspan="13"| Play
  |
+
|rowspan="13"| Client
 +
  |colspan="2"| Chunk X
 +
|colspan="2"| VarInt
 +
  | Chunk coordinate (block coordinate divided by 16, rounded down)
 
  |-
 
  |-
  | 1029
+
  |colspan="2"| Chunk Z
  | Anvil destroyed
+
  |colspan="2"| VarInt
  |  
+
  | Chunk coordinate (block coordinate divided by 16, rounded down)
 
  |-
 
  |-
  | 1030
+
  |colspan="2"| Trust Edges
  | Anvil used
+
  |colspan="2"| Boolean
  |  
+
  | If edges should be trusted for light updates.
 
  |-
 
  |-
  | 1031
+
  |colspan="2"| Sky Light Mask
  | Anvil landed
+
  |colspan="2"| BitSet
  |
+
  | BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has data in the Sky Light array below.  The least significant bit is for blocks 16 blocks to 1 block below the min world height (one section below the world), while the most significant bit covers blocks 1 to 16 blocks above the max world height (one section above the world).
 
  |-
 
  |-
  | 1032
+
  |colspan="2"| Block Light Mask
  | Portal travel
+
  |colspan="2"| BitSet
  |  
+
  | BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has data in the Block Light array below.  The order of bits is the same as in Sky Light Mask.
 
  |-
 
  |-
  | 1033
+
  |colspan="2"| Empty Sky Light Mask
  | Chorus flower grown
+
  |colspan="2"| BitSet
  |
+
  | BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has all zeros for its Sky Light data.  The order of bits is the same as in Sky Light Mask.
 
  |-
 
  |-
  | 1034
+
  |colspan="2"| Empty Block Light Mask
  | Chorus flower died
+
  |colspan="2"| BitSet
  |  
+
  | BitSet containing bits for each section in the world + 2.  Each set bit indicates that the corresponding 16×16×16 chunk section has all zeros for its Block Light data.  The order of bits is the same as in Sky Light Mask.
 
  |-
 
  |-
  | 1035
+
  |colspan="2"| Sky Light array count
  | Brewing stand brewed
+
  |colspan="2"| VarInt
  |
+
  | Number of entries in the following array; should match the number of bits set in Sky Light Mask
 
  |-
 
  |-
  | 1036
+
  |rowspan="2"| Sky Light arrays
  | Iron trapdoor opened
+
| Length
  |  
+
|rowspan="2"| Array
 +
  | VarInt
 +
  | Length of the following array in bytes (always 2048)
 
  |-
 
  |-
  | 1037
+
  | Sky Light array
  | Iron trapdoor closed
+
  | 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.
 
  |-
 
  |-
  | 1038
+
  |colspan="2"| Block Light array count
  | End portal created in overworld
+
  |colspan="2"| VarInt
  |
+
  | Number of entries in the following array; should match the number of bits set in Block Light Mask
 
  |-
 
  |-
  | 1039
+
  |rowspan="2"| Block Light arrays
  | Phantom bites
+
| Length
  |
+
|rowspan="2"| Array
 +
  | VarInt
 +
  | Length of the following array in bytes (always 2048)
 
  |-
 
  |-
  | 1040
+
  | Block Light array
  | Zombie converts to drowned
+
  | 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.
  |-
+
  |}
  | 1041
+
 
  | Husk converts to zombie by drowning
+
A bit will never be set in both the block light mask and the empty block light mask, though it may be present in neither of them (if the block light does not need to be updated for the corresponding chunk section). The same applies to the sky light mask and the empty sky light mask.
  |
+
 
 +
==== Login (play) ====
 +
 
 +
See [[Protocol Encryption]] for information on logging in.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
  ! Bound To
 +
! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | 1042
+
  |rowspan="20"| 0x23
  | Grindstone used
+
|rowspan="20"| Play
  |
+
|rowspan="20"| Client
 +
| Entity ID
 +
  | Int
 +
  | The player's Entity ID (EID).
 
  |-
 
  |-
  | 1043
+
  | Is hardcore
  | Book page turned
+
  | Boolean
 
  |
 
  |
 
  |-
 
  |-
 +
| Gamemode
 +
| Unsigned Byte
 +
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 
  |-
 
  |-
  !colspan="3"| Particle
+
  | 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)
 
  |-
 
  |-
  | 1500
+
  | Dimension Count
  | Composter composts
+
  | VarInt
  |
+
  | Size of the following array.
 
  |-
 
  |-
  | 1501
+
  | Dimension Names
  | Lava converts block (either water to stone, or removes existing blocks such as torches)
+
  | Array of Identifier
  |
+
  | Identifiers for all dimensions on the server.
 
  |-
 
  |-
  | 1502
+
  | Registry Codec
  | Redstone torch burns out
+
  | [[NBT|NBT Tag Compound]]
|
+
  | Represents certain registries that are sent from the server and are applied on the client.
|-
 
| 1503
 
| Ender eye placed
 
  |
 
 
  |-
 
  |-
  | 2000
+
  | Dimension Type
  | Spawns 10 smoke particles, e.g. from a fire
+
  | Identifier
  | Direction, see below.
+
  | Name of the dimension type being spawned into.
 
  |-
 
  |-
  | 2001
+
  | Dimension Name
  | Block break + block break sound
+
  | Identifier
  | Block state, as an index into the global palette.
+
  | Name of the dimension being spawned into.
 
  |-
 
  |-
  | 2002
+
  | Hashed seed
  | Splash potion. Particle effect + glass break sound.
+
  | Long
  | RGB color as an integer (e.g. 8364543 for #7FA1FF).
+
  | First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
 
  |-
 
  |-
  | 2003
+
  | Max Players
  | Eye of Ender entity break animation — particles and sound
+
  | VarInt
  |  
+
  | Was once used by the client to draw the player list, but now is ignored.
 
  |-
 
  |-
  | 2004
+
  | View Distance
  | Mob spawn particle effect: smoke + flames
+
  | VarInt
  |  
+
  | Render distance (2-32).
 
  |-
 
  |-
  | 2005
+
  | Simulation Distance
  | Bonemeal particles
+
  | VarInt
  | How many particles to spawn (if set to 0, 15 are spawned).
+
  | The distance that the client will process specific things, such as entities.
 
  |-
 
  |-
  | 2006
+
  | Reduced Debug Info
  | Dragon breath
+
  | 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.
 
  |-
 
  |-
  | 2007
+
  | Enable respawn screen
  | Instant splash potion. Particle effect + glass break sound.
+
  | Boolean
  | RGB color as an integer (e.g. 8364543 for #7FA1FF).
+
  | Set to false when the doImmediateRespawn gamerule is true.
 
  |-
 
  |-
  | 2008
+
  | Is Debug
  | Ender dragon destroys block
+
  | Boolean
  |
+
  | True if the world is a {{Minecraft Wiki|debug mode}} world; debug mode worlds cannot be modified and have predefined blocks.
 
  |-
 
  |-
  | 2009
+
  | Is Flat
  | Wet sponge vaporizes in nether
+
  | 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.
 
  |-
 
  |-
  | 3000
+
  | Has death location
  | End gateway spawn
+
  | Boolean
  |  
+
  | If true, then the next two fields are present.
 
  |-
 
  |-
  | 3001
+
  | Death dimension name
  | Enderdragon growl
+
  | Identifier
  |
+
  | Name of the dimension the player died in.
 
  |-
 
  |-
  | 3002
+
  | Death location
  | Electric spark
+
  | Position
  |
+
  | The location that the player died at.
 +
|}
 +
 
 +
 
 +
The '''Registry Codec''' NBT Tag Compound ([https://gist.github.com/joserobjr/d877abd88767eda006ee2d1d8779b176 Default value in SNBT]) includes three registries: "minecraft:dimension_type", "minecraft:worldgen/biome", and "minecraft:chat_type".
 +
 
 +
{| class="wikitable"
 +
!Name
 +
!Type
 +
!style="width: 250px;" colspan="2"| Notes
 
  |-
 
  |-
  | 3003
+
  | minecraft:dimension_type
  | Copper apply wax
+
  | TAG_Compound
  |
+
  | The dimension type registry (see below).
 
  |-
 
  |-
  | 3004
+
  | minecraft:worldgen/biome
  | Copper remove wax
+
  | TAG_Compound
  |
+
  | The biome registry (see below).
 
  |-
 
  |-
  | 3005
+
  | minecraft:chat_type
  | Copper scrape oxidation
+
  | TAG_Compound
  |
+
  | The chat type registry (see below).
 
  |}
 
  |}
  
Smoke directions:
+
Dimension type registry:
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! ID
+
  !Name
  ! Direction
+
  !Type
 +
!style="width: 250px;" colspan="2"| Notes
 
  |-
 
  |-
  | 0
+
  | type
  | Down
+
  | TAG_String
 +
| The name of the registry. Always "minecraft:dimension_type".
 
  |-
 
  |-
  | 1
+
  | value
  | Up
+
  | TAG_List
  |-
+
  | List of dimension types registry entries (see below).
| 2
 
| North
 
|-
 
| 3
 
| South
 
|-
 
| 4
 
| West
 
|-
 
| 5
 
| East
 
 
  |}
 
  |}
  
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.
+
Dimension type registry entry:
  
==== Particle ====
+
{| class="wikitable"
 +
!Name
 +
!Type
 +
!style="width: 250px;" colspan="2"| Notes
 +
|-
 +
| name
 +
| TAG_String
 +
| The name of the dimension type (for example, "minecraft:overworld").
 +
|-
 +
| id
 +
| TAG_Int
 +
| The protocol ID of the dimension (matches the index of the element in the registry list).
 +
|-
 +
| element
 +
| TAG_Compound
 +
| The dimension type (see below).
 +
|}
  
Displays the named particle
+
Dimension type:
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  ! Name
  ! State
+
  ! Type
! Bound To
+
  !style="width: 250px;" colspan="2"| Meaning
  ! Field Name
+
  ! Values
! Field Type
 
  ! Notes
 
 
  |-
 
  |-
  |rowspan="11"| 0x24
+
  | piglin_safe
  |rowspan="11"| Play
+
  | TAG_Byte
  |rowspan="11"| Client
+
  |colspan="2"| Whether piglins shake and transform to zombified piglins.
  | Particle ID
+
  | 1: true, 0: false.
| Int
 
| The particle ID listed in [[#Particle|the particle data type]].
 
 
  |-
 
  |-
  | Long Distance
+
  | has_raids
  | Boolean
+
  | TAG_Byte
  | If true, particle distance increases from 256 to 65536.
+
  |colspan="2"| Whether players with the Bad Omen effect can cause a raid.
 +
| 1: true, 0: false.
 
  |-
 
  |-
  | X
+
  | monster_spawn_light_level
  | Double
+
  | TAG_Int
  | X position of the particle.
+
|colspan="2"|
 +
  |
 
  |-
 
  |-
  | Y
+
  | monster_spawn_block_light_limit
  | Double
+
  | TAG_Int
  | Y position of the particle.
+
|colspan="2"|
 +
  |
 
  |-
 
  |-
  | Z
+
  | natural
  | Double
+
  | TAG_Byte
  | Z position of the particle.
+
  |colspan="2"| When false, compasses spin randomly. When true, nether portals can spawn zombified piglins.
 +
| 1: true, 0: false.
 
  |-
 
  |-
  | Offset X
+
  | ambient_light
  | Float
+
  | TAG_Float
  | This is added to the X position after being multiplied by <code>random.nextGaussian()</code>.
+
  |colspan="2"| How much light the dimension has.
 +
| 0.0 to 1.0.
 
  |-
 
  |-
  | Offset Y
+
  | fixed_time
  | Float
+
  | Optional TAG_Long
  | This is added to the Y position after being multiplied by <code>random.nextGaussian()</code>.
+
  |colspan="2"| If set, the time of the day is the specified value.
 +
| If set, 0 to 24000.
 
  |-
 
  |-
  | Offset Z
+
  | infiniburn
  | Float
+
  | TAG_String
  | This is added to the Z position after being multiplied by <code>random.nextGaussian()</code>.
+
  |colspan="2"| A resource location defining what block tag to use for infiniburn.
 +
| "#" or minecraft resource "#minecraft:...".
 
  |-
 
  |-
  | Particle Data
+
  | respawn_anchor_works
  | Float
+
  | TAG_Byte
  | The data of each particle.
+
  |colspan="2"| Whether players can charge and use respawn anchors.
 +
| 1: true, 0: false.
 
  |-
 
  |-
  | Particle Count
+
  | has_skylight
  | Int
+
  | TAG_Byte
  | The number of particles to create.
+
  |colspan="2"| Whether the dimension has skylight access or not.
 +
| 1: true, 0: false.
 
  |-
 
  |-
  | Data
+
  | bed_works
  | Varies
+
  | TAG_Byte
  | The variable data listed in [[#Particle|the particle data type]].
+
  |colspan="2"| Whether players can use a bed to sleep.
|}
+
  | 1: true, 0: false.
 
 
==== Update Light ====
 
 
 
Updates light levels for a chunk.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
!colspan="2"| Field Name
 
  !colspan="2"| Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="17"| 0x25
+
  | effects
  |rowspan="17"| Play
+
  | TAG_String
  |rowspan="17"| Client
+
  |colspan="2"| ?
  |colspan="2"| Chunk X
+
  | "minecraft:overworld", "minecraft:the_nether", "minecraft:the_end" or something else.
|colspan="2"| VarInt
 
| Chunk coordinate (block coordinate divided by 16, rounded down)
 
 
  |-
 
  |-
  |colspan="2"| Chunk Z
+
  | min_y
  |colspan="2"| VarInt
+
| TAG_Int
  | Chunk coordinate (block coordinate divided by 16, rounded down)
+
  |colspan="2"| The minimum Y level.
 +
  | A multiple of 16. Example: -64
 
  |-
 
  |-
  |colspan="2"| Trust Edges
+
  | height
  |colspan="2"| Boolean
+
| TAG_Int
  | If edges should be trusted for light updates.
+
  |colspan="2"| The maximum height.
 +
  | A multiple of 16. Example: 256
 
  |-
 
  |-
  |colspan="2"| Length 1
+
  | logical_height
  |colspan="2"| VarInt
+
| TAG_Int
  | Length of the following array
+
  |colspan="2"| The maximum height to which chorus fruits and nether portals can bring players within this dimension.
 +
  | 0-384.
 
  |-
 
  |-
  |colspan="2"| Sky Light Mask
+
  | coordinate_scale
  |colspan="2"| Array of Long
+
| TAG_Double
  | 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"| The multiplier applied to coordinates when traveling to the dimension.
 +
  | 0.00001 - 30000000.0
 
  |-
 
  |-
  |colspan="2"| Length 2
+
  | ultrawarm
  |colspan="2"| VarInt
+
| TAG_Byte
  | Length of the following array
+
  |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.
 
  |-
 
  |-
  |colspan="2"| Block Light Mask
+
| has_ceiling
  |colspan="2"| Array of Long
+
| TAG_Byte
| BitSet containing bits for each sections in the world + 2, same order as sky light
+
  |colspan="2"| Whether the dimension has a bedrock ceiling or not. When true, causes lava to spread faster.
 +
| 1: true, 0: false.
 +
  |}
 +
 
 +
Biome registry:
 +
 
 +
{| class="wikitable"
 +
!Name
 +
!Type
 +
!style="width: 250px;" colspan="2"| Notes
 
  |-
 
  |-
  |colspan="2"| Length 3
+
  | type
  |colspan="2"| VarInt
+
  | TAG_String
  | Length of the following array
+
  | The name of the registry. Always "minecraft:worldgen/biome".
 
  |-
 
  |-
  |colspan="2"| Empty Sky Light Mask
+
  | value
  |colspan="2"| Array of Long
+
  | TAG_List
  | BitSet containing a variable amount of bits (see sky/block light) which indicates sections that have 0 for all their sky light values
+
  | List of biome registry entries (see below).
  |-
+
  |}
|colspan="2"| Length 4
+
 
  |colspan="2"| VarInt
+
Biome registry entry:
| Length of the following array
+
 
 +
{| class="wikitable"
 +
  !Name
 +
!Type
 +
!style="width: 250px;" colspan="2"| Notes
 
  |-
 
  |-
  |colspan="2"| Empty Block Light Mask
+
  | name
  |colspan="2"| Array of Long
+
  | TAG_String
  | BitSet containing a variable amount of bits (see sky/block light) which indicates sections that have 0 for all their block light values
+
  | The name of the biome (for example, "minecraft:ocean").
 
  |-
 
  |-
  |colspan="2"| Sky Light array count
+
  | id
  |colspan="2"| VarInt
+
  | TAG_Int
  | Number of entries in the following array
+
  | The protocol ID of the biome (matches the index of the element in the registry list).
 
  |-
 
  |-
  |rowspan="2"| Sky Light arrays
+
  | element
| Length
+
  | TAG_Compound
|rowspan="2"| Array
+
  | The biome properties (see below).
| 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 ====
+
Biome properties:
 
 
See [[Protocol Encryption]] for information on logging in.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  !colspan="3"|Name
  ! State
+
  !colspan="2"|Type
! Bound To
+
  !style="width: 250px;" colspan="2"| Meaning
  ! Field Name
+
  !colspan="2"|Values
! Field Type
 
  ! Notes
 
 
  |-
 
  |-
  |rowspan="16"| 0x26
+
  |colspan="3"|precipitation
  |rowspan="16"| Play
+
  |colspan="2"|TAG_String
  |rowspan="16"| Client
+
  |colspan="2"| The type of precipitation in the biome.
  | Entity ID
+
  |colspan="2"|"rain", "snow", or "none".
| Int
 
| The player's Entity ID (EID).
 
 
  |-
 
  |-
  | Is hardcore
+
  |colspan="3"| depth
  | Boolean
+
  |colspan="2"| TAG_Float
  |
+
  |colspan="2"| The depth factor of the biome.
 +
|colspan="2"| The default values vary between 1.5 and -1.8.
 
  |-
 
  |-
  | Gamemode
+
  |colspan="3"| temperature
  | Unsigned Byte
+
  |colspan="2"| TAG_Float
  | 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
+
  |colspan="2"| The temperature factor of the biome.
 +
|colspan="2"| The default values vary between 2.0 and -0.5.
 
  |-
 
  |-
  | Previous Gamemode
+
  |colspan="3"| scale
  | Byte
+
|colspan="2"| TAG_Float
  | 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)
+
  |colspan="2"| ?
 +
  |colspan="2"| The default values vary between 1.225 and 0.0.
 
  |-
 
  |-
  | World Count
+
  |colspan="3"| downfall
  | VarInt
+
  |colspan="2"| TAG_Float
  | Size of the following array.
+
  |colspan="2"| ?
 +
|colspan="2"| The default values vary between 1.0 and 0.0.
 
  |-
 
  |-
  | World Names
+
  |colspan="3"| category
  | Array of Identifier
+
  |colspan="2"| TAG_String
  | Identifiers for all worlds on the server.
+
|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".
 
  |-
 
  |-
  | Dimension Codec
+
  |colspan="3"| temperature_modifier
  | [[NBT|NBT Tag Compound]]
+
|colspan="2"| Optional TAG_String
  | The full extent of these is still unknown, but the tag represents a dimension and biome registry. See below for the vanilla default.
+
  |colspan="2"| ?
 +
  |colspan="2"| The only known value is "frozen".
 
  |-
 
  |-
  | Dimension
+
  |rowspan="13"| effects
  | [[NBT|NBT Tag Compound]]
+
  |colspan="2"| sky_color
  | Valid dimensions are defined per dimension registry sent before this. The structure of this tag is a dimension type (see below).
+
  |rowspan="11"| TAG_Compound
  |-
+
  | TAG_Int
  | World Name
+
  |colspan="2"| The color of the sky.
| Identifier
+
  | Example: 8364543, which is #7FA1FF in RGB.
  | Name of the world being spawned into.
 
 
  |-
 
  |-
  | Hashed seed
+
  |colspan="2"| water_fog_color
  | Long
+
  | TAG_Int
  | First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
+
  |colspan="2"| Possibly the tint color when swimming.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 
  |-
 
  |-
  | Max Players
+
  |colspan="2"| fog_color
  | VarInt
+
  | TAG_Int
  | Was once used by the client to draw the player list, but now is ignored.
+
  |colspan="2"| Possibly the color of the fog effect when looking past the view distance.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 
  |-
 
  |-
  | View Distance
+
  |colspan="2"| water_color
  | VarInt
+
| TAG_Int
  | Render distance (2-32).
+
  |colspan="2"| The tint color of the water blocks.
 +
  | Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
|colspan="2"| foliage_color
 +
| Optional TAG_Int
 +
|colspan="2"| The tint color of the grass.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
|colspan="2"| grass_color
 +
| Optional TAG_Int
 +
| colspan="2"| ?
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
|colspan="2"| grass_color_modifier
 +
| Optional TAG_String
 +
|colspan="2"| Unknown, likely affects foliage color.
 +
| If set, known values are "swamp" and "dark_forest".
 +
|-
 +
|colspan="2"| music
 +
| Optional TAG_Compound
 +
|colspan="2"| Music properties for the biome.
 +
| If present, contains the fields: replace_current_music (TAG_Byte), sound (TAG_String), max_delay (TAG_Int), min_delay (TAG_Int).
 +
|-
 +
|colspan="2"| ambient_sound
 +
| Optional TAG_String
 +
|colspan="2"| Ambient soundtrack.
 +
| If present, the ID of a soundtrack. Example: "minecraft:ambient.basalt_deltas.loop".
 
  |-
 
  |-
  | Reduced Debug Info
+
  |colspan="2"| additions_sound
  | Boolean
+
  | Optional TAG_Compound
  | If true, a Notchian client shows reduced information on the {{Minecraft Wiki|debug screen}}.  For servers in development, this should almost always be false.
+
|colspan="2"| Additional ambient sound that plays randomly.
 +
  | If present, contains the fields: sound (TAG_String), tick_chance (TAG_Double).
 
  |-
 
  |-
  | Enable respawn screen
+
  |colspan="2"| mood_sound
  | Boolean
+
  | Optional TAG_Compound
  | Set to false when the doImmediateRespawn gamerule is true.
+
|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).
 
  |-
 
  |-
  | Is Debug
+
  |rowspan="2"| particle
  | Boolean
+
  | probability
  | True if the world is a {{Minecraft Wiki|debug mode}} world; debug mode worlds cannot be modified and have predefined blocks.
+
  |rowspan="2"| Optional TAG_Compound
 +
| TAG_FLOAT
 +
|rowspan="2"| Particles that appear randomly in the biome.
 +
| Possibly the probability of spawning the particle.
 +
| ?
 
  |-
 
  |-
  | Is Flat
+
  | options
  | Boolean
+
  | TAG_COMPOUND
  | 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 properties of the particle to spawn.
 +
| Contains the field "type" (TAG_String), which identifies the particle type.
 
  |}
 
  |}
  
 
+
Chat registry:
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".
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,260: Line 3,342:
 
  !style="width: 250px;" colspan="2"| Notes
 
  !style="width: 250px;" colspan="2"| Notes
 
  |-
 
  |-
| minecraft:dimension_type
+
  | type
| TAG_Compound
+
  | TAG_String
| The dimension type registry (see below).
+
  | The name of the registry. Always "minecraft:chat_type".
|-
 
| minecraft:worldgen/biome
 
| TAG_Compound
 
| The biome registry (see below).
 
|}
 
 
 
Dimension type registry:
 
 
 
{| class="wikitable"
 
!Name
 
!Type
 
!style="width: 250px;" colspan="2"| Notes
 
|-
 
  | type
 
  | TAG_String
 
  | The name of the registry. Always "minecraft:dimension_type".
 
 
  |-
 
  |-
 
  | value
 
  | value
 
  | TAG_List
 
  | TAG_List
  | List of dimension types registry entries (see below).
+
  | List of chat registry entries (see below).
 
  |}
 
  |}
  
Dimension type registry entry:
+
==== Map Item Data ====
 +
 
 +
Updates a rectangular area on a {{Minecraft Wiki|map}} item.
  
 
{| class="wikitable"
 
{| class="wikitable"
  !Name
+
  ! Packet ID
  !Type
+
! State
  !style="width: 250px;" colspan="2"| Notes
+
! Bound To
 +
!colspan="2"| Field Name
 +
  !colspan="2"| Field Type
 +
  ! Notes
 +
|-
 +
|rowspan="17"| 0x24
 +
|rowspan="17"| Play
 +
|rowspan="17"| Client
 +
|colspan="2"| Map ID
 +
|colspan="2"| VarInt
 +
| Map ID of the map being modified
 
  |-
 
  |-
  | name
+
  |colspan="2"| Scale
  | TAG_String
+
  |colspan="2"| Byte
  | The name of the dimension type (for example, "minecraft:overworld").
+
  | From 0 for a fully zoomed-in map (1 block per pixel) to 4 for a fully zoomed-out map (16 blocks per pixel)
 
  |-
 
  |-
  | id
+
  |colspan="2"| Locked
  | TAG_Int
+
  |colspan="2"| Boolean
  | The protocol ID of the dimension (matches the index of the element in the registry list).
+
  | True if the map has been locked in a cartography table
 
  |-
 
  |-
  | element
+
  |colspan="2"| Tracking Position
| TAG_Compound
+
  |colspan="2"| Boolean
| The dimension type (see below).
+
  | Specifies whether player and item frame icons are shown
|}
 
 
 
Dimension type:
 
 
 
{| class="wikitable"
 
  ! Name
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
  ! Values
 
 
  |-
 
  |-
  | piglin_safe
+
  |colspan="2"| Icon Count
| TAG_Byte
+
  |colspan="2"| VarInt
  |colspan="2"| Whether piglins shake and transform to zombified piglins.
+
  | Number of elements in the following array. Only present if "Tracking Position" is true.
  | 1: true, 0: false.
 
 
  |-
 
  |-
  | natural
+
  |rowspan="6"| Icon
  | TAG_Byte
+
  | Type
  |colspan="2"| When false, compasses spin randomly. When true, nether portals can spawn zombified piglins.
+
  |rowspan="6"| Array
  | 1: true, 0: false.
+
| VarInt enum
 +
  | See below
 
  |-
 
  |-
  | ambient_light
+
  | X
  | TAG_Float
+
  | Byte
  |colspan="2"| How much light the dimension has.
+
  | Map coordinates: -128 for furthest left, +127 for furthest right
| 0.0 to 1.0.
 
 
  |-
 
  |-
  | fixed_time
+
  | Z
  | Optional TAG_Long
+
  | Byte
  |colspan="2"| If set, the time of the day is the specified value.
+
  | Map coordinates: -128 for highest, +127 for lowest
| If set, 0 to 24000.
 
 
  |-
 
  |-
  | infiniburn
+
  | Direction
  | TAG_String
+
  | Byte
  |colspan="2"| A resource location defining what block tag to use for infiniburn.
+
  | 0-15
| "" or minecraft resource "minecraft:...".
 
 
  |-
 
  |-
  | respawn_anchor_works
+
  | Has Display Name
  | TAG_Byte
+
  | Boolean
  |colspan="2"| Whether players can charge and use respawn anchors.
+
  |
| 1: true, 0: false.
 
 
  |-
 
  |-
  | has_skylight
+
  | Display Name
  | TAG_Byte
+
  | Optional [[Chat]]
  |colspan="2"| Whether the dimension has skylight access or not.
+
  | Only present if previous Boolean is true
| 1: true, 0: false.
 
 
  |-
 
  |-
  | bed_works
+
  |colspan="2"| Columns
| TAG_Byte
+
  |colspan="2"| Unsigned Byte
  |colspan="2"| Whether players can use a bed to sleep.
+
  | Number of columns updated
  | 1: true, 0: false.
 
 
  |-
 
  |-
  | effects
+
  |colspan="2"| Rows
| TAG_String
+
  |colspan="2"| Optional Unsigned Byte
  |colspan="2"| ?
+
  | Only if Columns is more than 0; number of rows updated
  | "minecraft:overworld", "minecraft:the_nether", "minecraft:the_end" or something else.
 
 
  |-
 
  |-
  | has_raids
+
  |colspan="2"| X
| TAG_Byte
+
  |colspan="2"| Optional Byte
  |colspan="2"| Whether players with the Bad Omen effect can cause a raid.
+
  | Only if Columns is more than 0; x offset of the westernmost column
  | 1: true, 0: false.
 
 
  |-
 
  |-
  | min_y
+
  |colspan="2"| Z
| TAG_Int
+
  |colspan="2"| Optional Byte
  |colspan="2"| The minimum Y level.
+
  | Only if Columns is more than 0; z offset of the northernmost row
  |
 
 
  |-
 
  |-
  | height
+
  |colspan="2"| Length
| TAG_Int
+
  |colspan="2"| Optional VarInt
  |colspan="2"| The maximum height.
+
  | Only if Columns is more than 0; length of the following array
  |
 
 
  |-
 
  |-
  | logical_height
+
  |colspan="2"| Data
| TAG_Int
+
  |colspan="2"| Optional Array of Unsigned Byte
  |colspan="2"| The maximum height to which chorus fruits and nether portals can bring players within this dimension.
+
| Only if Columns is more than 0; see {{Minecraft Wiki|Map item format}}
  | 0-256.
+
  |}
 +
 
 +
For icons, a direction of 0 is a vertical icon and increments by 22.5&deg; (360/16).
 +
 
 +
Types are based off of rows and columns in <code>map_icons.png</code>:
 +
 
 +
{| class="wikitable"
 
  |-
 
  |-
  | coordinate_scale
+
  ! Icon type
  | TAG_Float
+
! Result
  |colspan="2"| The multiplier applied to coordinates when traveling to the dimension.
+
  |-
  | 0.00001 - 30000000.0
+
  | 0
 +
  | White arrow (players)
 
  |-
 
  |-
  | ultrawarm
+
  | 1
  | TAG_Byte
+
  | Green arrow (item frames)
|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
+
  | 2
| TAG_Byte
+
  | Red arrow
|colspan="2"| Whether the dimension has a bedrock ceiling or not. When true, causes lava to spread faster.
 
| 1: true, 0: false.
 
  |}
 
 
 
Biome registry:
 
 
 
{| class="wikitable"
 
!Name
 
!Type
 
!style="width: 250px;" colspan="2"| Notes
 
 
  |-
 
  |-
  | type
+
  | 3
  | TAG_String
+
  | Blue arrow
| The name of the registry. Always "minecraft:worldgen/biome".
 
 
  |-
 
  |-
  | value
+
  | 4
  | TAG_List
+
  | White cross
| List of biome registry entries (see below).
 
|}
 
 
 
Biome registry entry:
 
 
 
{| class="wikitable"
 
!Name
 
!Type
 
!style="width: 250px;" colspan="2"| Notes
 
 
  |-
 
  |-
  | name
+
  | 5
  | TAG_String
+
  | Red pointer
| The name of the biome (for example, "minecraft:ocean").
 
 
  |-
 
  |-
  | id
+
  | 6
  | TAG_Int
+
  | White circle (off-map players)
| The protocol ID of the biome (matches the index of the element in the registry list).
 
 
  |-
 
  |-
  | element
+
  | 7
  | TAG_Compound
+
  | Small white circle (far-off-map players)
| The biome properties (see below).
 
|}
 
 
 
Biome properties:
 
 
 
{| class="wikitable"
 
!colspan="2"|Name
 
!colspan="2"|Type
 
!style="width: 250px;" colspan="2"| Meaning
 
!colspan="2"|Values
 
 
  |-
 
  |-
  |colspan="2"|precipitation
+
  | 8
|colspan="2"|TAG_String
+
  | Mansion
  |colspan="2"| The type of precipitation in the biome.
 
|colspan="2"|"rain", "snow", or "none".
 
 
  |-
 
  |-
  |colspan="2"| depth
+
  | 9
|colspan="2"| TAG_Float
+
  | Temple
  |colspan="2"| The depth factor of the biome.
 
|colspan="2"| The default values vary between 1.5 and -1.8.
 
 
  |-
 
  |-
  |colspan="2"| temperature
+
  | 10
|colspan="2"| TAG_Float
+
  | White Banner
  |colspan="2"| The temperature factor of the biome.
 
|colspan="2"| The default values vary between 2.0 and -0.5.
 
 
  |-
 
  |-
  |colspan="2"| scale
+
  | 11
|colspan="2"| TAG_Float
+
  | Orange Banner
  |colspan="2"| ?
 
|colspan="2"| The default values vary between 1.225 and 0.0.
 
 
  |-
 
  |-
  |colspan="2"| downfall
+
  | 12
|colspan="2"| TAG_Float
+
  | Magenta Banner
  |colspan="2"| ?
 
|colspan="2"| The default values vary between 1.0 and 0.0.
 
 
  |-
 
  |-
  |colspan="2"| category
+
  | 13
|colspan="2"| TAG_String
+
  | Light Blue Banner
  |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
+
  | 14
|colspan="2"| Optional TAG_String
+
  | Yellow Banner
  |colspan="2"| ?
 
|colspan="2"| The only known value is "frozen".
 
 
  |-
 
  |-
  |rowspan="11"| effects
+
  | 15
| sky_color
+
  | Lime Banner
|rowspan="11"| TAG_Compound
 
| TAG_Int
 
|colspan="2"| The color of the sky.
 
  | Example: 8364543, which is #7FA1FF in RGB.
 
 
  |-
 
  |-
  | water_fog_color
+
  | 16
  | TAG_Int
+
  | Pink Banner
|colspan="2"| Possibly the tint color when swimming.
 
| Example: 8364543, which is #7FA1FF in RGB.
 
 
  |-
 
  |-
  | fog_color
+
  | 17
  | TAG_Int
+
  | Gray Banner
|colspan="2"| Possibly the color of the fog effect when looking past the view distance.
 
| Example: 8364543, which is #7FA1FF in RGB.
 
 
  |-
 
  |-
  | water_color
+
  | 18
  | TAG_Int
+
  | Light Gray Banner
|colspan="2"| The tint color of the water blocks.
 
| Example: 8364543, which is #7FA1FF in RGB.
 
 
  |-
 
  |-
  | foliage_color
+
  | 19
  | Optional TAG_Int
+
  | Cyan Banner
|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
+
  | 20
  | Optional TAG_String
+
  | Purple Banner
|colspan="2"| Unknown, likely affects foliage color.
 
| If set, known values are "swamp" and "dark_forest".
 
 
  |-
 
  |-
  | music
+
  | 21
  | Optional TAG_Compound
+
  | Blue Banner
|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
+
  | 22
  | Optional TAG_String
+
  | Brown Banner
|colspan="2"| Ambient soundtrack.
 
| If present, the ID of a soundtrack. Example: "minecraft:ambient.basalt_deltas.loop".
 
 
  |-
 
  |-
  | additions_sound
+
  | 23
  | Optional TAG_Compound
+
  | Green Banner
|colspan="2"| Additional ambient sound that plays randomly.
 
| If present, contains the fields: sound (TAG_String), tick_chance (TAG_Double).
 
 
  |-
 
  |-
  | mood_sound
+
  | 24
  | Optional TAG_Compound
+
  | Red Banner
|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
+
  | 25
| probability
+
  | Black Banner
|rowspan="2"|Optional TAG_Compound
 
| TAG_FLOAT
 
|rowspan="2"| Particles that appear randomly in the biome.
 
| Possibly the probability of spawning the particle.
 
  | ?
 
 
  |-
 
  |-
  | options
+
  | 26
  | TAG_COMPOUND
+
  | Treasure marker
| The properties of the particle to spawn.
 
| Contains the field "type" (TAG_String), which identifies the particle type.
 
 
  |}
 
  |}
  
==== Map Data ====
+
==== Merchant Offers ====
  
Updates a rectangular area on a {{Minecraft Wiki|map}} item.
+
The list of trades a villager NPC is offering.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,556: Line 3,540:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="17"| 0x27
+
  |rowspan="18"| 0x25
  |rowspan="17"| Play
+
  |rowspan="18"| Play
  |rowspan="17"| Client
+
  |rowspan="18"| Client
|colspan="2"| Map ID
 
|colspan="2"| VarInt
 
| Map ID of the map being modified
 
 
  |-
 
  |-
  |colspan="2"| Scale
+
  | colspan="2" | Window ID
  |colspan="2"| Byte
+
  | colspan="2" | VarInt
  | From 0 for a fully zoomed-in map (1 block per pixel) to 4 for a fully zoomed-out map (16 blocks per pixel)
+
  | The ID of the window that is open; this is an int rather than a byte.
 
  |-
 
  |-
  |colspan="2"| Locked
+
  | colspan="2" | Size
  |colspan="2"| Boolean
+
  | colspan="2" | Byte
  | True if the map has been locked in a cartography table
+
  | The number of trades in the following array.
 
  |-
 
  |-
  |colspan="2"| Tracking Position
+
  | rowspan="11" | Trades
  |colspan="2"| Boolean
+
  | Input item 1
  | Specifies whether player and item frame icons are shown
+
| 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.
 
  |-
 
  |-
  |colspan="2"| Icon Count
+
  | Output item
  |colspan="2"| VarInt
+
  | [[Slot]]
  | Number of elements in the following array. Only present if "Tracking Position" is true.
+
  | The item the player will receive from this villager trade.
 
  |-
 
  |-
  |rowspan="6"| Icon
+
  | Has second item
| Type
+
  | Boolean
|rowspan="6"| Array
+
  | Whether there is a second item.
  | VarInt enum
 
  | See below
 
 
  |-
 
  |-
  | X
+
  | Input item 2
  | Byte
+
  | Optional [[Slot]]
  | Map coordinates: -128 for furthest left, +127 for furthest right
+
  | The second item the player has to supply for this villager trade; only present if has a second item is true.
 
  |-
 
  |-
  | Z
+
  | Trade disabled
  | Byte
+
  | Boolean
  | Map coordinates: -128 for highest, +127 for lowest
+
| 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.
 
  |-
 
  |-
  | Direction
+
  | Maximum number of trade uses
  | Byte
+
  | Integer
  | 0-15
+
  | Number of times this trade can be used before it's exhausted.
 
  |-
 
  |-
  | Has Display Name
+
  | XP
  | Boolean
+
  | Integer
  |
+
  | Amount of XP the villager will earn each time the trade is used.
 
  |-
 
  |-
  | Display Name
+
  | Special Price
  | Optional [[Chat]]
+
  | Integer
  | Only present if previous Boolean is true
+
  | Can be zero or negative. The number is added to the price when an item is discounted due to player reputation or other effects.
|-
 
|colspan="2"| Columns
 
|colspan="2"| Unsigned Byte
 
| Number of columns updated
 
 
  |-
 
  |-
  |colspan="2"| Rows
+
  | Price Multiplier
  |colspan="2"| Optional Byte
+
  | Float
  | Only if Columns is more than 0; number of rows updated
+
  | Can be low (0.05) or high (0.2). Determines how much demand, player reputation, and temporary effects will adjust the price.
 
  |-
 
  |-
  |colspan="2"| X
+
  | Demand
  |colspan="2"| Optional Byte
+
  | Integer
  | Only if Columns is more than 0; x offset of the westernmost column
+
  | If positive, causes the price to increase. Negative values seem to be treated the same as zero.
 
  |-
 
  |-
  |colspan="2"| Z
+
  |colspan="2"| Villager level
  |colspan="2"| Optional Byte
+
  |colspan="2"| VarInt
  | Only if Columns is more than 0; z offset of the northernmost row
+
  | 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"| Length
+
  |colspan="2"| Experience
  |colspan="2"| Optional VarInt
+
  |colspan="2"| VarInt
  | Only if Columns is more than 0; length of the following array
+
  | Total experience for this villager (always 0 for the wandering trader).
 
  |-
 
  |-
  |colspan="2"| Data
+
  |colspan="2"| Is regular villager
  |colspan="2"| Optional Array of Unsigned Byte
+
  |colspan="2"| Boolean
  | Only if Columns is more than 0; see {{Minecraft Wiki|Map item format}}
+
  | 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
 +
 
 +
[[File:1.14-merchant-slots.png|thumb|The merchant UI, for reference]]
 +
{{-}}
 +
 
 +
==== Move Entity Position ====
  
For icons, a direction of 0 is a vertical icon and increments by 22.5&deg; (360/16).
+
This packet is sent by the server when an entity moves less then 8 blocks; if an entity moves more than 8 blocks [[#Teleport Entity|Teleport Entity]] should be sent instead.
  
Types are based off of rows and columns in <code>map_icons.png</code>:
+
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
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  ! Icon type
+
  |rowspan="5"| 0x26
  ! Result
+
  |rowspan="5"| Play
 +
|rowspan="5"| Client
 +
| Entity ID
 +
| VarInt
 +
|
 
  |-
 
  |-
  | 0
+
  | Delta X
  | White arrow (players)
+
  | Short
 +
| Change in X position as <code>(currentX * 32 - prevX * 32) * 128</code>.
 
  |-
 
  |-
  | 1
+
  | Delta Y
  | Green arrow (item frames)
+
  | Short
 +
| Change in Y position as <code>(currentY * 32 - prevY * 32) * 128</code>.
 
  |-
 
  |-
  | 2
+
  | Delta Z
  | Red arrow
+
  | Short
 +
| Change in Z position as <code>(currentZ * 32 - prevZ * 32) * 128</code>.
 
  |-
 
  |-
  | 3
+
  | On Ground
  | Blue arrow
+
  | Boolean
  |-
+
  |
  | 4
+
|}
  | White cross
+
 
 +
==== Move Entity Position and Rotation ====
 +
 
 +
This packet is sent by the server when an entity rotates and moves. Since a short range is limited from -32768 to 32767, and movement is offset of fixed-point numbers, this packet allows at most 8 blocks movement in any direction. (<code>-32768 / (32 * 128) == -8</code>)
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
  ! Bound To
 +
! Field Name
 +
! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | 5
+
  |rowspan="7"| 0x27
  | Red pointer
+
|rowspan="7"| Play
 +
|rowspan="7"| Client
 +
| Entity ID
 +
| VarInt
 +
  |
 
  |-
 
  |-
  | 6
+
  | Delta X
  | White circle (off-map players)
+
  | Short
 +
| Change in X position as <code>(currentX * 32 - prevX * 32) * 128</code>.
 
  |-
 
  |-
  | 7
+
  | Delta Y
  | Small white circle (far-off-map players)
+
  | Short
 +
| Change in Y position as <code>(currentY * 32 - prevY * 32) * 128</code>.
 
  |-
 
  |-
  | 8
+
  | Delta Z
  | Mansion
+
  | Short
 +
| Change in Z position as <code>(currentZ * 32 - prevZ * 32) * 128</code>.
 
  |-
 
  |-
  | 9
+
  | Yaw
  | Temple
+
  | Angle
 +
| New angle, not a delta.
 
  |-
 
  |-
  | 10
+
  | Pitch
  | White Banner
+
  | Angle
 +
| New angle, not a delta.
 
  |-
 
  |-
  | 11
+
  | On Ground
  | Orange Banner
+
  | Boolean
  |-
+
  |
| 12
+
  |}
| Magenta Banner
+
 
|-
+
==== Move Entity Rotation ====
| 13
+
 
| Light Blue Banner
+
This packet is sent by the server when an entity rotates.
|-
 
| 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
 
  |}
 
 
 
==== Trade List ====
 
 
 
The list of trades a villager NPC is offering.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,729: Line 3,713:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
  !colspan="2"| Field Type
+
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="18"| 0x28
+
  |rowspan="4"| 0x28
  |rowspan="18"| Play
+
  |rowspan="4"| Play
  |rowspan="18"| Client
+
  |rowspan="4"| Client
 +
| Entity ID
 +
| VarInt
 +
|
 
  |-
 
  |-
  | colspan="2" | Window ID
+
  | Yaw
  | colspan="2" | VarInt
+
  | Angle
  | The ID of the window that is open; this is an int rather than a byte.
+
  | New angle, not a delta.
 
  |-
 
  |-
  | colspan="2" | Size
+
  | Pitch
  | colspan="2" | Byte
+
  | Angle
  | The number of trades in the following array.
+
  | New angle, not a delta.
 
  |-
 
  |-
  | rowspan="11" | Trades
+
  | On Ground
  | Input item 1
+
| Boolean
  | 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.
+
 
 +
==== Move Vehicle (clientbound) ====
 +
 
 +
Note that all fields use absolute positioning and do not allow for relative positioning.
 +
 
 +
{| class="wikitable"
 +
  ! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | Output item
+
  |rowspan="5"| 0x29
  | [[Slot]]
+
|rowspan="5"| Play
  | The item the player will receive from this villager trade.
+
|rowspan="5"| Client
 +
| X
 +
  | Double
 +
  | Absolute position (X coordinate).
 
  |-
 
  |-
  | Has second item
+
  | Y
  | Boolean
+
  | Double
  | Whether there is a second item.
+
  | Absolute position (Y coordinate).
 
  |-
 
  |-
  | Input item 2
+
  | Z
  | Optional [[Slot]]
+
  | Double
  | The second item the player has to supply for this villager trade; only present if has a second item is true.
+
  | Absolute position (Z coordinate).
|-
 
| Trade disabled
 
| Boolean
 
| True if the trade is disabled; false if the trade is enabled.
 
 
  |-
 
  |-
  | Number of trade uses
+
  | Yaw
  | Integer
+
  | Float
  | 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.
+
  | Absolute rotation on the vertical axis, in degrees.
 
  |-
 
  |-
  | Maximum number of trade uses
+
  | Pitch
| 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
 
  | Float
  | Can be low (0.05) or high (0.2). Determines how much demand, player reputation, and temporary effects will adjust the price.
+
  | Absolute rotation on the horizontal axis, in degrees.
|-
 
| 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:
+
==== Open Book ====
  
Adjusted price = default price + floor(default price x multiplier x demand) + special price
+
Sent when a player right clicks with a signed book. This tells the client to open the book GUI.
  
[[File:1.14-merchant-slots.png|thumb|The merchant UI, for reference]]
+
{| class="wikitable"
{{-}}
+
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| 0x2A
 +
| Play
 +
| Client
 +
| Hand
 +
| VarInt enum
 +
| 0: Main hand, 1: Off hand .
 +
|}
  
==== Entity Position ====
+
==== Open Screen ====
  
This packet is sent by the server when an entity moves less then 8 blocks; if an entity moves more than 8 blocks [[#Entity Teleport|Entity Teleport]] should be sent instead.
+
This is sent to the client when it should open an inventory, such as a chest, workbench, or furnace. This message is not sent anywhere for clients opening their own inventory. Resending this packet with already existing window id, will update the window title and window type without closing the window.
 
+
For horses, use [[#Horse Screen Open|Horse Screen Open]].
This packet allows at most 8 blocks movement in any direction, because short range is from -32768 to 32767. And <code>32768 / (128 * 32)</code> = 8.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,830: Line 3,806:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| 0x29
+
  |rowspan="3"| 0x2B
  |rowspan="5"| Play
+
  |rowspan="3"| Play
  |rowspan="5"| Client
+
  |rowspan="3"| Client
  | Entity ID
+
  | Window ID
 
  | VarInt
 
  | VarInt
  |  
+
  | A unique id number for the window to be displayed. Notchian server implementation is a counter, starting at 1.
 
  |-
 
  |-
  | Delta X
+
  | Window Type
  | Short
+
  | VarInt
  | Change in X position as <code>(currentX * 32 - prevX * 32) * 128</code>.
+
  | The window type to use for display. Contained in the <code>minecraft:menu</code> registry; see [[Inventory]] for the different values.
 
  |-
 
  |-
  | Delta Y
+
  | Window Title
  | Short
+
  | [[Chat]]
  | Change in Y position as <code>(currentY * 32 - prevY * 32) * 128</code>.
+
  | The title of the window.
|-
 
| Delta Z
 
| Short
 
| Change in Z position as <code>(currentZ * 32 - prevZ * 32) * 128</code>.
 
|-
 
| On Ground
 
| Boolean
 
|
 
 
  |}
 
  |}
  
==== Entity Position and Rotation ====
+
==== Open Sign Editor ====
  
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>)
+
Sent when the client has placed a sign and is allowed to send [[#Sign Update|Sign Update]]. There must already be a sign at the given location (which the client does not do automatically) - send a [[#Block Update|Block Update]] first.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,866: Line 3,834:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="7"| 0x2A
+
  | 0x2C
  |rowspan="7"| Play
+
  | Play
  |rowspan="7"| Client
+
  | Client
  | Entity ID
+
  | Location
| VarInt
+
  | Position
|
+
  |
|-
+
  |}
| Delta X
 
| Short
 
| Change in X position as <code>(currentX * 32 - prevX * 32) * 128</code>.
 
|-
 
| Delta Y
 
| Short
 
| Change in Y position as <code>(currentY * 32 - prevY * 32) * 128</code>.
 
|-
 
| Delta Z
 
| Short
 
| Change in Z position as <code>(currentZ * 32 - prevZ * 32) * 128</code>.
 
|-
 
| Yaw
 
| Angle
 
| New angle, not a delta.
 
|-
 
| Pitch
 
| Angle
 
| New angle, not a delta.
 
|-
 
| On Ground
 
  | Boolean
 
  |  
 
  |}
 
  
==== Entity Rotation ====
+
==== Ping (play) ====
  
This packet is sent by the server when an entity rotates.
+
Packet is not used by the Notchian server. When sent to the client, client responds with a [[#Pong (play)|Pong]] packet with the same id.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,910: Line 3,854:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x2B
+
  | 0x2D
  |rowspan="4"| Play
+
  | Play
  |rowspan="4"| Client
+
  | Client
  | Entity ID
+
  | ID
  | VarInt
+
  | Int
|
+
  |
|-
 
| Yaw
 
| Angle
 
| New angle, not a delta.
 
|-
 
| Pitch
 
| Angle
 
| New angle, not a delta.
 
|-
 
| On Ground
 
| Boolean
 
  |  
 
 
  |}
 
  |}
  
==== Vehicle Move (clientbound) ====
+
==== Place Ghost Recipe ====
  
Note that all fields use absolute positioning and do not allow for relative positioning.
+
Response to the serverbound packet ([[#Place Recipe|Place Recipe]]), with the same recipe ID. Appears to be used to notify the UI.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,942: Line 3,874:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| 0x2C
+
  |rowspan="2"| 0x2E
  |rowspan="5"| Play
+
  |rowspan="2"| Play
  |rowspan="5"| Client
+
  |rowspan="2"| Client
  | X
+
  | Window ID
  | Double
+
  | Byte
  | Absolute position (X coordinate).
+
  |
 
  |-