Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
 
(1.20-rc1)
 
Line 1: Line 1:
This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently 1.2.5) to the current pre-release (or weekly release).
+
This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently [[Protocol version numbers|1.19.4, protocol 762]]) to the current pre-release (currently [[Protocol version numbers|1.20-rc1, protocol {{Snapshot PVN|1073741965}}]]). Note that this page contains bleeding-edge information that may not be completely or correctly documented.
  
== New packets ==
+
One who wishes to commandeer the merging of this into [[Protocol]] when an update is made must be sure to respect any changes that may have occurred to the respective packets there.
  
=== Tab-complete (0xCB) ===
+
== Contents ==
  
''Two-way''
+
<div style="float:right;">__TOC__</div>
  
Sent C->S when the user presses [tab] while writing text. The payload contains all text behind the cursor.
+
=== Data types ===
  
The server responds with an auto-completion 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.
+
No changes so far.
  
In the event of more than one possible completion, the server responds with the options packed into the single string field, separated by a null character. Note that as strings are UTF-16, this is two bytes wide.
+
=== Packets ===
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! ID
! class="col0" | Packet ID
+
! Packet name
! class="col1" | Field Name
+
!colspan="2"| Documentation
! class="col2" | Field Type
+
|-
! class="col3" | Example
+
!colspan="4"| Play clientbound
! class="col4" | Notes
+
{{PacketList|0x24|Chunk Data and Update Light}}
|- class="row1"
+
{{PacketList|0x27|Update Light}}
| class="col0 centeralign" | 0xCB
+
{{PacketList|0x28|Login (play)}}
| class="col1 centeralign" | Text
+
{{PacketList|0x31|Open Sign Editor}}
| class="col2 centeralign" | string
+
{{PacketList|0x36|End Combat}}
| class="col3 centeralign" |  
+
{{PacketList|0x38|Combat Death}}
| class="col4" |  
+
{{PacketList|0x41|Respawn}}
|- class="row3"
+
{{PacketList|0x43|Update Section Blocks}}
! class="col0" | Total Size:
+
{{PacketList|0x69|Update Advancements}}
| class="col1 rightalign" colspan="4" | 3 bytes + length of string
+
{{PacketList|0x6B|Feature Flags}}
 +
{{PacketList|0x6D|Update Recipes}}
 +
|-
 +
!colspan="4"| Play serverbound
 +
{{PacketList|0x2E|Update Sign}}
 
|}
 
|}
  
=== Locale and View Distance (0xCC) ===
+
== New/modified data types ==
  
''Client to server''
+
No changes so far.
  
Sent when the player connects, or when settings are changed.
+
== Entity Metadata ==
 +
 
 +
No changes so far.
 +
 
 +
=== Entity ===
 +
 
 +
No changes so far.
 +
 
 +
== Block Actions ==
 +
 
 +
No changes so far.
 +
 
 +
== Inventories ==
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Type
 +
! Name
 +
! Description
 +
|-
 +
| 0
 +
| minecraft:generic_9x1
 +
| A 1-row inventory, not used by the notchian server.
 +
|-
 +
| 1
 +
| minecraft:generic_9x2
 +
| A 2-row inventory, not used by the notchian server.
 +
|-
 +
| 2
 +
| minecraft:generic_9x3
 +
| General-purpose 3-row inventory.  Used by {{Minecraft Wiki|Chest}}, {{Minecraft Wiki|minecart with chest}}, {{Minecraft Wiki|ender chest}}, and {{Minecraft Wiki|barrel}}
 +
|-
 +
| 3
 +
| minecraft:generic_9x4
 +
| A 4-row inventory, not used by the notchian server.
 +
|-
 +
| 4
 +
| minecraft:generic_9x5
 +
| A 5-row inventory, not used by the notchian server.
 +
|-
 +
| 5
 +
| minecraft:generic_9x6
 +
| General-purpose 6-row inventory, used by large chests.
 +
|-
 +
| 6
 +
| minecraft:generic_3x3
 +
| General-purpose 3-by-3 square inventory, used by {{Minecraft Wiki|Dispenser}} and {{Minecraft Wiki|Dropper}}
 +
|-
 +
| 7
 +
| minecraft:anvil
 +
| {{Minecraft Wiki|Anvil}}
 +
|-
 +
| 8
 +
| minecraft:beacon
 +
| {{Minecraft Wiki|Beacon}}
 +
|-
 +
| 9
 +
| minecraft:blast_furnace
 +
| {{Minecraft Wiki|Blast Furnace}}
 +
|-
 +
| 10
 +
| minecraft:brewing_stand
 +
| {{Minecraft Wiki|Brewing stand}}
 +
|-
 +
| 11
 +
| minecraft:crafting
 +
| {{Minecraft Wiki|Crafting table}}
 +
|-
 +
| 12
 +
| minecraft:enchantment
 +
| {{Minecraft Wiki|Enchantment table}}
 +
|-
 +
| 13
 +
| minecraft:furnace
 +
| {{Minecraft Wiki|Furnace}}
 +
|-
 +
| 14
 +
| minecraft:grindstone
 +
| {{Minecraft Wiki|Grindstone}}
 +
|-
 +
| 15
 +
| minecraft:hopper
 +
| {{Minecraft Wiki|Hopper}} or {{Minecraft Wiki|minecart with hopper}}
 +
|-
 +
| 16
 +
| minecraft:lectern
 +
| {{Minecraft Wiki|Lectern}}
 +
|-
 +
| 17
 +
| minecraft:loom
 +
| {{Minecraft Wiki|Loom}}
 +
|-
 +
| 18
 +
| minecraft:merchant
 +
| {{Minecraft Wiki|Villager}}, {{Minecraft Wiki|Wandering Trader}}
 +
|-
 +
| 19
 +
| minecraft:shulker_box
 +
| {{Minecraft Wiki|Shulker box}}
 +
|- {{removed}}
 +
| 20
 +
| minecraft:legacy_smithing
 +
