Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
(1.15-pre5)
(→‎Entity Properties: From snapshot update article)
(38 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.14.4, protocol 498]]) to the current pre-release (currently [[Protocol version numbers|1.15-pre5, protocol 570]]). 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 22: Line 22:
 
  |-
 
  |-
 
!colspan="4"| Play clientbound
 
!colspan="4"| Play clientbound
{{PacketList|0x03|Spawn Mob}}
+
{{PacketList|{{Change|0x4E|0x43}}|Spawn Position|pre=unchanged}}
{{PacketList|0x05|Spawn Player}}
+
{{PacketList|{{Change|0x43|0x44}}|Display Scoreboard|pre=unchanged}}
{{PacketList|{{change|0x5C|0x08}}|Acknowledge Player Digging|pre=unchanged}}
+
{{PacketList|{{Change|0x44|0x45}}|Entity Metadata|pre=unchanged}}
{{PacketList|{{change|0x08|0x09}}|Block Break Animation|pre=unchanged}}
+
{{PacketList|{{Change|0x45|0x46}}|Attach Entity|pre=unchanged}}
{{PacketList|{{change|0x09|0x0A}}|Update Block Entity}}
+
{{PacketList|{{Change|0x46|0x47}}|Entity Velocity|pre=unchanged}}
{{PacketList|{{change|0x0A|0x0B}}|Block Action|pre=unchanged}}
+
{{PacketList|{{Change|0x47|0x48}}|Entity Equipment|pre=unchanged}}
{{PacketList|{{change|0x0B|0x0C}}|Block Change|pre=unchanged}}
+
{{PacketList|{{Change|0x48|0x49}}|Set Experience|pre=unchanged}}
{{PacketList|{{change|0x0C|0x0D}}|Boss Bar|pre=unchanged}}
+
{{PacketList|{{Change|0x49|0x4A}}|Update Health|pre=unchanged}}
{{PacketList|{{change|0x0D|0x0E}}|Server Difficulty|pre=unchanged}}
+
{{PacketList|{{Change|0x4A|0x4B}}|Scoreboard Objective|pre=unchanged}}
{{PacketList|{{change|0x0E|0x0F}}|Chat Message (clientbound)|pre=unchanged}}
+
{{PacketList|{{Change|0x4B|0x4C}}|Set Passengers|pre=unchanged}}
{{PacketList|{{change|0x0F|0x10}}|Multi Block Change|pre=unchanged}}
+
{{PacketList|{{Change|0x4C|0x4D}}|Teams|pre=unchanged}}
{{PacketList|{{change|0x10|0x11}}|Tab-Complete (clientbound)|pre=unchanged}}
+
{{PacketList|{{Change|0x4D|0x4E}}|Update Score|pre=unchanged}}
{{PacketList|{{change|0x11|0x12}}|Declare Commands|pre=unchanged}}
+
{{PacketList|0x59|Entity Properties}}
{{PacketList|{{change|0x12|0x13}}|Confirm Transaction (clientbound)|pre=unchanged}}
+
|-
{{PacketList|{{change|0x13|0x14}}|Close Window (clientbound)|pre=unchanged}}
+
!colspan="4"| Play serverbound
{{PacketList|{{change|0x14|0x15}}|Window Items|pre=unchanged}}
+
{{PacketList|0x27|Update Jigsaw Block}}
{{PacketList|{{change|0x15|0x16}}|Window Property|pre=unchanged}}
+
|-
{{PacketList|{{change|0x16|0x17}}|Set Slot|pre=unchanged}}
+
!colspan="4"| Login clientbound
{{PacketList|{{change|0x17|0x18}}|Set Cooldown|pre=unchanged}}
+
{{PacketList|0x02|Login Success}}
{{PacketList|{{change|0x18|0x19}}|Plugin Message (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x19|0x1A}}|Named Sound Effect|pre=unchanged}}
 
{{PacketList|{{change|0x1A|0x1B}}|Disconnect (play)|pre=unchanged}}
 
{{PacketList|{{change|0x1B|0x1C}}|Entity Status|pre=unchanged}}
 
{{PacketList|{{change|0x1C|0x1D}}|Explosion|pre=unchanged}}
 
{{PacketList|{{change|0x1D|0x1E}}|Unload Chunk|pre=unchanged}}
 
{{PacketList|{{change|0x1E|0x1F}}|Change Game State|pre=unchanged}}
 
