Pre-release protocol: Difference between revisions

From wiki.vg
Jump to navigation Jump to search
imported>LassiPulkkinen
(1.21.2 packet ID changes (apart from regular shifts).)
imported>LassiPulkkinen
(1.21.2 new packets.)
Line 9: Line 9:
=== Data types ===
=== Data types ===


No changes so far.
{| class="wikitable"
|-
! Name
! Size (bytes)
! Encodes
! Notes
|- {{added}}
! id=Type:ID_Set | {{Type|ID Set}}
| Varies
| Set of registry IDs specified either inline or as a reference to a tag.
| See [[#ID Set]]
|}
 
==== ID Set ====
 
Represents a set of IDs in a certain registry (implied by context), either directly (enumerated IDs) or indirectly (tag name).
 
{| class="wikitable"
! Name
! Type
! Description
|-
| Type
| {{Type|VarInt}}
| Identifier used to determine the data that follows. It can be either:
* 0 - Represents a named set of IDs defined by a tag.
* Anything else - Represents an ad-hoc set of IDs enumerated inline.
|-
| Tag Name
| {{Type|Optional}} {{Type|Identifier}}
| The registry tag defining the ID set. Only present if Type is 0.
|-
| IDs
| {{Type|Optional}} {{Type|Array}} of {{Type|VarInt}}
| An array of registry IDs. Only present if Type is not 0.<br>The size of the array is equal to <code>Type - 1</code>.
|}


=== Packets ===
=== Packets ===
Line 34: Line 69:
  {{PacketList|0x0b|Client Tick End|rel=added}}
  {{PacketList|0x0b|Client Tick End|rel=added}}
|}
|}
== Handshake ==
No changes so far.
== Status ==
No changes so far.
== Login ==
No changes so far.
== Configuration ==
No changes so far.
== Play ==
=== Clientbound ===
==== Synchronize Entity Position ====
{| class="wikitable" {{added}}
! Packet ID
! State
! Bound To
! Field Name
! Field Type
! Notes
|-
| rowspan="10"| 0x20
| rowspan="10"| Play
| rowspan="10"| Client
| Teleport ID
| {{Type|VarInt}}
| Client should confirm this packet with [[#Confirm Teleportation|Confirm Teleportation]] containing the same Teleport ID.
|-
| X
| {{Type|Double}}
|
|-
| Y
| {{Type|Double}}
|
|-
| Z
| {{Type|Double}}
|
|-
| Velocity X
| {{Type|Double}}
|
|-
| Velocity Y
| {{Type|Double}}
|
|-
| Velocity Z
| {{Type|Double}}
|
|-
| Yaw
| {{Type|Float}}
| Rotation on the X axis, in degrees.
|-
| Pitch
| {{Type|Float}}
| Rotation on the Y axis, in degrees.
|-
| On Ground
| {{Type|Boolean}}
|
|}
==== Move Minecart Along Track ====
{| class="wikitable" {{added}}
! Packet ID
! State
! Bound To
! colspan="2"| Field Name
! colspan="2"| Field Type
! colspan="2"| Notes
|-
| rowspan="11"| 0x31
| rowspan="11"| Play
| rowspan="11"| Client
| colspan="2"| Entity ID
| colspan="2"| {{Type|VarInt}}
|
|-
| colspan="2"| Step Count
| colspan="2"| {{Type|VarInt}}
| Number of elements in the following array.
|-
| rowspan="9"| Steps
| X
| rowspan="9"| {{Type|Array}}
| {{Type|Double}}
|
|-
| Y
| {{Type|Double}}
|
|-
| Z
| {{Type|Double}}
|
|-
| Velocity X
| {{Type|Double}}
|
|-
| Velocity Y
| {{Type|Double}}
|
|-
| Velocity Z
| {{Type|Double}}
|
|-
| Yaw
| {{Type|Angle}}
|
|-
| Pitch
| {{Type|Angle}}
|
|-
| Weight
| {{Type|Float}}
|}
==== Player Rotation ====
{| class="wikitable" {{added}}
! Packet ID
! State
! Bound To
! Field Name
! Field Type
! Notes
|-
| rowspan="2"| 0x43
| rowspan="2"| Play
| rowspan="2"| Client
| Yaw
| {{Type|Float}}
| Rotation on the X axis, in degrees.
|-
| Pitch
| {{Type|Float}}
| Rotation on the Y axis, in degrees.
|}
==== Recipe Book Add ====
{| class="wikitable" {{added}}
! Packet ID
! State
! Bound To
! colspan="2"| Field Name
! colspan="2"| Field Type
! colspan="2"| Notes
|-
| rowspan="9"| 0x44
| rowspan="9"| Play
| rowspan="9"| Client
| colspan="2"| Recipe Count
| colspan="2"| {{Type|VarInt}}
| Number of elements in the following array.
|-
| rowspan="7"| Recipes
| Recipe ID
| rowspan="7"| {{Type|Array}}
| {{Type|VarInt}}
| ID to assign to the recipe.
|-
| Display ID
| {{Type|VarInt}}
| ID in the <code>minecraft:recipe_display</code> registry.
|-
| Group ID
| {{Type|VarInt}}
|
|-
| Category ID
| {{Type|VarInt}}
| ID in the <code>minecraft:recipe_book_category</code> registry.
|-
| Has Ingredients
| {{Type|Boolean}}
|
|-
| Ingredient Count
| {{Type|Optional}} {{Type|VarInt}}
| Number of elements in the following array. Only present if Has Ingredients is true.
|-
| Ingredients
| {{Type|Optional}} {{Type|Array}} of {{Type|ID Set}}
| Only present if Has Ingredients is true.
|-
| colspan="2"| Flags
| colspan="2"| {{Type|Byte}}
| 0x01: show notification; 0x02: hightlight as new
|}
==== Recipe Book Remove ====
{| class="wikitable" {{added}}
! Packet ID
! State
! Bound To
! Field Name
! Field Type
! Notes
|-
| rowspan="2"| 0x45
| rowspan="2"| Play
| rowspan="2"| Client
| Recipe Count
| {{Type|VarInt}}
| Number of elements in the following array.
|-
| Recipes
| {{Type|Array}} of {{Type|VarInt}}
| IDs of recipes to remove.
|}
==== Recipe Book Settings ====
{| class="wikitable" {{added}}
! Packet ID
! State
! Bound To
! Field Name
! Field Type
! Notes
|-
| rowspan="8"| 0x46
| rowspan="8"| Play
| rowspan="8"| Client
| Crafting Recipe Book Open
| {{Type|Boolean}}
| If true, then the crafting recipe book will be open when the player opens its inventory.
|-
| Crafting Recipe Book Filter Active
| {{Type|Boolean}}
| If true, then the filtering option is active when the players opens its inventory.
|-
| Smelting Recipe Book Open
| {{Type|Boolean}}
| If true, then the smelting recipe book will be open when the player opens its inventory.
|-
| Smelting Recipe Book Filter Active
| {{Type|Boolean}}
| If true, then the filtering option is active when the players opens its inventory.
|-
| Blast Furnace Recipe Book Open
| {{Type|Boolean}}
| If true, then the blast furnace recipe book will be open when the player opens its inventory.
|-
| Blast Furnace Recipe Book Filter Active
| {{Type|Boolean}}
| If true, then the filtering option is active when the players opens its inventory.
|-
| Smoker Recipe Book Open
| {{Type|Boolean}}
| If true, then the smoker recipe book will be open when the player opens its inventory.
|-
| Smoker Recipe Book Filter Active
| {{Type|Boolean}}
| If true, then the filtering option is active when the players opens its inventory.
|}
==== Set Cursor Item ====
{| class="wikitable" {{added}}
! Packet ID
! State
! Bound To
! Field Name
! Field Type
! Notes
|-
| 0x5A
| Play
| Client
| Slot Data
| {{Type|Slot}}
|
|}
==== Set Player Inventory Slot ====
{| class="wikitable" {{added}}
! Packet ID
! State
! Bound To
! Field Name
! Field Type
! Notes
|-
| rowspan="2"| 0x66
| rowspan="2"| Play
| rowspan="2"| Client
| Slot
| {{Type|VarInt}}
|
|-
| Slot Data
| {{Type|Slot}}
|
|}
=== Serverbound ===
==== Bundle Item Selected ====
{| class="wikitable" {{added}}
! Packet ID
! State
! Bound To
! Field Name
! Field Type
! Notes
|-
| rowspan="2"| 0x02
| rowspan="2"| Play
| rowspan="2"| Server
| Slot of Bundle
| {{Type|VarInt}}
|
|-
| Slot in Bundle
| {{Type|VarInt}}
|
|}
==== Client Tick End ====
{| class="wikitable" {{added}}
! Packet ID
! State
! Bound To
! Field Name
! Field Type
! Notes
|-
| 0x0B
| Play
| Server
| colspan="3"| ''no fields''
|}


[[Category:Minecraft Modern]]
[[Category:Minecraft Modern]]

Revision as of 04:15, 1 November 2024

This page documents the changes from release 1.21.1 (protocol 767) to the current release (1.21.3, protocol 768). The stable protocol documentation is currently lagging behind, and the changes documented here will be merged soon, once they are complete. The current pre-release (snapshot 24w44a) is not yet 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

Name Size (bytes) Encodes Notes
{{#switch: Pre-release protocol Data types =
       ID Set
#default =
       ID Set
   }}
Varies Set of registry IDs specified either inline or as a reference to a tag. See #ID Set

ID Set

Represents a set of IDs in a certain registry (implied by context), either directly (enumerated IDs) or indirectly (tag name).

Name Type Description
Type {{#switch: Pre-release protocol Data types =
       VarInt
#default =
       VarInt
   }}
Identifier used to determine the data that follows. It can be either:
  • 0 - Represents a named set of IDs defined by a tag.
  • Anything else - Represents an ad-hoc set of IDs enumerated inline.
Tag Name {{#switch: Pre-release protocol Data types =
       Optional
#default =
       Optional
   }} {{#switch: Pre-release protocol
Data types =
       Identifier
#default =
       Identifier
   }}
The registry tag defining the ID set. Only present if Type is 0.
IDs {{#switch: Pre-release protocol Data types =
       Optional
#default =
       Optional
   }} {{#switch: Pre-release protocol
Data types =
       Array
#default =
       Array
   }} of {{#switch: Pre-release protocol
Data types =
       VarInt
#default =
       VarInt
   }}
An array of registry IDs. Only present if Type is not 0.
The size of the array is equal to Type - 1.

Packets

ID Packet name Documentation
Play clientbound
0x20 Synchronize Entity Position added Current }} removed unchanged | (unchanged) | Pre }} }}
0x31 Move Minecart Along Track added Current }} removed unchanged | (unchanged) | Pre }} }}
0x41 Update Recipe Book added Current }} removed unchanged | (unchanged) | Pre }} }}
0x43 Player Rotation added Current }} removed unchanged | (unchanged) | Pre }} }}
0x44 Recipe Book Add added Current }} removed unchanged | (unchanged) | Pre }} }}
0x45 Recipe Book Remove added Current }} removed unchanged | (unchanged) | Pre }} }}
0x46 Recipe Book Settings added Current }} removed unchanged | (unchanged) | Pre }} }}
0x53}}{{#if:0x63|{{#if:0x53| }}0x63}} Set Held Item added Current }} removed unchanged | (unchanged) | Pre }} }}
0x5a Set Cursor Item added Current }} removed unchanged | (unchanged) | Pre }} }}
0x66 Set Player Inventory Slot added Current }} removed unchanged | (unchanged) | Pre }} }}
Play serverbound
0x02 Bundle Item Selected added Current }} removed unchanged | (unchanged) | Pre }} }}
0x0b Client Tick End added Current }} removed unchanged | (unchanged) | Pre }} }}

