Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
(12w41a)
 
(Updated to 1.21-pre2)
 
Line 1: Line 1:
This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently 1.3.2) 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.20.6, protocol 766]]) to the current pre-release (currently [[Protocol version numbers|1.21-pre2, protocol {{Snapshot PVN|1073742024}}]]). 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.
  
-None-
+
== Contents ==
  
== Changed packets ==
+
<div style="float:right;">__TOC__</div>
  
=== Time Update (0x04) ===
+
=== Data types ===
  
''Server to Client''
+
No changes documented so far.
  
Time is based on ticks, where 20 ticks happen every second. There are 24000 ticks in a day, making Minecraft days exactly 20 minutes long.
+
=== Packets ===
 
 
The time of day is based on the timestamp modulo 24000. 0 is sunrise, 6000 is noon, 12000 is sunset, and 18000 is midnight.
 
 
 
The default SMP server increments both by 20 every second.
 
 
 
The &#39;Time&#39; is the Age of the world. It is not changing on server commands and will increased by 20 every second.
 
  
 
{| 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"| Configuration clientbound
! class="col4" | Notes
+
{{PacketList|0x0F|Clientbound Report Details (configuration)|rel=added}}
|- class="row1"
+
{{PacketList|0x10|Clientbound Server Links (configuration)|rel=added}}
| class="col0 centeralign" rowspan="2" | 0x04
+
|-
| class="col1 centeralign" | Time
+
!colspan="4"| Play clientbound
| class="col2 centeralign" | long
+
{{PacketList|0x7A|Clientbound Report Details (play)|rel=added}}
| class="col3 centeralign" | 45464654
+
{{PacketList|0x7B|Clientbound Server Links (play)|rel=added}}
| class="col4" | The &#39;Age of the world&#39;, in ticks
+
|-
 
 
|- class="row2"
 
| class="col0 centeralign" | Day Time
 
| class="col1 centeralign" | long
 
| class="col2 centeralign" | 21321
 
| class="col3" | The world (or region) time, in ticks
 
|- class="row3"
 
! class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 17 Bytes
 
 
|}
 
|}
  
=== Spawn Named Entity (0x14) ===
+
== Handshake ==
  