{{PacketList|{{change|0x1F|0x20}}|Open Horse Window|pre=unchanged}}
 
{{PacketList|{{change|0x20|0x21}}|Keep Alive (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x21|0x22}}|Chunk Data}}
 
{{PacketList|{{change|0x22|0x23}}|Effect|pre=unchanged}}
 
{{PacketList|{{change|0x23|0x24}}|Particle}}
 
{{PacketList|{{change|0x24|0x25}}|Update Light|pre=unchanged}}
 
{{PacketList|{{change|0x25|0x26}}|Join Game}}
 
{{PacketList|{{change|0x26|0x27}}|Map Data|pre=unchanged}}
 
{{PacketList|{{change|0x27|0x28}}|Trade List|pre=unchanged}}
 
{{PacketList|{{change|0x28|0x29}}|Entity Relative Move|pre=unchanged}}
 
{{PacketList|{{change|0x29|0x2A}}|Entity Look And Relative Move|pre=unchanged}}
 
{{PacketList|{{change|0x2A|0x2B}}|Entity Look|pre=unchanged}}
 
{{PacketList|{{change|0x2B|0x2C}}|Entity|pre=unchanged}}
 
{{PacketList|{{change|0x2C|0x2D}}|Vehicle Move (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x2D|0x2E}}|Open Book|pre=unchanged}}
 
{{PacketList|{{change|0x2E|0x2F}}|Open Window|pre=unchanged}}
 
{{PacketList|{{change|0x2F|0x30}}|Open Sign Editor|pre=unchanged}}
 
{{PacketList|{{change|0x30|0x31}}|Craft Recipe Response|pre=unchanged}}
 
{{PacketList|{{change|0x31|0x32}}|Player Abilities (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x32|0x33}}|Combat Event|pre=unchanged}}
 
{{PacketList|{{change|0x33|0x34}}|Player Info|pre=unchanged}}
 
{{PacketList|{{change|0x34|0x35}}|Face Player|pre=unchanged}}
 
{{PacketList|{{change|0x35|0x36}}|Player Position And Look (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x36|0x37}}|Unlock Recipes|pre=unchanged}}
 
{{PacketList|{{change|0x37|0x38}}|Destroy Entities|pre=unchanged}}
 
{{PacketList|{{change|0x38|0x39}}|Remove Entity Effect|pre=unchanged}}
 
{{PacketList|{{change|0x39|0x3A}}|Resource Pack Send|pre=unchanged}}
 
{{PacketList|{{change|0x3A|0x3B}}|Respawn}}
 
{{PacketList|{{change|0x3B|0x3C}}|Entity Head Look|pre=unchanged}}
 
{{PacketList|{{change|0x3C|0x3D}}|Select Advancement Tab|pre=unchanged}}
 
{{PacketList|{{change|0x3D|0x3E}}|World Border|pre=unchanged}}
 
{{PacketList|{{change|0x3E|0x3F}}|Camera|pre=unchanged}}
 
{{PacketList|{{change|0x3F|0x40}}|Held Item Change (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x40|0x41}}|Update View Position|pre=unchanged}}
 
{{PacketList|{{change|0x41|0x42}}|Update View Distance|pre=unchanged}}
 
{{PacketList|{{change|0x42|0x43}}|Display Scoreboard|pre=unchanged}}
 
{{PacketList|{{change|0x43|0x44}}|Entity Metadata|pre=unchanged}}
 
{{PacketList|{{change|0x44|0x45}}|Attach Entity|pre=unchanged}}
 
{{PacketList|{{change|0x45|0x46}}|Entity Velocity|pre=unchanged}}
 
{{PacketList|{{change|0x46|0x47}}|Entity Equipment|pre=unchanged}}
 
{{PacketList|{{change|0x47|0x48}}|Set Experience|pre=unchanged}}
 
{{PacketList|{{change|0x48|0x49}}|Update Health|pre=unchanged}}
 
{{PacketList|{{change|0x49|0x4A}}|Scoreboard Objective|pre=unchanged}}
 
{{PacketList|{{change|0x4A|0x4B}}|Set Passengers|pre=unchanged}}
 
{{PacketList|{{change|0x4B|0x4C}}|Teams|pre=unchanged}}
 
{{PacketList|{{change|0x4C|0x4D}}|Update Score|pre=unchanged}}
 