| {{Minecraft Wiki|Smithing Table}}
 +
{{Warning|The Notchian server only sends this type if [[Protocol#Feature_Flags|feature flag]] '''update_1_20''' was '''not''' enabled}}
 +
|-
 +
| {{change|21|20}}
 +
| minecraft:smithing
 +
| {{Minecraft Wiki|Smithing Table}}
 +
{{change|{{Warning|The Notchian server only sends this type if [[Protocol#Feature_Flags|feature flag]] '''update_1_20''' was enabled}}|}}
 +
|-
 +
| {{change|22|21}}
 +
| minecraft:smoker
 +
| {{Minecraft Wiki|Smoker}}
 +
|-
 +
| {{change|23|22}}
 +
| minecraft:cartography
 +
| {{Minecraft Wiki|Cartography Table}}
 +
|-
 +
| {{change|24|23}}
 +
| minecraft:stonecutter
 +
| {{Minecraft Wiki|Stonecutter}}
 +
|}
 +
 
 +
== Plugin Channels ==
 +
 
 +
No changes so far.
 +
 
 +
== Play ==
 +
 
 +
=== Clientbound ===
 +
 
 +
==== Chunk Data and Update Light ====
 +
{{Main|Chunk Format}}
 +
{{See also|#Unload Chunk}}
 +
 
 +
{{Need Info|How do biomes work now?  The biome change happened at the same time as the seed change, but it's not clear how/if biomes could be computed given that it's not the actual seed...  ([https://www.reddit.com/r/Mojira/comments/e5at6i/a_discussion_for_the_changes_to_how_biomes_are/ /r/mojira discussion] which notes that it seems to be some kind of interpolation)}}
 +
 
 +
This packet 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). The light data in this packet is the same format as in the [[#Update Light|Update Light]] packet.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! colspan="2"| Field Name
 +
! colspan="2"| Field Type
 +
! Notes
 +
|-
 +
| rowspan="21"| 0x24
 +
| rowspan="21"| Play
 +
| rowspan="21"| Client
 +
| colspan="2"| Chunk X
 +
| colspan="2"| Int
 +
| 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)
 +
|-
 +
| colspan="2"| Heightmaps
 +
| colspan="2"| [[NBT]]
 +
| Compound containing one long array named <code>MOTION_BLOCKING</code>, which is a heightmap for the highest solid block at each position in the chunk (as a compacted long array with 256 entries, with the number of bits per entry varying depending on the world's height, defined by the formula <code>ceil(log2(height + 1))</code>). The Notchian server also adds a <code>WORLD_SURFACE</code> long array, the purpose of which is unknown, but it's not required for the chunk to be accepted.
 +
|-
 +
| colspan="2"| Size
 +
| colspan="2"| VarInt
 +
| Size of Data in bytes
 +
|-
 +
| colspan="2"| Data
 +
| colspan="2"| Byte array
 +
| See [[Chunk Format#Data structure|data structure]] in Chunk Format
 +
|-
 +
| colspan="2"| Number of block entities
 +
| colspan="2"| VarInt
 +
| Number of elements in the following array
 +
|-
 +
| rowspan="4"| Block Entity
 +
| Packed XZ
 +
| rowspan="4"| Array
 +
| Byte
 +
| The packed section coordinates, calculated from <code><nowiki>((blockX & 15) << 4) | (blockZ & 15)</nowiki></code>
 +
|-
 +
| Y
 +
| Short
 +
| The height relative to the world
 +
|-
 +
| Type
 +
| VarInt
 +
| The type of block entity
 +
|-
 +
| Data
 +
| [[NBT]]
 +
| The block entity's data, without the X, Y, and Z values
 +
|- {{removed}}
 +
| 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.
 +
|}
 +
 
 +
Note that the Notchian client requires an [[#Set Center Chunk|Set Center Chunk]] packet when it crosses a chunk border, otherwise it'll only display render distance + 2 chunks around the chunk it spawned in.
 +
 
 +
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>
 +
 
 +
==== Update Light ====
 +
 
 +
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
 +
|-
 +
| rowspan="13"| 0x27
 +
| rowspan="13"| Play
 +
| rowspan="13"| Client
 +
| colspan="2"| Chunk X
 +
| colspan="2"| VarInt
 +
| Chunk coordinate (block coordinate divided by 16, rounded down)
 +
|-
 +
| colspan="2"| Chunk Z
 +
| colspan="2"| VarInt
 +
| Chunk coordinate (block coordinate divided by 16, rounded down)
 +
|- {{removed}}
 +
| 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.
 +
|-
 +
| 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.
 +
|}
 +
 
 +
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
 +
|-
 +
| rowspan="21"| 0x28
 +
| rowspan="21"| Play
 +
| rowspan="21"| Client
 +
| Entity ID
 +
| Int
 +
| The player's Entity ID (EID).
 +
|-
 +
| Is hardcore
 +
| Boolean
 +
|
 +
|-
 +
| Gamemode
 +
| Unsigned Byte
 +
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 +
|-
 +
| Previous Gamemode
 +
| Byte
 +
| -1: Undefined (null), 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. The previous gamemode. Vanilla client uses this for the debug (F3 + N & F3 + F4) gamemode switch. (More information needed)
 +
|-
 +
| Dimension Count
 +
| VarInt
 +
| Size of the following array.
 +
|-
 +
| Dimension Names
 +
| Array of Identifier
 +
| Identifiers for all dimensions on the server.
 +
|-
 +
| Registry Codec
 +
| [[NBT|NBT Tag Compound]]
 +
| Represents certain registries that are sent from the server and are applied on the client.
 +
|-
 +
| Dimension Type
 +
| Identifier
 +
| Name of the dimension type being spawned into.
 +
|-
 +
| Dimension Name
 +
| Identifier
 +
| Name of the dimension being spawned into.
 +
|-
 +
| Hashed seed
 +
| Long
 +
| First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
 +
|-
 +
| Max Players
 +
| VarInt
 +
| Was once used by the client to draw the player list, but now is ignored.
 +
|-
 +
| View Distance
 +
| VarInt
 +
| Render distance (2-32).
 +
|-
 +
| Simulation Distance
 +
| VarInt
 +
| The distance that the client will process specific things, such as entities.
 +
|-
 +
| Reduced Debug Info
 +
| Boolean
 +
| If true, a Notchian client shows reduced information on the {{Minecraft Wiki|debug screen}}.  For servers in development, this should almost always be false.
 +
|-
 +
| Enable respawn screen
 +
| Boolean
 +
| Set to false when the doImmediateRespawn gamerule is true.
 +
|-
 +
| Is Debug
 +
| Boolean
 +
| True if the world is a {{Minecraft Wiki|debug mode}} world; debug mode worlds cannot be modified and have predefined blocks.
 +
|-
 +
| Is Flat
 +
| Boolean
 +
| True if the world is a {{Minecraft Wiki|superflat}} world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
 +
|-
 +
| Has death location
 +
| Boolean
 +
| If true, then the next two fields are present.
 +
|-
 +
| Death dimension name
 +
| Optional Identifier
 +
| Name of the dimension the player died in.
 +
|-
 +
| Death location
 +
| Optional Position
 +
| The location that the player died at.
 +
|- {{added}}
 +
| Portal cooldown
 +
| VarInt
 +
| The number of ticks until the player can use the portal again<sup>What impact does this have on the client? Needs more info</sup>.
 +
|}
 +
 
 +
 
 +
The '''Registry Codec''' NBT Tag Compound ([https://gist.github.com/rj00a/f2970a8ce4d09477ec8f16003b9dce86 Default value in JSON as of 1.19], [https://gist.github.com/nikes/aff59b758a807858da131a1881525b14 1.19.2]) includes three registries: "minecraft:dimension_type", "minecraft:worldgen/biome", and "minecraft:chat_type".
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
!Name
! class="col0" | Packet ID
+
!Type
! class="col1" | Field Name
+
!style="width: 250px;" colspan="2"| Notes
! class="col2" | Field Type
+
|-
! class="col3" | Example
+
| minecraft:dimension_type
! class="col4" | Notes
+
| TAG_Compound
|- class="row1"
+
| The dimension type registry (see below).
| class="col0 centeralign" rowspan="4" | 0xCC
+
|-
| class="col1 centeralign" | Locale
+
| minecraft:worldgen/biome
| class="col2 centeralign" | string
+
| TAG_Compound
| class="col3 centeralign" | en_GB
+
| The biome registry (see below).
|- class="row2"
+
|-
| class="col1 centeralign" | View distance
+
| minecraft:chat_type
| class="col2 centeralign" | byte
+
| TAG_Compound
| class="col3 centeralign" | 0
+
| The chat type registry (see below).
| class="col4" | 0-3 for 'far', 'normal', 'short', 'tiny'.
+
|}
|- class="row3"
 
| class="col1 centeralign" | Chat flags
 
| class="col2 centeralign" | byte
 
| class="col3 centeralign" | 8
 
| class="col4" | Bit field. 0: chat enabled, 2: colors enabled
 
|- class="row4"
 
| class="col1 centeralign" | Unknown
 
| class="col2 centeralign" | byte
 
| class="col3 centeralign" | 0
 
| class="col4 centeralign" | First three bits(bitmask 0x7) are used as a number, bit four(bitmask 0x8) is used as bool
 
|- class="row5"
 
! class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 8 bytes + length of string
 
|}
 
  
=== Encryption Key Response (0xFC) ===
+
Dimension type registry:
  
''Two-Way''
+
{| class="wikitable"
 +
!Name
 +
!Type
 +
!style="width: 250px;" colspan="2"| Notes
 +
|-
 +
| type
 +
| TAG_String
 +
| The name of the registry. Always "minecraft:dimension_type".
 +
|-
 +
| value
 +
| TAG_List
 +
| List of dimension types registry entries (see below).
 +
|}
  
See [[Protocol Encryption]] for information on this packet.
+
Dimension type registry entry:
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
!Name
! class="col0" | Packet ID
+
!Type
! class="col1" | Field Name
+
!style="width: 250px;" colspan="2"| Notes
! class="col2" | Field Type
+
|-
! class="col3" | Example
+
| name
! class="col4" | Notes
+
| TAG_String
|- class="row1"
+
| The name of the dimension type (for example, "minecraft:overworld").
| class="col0 centeralign" rowspan="2" | 0xFC
+
|-
| class="col1 centeralign" | Shared secret length
+
| id
| class="col2 centeralign" | short
+
| TAG_Int
| class="col3 centeralign" |
+
| The protocol ID of the dimension (matches the index of the element in the registry list).
| class="col4 centeralign" |
+
|-
|- class="row2"
+
| element
| class="col1 centeralign" | Shared secret
+
| TAG_Compound
| class="col2 centeralign" | byte array
+
| The dimension type (see below).
| class="col3 centeralign" |
+
|}
| class="col4 centeralign" |
 
|- class="row3"
 
! class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 3 bytes + length of shared secret
 
|}
 
  
=== Encryption Key Request (0xFD) ===
+
Dimension type:
  
''Server to client''
+
{| class="wikitable"
 +
! Name
 +
! Type
 +
!style="width: 250px;" colspan="2"| Meaning
 +
! Values
 +
|-
 +
| piglin_safe
 +
| TAG_Byte
 +
| colspan="2"| Whether piglins shake and transform to zombified piglins.
 +
| 1: true, 0: false.
 +
|-
 +
| has_raids
 +
| TAG_Byte
 +
| colspan="2"| Whether players with the Bad Omen effect can cause a raid.
 +
| 1: true, 0: false.
 +
|-
 +
| monster_spawn_light_level
 +
| TAG_Int or TAG_Compound
 +
| Possibly the light level(s) at which monsters can spawn.
 +
| colspan="2"| When TAG_Int, 0 - 15. When TAG_Compound, contains the fields: type (TAG_String), appears to be always "minecraft:uniform", and value (TAG_Compound), which contains the fields: max_inclusive (TAG_Int), min_inclusive (TAG_Int).
 +
|-
 +
| monster_spawn_block_light_limit
 +
| TAG_Int
 +
| colspan="2"|
 +
|
 +
|-
 +
| natural
 +
| TAG_Byte
 +
| colspan="2"| When false, compasses spin randomly. When true, nether portals can spawn zombified piglins.
 +
| 1: true, 0: false.
 +
|-
 +
| ambient_light
 +
| TAG_Float
 +
| colspan="2"| How much light the dimension has.
 +
| 0.0 to 1.0.
 +
|-
 +
| fixed_time
 +
| Optional TAG_Long
 +
| colspan="2"| If set, the time of the day is the specified value.
 +
| If set, 0 to 24000.
 +
|-
 +
| infiniburn
 +
| TAG_String
 +
| colspan="2"| A resource location defining what block tag to use for infiniburn.
 +
| "#" or minecraft resource "#minecraft:...".
 +
|-
 +
| respawn_anchor_works
 +
| TAG_Byte
 +
| colspan="2"| Whether players can charge and use respawn anchors.
 +
| 1: true, 0: false.
 +
|-
 +
| has_skylight
 +
| TAG_Byte
 +
| colspan="2"| Whether the dimension has skylight access or not.
 +
| 1: true, 0: false.
 +
|-
 +
| bed_works
 +
| TAG_Byte
 +
| colspan="2"| Whether players can use a bed to sleep.
 +
| 1: true, 0: false.
 +
|-
 +
| effects
 +
| TAG_String
 +
| colspan="2"| ?
 +
| "minecraft:overworld", "minecraft:the_nether", "minecraft:the_end" or something else.
 +
|-
 +
| min_y
 +
| TAG_Int
 +
| colspan="2"| The minimum Y level.
 +
| A multiple of 16. Example: -64
 +
|-
 +
| height
 +
| TAG_Int
 +
| colspan="2"| The maximum height.
 +
| A multiple of 16. Example: 256
 +
|-
 +
| logical_height
 +
| TAG_Int
 +
| colspan="2"| The maximum height to which chorus fruits and nether portals can bring players within this dimension.
 +
| 0-384.
 +
|-
 +
| coordinate_scale
 +
| TAG_Double
 +
| colspan="2"| The multiplier applied to coordinates when traveling to the dimension.
 +
| 0.00001 - 30000000.0
 +
|-
 +
| ultrawarm
 +
| TAG_Byte
 +
| colspan="2"| Whether the dimensions behaves like the nether (water evaporates and sponges dry) or not. Also causes lava to spread thinner.
 +
| 1: true, 0: false.
 +
|-
 +
| has_ceiling
 +
| TAG_Byte
 +
| colspan="2"| Whether the dimension has a bedrock ceiling or not. When true, causes lava to spread faster.
 +
| 1: true, 0: false.
 +
|}
  
See [[Protocol Encryption]] for information on this packet.
+
Biome registry:
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
!Name
! class="col0" | Packet ID
+
!Type
! class="col1" | Field Name
+
!style="width: 250px;" colspan="2"| Notes
! class="col2" | Field Type
+
|-
! class="col3" | Example
+
| type
! class="col4" | Notes
+
| TAG_String
|- class="row1"
+
| The name of the registry. Always "minecraft:worldgen/biome".
| class="col0 centeralign" rowspan="3" | 0xFD
+
|-
| class="col1 centeralign" | Server id
+
| value
| class="col2 centeralign" | string
+
| TAG_List
| class="col3 centeralign" |
+
| List of biome registry entries (see below).
| class="col4 centeralign" |
+
|}
|- class="row2"
 
| class="col1 centeralign" | Public key length
 
| class="col2 centeralign" | short
 
| class="col3 centeralign" |
 
| class="col4 centeralign" |
 
|- class="row3"
 
| class="col1 centeralign" | Public key
 
| class="col2 centeralign" | byte array
 
| class="col3 centeralign" |
 
| class="col4 centeralign" |
 
|- class="row4"
 
! class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 5 bytes + length of string + length of key
 
|}
 
  
=== Named Sound Effect (0x3E) ===
+
Biome registry entry:
  
''Server to client''
+
{| class="wikitable"
 +
!Name
 +
!Type
 +
!style="width: 250px;" colspan="2"| Notes
 +
|-
 +
| name
 +
| TAG_String
 +
| The name of the biome (for example, "minecraft:ocean").
 +
|-
 +
| id
 +
| TAG_Int
 +
| The protocol ID of the biome (matches the index of the element in the registry list).
 +
|-
 +
| element
 +
| TAG_Compound
 +
| The biome properties (see below).
 +
|}
  
Used to play a sound effect on the client.
+
Biome properties:
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! colspan="3"|Name
! class="col0" | Packet ID
+
! colspan="2"|Type
! class="col1" | Field Name
+
!style="width: 250px;" colspan="2"| Meaning
! class="col2" | Field Type
+
! colspan="2"|Values
! class="col3" | Example
+
|-
! class="col4" | Notes
+
| colspan="3"|precipitation
|- class="row1"
+
| colspan="2"|TAG_String
| class="col0 centeralign" rowspan="6" | 0x3E
+
| colspan="2"| The type of precipitation in the biome.
| class="col1 centeralign" | Sound name
+
| colspan="2"|"rain", "snow", or "none".
| class="col2 centeralign" | string
+
|-
| class="col3 centeralign" | step.grass
+
| colspan="3"| depth
| class="col4 centeralign" | 250
+
| colspan="2"| Optional TAG_Float
|- class="row2"
+
| colspan="2"| The depth factor of the biome.
| class="col1 centeralign" | Effect position X
+
| colspan="2"| The default values vary between 1.5 and -1.8.
| class="col2 centeralign" | int
+
|-
| class="col3 centeralign" | 250
+
| colspan="3"| temperature
| class="col4 centeralign" | effect X multiplied by 8
+
| colspan="2"| TAG_Float
|- class="row3"
+
| colspan="2"| The temperature factor of the biome.
| class="col1 centeralign" | Effect position Y
+
| colspan="2"| The default values vary between 2.0 and -0.5.
| class="col2 centeralign" | int
+
|-
| class="col3 centeralign" | 250
+
| colspan="3"| scale
| class="col4 centeralign" | effect Y multiplied with 8
+
| colspan="2"| Optional TAG_Float
|- class="row4"
+
| colspan="2"| ?
| class="col1 centeralign" | Effect position Z
+
| colspan="2"| The default values vary between 1.225 and 0.0.
| class="col2 centeralign" | int
+
|-
| class="col3 centeralign" | 250
+
| colspan="3"| downfall
| class="col4 centeralign" | effect Z multiplied with 8
+
| colspan="2"| TAG_Float
|- class="row5"
+
| colspan="2"| ?
| class="col1 centeralign" | Volume
+
| colspan="2"| The default values vary between 1.0 and 0.0.
| class="col2 centeralign" | byte
+
|-
| class="col3 centeralign" | 9
+
| colspan="3"| category
| class="col4 centeralign" | 63 is 100%, can be more
+
| colspan="2"| Optional TAG_String
|- class="row6"
+
| colspan="2"| The category of the biome.
| class="col1 centeralign" | Pitch
+
| 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".
| class="col2 centeralign" | byte
+
|-
| class="col3 centeralign" | 63
+
| colspan="3"| temperature_modifier
| class="col4 centeralign" | 63 is 100%, can be more
+
| colspan="2"| Optional TAG_String
|- class="row7"
+
| colspan="2"| ?
! class="col0" | Total Size:
+
| colspan="2"| The only known value is "frozen".
| class="col1 rightalign" colspan="4" | 17 bytes + length of string
+
|-
|}
+
| rowspan="13"| effects
 +
| colspan="2"| sky_color
 +
| rowspan="11"| TAG_Compound
 +
| TAG_Int
 +
| colspan="2"| The color of the sky.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
| colspan="2"| water_fog_color
 +
| TAG_Int
 +
| colspan="2"| Possibly the tint color when swimming.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
| colspan="2"| fog_color
 +
| TAG_Int
 +
| colspan="2"| Possibly the color of the fog effect when looking past the view distance.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
| colspan="2"| water_color
 +
| TAG_Int
 +
| colspan="2"| The tint color of the water blocks.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
| colspan="2"| foliage_color
 +
| Optional TAG_Int
 +
| colspan="2"| The tint color of the grass.
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
| colspan="2"| grass_color
 +
| Optional TAG_Int
 +
| colspan="2"| ?
 +
| Example: 8364543, which is #7FA1FF in RGB.
 +
|-
 +
| colspan="2"| grass_color_modifier
 +
| Optional TAG_String
 +
| colspan="2"| Unknown, likely affects foliage color.
 +
| If set, known values are "swamp" and "dark_forest".
 +
|-
 +
| colspan="2"| music
 +
| Optional TAG_Compound
 +
| colspan="2"| Music properties for the biome.
 +
| If present, contains the fields: replace_current_music (TAG_Byte), sound (TAG_String), max_delay (TAG_Int), min_delay (TAG_Int).
 +
|-
 +
| colspan="2"| ambient_sound
 +
| Optional TAG_String
 +
| colspan="2"| Ambient soundtrack.
 +
| If present, the ID of a soundtrack. Example: "minecraft:ambient.basalt_deltas.loop".
 +
|-
 +
| colspan="2"| additions_sound
 +
| Optional TAG_Compound
 +
| colspan="2"| Additional ambient sound that plays randomly.
 +
| If present, contains the fields: sound (TAG_String), tick_chance (TAG_Double).
 +
|-
 +
| colspan="2"| mood_sound
 +
| Optional TAG_Compound
 +
| colspan="2"| Additional ambient sound that plays at an interval.
 +
| If present, contains the fields: sound (TAG_String), tick_delay (TAG_Int), offset (TAG_Double), block_search_extent (TAG_Int).
 +
|-
 +
| rowspan="2"| particle
 +
| probability
 +
| rowspan="2"| Optional TAG_Compound
 +
| TAG_FLOAT
 +
| rowspan="2"| Particles that appear randomly in the biome.
 +
| Possibly the probability of spawning the particle.
 +
| ?
 +
|-
 +
| options
 +
| TAG_COMPOUND
 +
| The properties of the particle to spawn.
 +
| Contains the field "type" (TAG_String), which identifies the particle type.
 +
|}
  
=== Block Break Animation (0x37) ===
+
Chat registry:
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
!Name
! class="col0" | Packet ID
+
!Type
! class="col1" | Field Name
+
!style="width: 250px;" colspan="2"| Notes
! class="col2" | Field Type
+
|-
! class="col3" | Example
+
| type
! class="col4" | Notes
+
| TAG_String
|- class="row1"
+
| The name of the registry. Always "minecraft:chat_type".
| class="col0 centeralign" rowspan=5 | 0x37
+
|-
| class="col1 centeralign" | EID?
+
| value
| class="col2 centeralign" | int
+
| TAG_List
| class="col3 centeralign" |
+
| List of chat type registry entries (see below).
| class="col4" | Entity breaking the block?
+
|}
|- class="row2"
 
| class="col1 centeralign" | X
 
| class="col2 centeralign" | int
 
| class="col3 centeralign" |
 
| class="col4" rowspan=3 | Block position
 
|- class="row2"
 
| class="col1 centeralign" | Y
 
| class="col2 centeralign" | int
 
| class="col3 centeralign" |
 
|- class="row2"
 
| class="col1 centeralign" | Z
 
| class="col2 centeralign" | int
 
| class="col3 centeralign" |
 
|- class="row3"
 
| class="col1 centeralign" | Unknown
 
| class="col2 centeralign" | byte
 
| class="col3 centeralign" | 1
 
| class="col4" | ?
 
|- class="row2"
 
! class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 4 bytes
 
|}
 
  
== Changed packets ==
+
Chat type:
  
=== Login Request (0x01) ===
+
{| class="wikitable"
 +
!Name
 +
!Type
 +
!style="width: 250px;" colspan="2"| Notes
 +
|-
 +
| name
 +
| TAG_String
 +
| The type's name (eg "minecraft:chat")
 +
|-
 +
| id
 +
| TAG_Int
 +
|
 +
|-
 +
| elements
 +
| TAG_Compound
 +
| "chat" and "narration" TAG_Compound's (see below)
 +
|}
  
''Two-Way''
+
Chat type "chat" and "narration":
  
See [[Protocol Encryption]] for information on logging in.
+
{| class="wikitable"
 +
!Name
 +
!Type
 +
!style="width: 250px;" colspan="2"| Notes
 +
|-
 +
| translation_key
 +
| TAG_String
 +
|
 +
|-
 +
| style
 +
| TAG_Compound
 +
| Similar to Chat JSON (only present in "chat" TAG_Compound)
 +
|-
 +
| parameters
 +
| TAG_List of TAG_String
 +
| Values can be "sender", "target" and "content"
 +
|}
  
'''Client to Server'''
+
==== Open Sign Editor ====
  
Just 1 byte C->S
+
Sent when the client has placed a sign and is allowed to send [[#Update Sign|Update Sign]].  There must already be a sign at the given location (which the client does not do automatically) - send a [[#Block Update|Block Update]] first.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
! class="col0" | Packet ID
+
! State
|- class="row1"
+
! Bound To
| class="col0 centeralign" | 0x01
+
! Field Name
|}
+
! Field Type
 +
! Notes
 +
|-
 +
| rowspan="2" | 0x31
 +
| rowspan="2" | Play
 +
| rowspan="2" | Client
 +
| Location
 +
| Position
 +
|
 +
|- {{added}}
 +
| Is Front Text
 +
| Boolean
 +
| Whether the opened editor is for the front or on the back of the sign
 +
|}
 +
 
 +
==== End Combat ====
  
'''Server to Client'''
+
Unused by the Notchian client.  This data was once used for twitch.tv metadata circa 1.8.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
! class="col0" | Packet ID
+
! State
! class="col1" | Field Name
+
! Bound To
! class="col2" | Field Type
+
! Field Name
! class="col3" | Example
+
! Field Type
! class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="7" | 0x01
+
| rowspan="2"| 0x36
| class="col1 centeralign" | Entity ID
+
| rowspan="2"| Play
| class="col2 centeralign" | int
+
| rowspan="2"| Client
| class="col3 centeralign" | <code>1298</code>
+
| Duration
| class="col4" | The Players Entity ID
+
| VarInt
|- class="row2"
+
| Length of the combat in ticks.
| class="col0 centeralign" | Level Type
+
|- {{removed}}
| class="col1 centeralign" | string
+
| Entity ID
| class="col2 centeralign" | default
+
| Int
| class="col3" | default or SUPERFLAT; level-type in server.properties
+
| ID of the primary opponent of the ended combat, or -1 if there is no obvious primary opponent.
|- class="row3"
+
|}
| class="col0 centeralign" | Server mode
+
 
| class="col1 centeralign" | byte
+
==== Combat Death ====
| class="col2 centeralign" | <code>0</code>
+
 
| class="col3" | 0 for survival, 1 for creative
+
Used to send a respawn screen.
|- class="row4"
 
| class="col0 centeralign" | Dimension
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | <code>0</code>
 
| class="col3" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End
 
|- class="row5"
 
| class="col0 centeralign" | Difficulty
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | <code>1</code>
 
| class="col3" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard
 
|- class="row6"
 
| class="col0 centeralign" | Not used
 
| class="col1 centeralign" | unsigned byte
 
| class="col2 centeralign" | <code>0</code>
 
| class="col3" | Only 0 observed from vanilla server, was previously world height
 
|- class="row7"
 
| class="col0 centeralign" | Max players
 
| class="col1 centeralign" | unsigned byte
 
| class="col2 centeralign" | <code>8</code>
 
| class="col3" | Used by the client to draw the player list
 
|- class="row8"
 
! class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 12 bytes + length of strings
 
|}
 
  
=== Handshake (0x02) ===
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| rowspan="3"| 0x38
 +
| rowspan="3"| Play
 +
| rowspan="3"| Client
 +
| Player ID
 +
| VarInt
 +
| Entity ID of the player that died (should match the client's entity ID).
 +
|- {{removed}}
 +
| Entity ID
 +
| Int
 +
| The killer entity's ID, or -1 if there is no obvious killer.
 +
|-
 +
| Message
 +
| [[Chat]]
 +
| The death message.
 +
|}
  
''Client to server''
+
==== Respawn ====
  
See [[Protocol Encryption]] for information on logging in.
+
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
! class="col0" | Packet ID
+
! State
! class="col1" | Field Name
+
! Bound To
! class="col2" | Field Type
+
! Field Name
! class="col3" | Example
+
! Field Type
! class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="4" | 0x02
+
| rowspan="12"| 0x41
| class="col1 centeralign" | Protocol Version
+
| rowspan="12"| Play
| class="col2 centeralign" | byte
+
| rowspan="12"| Client
| class="col3 centeralign" | <code>32</code>
+
| Dimension Type
| class="col4" |  
+
| Identifier
|- class="row2"
+
| Valid dimensions are defined per dimension registry sent in [[#Login (play)|Login (play)]]
| class="col1 centeralign" | Username
+
|-
| class="col2 centeralign" | string
+
| Dimension Name
| class="col3 centeralign" | <code>TkTech</code>
+
| Identifier
| class="col4" | The username of the player attempting to connect
+
| Name of the dimension being spawned into.
|- class="row3"
+
|-
| class="col1 centeralign" | Server Host
+
| Hashed seed
| class="col2 centeralign" | string
+
| Long
| class="col3 centeralign" | <code>localhost</code>
+
| First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
| class="col4" |  
+
|-
|- class="row4"
+
| Gamemode
| class="col1 centeralign" | Server Port
+
| Unsigned Byte
| class="col2 centeralign" | int
+
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
| class="col3 centeralign" | <code>25565</code>
+
|-
| class="col4" |
+
| Previous Gamemode
|- class="row5"
+
| Byte
! class="col0" | Total Size:
+
| -1: Undefined (null), 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. The previous gamemode. Vanilla client uses this for the debug (F3 + N & F3 + F4) gamemode switch. (More information needed)
| class="col1 rightalign" colspan="4" | 10 bytes + length of strings
+
|-
|}
+
| Is Debug
 +
| Boolean
 +
| True if the world is a {{Minecraft Wiki|debug mode}} world; debug mode worlds cannot be modified and have predefined blocks.
 +
|-
 +
| Is Flat
 +
| Boolean
 +
| True if the world is a {{Minecraft Wiki|superflat}} world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
 +
|-
 +
| Data kept
 +
| Byte
 +
| Bit mask. 0x01: Keep attributes, 0x02: Keep metadata. Tells which data should be kept on the client side once the player has respawned.
 +
In the Notchian implementation, this is context dependent:
 +
* normal respawns (after death) keep no data;
 +
* exiting the end poem/credits keeps the attributes;
 +
* other dimension changes (portals or teleports) keep all data.
 +
|-
 +
| Has death location
 +
| Boolean
 +
| If true, then the next two fields are present.
 +
|-
 +
| Death dimension Name
 +
| Optional Identifier
 +
| Name of the dimension the player died in.
 +
|-
 +
| Death location
 +
| Optional Position
 +
| The location that the player died at.
 +
|- {{added}}
 +
| Portal cooldown
 +
| VarInt
 +
| The number of ticks until the player can use the portal again<sup>What impact does this have on the client? Needs more info</sup>.
 +
|}
 +
 
 +
{{Warning2|Avoid changing player's dimension to same dimension they were already in unless they are dead. If you change the dimension to one they are already in, weird bugs can occur, such as the player being unable to attack other players in new world (until they die and respawn).
 +
 
 +
Before 1.16, if you must respawn a player in the same dimension without killing them, send two respawn packets, one to a different world and then another to the world you want. You do not need to complete the first respawn; it only matters that you send two packets.}}
 +
 
 +
==== Update Section Blocks ====
  
=== Entity Equipment (0x05) ===
+
Fired whenever 2 or more blocks are changed within the same chunk on the same tick.
  
''Server to Client''
+
{{Warning|Changing blocks in chunks not loaded by the client is unsafe (see note on [[#Block Update|Block Update]]).}}
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
! class="col0" | Packet ID
+
! State
! class="col1" | Field Name
+
! Bound To
! class="col2" | Field Type
+
! Field Name
! class="col3" | Example
+
! Field Type
! class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="3" | 0x05
+
| rowspan="4"| 0x43
| class="col1 centeralign" | Entity ID
+
| rowspan="4"| Play
| class="col2 centeralign" | int
+
| rowspan="4"| Client
| class="col3 centeralign" | 0x00010643
+
| Chunk section position
| class="col4" | Named Entity ID
+
| Long
|- class="row2"
+
| Chunk section coordinate (encoded chunk x and z with each 22 bits, and section y with 20 bits, from left to right).
| class="col0 centeralign" | Slot
+
|- {{removed}}
| class="col1 centeralign" | short
+
| Suppress Light Updates
| class="col2 centeralign" | 4
+
| Boolean
| class="col3" | Equipment slot: 0=held, 1-4=armor slot
+
| Whether to ignore light updates caused by the contained changes. Always inverse the preceding Update Light packet's "Trust Edges" bool
|- class="row3"
+
|-
| class="col0 centeralign" | Item
+
| Blocks array size
| class="col1 centeralign" | slot
+
| VarInt
| class="col2 centeralign" |
+
| Number of elements in the following array.
| class="col3" | Item in slot format
+
|-
|- class="row5"
+
| Blocks
! class="col0" | Total Size:
+
| Array of VarLong
| class="col1 rightalign" colspan="4" | 11 bytes
+
| Each entry is composed of the block state id, shifted left by 12, and the relative block position in the chunk section (4 bits for x, z, and y, from left to right).
|}
+
|}
  
=== Respawn (0x09) ===
+
Chunk section position is encoded:
 +
<syntaxhighlight lang="java">
 +
((sectionX & 0x3FFFFF) << 42) | (sectionY & 0xFFFFF) | ((sectionZ & 0x3FFFFF) << 20);
 +
</syntaxhighlight>
 +
and decoded:
 +
<syntaxhighlight lang="java">
 +
sectionX = long >> 42;
 +
sectionY = long << 44 >> 44;
 +
sectionZ = long << 22 >> 42;
 +
</syntaxhighlight>
  
''Two-Way''
+
Blocks are encoded:
 +
<syntaxhighlight lang="java">
 +
blockStateId << 12 | (blockLocalX << 8 | blockLocalZ << 4 | blockLocalY)
 +
//Uses the local position of the given block position relative to its respective chunk section
 +
</syntaxhighlight>
  
Sent by the client when the player presses the "Respawn" button after dying. The server then teleports the user to the spawn point, and sends a respawn packet in response.  The client will not leave the respawn screen until it receives a respawn packet.
+
==== Update Advancements ====
  
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packetYou do not need to unload chunks, the client will do it automatically.
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! colspan="2"| Field Name
 +
! colspan="2"| Field Type
 +
! Notes
 +
|-
 +
| rowspan="9"| 0x69
 +
| rowspan="9"| Play
 +
| rowspan="9"| Client
 +
| colspan="2"| Reset/Clear
 +
| colspan="2"| Boolean
 +
| Whether to reset/clear the current advancements.
 +
|-
 +
| colspan="2"| Mapping size
 +
| colspan="2"| VarInt
 +
| Size of the following array.
 +
|-
 +
| rowspan="2"| Advancement mapping
 +
| Key
 +
| rowspan="2"| Array
 +
| Identifier
 +
| The identifier of the advancement.
 +
|-
 +
| Value
 +
| Advancement
 +
| See below
 +
|-
 +
| colspan="2"| List size
 +
| colspan="2"| VarInt
 +
| Size of the following array.
 +
|-
 +
| colspan="2"| Identifiers
 +
| colspan="2"| Array of Identifier
 +
| The identifiers of the advancements that should be removed.
 +
|-
 +
| colspan="2"| Progress size
 +
| colspan="2"| VarInt
 +
| Size of the following array.
 +
|-
 +
| rowspan="2"| Progress mapping
 +
| Key
 +
| rowspan="2"| Array
 +
  | Identifier
 +
| The identifier of the advancement.
 +
|-
 +
| Value
 +
| Advancement progress
 +
| See below.
 +
|}
  
'''Client to Server'''
+
Advancement structure:
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! colspan="2"| Field Name
! class="col0" | Packet ID
+
! colspan="2"| Field Type
|- class="row1"
+
! Notes
| class="col0 centeralign" | 0x09
+
|-
|}
+
| colspan="2"| Has parent
 +
| colspan="2"| Boolean
 +
| Indicates whether the next field exists.
 +
|-
 +
| colspan="2"| Parent id
 +
| colspan="2"| Optional Identifier
 +
| The identifier of the parent advancement.
 +
|-
 +
| colspan="2"| Has display
 +
| colspan="2"| Boolean
 +
| Indicates whether the next field exists.
 +
|-
 +
| colspan="2"| Display data
 +
| colspan="2"| Optional advancement display
 +
| See below.
 +
|-
 +
| colspan="2"| Number of criteria
 +
| colspan="2"| VarInt
 +
| Size of the following array.
 +
|-
 +
| rowspan="2"| Criteria
 +
| Key
 +
| rowspan="2"| Array
 +
| Identifier
 +
| The identifier of the criterion.
 +
|-
 +
| Value
 +
| '''Void'''
 +
| There is ''no'' content written here. Perhaps this will be expanded in the future?
 +
|-
 +
| colspan="2"| Array length
 +
| colspan="2"| VarInt
 +
| Number of arrays in the following array.
 +
|-
 +
| rowspan="2"| Requirements
 +
| Array length 2
 +
| rowspan="2"| Array
 +
| VarInt
 +
| Number of elements in the following array.
 +
|-
 +
| Requirement
 +
| Array of String
 +
| Array of required criteria.
 +
|- {{added}}
 +
| colspan="2"| Sends telemetry data
 +
| colspan="2"| Boolean
 +
| Whether the client should include this achievement in the telemetry data when it's completed.
 +
The Notchian client only sends data for advancements on the <code>minecraft</code> namespace.
 +
|}
 +
 
 +
Advancement display:
 +
 
 +
{| class="wikitable"
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| Title
 +
| Chat
 +
|
 +
|-
 +
| Description
 +
| Chat
 +
|
 +
|-
 +
| Icon
 +
| [[Slot]]
 +
|
 +
|-
 +
| Frame type
 +
| VarInt Enum
 +
| 0 = <code>task</code>, 1 = <code>challenge</code>, 2 = <code>goal</code>.
 +
|-
 +
| Flags
 +
| Int
 +
| 0x01: has background texture; 0x02: <code>show_toast</code>; 0x04: <code>hidden</code>.
 +
|-
 +
| Background texture
 +
| Optional Identifier
 +
| Background texture location.  Only if flags indicates it.
 +
|-
 +
| X coord
 +
| Float
 +
|
 +
|-
 +
| Y coord
 +
| Float
 +
|
 +
|}
  
'''Server to Client'''
+
Advancement progress:
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! colspan="2"| Field Name
! class="col0" | Packet ID
+
! colspan="2"| Field Type
! class="col1" | Field Name
+
! Notes
! class="col2" | Field Type
+
|-
! class="col3" | Example
+
| colspan="2"| Size
! class="col4" | Notes
+
| colspan="2"| VarInt
|- class="row1"
+
| Size of the following array.
| class="col0 centeralign" rowspan="5" | 0x09
+
|-
| class="col1 centeralign" | Dimension
+
| rowspan="2"| Criteria
| class="col2 centeralign" | int
+
| Criterion identifier
| class="col3 centeralign" | <code>1</code>
+
| rowspan="2"| Array
| class="col4" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End
+
| Identifier
|- class="row2"
+
| The identifier of the criterion.
| class="col1 centeralign" | Difficulty
+
|-
| class="col2 centeralign" | byte
+
| Criterion progress
| class="col3 centeralign" | <code>1</code>
+
| Criterion progress
| class="col4" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard. <code>1</code> is always sent c->s
+
|
|- class="row3"
+
|}
| class="col1 centeralign" | Creative mode
 
| class="col2 centeralign" | byte
 
| class="col3 centeralign" | <code>1</code>
 
| class="col4" | <code>0</code> for survival, <code>1</code> for creative.
 
|- class="row4"
 
| class="col1 centeralign" | World height
 
| class="col2 centeralign" | short
 
| class="col3 centeralign" | <code>256</code>
 
| class="col4" | Defaults to <code>256</code>
 
|- class="row5"
 
| class="col1 centeralign" | Level Type
 
| class="col2 centeralign" | string
 
| class="col3 centeralign" | default
 
| class="col4" | See [[#0x01|0x01 login]]
 
|- class="row6"
 
! class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 11 bytes + length of string
 
|}
 
  
=== Spawn Object/Vehicle (0x17) ===
+
Criterion progress:
  
''Server to Client''
+
{| class="wikitable"
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| Achieved
 +
| Boolean
 +
| If true, next field is present.
 +
|-
 +
| Date of achieving
 +
| Optional Long
 +
| As returned by [https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getTime() <code>Date.getTime</code>].
 +
|}
  
Sent by the server when an Object/Vehicle is created. The throwers entity id is now used for fishing floats too.
+
==== Feature Flags ====
 +
 
 +
Used to enable and disable features, generally experimental ones, on the client.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
! class="col0" | Packet ID
+
! State
! class="col1" | Field Name
+
! Bound To
! class="col2" | Field Type
+
! Field Name
! class="col3" | Example
+
! Field Type
! class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="9" | 0x17
+
| rowspan="2"| 0x6B
| class="col1 centeralign" | EID
+
| rowspan="2"| Play
| class="col2 centeralign" | int
+
| rowspan="2"| Client
| class="col3 centeralign" | <code>62</code>
+
| Total Features
| class="col4" | Entity ID of the Object
+
| VarInt
|- class="row2"
+
| Number of features that appear in the array below.
| class="col0 centeralign" | Type
+
|-
| class="col1 centeralign" | byte
+
| Feature Flags
| class="col2 centeralign" | <code>11</code>
+
| Identifier Array
| class="col3" | The type of object (see [[Entities#Objects]])
+
|
|- class="row3"
+
|}
| class="col0 centeralign" | X
+
 
| class="col1 centeralign" | int
+
As of {{change|1.19.4|1.20}}, the following feature flags are available:
| class="col2 centeralign" | <code>16080</code>
 
| class="col3" | The Absolute Integer X Position of the object
 
|- class="row4"
 
| class="col0 centeralign" | Y
 
| class="col1 centeralign" | int
 
| class="col2 centeralign" | <code>2299</code>
 
| class="col3" | The Absolute Integer Y Position of the object
 
|- class="row5"
 
| class="col0 centeralign" | Z
 
| class="col1 centeralign" | int
 
| class="col2 centeralign" | <code>592</code>
 
| class="col3" | The Absolute Integer Z Position of the object
 
|- class="row6"
 
| class="col0 centeralign" | thrower's entity ID
 
| class="col1 centeralign" | int
 
| class="col2 centeralign" | <code>0</code>
 
| class="col3" | If this is bigger than 0, this is a entity trown by a other entity and the next 3 fields are sent.
 
|- class="row7"
 
| class="col0 centeralign" | Speed X
 
| class="col1 centeralign" | short
 
| class="col2 centeralign" | <code>0</code>
 
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the X axis.
 
|- class="row5"
 
| class="col0 centeralign" | Speed Y
 
| class="col1 centeralign" | short
 
| class="col2 centeralign" | <code>0</code>
 
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Y axis.
 
|- class="row5"
 
| class="col0 centeralign" | Speed Z
 
| class="col1 centeralign" | short
 
| class="col2 centeralign" | <code>0</code>
 
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Z axis.
 
|- class="row6"
 
! class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 22 or 28 bytes
 
|}
 
  
 +
* minecraft:vanilla - enables vanilla features</li>
 +
* minecraft:bundle - enables support for the bundle</li>
 +
* {{change|minecraft:update_1_20 - enables all the Minecraft 1.20 features that are available in 1.19.4</li>|}}
  
{{anchor|0x18}}
+
==== Update Recipes ====
  
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! colspan="2"| Field Name
 +
! colspan="2"| Field Type
 +
! Notes
 +
|-
 +
| rowspan="4"| 0x6D
 +
| rowspan="4"| Play
 +
| rowspan="4"| Client
 +
| colspan="2"| Num Recipes
 +
| colspan="2"| VarInt
 +
| Number of elements in the following array.
 +
|-
 +
| rowspan="3"| Recipe
 +
| Type
 +
| rowspan="3"| Array
 +
| Identifier
 +
| The recipe type, see below.
 +
|-
 +
| Recipe ID
 +
| Identifier
 +
|
 +
|-
 +
| Data
 +
| Varies
 +
| Additional data for the recipe.
 +
|}
  
=== Player Abilities (0xCA) ===
+
Recipe types:
This packet changed with 12w17a. It now contains 3 booleans but the values of these 3 booleans are not currently known.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Type
! class="col0" | Packet ID
+
! Description
! class="col1" | Field Name
+
! Data
! class="col2" | Field Type
+
|-
! class="col3" | Example
+
| <code>minecraft:crafting_shapeless</code>
! class="col4" | Notes
+
| Shapeless crafting recipe. All items in the ingredient list must be present, but in any order/slot.
|- class="row1"
+
| As follows:
| class="col0 centeralign" rowspan=4 | 0xCA
+
  {| class="wikitable"
| class="col1 centeralign" | Flags
+
    ! Name
| class="col2 centeralign" | byte
+
    ! Type
| class="col3 centeralign" | 5
+
    ! Description
| class="col4" |  
+
    |-
|- class="row2"
+
    | Group
| class="col1 centeralign" | Walking speed
+
    | String
| class="col2 centeralign" | byte
+
    | Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
| class="col3 centeralign" | 12
+
    |-
| class="col4" |  
+
    |Category
|- class="row3"
+
    |VarInt Enum
| class="col1 centeralign" | Flying speed
+
    |Building = 0, Redstone = 1, Equipment = 2, Misc = 3
| class="col2 centeralign" | byte
+
    |-
| class="col3 centeralign" | 25
+
    | Ingredient count
| class="col4" |  
+
    | VarInt
|- class="row2"
+
    | Number of elements in the following array.
! class="col0" | Total Size:
+
    |-
| class="col1 rightalign" colspan="4" | 4 bytes
+
    | Ingredients
|}
+
    | Array of Ingredient.
 +
    |
 +
    |-
 +
    | Result
 +
    | [[Slot]]
 +
    |
 +
    |}
 +
|-
 +
| <code>minecraft:crafting_shaped</code>
 +
| Shaped crafting recipe. All items must be present in the same pattern (which may be flipped horizontally or translated).
 +
| As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Width
 +
    | VarInt
 +
    |
 +
    |-
 +
    | Height
 +
    | VarInt
 +
    |
 +
    |-
 +
    | Group
 +
    | String
 +
    | Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
 +
    |-
 +
    |Category
 +
    |VarInt Enum
 +
    |Building = 0, Redstone = 1, Equipment = 2, Misc = 3
 +
    |-
 +
    | Ingredients
 +
    | Array of Ingredient
 +
    | Length is <code>width * height</code>. Indexed by <code>x + (y * width)</code>.
 +
    |-
 +
    | Result
 +
    | [[Slot]]
 +
    |-
 +
    | Show notification
 +
    | Boolean
 +
    | Show a toast when the recipe is [[Protocol#Update_Recipe_Book|added]].
 +
    |}
 +
|-
 +
| <code>minecraft:crafting_special_armordye</code>
 +
| Recipe for dying leather armor
 +
| rowspan="14" | As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    |Category
 +
    |VarInt Enum
 +
    |Building = 0, Redstone = 1, Equipment = 2, Misc = 3
 +
    |}
 +
|-
 +
| <code>minecraft:crafting_special_bookcloning</code>
 +
| Recipe for copying contents of written books
 +
|-
 +
| <code>minecraft:crafting_special_mapcloning</code>
 +
| Recipe for copying maps
 +
|-
 +
| <code>minecraft:crafting_special_mapextending</code>
 +
| Recipe for adding paper to maps
 +
|-
 +
| <code>minecraft:crafting_special_firework_rocket</code>
 +
| Recipe for making firework rockets
 +
|-
 +
| <code>minecraft:crafting_special_firework_star</code>
 +
| Recipe for making firework stars
 +
|-
 +
| <code>minecraft:crafting_special_firework_star_fade</code>
 +
| Recipe for making firework stars fade between multiple colors
 +
|-
 +
| <code>minecraft:crafting_special_repairitem</code>
 +
| Recipe for repairing items via crafting
 +
|-
 +
| <code>minecraft:crafting_special_tippedarrow</code>
 +
| Recipe for crafting tipped arrows
 +
|-
 +
| <code>minecraft:crafting_special_bannerduplicate</code>
 +
| Recipe for copying banner patterns
 +
|-
 +
| <code>minecraft:crafting_special_shielddecoration</code>
 +
| Recipe for applying a banner's pattern to a shield
 +
|-
 +
| <code>minecraft:crafting_special_shulkerboxcoloring</code>
 +
| Recipe for recoloring a shulker box
 +
|-
 +
| <code>minecraft:crafting_special_suspiciousstew</code>
 +
| Recipe for crafting suspicious stews
 +
|-
 +
| <code>minecraft:crafting_decorated_pot</code>
 +
| Recipe for crafting decorated pots
 +
{{change|{{Warning|The Notchian server only sends this recipe if [[Protocol#Feature_Flags|feature flag]] '''update_1_20''' was enabled}}|}}
 +
|-
 +
| <code>minecraft:smelting</code>
 +
| Smelting recipe
 +
| rowspan="4"| As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Group
 +
    | String
 +
    | Used to group similar recipes together in the recipe book.
 +
    |-
 +
    |Category
 +
    |VarInt Enum
 +
    |Food = 0, Blocks = 1, Misc = 2
 +
    |-
 +
    | Ingredient
 +
    | Ingredient
 +
    |
 +
    |-
 +
    | Result
 +
    | [[Slot]]
 +
    |
 +
    |-
 +
    | Experience
 +
    | Float
 +
    |
 +
    |-
 +
    | Cooking time
 +
    | VarInt
 +
    |
 +
    |}
 +
|-
 +
| <code>minecraft:blasting</code>
 +
| Blast furnace recipe
 +
|-
 +
| <code>minecraft:smoking</code>
 +
| Smoker recipe
 +
|-
 +
| <code>minecraft:campfire_cooking</code>
 +
| Campfire recipe
 +
|-
 +
| <code>minecraft:stonecutting</code>
 +
| Stonecutter recipe
 +
| As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Group
 +
    | String
 +
    | Used to group similar recipes together in the recipe book.  Tag is present in recipe JSON.
 +
    |-
 +
    | Ingredient
 +
    | Ingredient
 +
    |
 +
    |-
 +
    | Result
 +
    | [[Slot]]
 +
    |
 +
    |}
 +
|- {{removed}}
 +
| <code>minecraft:smithing</code>
 +
| Smithing table recipe
 +
{{Warning|The Notchian server only sends this recipe if [[Protocol#Feature_Flags|feature flag]] '''update_1_20''' was '''not''' enabled}}
 +
| As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Base
 +
    | Ingredient
 +
    | First item.
 +
    |-
 +
    | Addition
 +
    | Ingredient
 +
    | Second item.
 +
    |-
 +
    | Result
 +
    | [[Slot]]
 +
    |
 +
    |}
 +
|-
 +
| <code>minecraft:smithing_transform</code>
 +
| Recipe for smithing netherite gear
 +
{{change|{{Warning2|The Notchian server only sends this recipe if [[Protocol#Feature_Flags|feature flag]] '''update_1_20''' was enabled. It supersedes the <code>minecraft:smithing</code> recipe type}}|}}
 +
| As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Template
 +
    | Ingredient
 +
    | The smithing template.
 +
    |-
 +
    | Base
 +
    | Ingredient
 +
    | The base item.
 +
    |-
 +
    | Addition
 +
    | Ingredient
 +
    | The additional ingredient.
 +
    |-
 +
    | Result
 +
    | [[Slot]]
 +
    |
 +
    |}
 +
|-
 +
| <code>minecraft:smithing_trim</code>
 +
| Recipe for applying armor trims
 +
{{change|{{Warning2|The Notchian server only sends this recipe if [[Protocol#Feature_Flags|feature flag]] '''update_1_20''' was enabled. It supersedes the <code>minecraft:smithing</code> recipe type}}|}}
 +
| As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Template
 +
    | Ingredient
 +
    | The smithing template.
 +
    |-
 +
    | Base
 +
    | Ingredient
 +
    | The base item.
 +
    |-
 +
    | Addition
 +
    | Ingredient
 +
    | The additional ingredient.
 +
    |}
 +
|}
 +
 
 +
Ingredient is defined as:
 +
 
 +
{| class="wikitable"
 +
! Name
 +
! Type
 +
! Description
 +
|-
 +
| Count
 +
| VarInt
 +
| Number of elements in the following array.
 +
|-
 +
| Items
 +
| Array of [[Slot]]
 +
| Any item in this array may be used for the recipe.  The count of each item should be 1.
 +
|}
 +
 
 +
=== Serverbound ===
 +
 
 +
==== Update Sign ====
 +
 
 +
This message is sent from the client to the server when the “Done” button is pushed after placing a sign.
  
=== Player Block Placement (0x0F) ===
+
The server only accepts this packet after [[#Open Sign Editor|Open Sign Editor]], otherwise this packet is silently ignored.
  
 
{| class="wikitable"
 
{| class="wikitable"
|- class="row0"
+
! Packet ID
! class="col0" | Packet ID
+
! State
! class="col1" | Field Name
+
! Bound To
! class="col2" | Field Type
+
! Field Name
! class="col3" | Example
+
! Field Type
! class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan="8" | 0x0F
+
| rowspan="6"| 0x2E
| class="col1 centeralign" | X
+
| rowspan="6"| Play
| class="col2 centeralign" | int
+
| rowspan="6"| Server
| class="col3 centeralign" | <code>32</code>
+
| Location
| class="col4" | Block position
+
| Position
|- class="row2"
+
| Block Coordinates.
| class="col0 centeralign" | Y
+
|- {{added}}
| class="col1 centeralign" | unsigned byte
+
| Is Front Text
| class="col2 centeralign" | <code>64</code>
+
| Boolean
| class="col3" | Block position
+
| Whether the updated text is in front or on the back of the sign
|- class="row3"
+
|-
| class="col0 centeralign" | Z
+
| Line 1
| class="col1 centeralign" | int
+
| String (384)
| class="col2 centeralign" | <code>32</code>
+
| First line of text in the sign.
| class="col3 leftalign" | Block position
+
|-
|- class="row4"
+
| Line 2
| class="col0 centeralign" | Direction
+
| String (384)
| class="col1 centeralign" | byte
+
| Second line of text in the sign.
| class="col2 centeralign" | <code>3</code>
+
|-
| class="col3" | The offset to use for block/item placement (see below)
+
| Line 3
|- class="row5"
+
| String (384)
| class="col0 centeralign" | Held item
+
| Third line of text in the sign.
| class="col1 centeralign" | [[Slot_Data|slot]]
+
|-
| class="col2 centeralign" |
+
| Line 4
| class="col3" |
+
| String (384)
|- class="row6"
+
| Fourth line of text in the sign.
| class="col0 centeralign" | Unknown
+
|}
| class="col1 centeralign" | byte
+
 
| class="col2 centeralign" | <code>0 - 0x0B</code> (or more)
+
== Status ==
| class="col3" | ?
+
 
|- class="row6"
+
=== Clientbound ===
| class="col0 centeralign" | Unknown
+
 
| class="col1 centeralign" | byte
+
No changes so far.
| class="col2 centeralign" | <code>0 - 0x10</code>
+
 
| class="col3" | ?
+
=== Serverbound ===
|- class="row6"
 
| class="col0 centeralign" | Unknown
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | <code>0 - 0x10</code>
 
| class="col3" | ?
 
|- class="row9"
 
! class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 11 bytes + slot data
 
|}
 
  
== Protocol History ==
+
No changes so far.
  
=== 2012-06-14 ===
+
== Login ==
* 12w24a
 
* Protocol version is now 36
 
* Changed Packet 0x01(Login Request), only used as Login Reply
 
* New Packet 0xCD used for Login Request and Respawn (1 byte payload)
 
* All items (except the empty hand) now send enchantment data
 
* more...
 
  
=== 2012-06-07 ===
+
=== Clientbound ===
* 12w23b
 
* Protocol version is now 35
 
* Change packet: Player Block Placement
 
* New Packet: Block breaking animation
 
  
=== 2012-05-24 ===
+
No changes so far.
* 12w21a
 
* No packet changes but the algorithm was changed to AES128 with the shared key as the IV, will be described in [[Protocol Encryption]]
 
  
=== 2012-05-10 ===
+
=== Serverbound ===
* 12w19a
 
* No packet changes, but an other encryption algorythm is used, described in [[Protocol Encryption]]
 
* The items which are not enchantable in 12w18a are now readded
 
* Fishing floats, spawned by a 0x17 packet do now use the extra fields
 
  
=== 2012-05-03 ===
+
No changes so far.
* 12w18a
 
* Protocol version is now 32
 
* New packet: 0x3D Name Sound Effect
 
* Changed packet: 0x01 Login Request
 
* Changed packet: 0x02 Handshake
 
* Changed packet: 0xCA Player Abilities
 
* Changed packet: 0xCC Locale and View Distance
 
* Changed packet: 0x09 Respawn
 
* Removed packet: 0x32 Map Column Allocation
 
* This items are not enchantable in this version: 0x103, 0x105, 0x15A, 0x167, 0x10C, 0x10D, 0x10E, 0x10F, 0x122, 0x110, 0x111, 0x112, 0x113, 0x123, 0x10B, 0x100, 0x101, 0x102, 0x124, 0x114, 0x115, 0x116, 0x117, 0x125, 0x11B, 0x11C, 0x11D, 0x11E, 0x126
 
  
=== 2012-04-26 ===
 
* 12w17a
 
* Protocol version is now 31
 
* RC4 based encryption, described in [[Protocol Encryption]]
 
* Changed packet: 0x01 Login Request
 
* Changed packet: 0x02 Handshake
 
* Changed packet: 0xCC Locale and View Distance
 
* Changed packet: 0xCA Player Abilities
 
* New packet: 0xFC Encryption Key Response
 
* New packet: 0xFD Encryption Key Request
 
* New Item: Book & Quills (0x182) is enchantable
 
* New Item: Written Book (0x183) is enchantable
 
  
=== 2012-04-19 ===
+
[[Category:Minecraft Modern]]
* 12w16a
 
* Protocol version is now 30
 
* New packet: 0xCB Tab-complete
 
* New packet: 0xCC Locale and View Distance
 

Latest revision as of 18:27, 31 May 2023

This page documents the changes from the last stable Minecraft release (currently 1.19.4, protocol 762) to the current pre-release (currently 1.20-rc1, protocol Snapshot 141). Note that this page contains bleeding-edge information that may not be completely or correctly documented.

One who wishes to commandeer the merging of this into Protocol when an update is made must be sure to respect any changes that may have occurred to the respective packets there.

Contents

Data types

No changes so far.

Packets

ID Packet name Documentation
Play clientbound
0x24 Chunk Data and Update Light Current Pre
0x27 Update Light Current Pre
0x28 Login (play) Current Pre
0x31 Open Sign Editor Current Pre
0x36 End Combat Current Pre
0x38 Combat Death Current Pre
0x41 Respawn Current Pre
0x43 Update Section Blocks Current Pre
0x69 Update Advancements Current Pre
0x6B Feature Flags Current Pre
0x6D Update Recipes Current Pre
Play serverbound
0x2E Update Sign Current Pre

New/modified data types

No changes so far.

Entity Metadata

No changes so far.

Entity

No changes so far.

Block Actions

No changes so far.

Inventories

Type Name Description
0 minecraft:generic_9x1 A 1-row inventory, not used by the notchian server.
1 minecraft:generic_9x2 A 2-row inventory, not used by the notchian server.
2 minecraft:generic_9x3 General-purpose 3-row inventory. Used by Chest, minecart with chest, ender chest, and barrel
3 minecraft:generic_9x4 A 4-row inventory, not used by the notchian server.
4 minecraft:generic_9x5 A 5-row inventory, not used by the notchian server.
5 minecraft:generic_9x6 General-purpose 6-row inventory, used by large chests.
6 minecraft:generic_3x3 General-purpose 3-by-3 square inventory, used by Dispenser and Dropper
7 minecraft:anvil Anvil
8 minecraft:beacon Beacon
9 minecraft:blast_furnace Blast Furnace
10 minecraft:brewing_stand Brewing stand
11 minecraft:crafting Crafting table
12 minecraft:enchantment Enchantment table
13 minecraft:furnace Furnace
14 minecraft:grindstone Grindstone
15 minecraft:hopper Hopper or minecart with hopper
16 minecraft:lectern Lectern
17 minecraft:loom Loom
18 minecraft:merchant Villager, Wandering Trader
19 minecraft:shulker_box Shulker box
20 minecraft:legacy_smithing Smithing Table

Warning.png The Notchian server only sends this type if feature flag update_1_20 was not enabled

21 20 minecraft:smithing Smithing Table

Warning.png The Notchian server only sends this type if feature flag update_1_20 was enabled

22 21 minecraft:smoker Smoker
23 22 minecraft:cartography Cartography Table
24 23 minecraft:stonecutter Stonecutter

Plugin Channels

No changes so far.

Play

Clientbound

Chunk Data and Update Light

Main article: Chunk Format
See also: #Unload Chunk
Huh.png The following information needs to be added to this page:
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... (/r/mojira discussion which notes that it seems to be some kind of interpolation)

This packet sends all block entities in the chunk (though sending them is not required; it is still legal to send them with Block Entity Data later). The light data in this packet is the same format as in the Update Light packet.

Packet ID State Bound To Field Name Field Type Notes
0x24 Play Client Chunk X Int Chunk coordinate (block coordinate divided by 16, rounded down)
Chunk Z Int Chunk coordinate (block coordinate divided by 16, rounded down)
Heightmaps NBT Compound containing one long array named MOTION_BLOCKING, 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 ceil(log2(height + 1))). The Notchian server also adds a WORLD_SURFACE long array, the purpose of which is unknown, but it's not required for the chunk to be accepted.
Size VarInt Size of Data in bytes
Data Byte array See data structure in Chunk Format
Number of block entities VarInt Number of elements in the following array
Block Entity Packed XZ Array Byte The packed section coordinates, calculated from ((blockX & 15) << 4) | (blockZ & 15)
Y Short The height relative to the world
Type VarInt The type of block entity
Data NBT The block entity's data, without the X, Y, and Z values
Trust Edges Boolean If edges should be trusted for light updates.
Sky Light Mask 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).
Block Light Mask 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.
Empty Sky Light Mask 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.
Empty Block Light Mask 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.
Sky Light array count VarInt Number of entries in the following array; should match the number of bits set in Sky Light Mask
Sky Light arrays Length 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 ((y<<8) | (z<<4) | x) / 2 If there's a remainder, masked 0xF0 else 0x0F.
Block Light array count VarInt Number of entries in the following array; should match the number of bits set in Block Light Mask
Block Light arrays Length 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 ((y<<8) | (z<<4) | x) / 2 If there's a remainder, masked 0xF0 else 0x0F.

Note that the Notchian client requires an Set Center Chunk packet when it crosses a chunk border, otherwise it'll only display render distance + 2 chunks around the chunk it spawned in.

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): 122344566480743131516914101202

0020863148418841 0000000000100000100001100011000101001000010000011000100001000001
01018A7260F68C87 0000000100000001100010100111001001100000111101101000110010000111

Update Light

Updates light levels for a chunk. See Light for information on how lighting works in Minecraft.

Packet ID State Bound To Field Name Field Type Notes
0x27 Play Client Chunk X VarInt Chunk coordinate (block coordinate divided by 16, rounded down)
Chunk Z VarInt Chunk coordinate (block coordinate divided by 16, rounded down)
Trust Edges Boolean If edges should be trusted for light updates.
Sky Light Mask 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).
Block Light Mask 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.
Empty Sky Light Mask 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.
Empty Block Light Mask 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.
Sky Light array count VarInt Number of entries in the following array; should match the number of bits set in Sky Light Mask
Sky Light arrays Length 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.
Block Light array count VarInt Number of entries in the following array; should match the number of bits set in Block Light Mask
Block Light arrays Length 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.

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.

Packet ID State Bound To Field Name Field Type Notes
0x28 Play Client Entity ID Int The player's Entity ID (EID).
Is hardcore Boolean
Gamemode Unsigned Byte 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
Previous Gamemode Byte -1: Undefined (null), 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. The previous gamemode. Vanilla client uses this for the debug (F3 + N & F3 + F4) gamemode switch. (More information needed)
Dimension Count VarInt Size of the following array.
Dimension Names Array of Identifier Identifiers for all dimensions on the server.
Registry Codec NBT Tag Compound Represents certain registries that are sent from the server and are applied on the client.
Dimension Type Identifier Name of the dimension type being spawned into.
Dimension Name Identifier Name of the dimension being spawned into.
Hashed seed Long First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
Max Players VarInt Was once used by the client to draw the player list, but now is ignored.
View Distance VarInt Render distance (2-32).
Simulation Distance VarInt The distance that the client will process specific things, such as entities.
Reduced Debug Info Boolean If true, a Notchian client shows reduced information on the debug screen. For servers in development, this should almost always be false.
Enable respawn screen Boolean Set to false when the doImmediateRespawn gamerule is true.
Is Debug Boolean True if the world is a debug mode world; debug mode worlds cannot be modified and have predefined blocks.
Is Flat Boolean True if the world is a superflat world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
Has death location Boolean If true, then the next two fields are present.
Death dimension name Optional Identifier Name of the dimension the player died in.
Death location Optional Position The location that the player died at.
Portal cooldown VarInt The number of ticks until the player can use the portal againWhat impact does this have on the client? Needs more info.


The Registry Codec NBT Tag Compound (Default value in JSON as of 1.19, 1.19.2) includes three registries: "minecraft:dimension_type", "minecraft:worldgen/biome", and "minecraft:chat_type".

Name Type Notes
minecraft:dimension_type TAG_Compound The dimension type registry (see below).
minecraft:worldgen/biome TAG_Compound The biome registry (see below).
minecraft:chat_type TAG_Compound The chat type registry (see below).

Dimension type registry:

Name Type Notes
type TAG_String The name of the registry. Always "minecraft:dimension_type".
value TAG_List List of dimension types registry entries (see below).

Dimension type registry entry:

Name Type 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).

Dimension type:

Name Type Meaning Values
piglin_safe TAG_Byte Whether piglins shake and transform to zombified piglins. 1: true, 0: false.
has_raids TAG_Byte Whether players with the Bad Omen effect can cause a raid. 1: true, 0: false.
monster_spawn_light_level TAG_Int or TAG_Compound Possibly the light level(s) at which monsters can spawn. When TAG_Int, 0 - 15. When TAG_Compound, contains the fields: type (TAG_String), appears to be always "minecraft:uniform", and value (TAG_Compound), which contains the fields: max_inclusive (TAG_Int), min_inclusive (TAG_Int).
monster_spawn_block_light_limit TAG_Int
natural TAG_Byte When false, compasses spin randomly. When true, nether portals can spawn zombified piglins. 1: true, 0: false.
ambient_light TAG_Float How much light the dimension has. 0.0 to 1.0.
fixed_time Optional TAG_Long If set, the time of the day is the specified value. If set, 0 to 24000.
infiniburn TAG_String A resource location defining what block tag to use for infiniburn. "#" or minecraft resource "#minecraft:...".
respawn_anchor_works TAG_Byte Whether players can charge and use respawn anchors. 1: true, 0: false.
has_skylight TAG_Byte Whether the dimension has skylight access or not. 1: true, 0: false.
bed_works TAG_Byte Whether players can use a bed to sleep. 1: true, 0: false.
effects TAG_String ? "minecraft:overworld", "minecraft:the_nether", "minecraft:the_end" or something else.
min_y TAG_Int The minimum Y level. A multiple of 16. Example: -64
height TAG_Int The maximum height. A multiple of 16. Example: 256
logical_height TAG_Int The maximum height to which chorus fruits and nether portals can bring players within this dimension. 0-384.
coordinate_scale TAG_Double The multiplier applied to coordinates when traveling to the dimension. 0.00001 - 30000000.0
ultrawarm TAG_Byte Whether the dimensions behaves like the nether (water evaporates and sponges dry) or not. Also causes lava to spread thinner. 1: true, 0: false.
has_ceiling TAG_Byte Whether the dimension has a bedrock ceiling or not. When true, causes lava to spread faster. 1: true, 0: false.

Biome registry:

Name Type Notes
type TAG_String The name of the registry. Always "minecraft:worldgen/biome".
value TAG_List List of biome registry entries (see below).

Biome registry entry:

Name Type Notes
name TAG_String The name of the biome (for example, "minecraft:ocean").
id TAG_Int The protocol ID of the biome (matches the index of the element in the registry list).
element TAG_Compound The biome properties (see below).

Biome properties:

Name Type Meaning Values
precipitation TAG_String The type of precipitation in the biome. "rain", "snow", or "none".
depth Optional TAG_Float The depth factor of the biome. The default values vary between 1.5 and -1.8.
temperature TAG_Float The temperature factor of the biome. The default values vary between 2.0 and -0.5.
scale Optional TAG_Float ? The default values vary between 1.225 and 0.0.
downfall TAG_Float ? The default values vary between 1.0 and 0.0.
category Optional TAG_String The category of the biome. Known values are "ocean", "plains", "desert", "forest", "extreme_hills", "taiga", "swamp", "river", "nether", "the_end", "icy", "mushroom", "beach", "jungle", "mesa", "savanna", and "none".
temperature_modifier Optional TAG_String ? The only known value is "frozen".
effects sky_color TAG_Compound TAG_Int The color of the sky. Example: 8364543, which is #7FA1FF in RGB.
water_fog_color TAG_Int Possibly the tint color when swimming. Example: 8364543, which is #7FA1FF in RGB.
fog_color TAG_Int Possibly the color of the fog effect when looking past the view distance. Example: 8364543, which is #7FA1FF in RGB.
water_color TAG_Int The tint color of the water blocks. Example: 8364543, which is #7FA1FF in RGB.
foliage_color Optional TAG_Int The tint color of the grass. Example: 8364543, which is #7FA1FF in RGB.
grass_color Optional TAG_Int ? Example: 8364543, which is #7FA1FF in RGB.
grass_color_modifier Optional TAG_String Unknown, likely affects foliage color. If set, known values are "swamp" and "dark_forest".
music Optional TAG_Compound Music properties for the biome. If present, contains the fields: replace_current_music (TAG_Byte), sound (TAG_String), max_delay (TAG_Int), min_delay (TAG_Int).
ambient_sound Optional TAG_String Ambient soundtrack. If present, the ID of a soundtrack. Example: "minecraft:ambient.basalt_deltas.loop".
additions_sound Optional TAG_Compound Additional ambient sound that plays randomly. If present, contains the fields: sound (TAG_String), tick_chance (TAG_Double).
mood_sound Optional TAG_Compound 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).
particle probability Optional TAG_Compound TAG_FLOAT Particles that appear randomly in the biome. Possibly the probability of spawning the particle. ?
options TAG_COMPOUND The properties of the particle to spawn. Contains the field "type" (TAG_String), which identifies the particle type.

Chat registry:

Name Type Notes
type TAG_String The name of the registry. Always "minecraft:chat_type".
value TAG_List List of chat type registry entries (see below).

Chat type:

Name Type Notes
name TAG_String The type's name (eg "minecraft:chat")
id TAG_Int
elements TAG_Compound "chat" and "narration" TAG_Compound's (see below)

Chat type "chat" and "narration":

Name Type Notes
translation_key TAG_String
style TAG_Compound Similar to Chat JSON (only present in "chat" TAG_Compound)
parameters TAG_List of TAG_String Values can be "sender", "target" and "content"

Open Sign Editor

Sent when the client has placed a sign and is allowed to send Update Sign. There must already be a sign at the given location (which the client does not do automatically) - send a Block Update first.

Packet ID State Bound To Field Name Field Type Notes
0x31 Play Client Location Position
Is Front Text Boolean Whether the opened editor is for the front or on the back of the sign

End Combat

Unused by the Notchian client. This data was once used for twitch.tv metadata circa 1.8.

Packet ID State Bound To Field Name Field Type Notes
0x36 Play Client Duration VarInt Length of the combat in ticks.
Entity ID Int ID of the primary opponent of the ended combat, or -1 if there is no obvious primary opponent.

Combat Death

Used to send a respawn screen.

Packet ID State Bound To Field Name Field Type Notes
0x38 Play Client Player ID VarInt Entity ID of the player that died (should match the client's entity ID).
Entity ID Int The killer entity's ID, or -1 if there is no obvious killer.
Message Chat The death message.

Respawn

To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.

Packet ID State Bound To Field Name Field Type Notes
0x41 Play Client Dimension Type Identifier Valid dimensions are defined per dimension registry sent in Login (play)
Dimension Name Identifier Name of the dimension being spawned into.
Hashed seed Long First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
Gamemode Unsigned Byte 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
Previous Gamemode Byte -1: Undefined (null), 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. The previous gamemode. Vanilla client uses this for the debug (F3 + N & F3 + F4) gamemode switch. (More information needed)
Is Debug Boolean True if the world is a debug mode world; debug mode worlds cannot be modified and have predefined blocks.
Is Flat Boolean True if the world is a superflat world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
Data kept Byte Bit mask. 0x01: Keep attributes, 0x02: Keep metadata. Tells which data should be kept on the client side once the player has respawned.

In the Notchian implementation, this is context dependent:

  • normal respawns (after death) keep no data;
  • exiting the end poem/credits keeps the attributes;
  • other dimension changes (portals or teleports) keep all data.
Has death location Boolean If true, then the next two fields are present.
Death dimension Name Optional Identifier Name of the dimension the player died in.
Death location Optional Position The location that the player died at.
Portal cooldown VarInt The number of ticks until the player can use the portal againWhat impact does this have on the client? Needs more info.

Warning.png Avoid changing player's dimension to same dimension they were already in unless they are dead. If you change the dimension to one they are already in, weird bugs can occur, such as the player being unable to attack other players in new world (until they die and respawn).

Before 1.16, if you must respawn a player in the same dimension without killing them, send two respawn packets, one to a different world and then another to the world you want. You do not need to complete the first respawn; it only matters that you send two packets.

Update Section Blocks

Fired whenever 2 or more blocks are changed within the same chunk on the same tick.

Warning.png Changing blocks in chunks not loaded by the client is unsafe (see note on Block Update).

Packet ID State Bound To Field Name Field Type Notes
0x43 Play Client Chunk section position Long Chunk section coordinate (encoded chunk x and z with each 22 bits, and section y with 20 bits, from left to right).
Suppress Light Updates Boolean Whether to ignore light updates caused by the contained changes. Always inverse the preceding Update Light packet's "Trust Edges" bool
Blocks array size VarInt Number of elements in the following array.
Blocks Array of VarLong Each entry is composed of the block state id, shifted left by 12, and the relative block position in the chunk section (4 bits for x, z, and y, from left to right).

Chunk section position is encoded:

((sectionX & 0x3FFFFF) << 42) | (sectionY & 0xFFFFF) | ((sectionZ & 0x3FFFFF) << 20);

and decoded:

sectionX = long >> 42;
sectionY = long << 44 >> 44;
sectionZ = long << 22 >> 42;

Blocks are encoded:

blockStateId << 12 | (blockLocalX << 8 | blockLocalZ << 4 | blockLocalY)
//Uses the local position of the given block position relative to its respective chunk section

Update Advancements

Packet ID State Bound To Field Name Field Type Notes
0x69 Play Client Reset/Clear Boolean Whether to reset/clear the current advancements.
Mapping size VarInt Size of the following array.
Advancement mapping Key Array Identifier The identifier of the advancement.
Value Advancement See below
List size VarInt Size of the following array.
Identifiers Array of Identifier The identifiers of the advancements that should be removed.
Progress size VarInt Size of the following array.
Progress mapping Key Array Identifier The identifier of the advancement.
Value Advancement progress See below.

Advancement structure:

Field Name Field Type Notes
Has parent Boolean Indicates whether the next field exists.
Parent id Optional Identifier The identifier of the parent advancement.
Has display Boolean Indicates whether the next field exists.
Display data Optional advancement display See below.
Number of criteria VarInt Size of the following array.
Criteria Key Array Identifier The identifier of the criterion.
Value Void There is no content written here. Perhaps this will be expanded in the future?
Array length VarInt Number of arrays in the following array.
Requirements Array length 2 Array VarInt Number of elements in the following array.
Requirement Array of String Array of required criteria.
Sends telemetry data Boolean Whether the client should include this achievement in the telemetry data when it's completed.

The Notchian client only sends data for advancements on the minecraft namespace.

Advancement display:

Field Name Field Type Notes
Title Chat
Description Chat
Icon Slot
Frame type VarInt Enum 0 = task, 1 = challenge, 2 = goal.
Flags Int 0x01: has background texture; 0x02: show_toast; 0x04: hidden.
Background texture Optional Identifier Background texture location. Only if flags indicates it.
X coord Float
Y coord Float

Advancement progress:

Field Name Field Type Notes
Size VarInt Size of the following array.
Criteria Criterion identifier Array Identifier The identifier of the criterion.
Criterion progress Criterion progress

Criterion progress:

Field Name Field Type Notes
Achieved Boolean If true, next field is present.
Date of achieving Optional Long As returned by Date.getTime.

Feature Flags

Used to enable and disable features, generally experimental ones, on the client.

Packet ID State Bound To Field Name Field Type Notes
0x6B Play Client Total Features VarInt Number of features that appear in the array below.
Feature Flags Identifier Array

As of 1.19.4 1.20, the following feature flags are available:

  • minecraft:vanilla - enables vanilla features
  • minecraft:bundle - enables support for the bundle
  • minecraft:update_1_20 - enables all the Minecraft 1.20 features that are available in 1.19.4

Update Recipes

Packet ID State Bound To Field Name Field Type Notes
0x6D Play Client Num Recipes VarInt Number of elements in the following array.
Recipe Type Array Identifier The recipe type, see below.
Recipe ID Identifier
Data Varies Additional data for the recipe.

Recipe types:

Type Description Data
minecraft:crafting_shapeless Shapeless crafting recipe. All items in the ingredient list must be present, but in any order/slot. As follows:
Name Type Description
Group String Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
Category VarInt Enum Building = 0, Redstone = 1, Equipment = 2, Misc = 3
Ingredient count VarInt Number of elements in the following array.
Ingredients Array of Ingredient.
Result Slot
minecraft:crafting_shaped Shaped crafting recipe. All items must be present in the same pattern (which may be flipped horizontally or translated). As follows:
Name Type Description
Width VarInt
Height VarInt
Group String Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
Category VarInt Enum Building = 0, Redstone = 1, Equipment = 2, Misc = 3
Ingredients Array of Ingredient Length is width * height. Indexed by x + (y * width).
Result Slot
Show notification Boolean Show a toast when the recipe is added.
minecraft:crafting_special_armordye Recipe for dying leather armor As follows:
Name Type Description
Category VarInt Enum Building = 0, Redstone = 1, Equipment = 2, Misc = 3
minecraft:crafting_special_bookcloning Recipe for copying contents of written books
minecraft:crafting_special_mapcloning Recipe for copying maps
minecraft:crafting_special_mapextending Recipe for adding paper to maps
minecraft:crafting_special_firework_rocket Recipe for making firework rockets
minecraft:crafting_special_firework_star Recipe for making firework stars
minecraft:crafting_special_firework_star_fade Recipe for making firework stars fade between multiple colors
minecraft:crafting_special_repairitem Recipe for repairing items via crafting
minecraft:crafting_special_tippedarrow Recipe for crafting tipped arrows
minecraft:crafting_special_bannerduplicate Recipe for copying banner patterns
minecraft:crafting_special_shielddecoration Recipe for applying a banner's pattern to a shield
minecraft:crafting_special_shulkerboxcoloring Recipe for recoloring a shulker box
minecraft:crafting_special_suspiciousstew Recipe for crafting suspicious stews
minecraft:crafting_decorated_pot Recipe for crafting decorated pots

Warning.png The Notchian server only sends this recipe if feature flag update_1_20 was enabled

minecraft:smelting Smelting recipe As follows:
Name Type Description
Group String Used to group similar recipes together in the recipe book.
Category VarInt Enum Food = 0, Blocks = 1, Misc = 2
Ingredient Ingredient
Result Slot
Experience Float
Cooking time VarInt
minecraft:blasting Blast furnace recipe
minecraft:smoking Smoker recipe
minecraft:campfire_cooking Campfire recipe
minecraft:stonecutting Stonecutter recipe As follows:
Name Type Description
Group String Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
Ingredient Ingredient
Result Slot
minecraft:smithing Smithing table recipe

Warning.png The Notchian server only sends this recipe if feature flag update_1_20 was not enabled

As follows:
Name Type Description
Base Ingredient First item.
Addition Ingredient Second item.
Result Slot
minecraft:smithing_transform Recipe for smithing netherite gear

Warning.png The Notchian server only sends this recipe if feature flag update_1_20 was enabled. It supersedes the minecraft:smithing recipe type

As follows:
Name Type Description
Template Ingredient The smithing template.
Base Ingredient The base item.
Addition Ingredient The additional ingredient.
Result Slot
minecraft:smithing_trim Recipe for applying armor trims

Warning.png The Notchian server only sends this recipe if feature flag update_1_20 was enabled. It supersedes the minecraft:smithing recipe type

As follows:
Name Type Description
Template Ingredient The smithing template.
Base Ingredient The base item.
Addition Ingredient The additional ingredient.

Ingredient is defined as:

Name Type Description
Count VarInt Number of elements in the following array.
Items Array of Slot Any item in this array may be used for the recipe. The count of each item should be 1.

Serverbound

Update Sign

This message is sent from the client to the server when the “Done” button is pushed after placing a sign.

The server only accepts this packet after Open Sign Editor, otherwise this packet is silently ignored.

Packet ID State Bound To Field Name Field Type Notes
0x2E Play Server Location Position Block Coordinates.
Is Front Text Boolean Whether the updated text is in front or on the back of the sign
Line 1 String (384) First line of text in the sign.
Line 2 String (384) Second line of text in the sign.
Line 3 String (384) Third line of text in the sign.
Line 4 String (384) Fourth line of text in the sign.

Status

Clientbound

No changes so far.

Serverbound

No changes so far.

Login

Clientbound

No changes so far.

Serverbound

No changes so far.