Handshake

No changes so far.

Status

No changes so far.

Login

No changes so far.

Configuration

No changes so far.

Play

Clientbound

Synchronize Entity Position

Packet ID State Bound To Field Name Field Type Notes
0x20 Play Client Teleport ID {{#switch: Pre-release protocol Data types =
       VarInt
#default =
       VarInt
   }}
Client should confirm this packet with Confirm Teleportation containing the same Teleport ID.
X {{#switch: Pre-release protocol Data types =
       Double
#default =
       Double
   }}
Y {{#switch: Pre-release protocol Data types =
       Double
#default =
       Double
   }}
Z {{#switch: Pre-release protocol Data types =
       Double
#default =
       Double
   }}
Velocity X {{#switch: Pre-release protocol Data types =
       Double
#default =
       Double
   }}
Velocity Y {{#switch: Pre-release protocol Data types =
       Double
#default =
       Double
   }}
Velocity Z {{#switch: Pre-release protocol Data types =
       Double
#default =
       Double
   }}
Yaw {{#switch: Pre-release protocol Data types =
       Float
#default =
       Float
   }}
Rotation on the X axis, in degrees.
Pitch {{#switch: Pre-release protocol Data types =
       Float
#default =
       Float
   }}
Rotation on the Y axis, in degrees.
On Ground {{#switch: Pre-release protocol Data types =
       Boolean
#default =
       Boolean
   }}