{{PacketList|{{change|0x4D|0x4E}}|Spawn Position|pre=unchanged}}
 
{{PacketList|{{change|0x4E|0x4F}}|Time Update|pre=unchanged}}
 
{{PacketList|{{change|0x4F|0x50}}|Title|pre=unchanged}}
 
{{PacketList|{{change|0x50|0x51}}|Entity Sound Effect|pre=unchanged}}
 
{{PacketList|{{change|0x51|0x52}}|Sound Effect|pre=unchanged}}
 
{{PacketList|{{change|0x52|0x53}}|Stop Sound|pre=unchanged}}
 
{{PacketList|{{change|0x53|0x54}}|Player List Header And Footer|pre=unchanged}}
 
{{PacketList|{{change|0x54|0x55}}|NBT Query Response|pre=unchanged}}
 
{{PacketList|{{change|0x55|0x56}}|Collect Item|pre=unchanged}}
 
{{PacketList|{{change|0x56|0x57}}|Entity Teleport|pre=unchanged}}
 
{{PacketList|{{change|0x57|0x58}}|Advancements|pre=unchanged}}
 
{{PacketList|{{change|0x58|0x59}}|Entity Properties|pre=unchanged}}
 
{{PacketList|{{change|0x59|0x5A}}|Entity Effect|pre=unchanged}}
 
{{PacketList|{{change|0x5A|0x5B}}|Declare Recipes|pre=unchanged}}
 
{{PacketList|{{change|0x5B|0x5C}}|Tags|pre=unchanged}}
 
 
  |}
 
  |}
  
Line 117: Line 49:
 
== Entity Metadata ==
 
== Entity Metadata ==
  
