Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
(20w07a - new metadata changes, not yet added)
(→‎Entity Properties: From snapshot update article)
(21 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently [[Protocol version numbers|1.15.2, protocol 578]]) to the current pre-release (currently [[Protocol version numbers|20w07a, protocol 702]]). Note that this page contains bleeding-edge information that may not be completely or correctly documented.
+
This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently [[Protocol version numbers|1.15.2, protocol 578]]) to the current pre-release (currently [[Protocol version numbers|20w14a, protocol 710]]). 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.
 
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 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 20: Line 20:
 
!colspan="4"| Handshaking serverbound
 
!colspan="4"| Handshaking serverbound
 
{{PacketList|0x00|Handshake}}
 
{{PacketList|0x00|Handshake}}
 +
|-
 +
!colspan="4"| Play clientbound
 +
{{PacketList|{{Change|0x4E|0x43}}|Spawn Position|pre=unchanged}}
 +
{{PacketList|{{Change|0x43|0x44}}|Display Scoreboard|pre=unchanged}}
 +
{{PacketList|{{Change|0x44|0x45}}|Entity Metadata|pre=unchanged}}
 +
{{PacketList|{{Change|0x45|0x46}}|Attach Entity|pre=unchanged}}
 +
{{PacketList|{{Change|0x46|0x47}}|Entity Velocity|pre=unchanged}}
 +
{{PacketList|{{Change|0x47|0x48}}|Entity Equipment|pre=unchanged}}
 +
{{PacketList|{{Change|0x48|0x49}}|Set Experience|pre=unchanged}}
 +
{{PacketList|{{Change|0x49|0x4A}}|Update Health|pre=unchanged}}
 +
{{PacketList|{{Change|0x4A|0x4B}}|Scoreboard Objective|pre=unchanged}}
 +
{{PacketList|{{Change|0x4B|0x4C}}|Set Passengers|pre=unchanged}}
 +
{{PacketList|{{Change|0x4C|0x4D}}|Teams|pre=unchanged}}
 +
{{PacketList|{{Change|0x4D|0x4E}}|Update Score|pre=unchanged}}
 +
{{PacketList|0x59|Entity Properties}}
 +
|-
 +
!colspan="4"| Play serverbound
 +
{{PacketList|0x27|Update Jigsaw Block}}
 +
|-
 +
!colspan="4"| Login clientbound
 +
{{PacketList|0x02|Login Success}}
 
  |}
 
  |}
  
Line 28: Line 49:
 
== Entity Metadata ==
 
== Entity Metadata ==
  
