Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
(Halfway done with 17w46a)
(Reset, added information about undocumented 1.21-pre2)
Tag: Replaced
 
(762 intermediate revisions by 48 users not shown)
Line 1: Line 1:
This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently [[Protocol version numbers|1.12.2, protocol 340]]) to the current pre-release (currently [[Protocol version numbers|17w45b, protocol 345]]). Note that this page contains bleeding-edge information that may not be completely or correctly documented.
+
There is currently a pre-release version available: 1.21-pre2, but it has not yet been documented. For the latest stable Minecraft release, see the [[Protocol|Protocol]] page. For previous pre-release pages, see the [[Protocol version numbers|Protocol version numbers]] page.
  
 
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.
 
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.
Line 12: Line 12:
  
 
=== Packets ===
 
=== Packets ===
 
{| class="wikitable"
 
! ID
 
! Packet name
 
!colspan="2"| Documentation
 
|-
 
!colspan="4"| Handshaking serverbound
 
{{PacketList|0x00|Handshake}}
 
|-
 
!colspan="4"| Play clientbound
 
{{PacketList|{{change|0x0F|0x0E}}|Chat Message (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x10|0x0F}}|Multi Block Change|pre=unchanged}}
 
{{PacketList|{{change|0x0E|0x10}}|Tab-Complete (clientbound)}}
 
{{PacketList|0x10|Declare Commands|rel=added}}
 
{{PacketList|0x19|Named Sound Effect}}
 
{{PacketList|0x22|Particle}}
 
{{PacketList|0x49|Stop Sound|rel=added}}
 
{{PacketList|{{change|0x49|0x4A}}|Sound Effect|pre=unchanged}}
 
{{PacketList|{{change|0x4A|0x4B}}|Player List Header And Footer|pre=unchanged}}
 
{{PacketList|{{change|0x4B|0x4C}}|Collect Item|pre=unchanged}}
 
{{PacketList|{{change|0x4C|0x4D}}|Entity Teleport|pre=unchanged}}
 
{{PacketList|{{change|0x4D|0x4E}}|Advancements|pre=unchanged}}
 
{{PacketList|{{change|0x4E|0x4F}}|Entity Properties|pre=unchanged}}
 
{{PacketList|{{change|0x4F|0x50}}|Entity Effect|pre=unchanged}}
 
|-
 
!colspan="4"| Play serverbound
 
{{PacketList|{{change|0x02|0x01}}|Chat Message (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x03|0x02}}|Client Status|pre=unchanged}}
 
{{PacketList|{{change|0x04|0x03}}|Client Settings|pre=unchanged}}
 
{{PacketList|{{change|0x01|0x04}}|Tab-Complete (serverbound)}}
 
|}
 
 
== New/modified data types ==
 
  
 
No changes so far.
 
No changes so far.
 