Move Minecart Along Track

Packet ID State Bound To Field Name Field Type Notes
0x31 Play Client Entity ID {{#switch: Pre-release protocol Data types =
       VarInt
#default =
       VarInt
   }}
Step Count {{#switch: Pre-release protocol Data types =
       VarInt
#default =
       VarInt
   }}
Number of elements in the following array.
Steps X {{#switch: Pre-release protocol Data types =
       Array
#default =
       Array
   }}
{{#switch: Pre-release protocol Data types =
       Double
#default =
       Double
   }}
Y {{#switch: Pre-release protocol Data types =
       Double
#default =
       Double
   }}
Z {{#switch: Pre-release protocol Data types =
       Double
#default =
       Double
   }}
Velocity X {{#switch: Pre-release protocol Data types =
       Double
#default =
       Double
   }}
Velocity Y {{#switch: Pre-release protocol Data types =
       Double
#default =
       Double
   }}
Velocity Z {{#switch: Pre-release protocol Data types =
       Double
#default =
       Double
   }}
Yaw {{#switch: Pre-release protocol Data types =
       Angle
#default =
       Angle
   }}
Pitch {{#switch: Pre-release protocol Data types =
       Angle
#default =
       Angle
   }}
Weight {{#switch: Pre-release protocol Data types =
       Float
#default =
       Float
   }}