{{#vardefine:meta_prerelease|1}}No changes so far.
+
{{#vardefine:meta_prerelease|1}}
 +
 
 +
=== FishingHook ===
 +
 
 +
{{Metadata inherit|FishingHook|inherits=Entity|start_at=7}}
 +
 
 +
{| class="wikitable"
 +
! Index
 +
! Type
 +
!style="width: 250px;" colspan="2"| Meaning
 +
! Default
 +
|-
 +
| {{Metadata id|}}
 +
| VarInt
 +
|colspan="2"| Hooked entity id + 1, or 0 if there is no hooked entity
 +
| 0
 +
|- {{Added}}
 +
| {{Metadata id|added}}
 +
| Boolean
 +
|colspan="2"| Is catchable
 +
| False
 +
|}
 +
 
 +
=== Abstract Arrow ===
 +
 
 +
{{Metadata inherit|Abstract Arrow|inherits=Entity|start_at=7}}
 +
 
 +
Abstract base class for [[#Tipped Arrow|Tipped Arrow]] (which is used for regular arrows as well as tipped ones) and [[#Spectral Arrow|Spectral Arrow]].
 +
 
 +
{| class="wikitable"
 +
! Index
 +
! Type
 +
!style="width: 250px;" colspan="2"| Meaning
 +
! Default
 +
|-
 +
| rowspan="3" | {{Metadata id|}}
 +
| rowspan="3" | Byte
 +
! Bit mask
 +
! Meaning
 +
| rowspan="3" | 0
 +
|-
 +
| 0x01
 +
| Is critical
 +
|-
 +
| 0x02
 +
| Is noclip (used by loyalty tridents when returning)
 +
|- {{removed}}
 +
| {{Metadata id|removed}}
 +
| OptUUID
 +
|colspan="2"| Unused
 +
| Empty
 +
|-
 +
| {{Metadata id|}}
 +
| Byte
 +
|colspan="2"| Peircing level
 +
| 0
 +
|}
 +
 
 +
=== Tipped Arrow ===
 +
 
 +
{{Metadata inherit|Tipped Arrow|inherits=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.
 +
 
 +
{| class="wikitable"
 +
! Index
 +
! Type
 +
!style="width: 250px;" colspan="2"| Meaning
 +
! Default
 +
|-
 +
| {{Metadata id|}}
 +
| VarInt
 +
|colspan="2"| Color (-1 for no particles)
 +
| -1
 +
|}
 +
 
 +
=== Spectral Arrow ===
 +
 
 +
{{Metadata inherit|Spectral Arrow|inherits=Abstract Arrow}}
 +
 
 +
No additional metadata.
 +
 
 +
=== Trident ===
 +
 
 +
{{Metadata inherit|Trident|inherits=Abstract Arrow}}
 +
 
 +
{| class="wikitable"
 +
! Index
 +
! Type
 +
!style="width: 250px;" colspan="2"| Meaning
 +
! Default
 +
|-
 +
| {{Metadata id|}}
 +
| VarInt
 +
|colspan="2"| Loyalty level (enchantment)
 +
| 0
 +
|-
 +
| {{Metadata id|}}
 +
| Boolean
 +
|colspan="2"| Has enchantment glint
 +
| False
 +
|}
 +
 
 +
=== Strider ===
 +
 
 +
{{Metadata inherit|Strider|inherits=Animal|start_at=16}}
 +
 
 +
{| class="wikitable" {{added}}
 +
! Index
 +
! Type
 +
!style="width: 250px;" colspan="2"| Meaning
 +
! Default
 +
|-
 +
| {{Metadata id|}}
 +
| VarInt
 +
|colspan="2"| Total time to "boost" with warped fungus on a stick for
 +
| 0
 +
|-
 +
| {{Metadata id|}}
 +
| Boolean
 +
|colspan="2"| Should display name tag (true unless riding a vehicle or on or in a block tagged with strider_warm_blocks (default: lava))
 +
| false
 +
|-
 +
| {{Metadata id|}}
 +
| Boolean
 +
|colspan="2"| Has saddle
 +
| false
 +
|}
 +
 
 +
=== Hoglin ===
 +
 
 +
{{Metadata inherit|Hoglin|inherits=Animal|start_at=16}}
 +
 
 +
{| class="wikitable" {{added}}
 +
! Index
 +
! Type
 +
!style="width: 250px;" colspan="2"| Meaning
 +
! Default
 +
|-
 +
| {{Metadata id|}}
 +
| Boolean
 +
|colspan="2"| ?
 +
| False
 +
|}
 +
 
 +
=== Zoglin ===
 +
 
 +
{{Metadata inherit|Hoglin|inherits=Monster|start_at=15}}
 +
 
 +
{| class="wikitable" {{added}}
 +
! Index
 +
! Type
 +
!style="width: 250px;" colspan="2"| Meaning
 +
! Default
 +
|-
 +
| {{Metadata id|}}
 +
| Boolean
 +
|colspan="2"| ?
 +
| False
 +
|}
 +
 
 +
=== Piglin ===
 +
 
 +
{{Metadata inherit|Piglin|inherits=Monster|start_at=15}}
 +
 
 +
{| class="wikitable" {{added}}
 +
! Index
 +
! Type
 +
!style="width: 250px;" colspan="2"| Meaning
 +
! Default
 +
|-
 +
| {{Metadata id|}}
 +
| Boolean
 +
|colspan="2"| Is baby
 +
| false
 +
|-
 +
| {{Metadata id|}}
 +
| Boolean
 +
|colspan="2"| Is immune to zombification
 +
| false
 +
|-
 +
| {{Metadata id|}}
 +
| Boolean
 +
|colspan="2"| Is charging crossbow
 +
| false
 +
|}
 +
 
 +
=== {{Change|Zombie Pigman|Zombified Piglin}} ===
 +
 
 +
{{Metadata inherit|{{Change|Zombie Pigman|Zombified Piglin}}|inherits=Zombie|start_at=18}}
 +
 
 +
No additional metadata.
  
 
== Block Actions ==
 
== Block Actions ==
Line 46: Line 258:
 
=== Clientbound ===
 
=== Clientbound ===
  
No changes so far.
+
==== Entity Properties ====
 +
 
 +
Sets {{Minecraft Wiki|Attribute|attributes}} on the given entity.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
!colspan="2"| Field Name
 +
!colspan="2"| Field Type
 +
! Notes
 +
|-
 +
|rowspan="6"| 0x59
 +
|rowspan="6"| Play
 +
|rowspan="6"| Client
 +
|colspan="2"| Entity ID
 +
|colspan="2"| VarInt
 +
|
 +
|-
 +
|colspan="2"| Number Of Properties
 +
|colspan="2"| Int
 +
| Number of elements in the following array
 +
|-
 +
|rowspan="4"| Property
 +
| Key
 +
|rowspan="4"| Array
 +
| {{Change|String (64)|Identifier}}
 +
| See below
 +
|-
 +
| Value
 +
| Double
 +
| See below
 +
|-
 +
| Number Of Modifiers
 +
| VarInt
 +
| Number of elements in the following array
 +
|-
 +
| Modifiers
 +
| Array of Modifier Data
 +
| See {{Minecraft Wiki|Attribute#Modifiers}}. Modifier Data defined below.
 +
|}
 +
 
 +
Known Key values (see also {{Minecraft Wiki|Attribute#Modifiers}}):
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Key
 +
! Default
 +
! Min
 +
! Max
 +
! Label
 +
|-
 +
| {{change|generic.maxHealth|generic.max_health}}
 +
| 20.0
 +
| 0.0
 +
| 1024.0
 +
| Max Health
 +
|-
 +
| {{change|generic.followRange|generic.follow_range}}
 +
| 32.0
 +
| 0.0
 +
| 2048.0
 +
| Follow Range
 +
|-
 +
| {{change|generic.knockbackResistance|generic.knockback_resistance}}
 +
| 0.0
 +
| 0.0
 +
| 1.0
 +
| Knockback Resistance
 +
|-
 +
| {{change|generic.movementSpeed|generic.movement_speed}}
 +
| 0.7
 +
| 0.0
 +
| 1024.0
 +
| Movement Speed
 +
|-
 +
| {{change|generic.attackDamage|generic.attack_damage}}
 +
| 2.0
 +
| 0.0
 +
| 2048.0
 +
| Attack Damage
 +
|-
 +
| {{change|generic.attackSpeed|generic.attack_speed}}
 +
| 4.0
 +
| 0.0
 +
| 1024.0
 +
| Attack Speed
 +
|-
 +
| {{change|generic.flyingSpeed|generic.flying_speed}}
 +
| 0.4
 +
| 0.0
 +
| 1024.0
 +
| Flying Speed
 +
|-
 +
| generic.armor
 +
| 0.0
 +
| 0.0
 +
| 30.0
 +
| Armor
 +
|-
 +
| {{change|generic.armorToughness|generic.armor_toughness}}
 +
| 0.0
 +
| 0.0
 +
| 20.0
 +
| Armor Toughness
 +
|-
 +
| {{change|generic.attackKnockback|generic.attack_knockback}}
 +
| 0.0
 +
| 0.0
 +
| 5.0
 +
| —
 +
|-
 +
| generic.luck
 +
| 0.0
 +
| -1024.0
 +
| 1024.0
 +
| Luck
 +
|-
 +
| {{change|horse.jumpStrength|horse.jump_strength}}
 +
| 0.7
 +
| 0.0
 +
| 2.0
 +
| Jump Strength
 +
|-
 +
| {{change|zombie.spawnReinforcements|zombie.spawn_reinforcements}}
 +
| 0.0
 +
| 0.0
 +
| 1.0
 +
| Spawn Reinforcements Chance
 +
|-
 +
| generic.reachDistance
 +
| 5.0
 +
| 0.0
 +
| 1024.0
 +
| Player Reach Distance (Forge only)
 +
|-
 +
| forge.swimSpeed
 +
| 1.0
 +
| 0.0
 +
| 1024.0
 +
| Swimming Speed (Forge only)
 +
|}
 +
 
 +
Unknown attributes will cause a game crash ([https://bugs.mojang.com/browse/MC-150405 MC-150405]) due to the default minimum being larger than the default value.
 +
 
 +
''Modifier Data'' structure:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| UUID
 +
| UUID
 +
|
 +
|-
 +
| Amount
 +
| Double
 +
| May be positive or negative
 +
|-
 +
| Operation
 +
| Byte
 +
| See below
 +
|}
 +
 
 +
The operation controls how the base value of the modifier is changed.
 +
 
 +
* 0: Add/subtract amount
 +
* 1: Add/subtract amount percent of the current value
 +
* 2: Multiply by amount percent
 +
 
 +
All of the 0's are applied first, and then the 1's, and then the 2's.
  
 
=== Serverbound ===
 
=== Serverbound ===
  
No changes so far.
+
==== Update Jigsaw Block ====
 +
 
 +
Sent when Done is pressed on the {{Minecraft Wiki|Jigsaw Block}} interface.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="7"| 0x27
 +
|rowspan="7"| Play
 +
|rowspan="7"| Server
 +
| Location
 +
| Position
 +
| Block entity location
 +
|- {{Removed}}
 +
| Attachment type
 +
| Identifier
 +
|
 +
|- {{Added}}
 +
| Name
 +
| Identifier
 +
|
 +
|- {{Added}}
 +
| Target
 +
| Identifier
 +
|
 +
|-
 +
| {{Change|Target pool|Pool}}
 +
| Identifier
 +
|
 +
|-
 +
| Final state
 +
| String
 +
| "Turns into" on the GUI, <code>final_state</code> in NBT
 +
|- {{Added}}
 +
| Joint type
 +
| String
 +
| <code>rollable</code> if the attached piece can be rotated, else <code>aligned</code>
 +
|}
  
 
== Handshaking ==
 
== Handshaking ==
Line 77: Line 503:
 
  | Protocol Version
 
  | Protocol Version
 
  | VarInt
 
  | VarInt
  | See [[protocol version numbers]] (currently {{change|578|702}})
+
  | See [[protocol version numbers]] (currently {{change|578|710}})
 
  |-
 
  |-
 
  | Server Address
 
  | Server Address
Line 106: Line 532:
 
=== Clientbound ===
 
=== Clientbound ===
  
No changes so far.
+
==== Login Success ====
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="2"| 0x02
 +
|rowspan="2"| Login
 +
|rowspan="2"| Client
 +
| UUID
 +
| {{Change|String (36)|UUID}}
 +
| {{Change|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|play]].
  
 
=== Serverbound ===
 
=== Serverbound ===

Revision as of 18:19, 2 April 2020

This page documents the changes from the last stable Minecraft release (currently 1.15.2, protocol 578) to the current pre-release (currently 20w14a, protocol 710). 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)
0x59 Entity Properties Current Pre
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.

Index Type Meaning Default
16 Boolean ? False

Zoglin

Extends Monster.

Index Type Meaning Default
15 Boolean ? False

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

Entity Properties

Sets attributes on the given entity.

Packet ID State Bound To Field Name Field Type Notes
0x59 Play Client Entity ID VarInt
Number Of Properties Int Number of elements in the following array
Property Key Array String (64) Identifier See below
Value Double See below
Number Of Modifiers VarInt Number of elements in the following array
Modifiers Array of Modifier Data See Attribute#Modifiers. Modifier Data defined below.

Known Key values (see also Attribute#Modifiers):

Key Default Min Max Label
generic.maxHealth generic.max_health 20.0 0.0 1024.0 Max Health
generic.followRange generic.follow_range 32.0 0.0 2048.0 Follow Range
generic.knockbackResistance generic.knockback_resistance 0.0 0.0 1.0 Knockback Resistance
generic.movementSpeed generic.movement_speed 0.7 0.0 1024.0 Movement Speed
generic.attackDamage generic.attack_damage 2.0 0.0 2048.0 Attack Damage
generic.attackSpeed generic.attack_speed 4.0 0.0 1024.0 Attack Speed
generic.flyingSpeed generic.flying_speed 0.4 0.0 1024.0 Flying Speed
generic.armor 0.0 0.0 30.0 Armor
generic.armorToughness generic.armor_toughness 0.0 0.0 20.0 Armor Toughness
generic.attackKnockback generic.attack_knockback 0.0 0.0 5.0
generic.luck 0.0 -1024.0 1024.0 Luck
horse.jumpStrength horse.jump_strength 0.7 0.0 2.0 Jump Strength
zombie.spawnReinforcements zombie.spawn_reinforcements 0.0 0.0 1.0 Spawn Reinforcements Chance
generic.reachDistance 5.0 0.0 1024.0 Player Reach Distance (Forge only)
forge.swimSpeed 1.0 0.0 1024.0 Swimming Speed (Forge only)

Unknown attributes will cause a game crash (MC-150405) due to the default minimum being larger than the default value.

Modifier Data structure:

Field Name Field Type Notes
UUID UUID
Amount Double May be positive or negative
Operation Byte See below

The operation controls how the base value of the modifier is changed.

  • 0: Add/subtract amount
  • 1: Add/subtract amount percent of the current value
  • 2: Multiply by amount percent

All of the 0's are applied first, and then the 1's, and then the 2's.

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 710)
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.