{{warning2|Lots of shifts, of course}}
+
{{#vardefine:meta_prerelease|1}}
  
=== Living ===
+
=== FishingHook ===
  
Extends [[#Entity|Entity]].
+
{{Metadata inherit|FishingHook|inherits=Entity|start_at=7}}
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 129: Line 61:
 
  ! Default
 
  ! Default
 
  |-
 
  |-
  |rowspan="5"| 7
+
  | {{Metadata id|}}
  |rowspan="5"| Byte
+
| VarInt
  |colspan="2"| Hand states, used to trigger blocking/eating/drinking animation.
+
|colspan="2"| Hooked entity id + 1, or 0 if there is no hooked entity
  |rowspan="5"| 0
+
| 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
 
  ! Bit mask
 
  ! Meaning
 
  ! Meaning
 +
| rowspan="3" | 0
 
  |-
 
  |-
 
  | 0x01
 
  | 0x01
  | Is hand active
+
  | Is critical
 
  |-
 
  |-
 
  | 0x02
 
  | 0x02
  | Active hand (0 = main hand, 1 = offhand)
+
  | Is noclip (used by loyalty tridents when returning)
 +
|- {{removed}}
 +
| {{Metadata id|removed}}
 +
| OptUUID
 +
|colspan="2"| Unused
 +
| Empty
 
  |-
 
  |-
  | 0x04
+
  | {{Metadata id|}}
  | In riptide spin attack
+
| 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
 
  |-
 
  |-
  | 8
+
  | {{Metadata id|}}
  | Float
+
  | VarInt
  |colspan="2"| Health
+
  |colspan="2"| Color (-1 for no particles)
  | 1.0
+
  | -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
 
  |-
 
  |-
  | 9
+
  | {{Metadata id|}}
 
  | VarInt
 
  | VarInt
  |colspan="2"| Potion effect color (or 0 if there is no effect)
+
  |colspan="2"| Loyalty level (enchantment)
 
  | 0
 
  | 0
 
  |-
 
  |-
  | 10
+
  | {{Metadata id|}}
 
  | Boolean
 
  | Boolean
  |colspan="2"| Is potion effect ambient: reduces the number of particles generated by potions to 1/5 the normal amount
+
  |colspan="2"| Has enchantment glint
  | false
+
  | False
|-
 
| 11
 
| VarInt
 
|colspan="2"| Number of arrows in entity
 
| 0
 
|- {{Added}}
 
| 12
 
| VarInt
 
|colspan="2"| Unknown
 
| 0
 
|-
 
| {{change|12|13}}
 
| OptBlockPos
 
|colspan="2"| Unknown (Bed location?)
 
| Absent
 
 
  |}
 
  |}
  
=== Bee ===
+
=== Strider ===
  
Extends [[#Insentient|Insentient]].
+
{{Metadata inherit|Strider|inherits=Animal|start_at=16}}
  
 
{| class="wikitable" {{added}}
 
{| class="wikitable" {{added}}
Line 187: Line 162:
 
  ! Default
 
  ! Default
 
  |-
 
  |-
  | 16
+
  | {{Metadata id|}}
  | Byte
+
  | VarInt
  |colspan="2"| Unknown
+
  |colspan="2"| Total time to "boost" with warped fungus on a stick for
 
  | 0
 
  | 0
 
  |-
 
  |-
  | 17
+
  | {{Metadata id|}}
  | VarInt
+
| Boolean
  |colspan="2"| Unknown
+
|colspan="2"| Should display name tag (true unless riding a vehicle or on or in a block tagged with strider_warm_blocks (default: lava))
  | 0
+
| false
 +
|-
 +
| {{Metadata id|}}
 +
  | Boolean
 +
  |colspan="2"| Has saddle
 +
  | false
 
  |}
 
  |}
  
=== Wolf ===
+
=== Hoglin ===
  
Extends [[#TameableAnimal|TameableAnimal]].
+
{{Metadata inherit|Hoglin|inherits=Animal|start_at=16}}
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
 
  ! Index
 
  ! Index
 
  ! Type
 
  ! Type
 
  !style="width: 250px;" colspan="2"| Meaning
 
  !style="width: 250px;" colspan="2"| Meaning
 
  ! Default
 
  ! Default
|- {{removed}}
 
| {{change|17|18}}
 
| Float
 
|colspan="2"| Damage taken (used for tail rotation)
 
| Value of health field (1.0)
 
 
  |-
 
  |-
  | 18
+
  | {{Metadata id|}}
 
  | Boolean
 
  | Boolean
  |colspan="2"| Is begging
+
  |colspan="2"| ?
  | false
+
  | False
|-
 
| 19
 
| VarInt
 
|colspan="2"| Collar color (values are those {{Minecraft Wiki|Data_values#Dyes|used with dyes}})
 
| 14 (Red)
 
 
  |}
 
  |}
  
=== Enderman ===
+
=== Zoglin ===
  
Extends [[#Monster|Monster]].
+
{{Metadata inherit|Hoglin|inherits=Monster|start_at=15}}
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
 
  ! Index
 
  ! Index
 
  ! Type
 
  ! Type
Line 234: Line 204:
 
  ! Default
 
  ! Default
 
  |-
 
  |-
  | 15
+
  | {{Metadata id|}}
| Opt BlockID
 
|colspan="2"| Carried block
 
| Absent
 
|-
 
| 16
 
 
  | Boolean
 
  | Boolean
  |colspan="2"| Is screaming
+
  |colspan="2"| ?
  | false
+
  | False
|- {{added}}
 
| 17
 
| Boolean
 
|colspan="2"| Unknown
 
| false
 
 
  |}
 
  |}
  
=== Trident ===
+
=== Piglin ===
  
Extends [[#Arrow|Arrow]].
+
{{Metadata inherit|Piglin|inherits=Monster|start_at=15}}
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
 
  ! Index
 
  ! Index
 
  ! Type
 
  ! Type
Line 260: Line 220:
 
  ! Default
 
  ! Default
 
  |-
 
  |-
  | 10
+
  | {{Metadata id|}}
  | VarInt
+
  | Boolean
  |colspan="2"| Loyalty level (enchantment)
+
  |colspan="2"| Is baby
  | 0
+
  | false
  |- {{Added}}
+
  |-
  | 11
+
| {{Metadata id|}}
 +
  | Boolean
 +
|colspan="2"| Is immune to zombification
 +
| false
 +
|-
 +
| {{Metadata id|}}
 
  | Boolean
 
  | Boolean
  |colspan="2"| Unknown
+
  |colspan="2"| Is charging crossbow
  | False
+
  | 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 287: Line 257:
  
 
=== Clientbound ===
 
=== Clientbound ===
==== Spawn Mob ====
 
  
Sent by the server when a mob entity is spawned.
+
==== Entity Properties ====
 +
 
 +
Sets {{Minecraft Wiki|Attribute|attributes}} on the given entity.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 295: Line 266:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  !colspan="2"| Field Name
  ! Field Type
+
  !colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="13"| 0x03
+
  |rowspan="6"| 0x59
  |rowspan="13"| Play
+
  |rowspan="6"| Play
  |rowspan="13"| Client
+
  |rowspan="6"| Client
  | Entity ID
+
  |colspan="2"| Entity ID
  | VarInt
+
  |colspan="2"| VarInt
 
  |  
 
  |  
 
  |-
 
  |-
  | Entity UUID
+
  |colspan="2"| Number Of Properties
  | UUID
+
  |colspan="2"| Int
  |  
+
  | Number of elements in the following array
 
  |-
 
  |-
  | Type
+
  |rowspan="4"| Property
  | VarInt
+
| Key
  | The type of mob. See [[Entities#Mobs]]
+
|rowspan="4"| Array
 +
  | {{Change|String (64)|Identifier}}
 +
  | See below
 
  |-
 
  |-
  | X
+
  | Value
 
  | Double
 
  | Double
  |  
+
  | See below
 
  |-
 
  |-
  | Y
+
  | Number Of Modifiers
  | Double
+
  | VarInt
  |  
+
  | Number of elements in the following array
 
  |-
 
  |-
  | Z
+
  | Modifiers
  | Double
+
  | Array of Modifier Data
  |  
+
  | See {{Minecraft Wiki|Attribute#Modifiers}}. Modifier Data defined below.
|-
 
| Yaw
 
| Angle
 
|
 
|-
 
| Pitch
 
| Angle
 
|
 
|-
 
| Head Pitch
 
| Angle
 
|
 
|-
 
| Velocity X
 
| Short
 
| Same units as [[#Entity Velocity|Entity Velocity]]
 
|-
 
| Velocity Y
 
| Short
 
| Same units as [[#Entity Velocity|Entity Velocity]]
 
|-
 
| Velocity Z
 
| Short
 
| Same units as [[#Entity Velocity|Entity Velocity]]
 
|- {{removed}}
 
| Metadata
 
| [[Entities#Entity Metadata Format|Entity Metadata]]
 
|
 
 
  |}
 
  |}
  
==== Spawn Player ====
+
Known Key values (see also {{Minecraft Wiki|Attribute#Modifiers}}):
 
 
This packet is sent by the server when a player comes into visible range, ''not'' when a player joins.
 
 
 
This packet must be sent after the [[#Player Info|Player Info]] packet that adds the player data for the client to use when spawning a player. If the Player Info for the player spawned by this packet is not present when this packet arrives, Notchian clients will not spawn the player entity. The Player Info packet includes skin/cape data.
 
 
 
Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="8"| 0x05
+
  ! Key
  |rowspan="8"| Play
+
  ! Default
  |rowspan="8"| Client
+
  ! Min
  | Entity ID
+
  ! Max
  | VarInt
+
  ! Label
| Player's EID
 
 
  |-
 
  |-
  | Player UUID
+
  | {{change|generic.maxHealth|generic.max_health}}
  | UUID
+
  | 20.0
  | See below for notes on {{Minecraft Wiki|Server.properties#online-mode|offline mode}} and NPCs
+
  | 0.0
 +
| 1024.0
 +
| Max Health
 
  |-
 
  |-
  | X
+
  | {{change|generic.followRange|generic.follow_range}}
  | Double
+
| 32.0
  |  
+
| 0.0
 +
  | 2048.0
 +
  | Follow Range
 
  |-
 
  |-
  | Y
+
  | {{change|generic.knockbackResistance|generic.knockback_resistance}}
  | Double
+
| 0.0
  |  
+
| 0.0
 +
  | 1.0
 +
  | Knockback Resistance
 
  |-
 
  |-
  | Z
+
  | {{change|generic.movementSpeed|generic.movement_speed}}
  | Double
+
| 0.7
  |  
+
| 0.0
 +
  | 1024.0
 +
  | Movement Speed
 
  |-
 
  |-
  | Yaw
+
  | {{change|generic.attackDamage|generic.attack_damage}}
  | Angle
+
| 2.0
  |  
+
| 0.0
 +
  | 2048.0
 +
  | Attack Damage
 
  |-
 
  |-
  | Pitch
+
  | {{change|generic.attackSpeed|generic.attack_speed}}
| Angle
+
  | 4.0
|  
+
  | 0.0
|- {{removed}}
+
  | 1024.0
  | Metadata
+
  | Attack Speed
  | [[Entities#Entity Metadata Format|Entity Metadata]]
 
  |  
 
|}
 
 
 
When in {{Minecraft Wiki|Server.properties#online-mode|online mode}}, the UUIDs must be valid and have valid skin blobs.
 
 
 
In offline mode, [[Wikipedia:Universally unique identifier#Versions 3 and 5 (namespace name-based)|UUID v3]] is used with the String <code>OfflinePlayer:&lt;player name&gt;</code>, encoded in UTF-8 (and case-sensitive).
 
 
 
For NPCs UUID v2 should be used. Note:
 
 
 
  <+Grum> i will never confirm this as a feature you know that :)
 
 
 
In an example UUID, <code>xxxxxxxx-xxxx-Yxxx-xxxx-xxxxxxxxxxxx</code>, the UUID version is specified by <code>Y</code>. So, for UUID v3, <code>Y</code> will always be <code>3</code>, and for UUID v2, <code>Y</code> will always be <code>2</code>.
 
 
 
==== Update Block Entity ====
 
 
 
Sets the block entity associated with the block at the given location.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| {{change|0x09|0x0A}}
+
  | {{change|generic.flyingSpeed|generic.flying_speed}}
  |rowspan="3"| Play
+
  | 0.4
|rowspan="3"| Client
+
  | 0.0
  | Location
+
  | 1024.0
  | Position
+
  | Flying Speed
  |  
 
 
  |-
 
  |-
  | Action
+
  | generic.armor
  | Unsigned Byte
+
  | 0.0
  | The type of update to perform, see below
+
  | 0.0
 +
| 30.0
 +
| Armor
 
  |-
 
  |-
  | NBT Data
+
  | {{change|generic.armorToughness|generic.armor_toughness}}
| [[NBT|NBT Tag]]
+
| 0.0
| Data to set.  May be a TAG_END (0), in which case the block entity at the given location is removed (though this is not required since the client will remove the block entity automatically on chunk unload or block removal)
+
| 0.0
|}
+
  | 20.0
 
+
| Armor Toughness
''Action'' field:
 
 
 
* '''1''': Set data of a mob spawner (everything except for SpawnPotentials: current delay, min/max delay, mob to be spawned, spawn count, spawn range, etc.)
 
* '''2''': Set command block text (command and last execution status)
 
* '''3''': Set the level, primary, and secondary powers of a beacon
 
* '''4''': Set rotation and skin of mob head
 
* '''5''': Declare a conduit
 
* '''6''': Set base color and patterns on a banner
 
* '''7''': Set the data for a Structure tile entity
 
* '''8''': Set the destination for a end gateway
 
* '''9''': Set the text on a sign
 
* '''10''': Unused
 
* '''11''': Declare a bed
 
* '''12''': Set data of a jigsaw block
 
* '''13''': Set items in a campfire
 
* {{change||'''14''': Beehive information}}
 
 
 
==== Chunk Data ====
 
{{Main|Chunk Format}}
 
{{See also|#Unload Chunk}}
 
 
 
{{Need Info|How do biomes work now?  The biome change happened at the same time as the seed change, but it's not clear how/if biomes could be computed given that it's not the actual seed...  ([https://www.reddit.com/r/Mojira/comments/e5at6i/a_discussion_for_the_changes_to_how_biomes_are/ /r/mojira discussion] which notes that it seems to be some kind of interpolation, and 3D biomes are only used in the nether)}}
 
 
 
The server only sends skylight information for chunk pillars in the {{Minecraft Wiki|Overworld}}, it's up to the client to know in which dimenison the player is currently located. You can also infer this information from the primary bitmask and the amount of uncompressed bytes sent. This packet also sends all block entities in the chunk (though sending them is not required; it is still legal to send them with [[#Update Block Entity|Update Block Entity]] later).
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="10"| {{change|0x21|0x22}}
+
  | {{change|generic.attackKnockback|generic.attack_knockback}}
  |rowspan="10"| Play
+
  | 0.0
|rowspan="10"| Client
+
  | 0.0
  | Chunk X
+
  | 5.0
  | Int
+
  | &mdash;
  | Chunk coordinate (block coordinate divided by 16, rounded down)
 
 
  |-
 
  |-
  | Chunk Z
+
  | generic.luck
  | Int
+
  | 0.0
  | Chunk coordinate (block coordinate divided by 16, rounded down)
+
  | -1024.0
 +
| 1024.0
 +
| Luck
 
  |-
 
  |-
  | Full chunk
+
  | {{change|horse.jumpStrength|horse.jump_strength}}
  | Boolean
+
  | 0.7
  | See [[Chunk Format#Full chunk|Chunk Format]]
+
  | 0.0
 +
| 2.0
 +
| Jump Strength
 
  |-
 
  |-
  | Primary Bit Mask
+
  | {{change|zombie.spawnReinforcements|zombie.spawn_reinforcements}}
  | VarInt
+
  | 0.0
  | Bitmask with bits set to 1 for every 16×16×16 chunk section whose data is included in Data. The least significant bit represents the chunk section at the bottom of the chunk column (from y=0 to y=15).
+
| 0.0
 +
  | 1.0
 +
| Spawn Reinforcements Chance
 
  |-
 
  |-
  | Heightmaps
+
  | generic.reachDistance
  | [[NBT]]
+
  | 5.0
  | Compound containing one long array named <code>MOTION_BLOCKING</code>, which is a heightmap for the highest solid block at each position in the chunk (as a compacted long array with 256 entries at 9 bits per entry totaling 36 longs). The Notchian server also adds a <code>WORLD_SURFACE</code> long array, the purpose of which is unknown, but it's not required for the chunk to be accepted.
+
  | 0.0
  |- {{Added}}
+
  | 1024.0
  | Biomes
+
  | Player Reach Distance (Forge only)
| Optional array of Integer
 
| 1024 biome IDs, ordered by x then z then d, in 4&times;4&times;4 blocks.  Not present if full chunk is false.
 
 
  |-
 
  |-
  | Size
+
  | forge.swimSpeed
  | VarInt
+
  | 1.0
  | Size of Data in bytes
+
  | 0.0
  |-
+
  | 1024.0
| Data
+
  | Swimming Speed (Forge only)
| Byte array
 
| See [[Chunk Format#Data structure|data structure]] in Chunk Format
 
|-
 
  | Number of block entities
 
| VarInt
 
| Number of elements in the following array
 
|-
 
| Block entities
 
| Array of [[NBT|NBT Tag]]
 
| All block entities in the chunk.  Use the x, y, and z tags in the NBT to determine their positions.
 
 
  |}
 
  |}
  
Note that the Notchian client requires an [[#Update View Position|Update View Position]] packet when it crosses a chunk border, otherwise it'll only display render distance + 2 chunks around the chunk it spawned in.
+
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.
 
 
{{Change||To get the biome at a coordinate, use <code>biomes[((y >> 2) & 63) << 4 {{!}} ((z >> 2) & 3) << 2 {{!}} ((x >> 2) & 3)]</code>}}
 
 
 
===== Data structure =====
 
  
The data section of the packet contains most of the useful data for the chunk.
+
''Modifier Data'' structure:
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 536: Line 411:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  | Data
+
  | UUID
  | Array of [[Chunk Format#Chunk Section structure|Chunk Section]]
+
  | UUID
  | The number of elements in the array is equal to the number of bits set in Primary Bit Mask. Sections are sent bottom-to-top, i.e. the first section, if sent, extends from Y=0 to Y=15.
+
|  
  |- {{removed}}
+
  |-
  | Biomes
+
| Amount
  | Optional Int Array
+
| Double
  | Only sent if full chunk is true; 256 entries if present
+
| May be positive or negative
 +
  |-
 +
  | Operation
 +
  | Byte
 +
  | See below
 
  |}
 
  |}
  
==== Particle ====
+
The operation controls how the base value of the modifier is changed.
  
Displays the named particle.
+
* 0: Add/subtract amount
 +
* 1: Add/subtract amount percent of the current value
 +
* 2: Multiply by amount percent
  
{| class="wikitable"
+
All of the 0's are applied first, and then the 1's, and then the 2's.
! Packet ID
+
 
! State
+
=== Serverbound ===
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
|rowspan="11"| {{Change|0x23|0x24}}
 
|rowspan="11"| Play
 
|rowspan="11"| Client
 
| Particle ID
 
| Int
 
| The particle ID listed in [[#Particle|the particle data type]].
 
|-
 
| Long Distance
 
| Boolean
 
| If true, particle distance increases from 256 to 65536
 
|-
 
| X
 
| {{Change|Float|Double}}
 
| X position of the particle
 
|-
 
| Y
 
| {{Change|Float|Double}}
 
| Y position of the particle
 
|-
 
| Z
 
| {{Change|Float|Double}}
 
| 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
 
| Varies
 
| The variable data listed in [[#Particle|the particle data type]].
 
|}
 
  
==== Join Game ====
+
==== Update Jigsaw Block ====
  
See [[Protocol Encryption]] for information on logging in.
+
Sent when Done is pressed on the {{Minecraft Wiki|Jigsaw Block}} interface.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 617: Line 446:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="9"| {{change|0x25|0x26}}
+
  |rowspan="7"| 0x27
  |rowspan="9"| Play
+
  |rowspan="7"| Play
  |rowspan="9"| Client
+
  |rowspan="7"| Server
  | Entity ID
+
  | Location
  | Int
+
  | Position
  | The player's Entity ID (EID)
+
  | Block entity location
|-
+
  |- {{Removed}}
| Gamemode
+
  | Attachment type
| Unsigned Byte
+
  | Identifier
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. Bit 3 (0x8) is the hardcore flag.
+
  |  
  |-
 
  | Dimension
 
  | Int Enum
 
  | -1: Nether, 0: Overworld, 1: End; also, note that this is not a VarInt but instead a regular int.
 
 
  |- {{Added}}
 
  |- {{Added}}
  | Hashed seed
+
  | Name
  | Long
+
  | Identifier
  | First 8 bytes of the SHA-256 hash of the world's seed.
+
  |  
|-
 
| Max Players
 
| Unsigned Byte
 
| Was once used by the client to draw the player list, but now is ignored
 
|-
 
| Level Type
 
| String Enum (16)
 
| default, flat, largeBiomes, amplified, customized, buffet, default_1_1
 
|-
 
| View Distance
 
| VarInt
 
| Render distance (2-32)
 
|-
 
| Reduced Debug Info
 
| Boolean
 
| If true, a Notchian client shows reduced information on the {{Minecraft Wiki|debug screen}}.  For servers in development, this should almost always be false.
 
 
  |- {{Added}}
 
  |- {{Added}}
  | Unknown
+
  | Target
  | Boolean
+
  | Identifier
  | Added
+
  |  
  |}
+
  |-
 
+
| {{Change|Target pool|Pool}}
==== Respawn ====
+
  | Identifier
 
+
  |
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.
 
 
 
{| class="wikitable"
 
  ! Packet ID
 
  ! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="4"| {{change|0x3A|0x3B}}
+
  | Final state
  |rowspan="4"| Play
+
  | String
  |rowspan="4"| Client
+
  | "Turns into" on the GUI, <code>final_state</code> in NBT
| Dimension
 
| Int Enum
 
| -1: The Nether, 0: The Overworld, 1: The End
 
 
  |- {{Added}}
 
  |- {{Added}}
  | Hashed seed
+
  | Joint type
  | Long
+
  | String
  | First 8 bytes of the SHA-256 hash of the world's seed.
+
  | <code>rollable</code> if the attached piece can be rotated, else <code>aligned</code>
|-
 
| Gamemode
 
| Unsigned Byte
 
| 0: survival, 1: creative, 2: adventure, 3: spectator. The hardcore flag is not included
 
|-
 
| Level Type
 
| String (16)
 
| Same as [[#Join Game|Join Game]]
 
 
  |}
 
  |}
 
{{Warning2|Avoid changing player's dimension to same dimension they were already in unless they are dead. If you change the dimension to one they are already in, weird bugs can occur, such as the player being unable to attack other players in new world (until they die and respawn).
 
 
If you must respawn a player in the same dimension without killing them, send two respawn packets, one to a different world and then another to the world you want. You do not need to complete the first respawn; it only matters that you send two packets.}}
 
 
=== Serverbound ===
 
 
No changes so far.
 
  
 
== Handshaking ==
 
== Handshaking ==
Line 722: Line 503:
 
  | Protocol Version
 
  | Protocol Version
 
  | VarInt
 
  | VarInt
  | See [[protocol version numbers]] (currently {{change|498|570}})
+
  | See [[protocol version numbers]] (currently {{change|578|710}})
 
  |-
 
  |-
 
  | Server Address
 
  | Server Address
Line 751: 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.