== Block Actions ==
 
 
No changes so far.
 
 
== Plugin Channels ==
 
 
=== <code>MC|StopSound</code> ===
 
 
{{Change|''Server to client''}}
 
 
{{Change|Used to implement {{Minecraft Wiki|Commands#StopSound|the <code>/stopsound</code> command}}.  Stops a sound that is currently playing on the client.}}
 
 
{| class="wikitable" style="background-color: #f4cccc; text-decoration: line-through;"
 
! Field name
 
! Field type
 
! Notes
 
|-
 
| Sound category
 
| String
 
| Should be one of the sound categories used in [[Protocol#Named Sound Effect|Named Sound Effect]], but if it's invalid or empty then it is (intentionally) treated as ''all'' sound categories.
 
|-
 
| Sound name
 
| String
 
| A [http://pokechu22.github.io/Burger/1.11.html#sounds sound effect name].  If left empty, ''all'' sounds are stopped.
 
|}
 
 
{{Change|Emptiness of sound category or sound name can be combined, IE a empty sound name but a set sound category will stop all sounds in the given category.}}
 
 
{{Change||This plugin channel has been replaced by the [[#Stop sound|stop sound]] packet.}}
 
 
== Play ==
 
 
=== Clientbound ===
 
 
==== Tab-Complete (clientbound) ====
 
 
The server responds with a list of auto-completions of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported. The client sorts these alphabetically before listing them.
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
|rowspan="3"| {{Change|0x0E|0x10}}
 
|rowspan="3"| Play
 
|rowspan="3"| Client
 
|style="background-color: #d9ead3;"| Unknown
 
|style="background-color: #d9ead3;"| VarInt
 
|style="background-color: #d9ead3;"|
 
|-
 
| Count
 
| VarInt
 
| Number of elements in the following array
 
|-
 
| Matches
 
| Array of String (32767)
 
| One eligible command, note that each command is sent separately instead of in a single string, hence the need for Count
 
|}
 
 
 
==== Declare Commands ====
 
 
Currently has no payload, but will serialize a Brigadier <code>RootCommandNode</code> instance.
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
| 0x10
 
| Play
 
| Client
 
|colspan="3"| ''no fields''
 
|}
 
 
==== Named Sound Effect ====
 
{{See also|#Sound Effect}}
 
 
Used to play a sound effect on the client. Custom sounds may be added by resource packs.
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
|rowspan="7"| 0x19
 
|rowspan="7"| Play
 
|rowspan="7"| Client
 
| Sound Name
 
| {{Change|String (256)|Identifier}}
 
| All sound effect names as of 1.12.2 can be seen [http://pokechu22.github.io/Burger/1.12.2.html#sounds here].
 
|-
 
| Sound Category
 
| VarInt Enum
 
| The category that this sound will be played from ([https://gist.github.com/konwboj/7c0c380d3923443e9d55 current categories])
 
|-
 
| Effect Position X
 
| Int
 
| Effect X multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
 
|-
 
| Effect Position Y
 
| Int
 
| Effect Y multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
 
|-
 
| Effect Position Z
 
| Int
 
| Effect Z multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part)
 
|-
 
| Volume
 
| Float
 
| 1 is 100%, can be more
 
|-
 
| Pitch
 
| Float
 
| Float between 0.5 and 2.0 by Notchian clients
 
|}
 
 
==== Particle ====
 
 
Displays the named particle
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
|rowspan="11"| 0x22
 
|rowspan="11"| Play
 
|rowspan="11"| Client
 
| Particle ID
 
| Int
 
| See below
 
|-
 
| Long Distance
 
| Boolean
 
| If true, particle distance increases from 256 to 65536
 
|-
 
| X
 
| Float
 
| X position of the particle
 
|-
 
| Y
 
| Float
 
| Y position of the particle
 
|-
 
| Z
 
| Float
 
| Z position of the particle
 
|-
 
| Offset X
 
| Float
 
| This is added to the X position after being multiplied by random.nextGaussian()
 
|-
 
| Offset Y
 
| Float
 
| This is added to the Y position after being multiplied by random.nextGaussian()
 
|-
 
| Offset Z
 
| Float
 
| This is added to the Z position after being multiplied by random.nextGaussian()
 
|-
 
| Particle Data
 
| Float
 
| The data of each particle
 
|-
 
| Particle Count
 
| Int
 
| The number of particles to create
 
|-
 
| Data
 
| {{Change|Array of VarInt|Varies}}
 
| {{Change|Length depends on particle. "iconcrack" has length of 2, "blockcrack", "blockdust", and "fallingdust" have lengths of 1, the rest have 0.|Type of data varies based off of the particle.  For "iconcrack", it is a [[Slot]].  For "blockcrack", "blockdust", and "fallingdust", it is a block state encoded as a VarInt that is an index within the global palette.}}
 
|}
 
 
==== Stop Sound ====
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
|rowspan="7"| 0x49
 
|rowspan="7"| Play
 
|rowspan="7"| Client
 
| Flags
 
| Byte
 
| Controls which fields are present.
 
|-
 
| Source
 
| Optional VarInt enum
 
| Only if flags is 3 or 1.  See below.  If not present, then sounds from all sources are cleared.
 
|-
 
| Sound
 
| Optional Identifier
 
| Only if flags is 2 or 3.  A sound effect name, see [[#Named Sound Effect|Named Sound Effect]].  If not present, then all sounds are cleared.
 
|}
 
 
Categories:
 
 
{| class="wikitable"
 
! Name !! Value
 
|-
 
| master || 0
 
|-
 
| music || 1
 
|-
 
| record || 2
 
|-
 
| weather || 3
 
|-
 
| block || 4
 
|-
 
| hostile || 5
 
|-
 
| neutral || 6
 
|-
 
| player || 7
 
|-
 
| ambient || 8
 
|-
 
| voice || 9
 
|}
 
 
=== Serverbound ===
 
 
==== Tab-Complete (serverbound) ====
 
 
Sent when the user presses ''tab'' while writing text.
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
|rowspan="5"| {{Change|0x01|0x04}}
 
|rowspan="5"| Play
 
|rowspan="5"| Server
 
|style="background-color: #d9ead3;"| Unknown
 
|style="background-color: #d9ead3;"| VarInt
 
|style="background-color: #d9ead3;"|
 
|-
 
| Text
 
| String (32767)
 
| All text behind the cursor (e.g. to the left of the cursor in left-to-right languages like English)
 
|- style="background-color: #f4cccc; text-decoration: line-through;"
 
| Assume Command
 
| Boolean
 
| If true, the server will parse Text as a command even if it doesn't start with a <code>/</code>. Used in the command block GUI.
 
|- style="background-color: #f4cccc; text-decoration: line-through;"
 
| Has Position
 
| Boolean
 
|
 
|- style="background-color: #f4cccc; text-decoration: line-through;"
 
| Looked At Block
 
| Optional Position
 
| The position of the block being looked at. Only sent if Has Position is true.
 
|}
 
 
 
== Handshaking ==
 
 
=== Clientbound ===
 
 
There are no clientbound packets in the Handshaking state, since the protocol immediately switches to a different state after the client sends the first packet.
 
 
=== Serverbound ===
 
 
==== Handshake ====
 
 
This causes the server to switch into the target state.
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
|rowspan="4"| 0x00
 
|rowspan="4"| Handshaking
 
|rowspan="4"| Server
 
| Protocol Version
 
| VarInt
 
| See [[protocol version numbers]] (currently {{change|340|345}})
 
|-
 
| Server Address
 
| String
 
| Hostname or IP, e.g. localhost or 127.0.0.1, that was used to connect.  The Notchian server does not use this information.
 
|-
 
| Server Port
 
| Unsigned Short
 
| Default is 25565.  The Notchian server does not use this information.
 
|-
 
| Next State
 
| VarInt Enum
 
| 1 for [[#Status|status]], 2 for [[#Login|login]]
 
|}
 
 
== Status ==
 
 
=== Clientbound ===
 
 
No changes so far.
 
 
=== Serverbound ===
 
 
No changes so far.
 
 
== Login ==
 
 
=== Clientbound ===
 
 
No changes so far.
 
 
=== Serverbound ===
 
 
No changes so far.
 
 
  
 
[[Category:Minecraft Modern]]
 
[[Category:Minecraft Modern]]

Latest revision as of 09:24, 6 June 2024

There is currently a pre-release version available: 1.21-pre2, but it has not yet been documented. For the latest stable Minecraft release, see the Protocol page. For previous pre-release pages, see the Protocol version numbers page.

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

No changes so far.