See the change in metadata [[#metadata|below]]. (Under Protocol History, 2012-08-24)
+
No changes so far.
  
=== Spawn Dropped Item (0x15) ===
+
== Status ==
  
'''''TODO'''''
+
No changes so far.
  
It includes a new byte array after the "Damage" field, and before the "X" field if certain conditions are met. If the array does not exist, then the length of the array is "-1".
+
== Login ==
  
=== Spawn Mob (0x18) ===
+
No changes so far.
  
See the change in metadata [[#metadata|below]]. (Under Protocol History, 2012-08-24)
+
== Configuration ==
  
=== Entity Metadata (0x28) ===
+
=== Clientbound ===
  
See the change in metadata [[#metadata|below]]. (Under Protocol History, 2012-08-24)
+
==== Clientbound Report Details (configuration) ====
  
 +
Contains a list of key-value text entries that are included in any crash or disconnection report generated during connection to the server.
  
=== Click Window (0x66) ===
+
{| class="wikitable" {{added}}
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! colspan="2"| Field Name
 +
! colspan="2"| Field Type
 +
! Notes
 +
|-
 +
| rowspan="3"| 0x0F
 +
| rowspan="3"| Configuration
 +
| rowspan="3"| Client
 +
| colspan="2"| Details Count
 +
| colspan="2"| {{Type|VarInt}} (32)
 +
| The number of details in the following array.
 +
|-
 +
| rowspan="2"| Details
 +
| Title
 +
| rowspan="2"| {{Type|Array}}
 +
| {{Type|String}} (128)
 +
|
 +
|-
 +
| Description
 +
| {{Type|String}} (4096)
 +
|
 +
|}
  
''Client to Server''
+
==== Clientbound Server Links (configuration) ====
  
This packet is sent by the player when it clicks on a slot in a window.
+
This packet contains a list of links that the Notchian client will display in the menu available from the pause menu. Link labels can be built-in or custom (i.e., any text).
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
|- class="row0"
+
! Packet ID
| class="col0" | Packet ID
+
! State
| class="col1" | Field Name
+
! Bound To
| class="col2" | Field Type
+
! colspan="2"| Field Name
| class="col3" | Example
+
! colspan="2"| Field Type
| class="col4" | Notes
+
! Notes
|- class="row1"
+
|-
| class="col0 centeralign" rowspan=6 | 0x66
+
| rowspan="4"| 0x10
| class="col1 centeralign" | Window id
+
| rowspan="4"| Configuration
| class="col2 centeralign" | byte
+
| rowspan="4"| Client
| class="col3 centeralign" | <code>0</code>
+
| colspan="2"| Links Count
| class="col4" | The id of the window which was clicked. 0 for player inventory.
+
| colspan="2"| {{Type|VarInt}}
|- class="row2"
+
| The number of links in the following array.
| class="col0 centeralign" | Slot
+
|-
| class="col1 centeralign" | short
+
| rowspan="3"| Links
| class="col2 centeralign" | <code>36</code>
+
| Is built-in
| class="col3" | The clicked slot. See below.
+
| rowspan="3"| {{Type|Array}}
|- class="row3"
+
| {{Type|Boolean}}
| class="col0 centeralign" | Right-click
+
| Determines if the following label is built-in (from enum) or custom (text component).
| class="col1 centeralign" | byte
+
|-
| class="col2 centeralign" | <code>1</code>
+
| Label
| class="col3" |  
+
| {{Type|VarInt}} {{Type|Enum}} / {{Type|Text Component}}
|- class="row4"
+
| See below.
| class="col0 centeralign" | Action number
+
|-
| class="col1 centeralign" | short
+
| URL
| class="col2 centeralign" | <code>12</code>
+
| {{Type|String}}
| class="col3" | A unique number for the action, used for transaction handling (See the Transaction packet).
+
| Valid URL.
|- class="row5"
 
| class="col0 centeralign" | Shift
 
| class="col1 centeralign" | boolean
 
| class="col2 centeralign" | <code>0</code>
 
| class="col3" | This is true if the user was holding keyboard shift when they clicked.
 
|- class="row6"
 
| class="col0 centeralign" | Clicked item
 
| class="col1 centeralign" | [[Slot_Data|slot]]
 
| class="col2 centeralign" |
 
| class="col3" |
 
|- class="row7"
 
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 9 bytes + slot data
 
 
|}
 
|}
  
=== Locale and View Distance (0xCC) ===
 
 
''Client to server''
 
 
Sent when the player connects, or when settings are changed.
 
 
{| class="wikitable"
 
|- class="row0"
 
| class="col0" | Packet ID
 
| class="col1" | Field Name
 
| class="col2" | Field Type
 
| class="col3" | Example
 
| class="col4" | Notes
 
|- class="row1"
 
| class="col0 centeralign" rowspan="4" | 0xCC
 
| class="col1 centeralign" | Locale
 
| class="col2 centeralign" | string
 
| class="col3 centeralign" | en_GB
 
|- class="row2"
 
| class="col0 centeralign" | View distance
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | 0
 
| class="col3" | 0-3 for 'far', 'normal', 'short', 'tiny'.
 
|- class="row3"
 
| class="col0 centeralign" | Chat flags
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | 8
 
| class="col3" | Chat settings. See notes below.
 
|- class="row4"
 
| class="col0 centeralign" | Difficulty
 
| class="col1 centeralign" | byte
 
| class="col2 centeralign" | 0
 
| class="col3 centeralign" | Client-side difficulty from options.txt
 
|- class="row5"
 
| class="col0 centeralign" |
 
| class="col1 centeralign" | boolean
 
| class="col2 centeralign" | true
 
| class="col3 centeralign" |
 
|- class="row6"
 
| class="col0" | Total Size:
 
| class="col1 rightalign" colspan="4" | 9 bytes + length of string
 
|}
 
  
 +
{| class="wikitable" {{added}}
 +
! ID
 +
! Name
 +
! Notes
 +
|-
 +
| 0
 +
| Bug Report
 +
| Displayed on connection error screen; included as a comment in the disconnection report.
 +
|-
 +
| 1
 +
| Community Guidelines
 +
|
 +
|-
 +
| 2
 +
| Support
 +
|
 +
|-
 +
| 3
 +
| Status
 +
|
 +
|-
 +
| 4
 +
| Feedback
 +
|
 +
|-
 +
| 5
 +
| Community
 +
|
 +
|-
 +
| 6
 +
| Website
 +
|
 +
|-
 +
| 7
 +
| Forums
 +
|
 +
|-
 +
| 8
 +
| News
 +
|
 +
|-
 +
| 9
 +
| Announcements
 +
|
 +
|-
 +
|}
  
== Changed data types ==
+
=== Serverbound ===
  
{{anchor|metadata}}
+
No changes so far.
== Entity Metadata Format ==
 
  
Note that entity metadata is a totally distinct concept from block metadata.
+
== Play ==
  
The entity metadata format is quirky dictionary format, where the key and the value's type are packed in a single byte.
+
=== Clientbound ===
  
To parse, repeat the following procedure:
+
==== Clientbound Report Details (play) ====
  
# Read an unsigned byte
+
Contains a list of key-value text entries that are included in any crash or disconnection report generated during connection to the server.
# If this byte == 127, stop reading
 
# Decompose the byte. <br> The bottom 5 bits (0x1F) serve as an identifier (key) for the data to follow. <br> The top 3 bits (0xE0) serve as a type.
 
# Read and unpack based on the type (below)
 
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
|-
+
! Packet ID
! Type
+
! State
! Meaning
+
! Bound To
|-  
+
! colspan="2"| Field Name
| 0
+
! colspan="2"| Field Type
| byte
+
! Notes
|-
+
|-
| 1
+
| rowspan="3"| 0x7A
| short
+
| rowspan="3"| Configuration
|-
+
| rowspan="3"| Client
| 2
+
| colspan="2"| Details Count
| int
+
| colspan="2"| {{Type|VarInt}} (32)
|-
+
| The number of details in the following array.
| 3
+
|-
| float
+
| rowspan="2"| Details
|-
+
| Title
| 4
+
| rowspan="2"| {{Type|Array}}
| string16
+
| {{Type|String}} (128)
|-
+
|
| 5
+
|-
| short, byte, short (slot type) - If first short is empty, no further data is sent.
+
| Description
|-
+
| {{Type|String}} (4096)
| 6
+
|
| int, int, int (x, y, z)
 
 
|}
 
|}
  
In Python-like code:
+
==== Clientbound Server Links (play) ====
<source lang="python">
 
#socket is positioned at the beginning of the metadata array. Also note that the method unpack() doesn't exist in socket
 
metadata = {}
 
x = socket.unpack('byte')
 
while x != 127:
 
    index = x & 0x1F # Lower 5 bits
 
    ty    = x >> 5  # Upper 3 bits
 
    if ty == 0: val = socket.unpack('byte')  
 
    if ty == 1: val = socket.unpack('short')
 
    if ty == 2: val = socket.unpack('int')
 
    if ty == 3: val = socket.unpack('float')
 
    if ty == 4: val = socket.unpack('string16')
 
    if ty == 5:
 
        val = {}
 
        val["id"] = socket.unpack('short')
 
        if val["id"] != -1:
 
            val["count"]  = socket.unpack('byte')
 
            val["damage"] = socket.unpack('short')
 
    if ty == 6:
 
        val = []
 
        for i in range(3):
 
            val.append(socket.unpack('int'))
 
    metadata[index] = (ty, val)
 
    x = socket.unpack('byte')
 
return metadata
 
</source>
 
  
== Removed packets ==
+
This packet contains a list of links that the Notchian client will display in the menu available from the pause menu. Link labels can be built-in or custom (i.e., any text).
  
-None-
+
{| class="wikitable" {{added}}
 
+
! Packet ID
== Protocol History ==
+
! State
=== 2012-10-11 ===
+
! Bound To
* 12w41a
+
! colspan="2"| Field Name
* Protocol version is now 46
+
! colspan="2"| Field Type
* 0xcc Changed
+
! Notes
 
+
|-
=== 2012-10-04 ===
+
| rowspan="4"| 0x7B
* 12w40a
+
| rowspan="4"| Configuration
* Protocol version is now 45
+
| rowspan="4"| Client
* Packet 0x66 changed
+
| colspan="2"| Links Count
 
+
| colspan="2"| {{Type|VarInt}}
=== 2012-09-06 ===
+
| The number of links in the following array.
* 12w36a
+
|-
* Protocol version is now 42
+
| rowspan="3"| Links
 +
| Is built-in
 +
| rowspan="3"| {{Type|Array}}
 +
| {{Type|Boolean}}
 +
| Determines if the following label is built-in (from enum) or custom (text component).
 +
|-
 +
| Label
 +
| {{Type|VarInt}} {{Type|Enum}} / {{Type|Text Component}}
 +
| See below.
 +
|-
 +
| URL
 +
| {{Type|String}}
 +
| Valid URL.
 +
|}
  
=== 2012-08-24 ===
+
{| class="wikitable" {{added}}
* 12w34b
+
! ID
* Protocol version is now 41
+
! Name
 +
! Notes
 +
|-
 +
| 0
 +
| Bug Report
 +
| Displayed on connection error screen; included as a comment in the disconnection report.
 +
|-
 +
| 1
 +
| Community Guidelines
 +
|
 +
|-
 +
| 2
 +
| Support
 +
|
 +
|-
 +
| 3
 +
| Status
 +
|
 +
|-
 +
| 4
 +
| Feedback
 +
|
 +
|-
 +
| 5
 +
| Community
 +
|
 +
|-
 +
| 6
 +
| Website
 +
|
 +
|-
 +
| 7
 +
| Forums
 +
|
 +
|-
 +
| 8
 +
| News
 +
|
 +
|-
 +
| 9
 +
| Announcements
 +
|
 +
|-
 +
|}
  
* Changed Entity Metadata Format
+
=== Serverbound ===
  
=== 2012-08-09 ===
+
No changes so far.
* 12w32a
 
* Protocol version is now 40
 
  
* Changed Time Update packet
+
[[Category:Minecraft Modern]]

Latest revision as of 10:40, 8 June 2024

This page documents the changes from the last stable Minecraft release (currently 1.20.6, protocol 766) to the current pre-release (currently 1.21-pre2, protocol Snapshot 200). 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 documented so far.

Packets

ID Packet name Documentation
Configuration clientbound
0x0F Clientbound Report Details (configuration) Pre
0x10 Clientbound Server Links (configuration) Pre
Play clientbound
0x7A Clientbound Report Details (play) Pre
0x7B Clientbound Server Links (play) Pre

Handshake

No changes so far.

Status

No changes so far.

Login

No changes so far.

Configuration

Clientbound

Clientbound Report Details (configuration)

Contains a list of key-value text entries that are included in any crash or disconnection report generated during connection to the server.

Packet ID State Bound To Field Name Field Type Notes
0x0F Configuration Client Details Count VarInt (32) The number of details in the following array.
Details Title Array String (128)
Description String (4096)

Clientbound Server Links (configuration)

This packet contains a list of links that the Notchian client will display in the menu available from the pause menu. Link labels can be built-in or custom (i.e., any text).

Packet ID State Bound To Field Name Field Type Notes
0x10 Configuration Client Links Count VarInt The number of links in the following array.
Links Is built-in Array Boolean Determines if the following label is built-in (from enum) or custom (text component).
Label VarInt Enum / Text Component See below.
URL String Valid URL.


ID Name Notes
0 Bug Report Displayed on connection error screen; included as a comment in the disconnection report.
1 Community Guidelines
2 Support
3 Status
4 Feedback
5 Community
6 Website
7 Forums
8 News
9 Announcements

Serverbound

No changes so far.

Play

Clientbound

Clientbound Report Details (play)

Contains a list of key-value text entries that are included in any crash or disconnection report generated during connection to the server.

Packet ID State Bound To Field Name Field Type Notes
0x7A Configuration Client Details Count VarInt (32) The number of details in the following array.
Details Title Array String (128)
Description String (4096)

Clientbound Server Links (play)

This packet contains a list of links that the Notchian client will display in the menu available from the pause menu. Link labels can be built-in or custom (i.e., any text).

Packet ID State Bound To Field Name Field Type Notes
0x7B Configuration Client Links Count VarInt The number of links in the following array.
Links Is built-in Array Boolean Determines if the following label is built-in (from enum) or custom (text component).
Label VarInt Enum / Text Component See below.
URL String Valid URL.
ID Name Notes
0 Bug Report Displayed on connection error screen; included as a comment in the disconnection report.
1 Community Guidelines
2 Support
3 Status
4 Feedback
5 Community
6 Website
7 Forums
8 News
9 Announcements

Serverbound

No changes so far.