Player Rotation

Packet ID State Bound To Field Name Field Type Notes
0x43 Play Client Yaw {{#switch: Pre-release protocol Data types =
       Float
#default =
       Float
   }}
Rotation on the X axis, in degrees.
Pitch {{#switch: Pre-release protocol Data types =
       Float
#default =
       Float
   }}
Rotation on the Y axis, in degrees.

Recipe Book Add

Packet ID State Bound To Field Name Field Type Notes
0x44 Play Client Recipe Count {{#switch: Pre-release protocol Data types =
       VarInt
#default =
       VarInt
   }}
Number of elements in the following array.
Recipes Recipe ID {{#switch: Pre-release protocol Data types =
       Array
#default =
       Array
   }}
{{#switch: Pre-release protocol Data types =
       VarInt
#default =
       VarInt
   }}
ID to assign to the recipe.
Display ID {{#switch: Pre-release protocol Data types =
       VarInt
#default =
       VarInt
   }}
ID in the minecraft:recipe_display registry.
Group ID {{#switch: Pre-release protocol Data types =
       VarInt
#default =
       VarInt
   }}
Category ID {{#switch: Pre-release protocol Data types =
       VarInt
#default =
       VarInt
   }}
ID in the minecraft:recipe_book_category registry.
Has Ingredients {{#switch: Pre-release protocol Data types =
       Boolean
#default =
       Boolean
   }}
