Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
(1.21.2 packet ID changes (apart from regular shifts).)
(→‎Synchronize Entity Position: Oops, it's an entity ID, obviously.)
 
(3 intermediate revisions by the same user not shown)
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" {{added}}
 +
! 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
 +
| Entity ID
 +
| {{Type|VarInt}}
 +
|
 +
|-
 +
| 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: highlight 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]]

Latest revision as of 04:27, 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
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 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 Optional Identifier The registry tag defining the ID set. Only present if Type is 0.
IDs Optional Array of 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 Pre
0x31 Move Minecart Along Track Pre
0x41 Update Recipe Book Current
0x43 Player Rotation Pre
0x44 Recipe Book Add Pre
0x45 Recipe Book Remove Pre
0x46 Recipe Book Settings Pre
0x53 0x63 Set Held Item Current (unchanged)
0x5a Set Cursor Item Pre
0x66 Set Player Inventory Slot Pre
Play serverbound
0x02 Bundle Item Selected Pre
0x0b Client Tick End 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 Entity ID VarInt
X Double
Y Double
Z Double
Velocity X Double
Velocity Y Double
Velocity Z Double
Yaw Float Rotation on the X axis, in degrees.
Pitch Float Rotation on the Y axis, in degrees.
On Ground Boolean

Move Minecart Along Track

Packet ID State Bound To Field Name Field Type Notes
0x31 Play Client Entity ID VarInt
Step Count VarInt Number of elements in the following array.
Steps X Array Double
Y Double
Z Double
Velocity X Double
Velocity Y Double
Velocity Z Double
Yaw Angle
Pitch Angle
Weight Float

Player Rotation

Packet ID State Bound To Field Name Field Type Notes
0x43 Play Client Yaw Float Rotation on the X axis, in degrees.
Pitch 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 VarInt Number of elements in the following array.
Recipes Recipe ID Array VarInt ID to assign to the recipe.
Display ID VarInt ID in the minecraft:recipe_display registry.
Group ID VarInt
Category ID VarInt ID in the minecraft:recipe_book_category registry.
Has Ingredients Boolean
Ingredient Count Optional VarInt Number of elements in the following array. Only present if Has Ingredients is true.
Ingredients Optional Array of ID Set Only present if Has Ingredients is true.
Flags Byte 0x01: show notification; 0x02: highlight as new

Recipe Book Remove

Packet ID State Bound To Field Name Field Type Notes
0x45 Play Client Recipe Count VarInt Number of elements in the following array.
Recipes Array of 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 Boolean If true, then the crafting recipe book will be open when the player opens its inventory.
Crafting Recipe Book Filter Active Boolean If true, then the filtering option is active when the players opens its inventory.
Smelting Recipe Book Open Boolean If true, then the smelting recipe book will be open when the player opens its inventory.
Smelting Recipe Book Filter Active Boolean If true, then the filtering option is active when the players opens its inventory.
Blast Furnace Recipe Book Open Boolean If true, then the blast furnace recipe book will be open when the player opens its inventory.
Blast Furnace Recipe Book Filter Active Boolean If true, then the filtering option is active when the players opens its inventory.
Smoker Recipe Book Open Boolean If true, then the smoker recipe book will be open when the player opens its inventory.
Smoker Recipe Book Filter Active Boolean If true, then the filtering option is active when the players opens its inventory.

Set Cursor Item

Packet ID State Bound To Field Name Field Type Notes
0x5A Play Client Slot Data Slot

Set Player Inventory Slot

Packet ID State Bound To Field Name Field Type Notes
0x66 Play Client Slot VarInt
Slot Data Slot

Serverbound

Bundle Item Selected

Packet ID State Bound To Field Name Field Type Notes
0x02 Play Server Slot of Bundle VarInt
Slot in Bundle VarInt

Client Tick End

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