Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
m (→‎Strider: Warped fungus on a stick, not warped fungi in general)
(UUID is equivalent to past formats; Mojang just has a different way of encoding it)
Line 9: Line 9:
 
=== Data types ===
 
=== Data types ===
  
No changes so far.
+
The UUID type is now also sometimes encoded by the Notchian server as an array of four 32-bit integers, from most significant to least significant (matching the new format used on entity NBT).  This representation is identical to using 16 bytes, two 64-bit integers, or one 128-bit integers.
  
 
=== Packets ===
 
=== Packets ===
Line 347: Line 347:
 
  |rowspan="2"| Client
 
  |rowspan="2"| Client
 
  | UUID
 
  | UUID
  | {{Change|String (36)|Int array (4)}}
+
  | {{Change|String (36)|UUID}}
  | Unlike in other packets, this field contains the UUID as {{change|a string with hyphens|a fixed length int array}}.
+
  | {{Change|Unlike in other packets, this field contains the UUID as a string with hyphens}}.
{{change||The UUID is encoded and decoded as follows, where the int array for decoding is read in the order the bytes are received:
 
  public static UUID decodeUuid(int[] is) {
 
    return new UUID((long)is[0] << 32 <nowiki>|</nowiki> (long)is[1] & 0xFFFF_FFFFL, (long)is[2] << 32 <nowiki>|</nowiki> (long)is[3] & 0xFFFF_FFFFL);
 
  }
 
  public static int[] encodeUuid(long mostSignificantBits, long leastSignificantBits) {
 
    return new int[]{
 
        (int)(mostSignificantBits >> 32),
 
        (int)mostSignificantBits,
 
        (int)(leastSignificantBits >> 32),
 
        (int)leastSignificantBits
 
    };
 
  }
 
}}
 
 
  |-
 
  |-
 
  | Username
 
  | Username

Revision as of 21:54, 30 March 2020

This page documents the changes from the last stable Minecraft release (currently 1.15.2, protocol 578) to the current pre-release (currently 20w13b, protocol 709). 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

The UUID type is now also sometimes encoded by the Notchian server as an array of four 32-bit integers, from most significant to least significant (matching the new format used on entity NBT). This representation is identical to using 16 bytes, two 64-bit integers, or one 128-bit integers.

Packets

ID Packet name Documentation
Handshaking serverbound
0x00 Handshake Current Pre
Play clientbound
0x4E 0x43 Spawn Position Current (unchanged)
0x43 0x44 Display Scoreboard Current (unchanged)
0x44 0x45 Entity Metadata Current (unchanged)
0x45 0x46 Attach Entity Current (unchanged)
0x46 0x47 Entity Velocity Current (unchanged)
0x47 0x48 Entity Equipment Current (unchanged)
0x48 0x49 Set Experience Current (unchanged)
0x49 0x4A Update Health Current (unchanged)
0x4A 0x4B Scoreboard Objective Current (unchanged)
0x4B 0x4C Set Passengers Current (unchanged)
0x4C 0x4D Teams Current (unchanged)
0x4D 0x4E Update Score Current (unchanged)
Play serverbound
0x27 Update Jigsaw Block Current Pre
Login clientbound
0x02 Login Success Current Pre

New/modified data types

No changes so far.

Entity Metadata

FishingHook

Extends Entity.

Index Type Meaning Default
7 VarInt Hooked entity id + 1, or 0 if there is no hooked entity 0
8 Boolean Is catchable False

Abstract Arrow

Extends Entity.

Abstract base class for Tipped Arrow (which is used for regular arrows as well as tipped ones) and Spectral Arrow.

Index Type Meaning Default
7 Byte Bit mask Meaning 0
0x01 Is critical
0x02 Is noclip (used by loyalty tridents when returning)
8 OptUUID Unused Empty
9 8 Byte Peircing level 0

Tipped Arrow

Extends Abstract Arrow.

Used for both tipped and regular arrows. If not tipped, then color is set to -1 and no tipped arrow particles are used.

Index Type Meaning Default
10 9 VarInt Color (-1 for no particles) -1

Spectral Arrow

Extends Abstract Arrow.

No additional metadata.

Trident

Extends Abstract Arrow.

Index Type Meaning Default
10 9 VarInt Loyalty level (enchantment) 0
11 10 Boolean Has enchantment glint False

Strider

Extends Animal.

Index Type Meaning Default
16 VarInt Total time to "boost" with warped fungus on a stick for 0
17 Boolean Should display name tag (true unless riding a vehicle or on or in a block tagged with strider_warm_blocks (default: lava)) false
18 Boolean Has saddle false

Hoglin

Extends Animal.

No additional metadata.

Piglin

Extends Monster.

Index Type Meaning Default
15 Boolean Is baby false
16 Boolean Is immune to zombification false
17 Boolean Is charging crossbow false

Zombie Pigman Zombified Piglin

Extends Zombie.

No additional metadata.

Block Actions

No changes so far.

Inventories

No changes so far.

Plugin Channels

No changes so far.

Play

Clientbound

No changes so far.

Serverbound

Update Jigsaw Block

Sent when Done is pressed on the Jigsaw Block interface.

Packet ID State Bound To Field Name Field Type Notes
0x27 Play Server Location Position Block entity location
Attachment type Identifier
Name Identifier
Target Identifier
Target pool Pool Identifier
Final state String "Turns into" on the GUI, final_state in NBT
Joint type String rollable if the attached piece can be rotated, else aligned

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.

Packet ID State Bound To Field Name Field Type Notes
0x00 Handshaking Server Protocol Version VarInt See protocol version numbers (currently 578 709)
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. Note that SRV records are a complete redirect, e.g. if _minecraft._tcp.example.com points to mc.example.org, users connecting to example.com will provide mc.example.org as server address in addition to connecting to it.
Server Port Unsigned Short Default is 25565. The Notchian server does not use this information.
Next State VarInt Enum 1 for status, 2 for login

Status

Clientbound

No changes so far.

Serverbound

No changes so far.

Login

Clientbound

Login Success

Packet ID State Bound To Field Name Field Type Notes
0x02 Login Client UUID String (36) UUID Unlike in other packets, this field contains the UUID as a string with hyphens.
Username String (16)

This packet switches the connection state to play.

Serverbound

No changes so far.