Ingredient Count {{#switch: Pre-release protocol Data types =
       Optional
#default =
       Optional
   }} {{#switch: Pre-release protocol
Data types =
       VarInt
#default =
       VarInt
   }}
Number of elements in the following array. Only present if Has Ingredients is true.
Ingredients {{#switch: Pre-release protocol Data types =
       Optional
#default =
       Optional
   }} {{#switch: Pre-release protocol
Data types =
       Array
#default =
       Array
   }} of {{#switch: Pre-release protocol
Data types =
       ID Set
#default =
       ID Set
   }}
Only present if Has Ingredients is true.
Flags {{#switch: Pre-release protocol Data types =
       Byte
#default =
       Byte
   }}
0x01: show notification; 0x02: hightlight as new

Recipe Book Remove

Packet ID State Bound To Field Name Field Type Notes
0x45 Play Client Recipe Count {{#switch: Pre-release protocol Data types =
       VarInt
#default =
       VarInt
   }}
Number of elements in the following array.
Recipes {{#switch: Pre-release protocol Data types =
       Array
#default =
       Array
   }} of {{#switch: Pre-release protocol
Data types =
       VarInt
#default =
       VarInt
   }}
IDs of recipes to remove.

Recipe Book Settings

Packet ID State Bound To Field Name Field Type Notes
0x46 Play Client Crafting Recipe Book Open {{#switch: Pre-release protocol Data types =
       Boolean
#default =
       Boolean
   }}
If true, then the crafting recipe book will be open when the player opens its inventory.
Crafting Recipe Book Filter Active {{#switch: Pre-release protocol Data types =
       Boolean
#default =
       Boolean
   }}
If true, then the filtering option is active when the players opens its inventory.
Smelting Recipe Book Open {{#switch: Pre-release protocol Data types =
       Boolean
#default =
       Boolean
   }}
If true, then the smelting recipe book will be open when the player opens its inventory.
Smelting Recipe Book Filter Active {{#switch: Pre-release protocol Data types =
       Boolean
#default =
       Boolean
   }}
If true, then the filtering option is active when the players opens its inventory.
Blast Furnace Recipe Book Open {{#switch: Pre-release protocol Data types =
       Boolean
#default =
       Boolean
   }}
If true, then the blast furnace recipe book will be open when the player opens its inventory.
Blast Furnace Recipe Book Filter Active {{#switch: Pre-release protocol Data types =
       Boolean
#default =
       Boolean
   }}
If true, then the filtering option is active when the players opens its inventory.
Smoker Recipe Book Open {{#switch: Pre-release protocol Data types =
       Boolean
#default =
       Boolean
   }}
If true, then the smoker recipe book will be open when the player opens its inventory.
Smoker Recipe Book Filter Active {{#switch: Pre-release protocol Data types =
       Boolean
#default =
       Boolean
   }}
If true, then the filtering option is active when the players opens its inventory.

Set Cursor Item

Packet ID State Bound To Field Name Field Type Notes
0x5A Play Client Slot Data {{#switch: Pre-release protocol Data types =
       Slot
#default =
       Slot
   }}

Set Player Inventory Slot

Packet ID State Bound To Field Name Field Type Notes
0x66 Play Client Slot {{#switch: Pre-release protocol Data types =
       VarInt
#default =
       VarInt
   }}
Slot Data {{#switch: Pre-release protocol Data types =
       Slot
#default =
       Slot
   }}

Serverbound

Bundle Item Selected

Packet ID State Bound To Field Name Field Type Notes
0x02 Play Server Slot of Bundle {{#switch: Pre-release protocol Data types =
       VarInt
#default =
       VarInt
   }}
Slot in Bundle {{#switch: Pre-release protocol Data types =
       VarInt
#default =
       VarInt
   }}

Client Tick End

Packet ID State Bound To Field Name Field Type Notes
0x0B Play Server no fields