Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
(Added new min_y and height fields for dimension codec (right page this time))
(Add changes to Update Registries.)
 
(160 intermediate revisions by 18 users not shown)
Line 1: Line 1:
This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently [[Protocol version numbers|1.16.5, protocol 754]]) to the current pre-release (currently [[Protocol version numbers|21w07a, protocol {{Snapshot PVN|1073741839}}]]). Note that this page contains bleeding-edge information that may not be completely or correctly documented.
+
This page documents the changes from release 1.21.1 (protocol 767) to the current release (1.21.3, protocol 768). The stable protocol documentation is currently lagging behind, and the changes documented here will be merged soon, once they are complete. The current pre-release (snapshot 24w44a) is not yet 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.
+
{| class="wikitable"
 +
|-
 +
! Name
 +
! Size (bytes)
 +
! Encodes
 +
! Notes
 +
|- {{added}}
 +
! id=Type:Teleport_Flags | {{Type|Teleport Flags}}
 +
| 4
 +
| Bit field specifying how a teleportation is to be applied on each axis.
 +
| See [[#Teleport Flags]]
 +
|}
 +
 
 +
==== Teleport Flags ====
 +
 
 +
A bit field represented as an {{Type|Int}}, specifying how a teleportation is to be applied on each axis.
 +
 
 +
In the lower 8 bits of the bit field, a set bit means the teleportation on the corresponding axis is relative, and an unset bit that it is absolute.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Hex Mask
 +
! Field
 +
|-
 +
| 0x0001
 +
| Relative X
 +
|-
 +
| 0x0002
 +
| Relative Y
 +
|-
 +
| 0x0004
 +
| Relative Z
 +
|-
 +
| 0x0008
 +
| Relative Yaw
 +
|-
 +
| 0x0010
 +
| Relative Pitch
 +
|- {{added}}
 +
| 0x0020
 +
| Relative Velocity X
 +
|- {{added}}
 +
| 0x0040
 +
| Relative Velocity Y
 +
|- {{added}}
 +
| 0x0080
 +
| Relative Velocity Z
 +
|- {{added}}
 +
| 0x0100
 +
| Rotate velocity according to the change in rotation, ''before'' applying the velocity change in this packet. Combining this with absolute rotation works as expected—the difference in rotation is still used.
 +
|}
  
 
=== Packets ===
 
=== Packets ===
Line 18: Line 68:
 
  !colspan="2"| Documentation
 
  !colspan="2"| Documentation
 
  |-
 
  |-
!colspan="4"| Play clientbound
+
!colspan="4"| Play clientbound
{{PacketList|0x05|Sculk Vibration Signal|rel=added}}
+
{{PacketList|0x12|Close Container}}
{{PacketList|{{change|0x05|0x06}}|Entity Animation (clientbound)|pre=unchanged}}
+
{{PacketList|0x13|Set Container Content}}
{{PacketList|{{change|0x06|0x07}}|Statistics|pre=unchanged}}
+
{{PacketList|0x14|Set Container Property}}
{{PacketList|{{change|0x07|0x08}}|Acknowledge Player Digging|pre=unchanged}}
+
{{PacketList|0x15|Set Container Slot}}
{{PacketList|{{change|0x08|0x09}}|Block Break Animation|pre=unchanged}}
+
{{PacketList|0x17|Set Cooldown}}
{{PacketList|{{change|0x09|0x0A}}|Block Entity Data|pre=unchanged}}
+
{{PacketList|{{change|0x70|0x20}}|Teleport Entity}}
{{PacketList|{{change|0x0A|0x0B}}|Block Action|pre=unchanged}}
+
{{PacketList|{{change|0x20|0x21}}|Explosion}}
{{PacketList|{{change|0x0B|0x0C}}|Block Change|pre=unchanged}}
+
{{PacketList|{{change|0x23|0x24}}|Open Horse Screen}}
{{PacketList|{{change|0x0C|0x0D}}|Boss Bar|pre=unchanged}}
+
{{PacketList|{{change|0x2B|0x2C}}|Login (play)}}
{{PacketList|{{change|0x0D|0x0E}}|Server Difficulty|pre=unchanged}}
+
{{PacketList|0x31|Move Minecart Along Track|rel=added}}
{{PacketList|{{change|0x0E|0x0F}}|Chat Message (clientbound)|pre=unchanged}}
+
{{PacketList|{{change|0x37|0x39}}|Place Ghost Recipe}}
{{PacketList|0x10|Clear Titles|rel=added}}
+
{{PacketList|{{change|0x3E|0x40}}|Player Info Update}}
{{PacketList|{{change|0x0F|0x11}}|Tab-Complete (clientbound)|pre=unchanged}}
+
{{PacketList|{{change|0x40|0x42}}|Synchronize Player Position}}
{{PacketList|{{change|0x10|0x12}}|Declare Commands|pre=unchanged}}
+
{{PacketList|0x41|Update Recipe Book|pre=removed}}
{{PacketList|0x11|Window Confirmation (clientbound)|pre=removed}}
+
{{PacketList|0x43|Player Rotation|rel=added}}
{{PacketList|{{change|0x12|0x13}}|Close Window (clientbound)|pre=unchanged}}
+
{{PacketList|0x44|Recipe Book Add|rel=added}}
{{PacketList|{{change|0x13|0x14}}|Window Items|pre=unchanged}}
+
{{PacketList|0x45|Recipe Book Remove|rel=added}}
{{PacketList|{{change|0x14|0x15}}|Window Property|pre=unchanged}}
+
{{PacketList|0x46|Recipe Book Settings|rel=added}}
{{PacketList|{{change|0x15|0x16}}|Set Slot|pre=unchanged}}
+
{{PacketList|{{change|0x47|0x4C}}|Respawn}}
{{PacketList|{{change|0x16|0x17}}|Set Cooldown|pre=unchanged}}
+
{{PacketList|0x5a|Set Cursor Item|rel=added}}
{{PacketList|{{change|0x17|0x18}}|Plugin Message (clientbound)|pre=unchanged}}
+
{{PacketList|{{change|0x53|0x63}}|Set Held Item|pre=unchanged}}
{{PacketList|{{change|0x18|0x19}}|Named Sound Effect|pre=unchanged}}
+
{{PacketList|0x66|Set Player Inventory Slot|rel=added}}
{{PacketList|{{change|0x19|0x1A}}|Disconnect (play)|pre=unchanged}}
+
{{PacketList|{{change|0x64|0x6b}}|Update Time}}
{{PacketList|{{change|0x1A|0x1B}}|Entity Status|pre=unchanged}}
+
{{PacketList|0x77|Synchronize Vehicle Position|rel=added}}
{{PacketList|{{change|0x1B|0x1C}}|Explosion}}
+
{{PacketList|{{change|0x77|0x7e}}|Update Recipes}}
{{PacketList|{{change|0x1C|0x1D}}|Unload Chunk|pre=unchanged}}
 
{{PacketList|{{change|0x1D|0x1E}}|Change Game State|pre=unchanged}}
 
{{PacketList|{{change|0x1E|0x1F}}|Open Horse Window|pre=unchanged}}
 
{{PacketList|0x20|Initialize World Border|rel=added}}
 
{{PacketList|{{change|0x1F|0x21}}|Keep Alive (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x20|0x22}}|Chunk Data}}
 
{{PacketList|{{change|0x21|0x23}}|Effect|pre=unchanged}}
 
{{PacketList|{{change|0x22|0x24}}|Particle|pre=unchanged}}
 
{{PacketList|{{change|0x23|0x25}}|Update Light}}
 
{{PacketList|{{change|0x24|0x26}}|Join Game}}
 
{{PacketList|{{change|0x25|0x27}}|Map Data}}
 
{{PacketList|{{change|0x26|0x28}}|Trade List|pre=unchanged}}
 
{{PacketList|{{change|0x27|0x29}}|Entity Position|pre=unchanged}}
 
{{PacketList|{{change|0x28|0x2A}}|Entity Position and Rotation|pre=unchanged}}
 
{{PacketList|{{change|0x29|0x2B}}|Entity Rotation|pre=unchanged}}
 
{{PacketList|0x2A|Entity Movement|pre=removed}}
 
{{PacketList|{{change|0x2B|0x2C}}|Vehicle Move (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x2C|0x2D}}|Open Book|pre=unchanged}}
 
{{PacketList|{{change|0x2D|0x2E}}|Open Window|pre=unchanged}}
 
{{PacketList|{{change|0x2E|0x2F}}|Open Sign Editor|pre=unchanged}}
 
{{PacketList|0x30|Ping|rel=added}}
 
{{PacketList|{{change|0x2F|0x31}}|Craft Recipe Response|pre=unchanged}}
 
{{PacketList|{{change|0x30|0x32}}|Player Abilities (clientbound)|pre=unchanged}}
 
{{PacketList|0x31|Combat Event|pre=removed}}
 
{{PacketList|0x33|End Combat Event|rel=added}}
 
{{PacketList|0x34|Enter Combat Event|rel=added}}
 
{{PacketList|0x35|Death Combat Event|rel=added}}
 
{{PacketList|{{change|0x32|0x36}}|Player Info|pre=unchanged}}
 
{{PacketList|{{change|0x33|0x37}}|Face Player|pre=unchanged}}
 
{{PacketList|0x36|Destroy Entities|pre=removed}}
 
{{PacketList|{{change|0x34|0x38}}|Player Position And Look (clientbound)}}
 
{{PacketList|{{change|0x35|0x39}}|Unlock Recipes|pre=unchanged}}
 
{{PacketList|0x3A|Destroy Entity|rel=added}}
 
{{PacketList|{{change|0x37|0x3B}}|Remove Entity Effect|pre=unchanged}}
 
{{PacketList|{{change|0x38|0x3C}}|Resource Pack Send}}
 
{{PacketList|{{change|0x39|0x3D}}|Respawn|pre=unchanged}}
 
{{PacketList|{{change|0x3A|0x3E}}|Entity Head Look|pre=unchanged}}
 
{{PacketList|{{change|0x3B|0x3F}}|Multi Block Change|pre=unchanged}}
 
{{PacketList|{{change|0x3C|0x40}}|Select Advancement Tab|pre=unchanged}}
 
{{PacketList|0x41|Action Bar|rel=added}}
 
{{PacketList|0x42|World Border Center|rel=added}}
 
{{PacketList|0x43|World Border Lerp Size|rel=added}}
 
{{PacketList|0x44|World Border Size |rel=added}}
 
{{PacketList|0x45|World Border Warning Delay|rel=added}}
 
{{PacketList|0x46|World Border Warning Reach|rel=added}}
 
{{PacketList|{{change|0x3E|0x47}}|Camera|pre=unchanged}}
 
{{PacketList|{{change|0x3F|0x48}}|Held Item Change (clientbound)|pre=unchanged}}
 
{{PacketList|{{change|0x40|0x49}}|Update View Position|pre=unchanged}}
 
{{PacketList|{{change|0x41|0x4A}}|Update View Distance|pre=unchanged}}
 
{{PacketList|{{change|0x42|0x4B}}|Spawn Position}}
 
{{PacketList|{{change|0x43|0x4C}}|Display Scoreboard|pre=unchanged}}
 
{{PacketList|{{change|0x44|0x4D}}|Entity Metadata|pre=unchanged}}
 
{{PacketList|{{change|0x45|0x4E}}|Attach Entity|pre=unchanged}}
 
{{PacketList|{{change|0x46|0x4F}}|Entity Velocity|pre=unchanged}}
 
{{PacketList|{{change|0x47|0x50}}|Entity Equipment|pre=unchanged}}
 
{{PacketList|0x4F|Title|pre=removed}}
 
{{PacketList|{{change|0x48|0x51}}|Set Experience|pre=unchanged}}
 
{{PacketList|{{change|0x49|0x52}}|Update Health|pre=unchanged}}
 
{{PacketList|{{change|0x4A|0x53}}|Scoreboard Objective|pre=unchanged}}
 
{{PacketList|{{change|0x4B|0x54}}|Set Passengers|pre=unchanged}}
 
{{PacketList|{{change|0x4C|0x55}}|Teams|pre=unchanged}}
 
{{PacketList|{{change|0x4D|0x56}}|Update Score|pre=unchanged}}
 
{{PacketList|0x57|Set Title SubTitle|rel=added}}
 
{{PacketList|{{change|0x4E|0x58}}|Time Update|pre=unchanged}}
 
{{PacketList|0x59|Set Title Text|rel=added}}
 
{{PacketList|0x5A|Set Title Time|rel=added}}
 
{{PacketList|{{change|0x50|0x5B}}|Entity Sound Effect|pre=unchanged}}
 
{{PacketList|{{change|0x51|0x5C}}|Sound Effect|pre=unchanged}}
 
{{PacketList|{{change|0x52|0x5D}}|Stop Sound|pre=unchanged}}
 
{{PacketList|{{change|0x53|0x5E}}|Player List Header And Footer|pre=unchanged}}
 
{{PacketList|{{change|0x54|0x5F}}|NBT Query Response|pre=unchanged}}
 
{{PacketList|{{change|0x55|0x60}}|Collect Item|pre=unchanged}}
 
{{PacketList|{{change|0x56|0x61}}|Entity Teleport|pre=unchanged}}
 
{{PacketList|{{change|0x57|0x62}}|Advancements|pre=unchanged}}
 
{{PacketList|{{change|0x58|0x63}}|Entity Properties}}
 
{{PacketList|{{change|0x59|0x64}}|Entity Effect|pre=unchanged}}
 
{{PacketList|{{change|0x5A|0x65}}|Declare Recipes|pre=unchanged}}
 
{{PacketList|{{change|0x5B|0x66}}|Tags}}
 
|-
 
!colspan="4"| Play serverbound
 
{{PacketList|0x05|Client Settings}}
 
{{PacketList|0x07|Window Confirmation (serverbound)|pre=removed}}
 
{{PacketList|{{change|0x08|0x07}}|Click Window Button|pre=unchanged}}
 
{{PacketList|{{change|0x09|0x08}}|Click Window|pre=unchanged}}
 
{{PacketList|{{change|0x0A|0x09}}|Close Window (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x0B|0x0A}}|Plugin Message (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x0C|0x0B}}|Edit Book|pre=unchanged}}
 
{{PacketList|{{change|0x0D|0x0C}}|Query Entity NBT|pre=unchanged}}
 
{{PacketList|{{change|0x0E|0x0D}}|Interact Entity|pre=unchanged}}
 
{{PacketList|{{change|0x0F|0x0E}}|Generate Structure|pre=unchanged}}
 
{{PacketList|{{change|0x10|0x0F}}|Keep Alive (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x11|0x10}}|Lock Difficulty|pre=unchanged}}
 
{{PacketList|{{change|0x12|0x11}}|Player Position|pre=unchanged}}
 
{{PacketList|{{change|0x13|0x12}}|Player Position And Rotation (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x14|0x13}}|Player Rotation|pre=unchanged}}
 
{{PacketList|{{change|0x15|0x14}}|Player Movement|pre=unchanged}}
 
{{PacketList|{{change|0x16|0x15}}|Vehicle Move (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x17|0x16}}|Steer Boat|pre=unchanged}}
 
{{PacketList|{{change|0x18|0x17}}|Pick Item|pre=unchanged}}
 
{{PacketList|{{change|0x19|0x18}}|Craft Recipe Request|pre=unchanged}}
 
{{PacketList|{{change|0x1A|0x19}}|Player Abilities (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x1B|0x1A}}|Player Digging|pre=unchanged}}
 
{{PacketList|{{change|0x1C|0x1B}}|Entity Action|pre=unchanged}}
 
{{PacketList|{{change|0x1D|0x1C}}|Steer Vehicle|pre=unchanged}}
 
{{PacketList|0x1D|Pong|rel=added}}
 
 
  |-
 
  |-
!colspan="4"| Handshaking serverbound
+
!colspan="4"| Play serverbound
{{PacketList|0x00|Handshake}}
+
{{PacketList|0x02|Bundle Item Selected|rel=added}}
 +
{{PacketList|0x0b|Client Tick End|rel=added}}
 +
{{PacketList|{{change|0x0E|0x10}}|Click Container}}
 +
{{PacketList|{{change|0x0F|0x11}}|Close Container}}
 +
{{PacketList|{{change|0x14|0x16}}|Edit Book}}
 +
{{PacketList|{{change|0x1A|0x1C}}|Set Player Position}}
 +
{{PacketList|{{change|0x1B|0x1D}}|Set Player Position and Rotation}}
 +
{{PacketList|{{change|0x1C|0x1E}}|Set Player Rotation}}
 +
{{PacketList|0x1D|Set Player On Ground|pre=removed}}
 +
{{PacketList|0x1F|Set Player Movement Flags|rel=added}}
 +
{{PacketList|{{change|0x22|0x24}}|Place Recipe}}
 +
{{PacketList|{{change|0x26|0x28}}|Player Input}}
 +
{{PacketList|{{change|0x29|0x2B}}|Set Seen Recipe}}
 +
{{PacketList|{{change|0x38|0x3A}}|Use Item On}}
 
  |}
 
  |}
  
== New/modified data types ==
+
== Entity Metadata ==
 +
 
 +
=== Entity Metadata Format ===
  
No changes so far.
+
==== Painting Variant ====
  
== Entity Metadata ==
+
{{See also|Registry Data#Painting Variant}}
  
{{#vardefine:meta_prerelease|1}}
+
{| class="wikitable"
 +
! Name
 +
! Type
 +
! Meaning
 +
|-
 +
| Width
 +
| {{Type|Int}}
 +
| The width of the painting, in blocks.
 +
|-
 +
| Height
 +
| {{Type|Int}}
 +
| The height of the painting, in blocks.
 +
|-
 +
| Asset ID
 +
| {{Type|Identifier}}
 +
| The texture for the painting.
 +
The Notchian client uses the corresponding asset located at
 +
<code>textures/painting</code>.
 +
|- {{added}}
 +
| Has title
 +
| {{Type|Boolean}}
 +
|
 +
|- {{added}}
 +
| Title
 +
| {{Type|Optional}} {{Type|Text Component}}
 +
| The displayed title of the painting. Only present if Has title is true.
 +
|- {{added}}
 +
| Has author
 +
| {{Type|Boolean}}
 +
|
 +
|- {{added}}
 +
| Author
 +
| {{Type|Optional}} {{Type|Text Component}}
 +
| The displayed author of the painting. Only present if Has author is true.
 +
|}
  
{{Warning2|Note that other entities have had metadata shifts due to these changes, not shown here.}}
+
== Registry Data ==
  
=== Entity ===
+
=== Painting Variant ===
  
{{metadata inherit|Entity}}
+
The <code>minecraft:painting_variant</code> registry. It defines the textures and dimensions for the game's paintings.
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Index
+
  ! Name
 
  ! Type
 
  ! Type
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
|-
 
|rowspan="9"| {{Metadata id|}}
 
|rowspan="9"| Byte
 
! Bit mask
 
 
  ! Meaning
 
  ! Meaning
  |rowspan="9"| 0
+
  ! Values
 
  |-
 
  |-
  | 0x01
+
  | asset_id
  | Is on fire
+
  | [[NBT#Specification:string_tag|String Tag]]
 +
| The texture for the painting.
 +
The Notchian client uses the corresponding asset located at
 +
<code>textures/painting</code>.
 +
| Example: "minecraft:backyard".
 
  |-
 
  |-
  | 0x02
+
  | height
  | Is crouching
+
  | [[NBT#Specification:int_tag|Int Tag]]
 +
| The height of the painting, in blocks.
 +
| Example: <code>2</code>
 
  |-
 
  |-
  | 0x04
+
  | width
  | Unused (previously riding)
+
  | [[NBT#Specification:int_tag|Int Tag]]
 +
| The width of the painting, in blocks.
 +
|
 +
|- {{added}}
 +
| title
 +
| [[NBT#Specification:compound_tag|Compound Tag]] or [[NBT#Specification:string_tag|String Tag]]
 +
| The displayed title of the painting. See [[Text formatting]].
 +
| Example: <code>{"color": "gray", "translate": "painting.minecraft.skeleton.title"}</code>
 +
|- {{added}}
 +
| author
 +
| [[NBT#Specification:compound_tag|Compound Tag]] or [[NBT#Specification:string_tag|String Tag]]
 +
| The displayed author of the painting. See [[Text formatting]].
 +
| Example: <code>{"color": "gray", "translate": "painting.minecraft.skeleton.author"}</code>
 +
|}
 +
 
 +
== Slot Data ==
 +
 
 +
=== Structured components ===
 +
 
 +
{| class="wikitable"
 +
! Type
 +
! Name
 +
! Description
 +
! style="width: 50%" | Data
 +
|- {{added}}
 +
| 6
 +
| <code>minecraft:item_model</code>
 +
| Item's model.
 +
| As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Model
 +
    | {{Type|Identifier}}
 +
    |
 +
    |}
 
  |-
 
  |-
  | 0x08
+
  | {{change|20|21}}
  | Is sprinting
+
| <code>minecraft:food</code>
 +
| Makes the item {{change|consumable|restore the player's hunger bar when consumed}}.
 +
| As follows:
 +
  {| class="wikitable"
 +
    ! colspan="2"| Name
 +
    ! colspan="2"| Type
 +
    ! Description
 +
    |-
 +
    | colspan="2"| Nutrition
 +
    | colspan="2"| {{Type|VarInt}}
 +
    | Non-negative
 +
    |-
 +
    | colspan="2"| Saturation Modifier
 +
    | colspan="2"| {{Type|Float}}
 +
    | How much saturation will be given after consuming the item.
 +
    |-
 +
    | colspan="2"| Can Always Eat
 +
    | colspan="2"| {{Type|Boolean}}
 +
    | Whether the item can always be eaten, even at full hunger.
 +
    |- {{removed}}
 +
    | colspan="2"| Seconds To Eat
 +
    | colspan="2"| {{Type|Float}}
 +
    | How long it takes to consume the item.
 +
    |- {{removed}}
 +
    | colspan="2"| Using converts to
 +
    | colspan="2"| {{Type|Slot Data}}
 +
    | This specifies the item produced after consuming the current item. In the Notchian server, this is used for stews, which turn into bowls. Set this to Air if the item should be consumed normally without leaving any other item after.
 +
    |- {{removed}}
 +
    | colspan="2"| Number of effects
 +
    | colspan="2"| {{Type|VarInt}}
 +
    | Number of elements in the following array.
 +
    |- {{removed}}
 +
    | rowspan="2"| Effect
 +
    | Type ID
 +
    | rowspan="2"| {{Type|Array}}
 +
    | [[#Potion_Effect|Potion Effect]]
 +
    | The potion effect. See [[#Potion_Effect|Potion Effect]].
 +
    |- {{removed}}
 +
    | Probability
 +
    | {{Type|Float}}
 +
    | The probability for this effect to be chosen.
 +
    |}
 +
  |- {{added}}
 +
| 22
 +
| <code>minecraft:consumable</code>
 +
| Makes the item consumable.
 +
| As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Consume seconds
 +
    | {{Type|Float}}
 +
    | How long it takes to consume the item.
 +
    |-
 +
    | Animation
 +
    | {{Type|VarInt}} {{Type|Enum}}
 +
    | 0: none, 1: eat, 2: drink, 3: block, 4: bow, 5: spear, 6: crossbow, 7: spyglass, 8: toot_horn, 9: brush
 +
    |-
 +
    | Sound
 +
    | {{Type|ID or}} {{Type|Sound Event}}
 +
    | ID in the <code>minecraft:sound_event</code> registry, or an inline definition.
 +
    |-
 +
    | Has consume particles
 +
    | {{Type|Boolean}}
 +
    |
 +
    |-
 +
    | Number of effects
 +
    | {{Type|VarInt}}
 +
    | Number of elements in the following array.
 +
    |-
 +
    | Effects
 +
    | {{Type|Array}} of [[#Consume Effect|Consume Effect]]
 +
    | Effects to apply on consumption. See [[#Consume Effect|Consume Effect]].
 +
    |}
 +
|- {{added}}
 +
| 23
 +
| <code>minecraft:use_remainder</code>
 +
| This specifies the item produced after using the current item. In the Notchian server, this is used for stews, which turn into bowls.
 +
| As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Remainder
 +
    | {{Type|Slot}}
 +
    |
 +
    |}
 +
|- {{added}}
 +
| 24
 +
| <code>minecraft:use_cooldown</code>
 +
| Cooldown to apply on use of the item.
 +
| As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Seconds
 +
    | {{Type|Float}}
 +
    |
 +
    |-
 +
    | Cooldown group
 +
    | {{Type|Optional}} {{Type|Identifier}}
 +
    | Group of items to apply the cooldown to. Only present if Has cooldown group is true; otherwise defaults to the item's identifier.
 +
    |}
 
  |-
 
  |-
  | 0x10
+
  | {{change|21|25}}
  | Is swimming
+
| <code>minecraft:{{change|fire|damage}}_resistant</code>
 +
| Marks this item as {{change|fire|damage}} resistant.<br>The client won't render the item as being on-fire if this component is present.
 +
| {{change|None.|As follows:}}
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Types
 +
    | {{Type|Identifier}}
 +
    | Tag specifying damage types the item is immune to. Not prefixed by '#'!.
 +
    |}
 +
|- {{added}}
 +
| 27
 +
| <code>minecraft:enchantable</code>
 +
| Allows the item to be enchanted by an enchanting table.
 +
| As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Value
 +
    | {{Type|VarInt}}
 +
    | Opaque internal value controlling how expensive enchantments may be offered.
 +
    |}
 +
|- {{added}}
 +
| 28
 +
| <code>minecraft:equippable</code>
 +
| Allows the item to be equipped by the player.
 +
| As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Slot
 +
    | {{Type|VarInt}} {{Type|Enum}}
 +
    | 0: mainhand, 1: feet, 2: legs, 3: chest, 4: head, 5: offhand, 6: body
 +
    |-
 +
    | Equip sound
 +
    | {{Type|ID or}} {{Type|Sound Event}}
 +
    | ID in the <code>minecraft:sound_event</code> registry, or an inline definition.
 +
    |-
 +
    | Has model
 +
    | {{Type|Boolean}}
 +
    |
 +
    |-
 +
    | Model
 +
    | {{Type|Optional}} {{Type|Identifier}}
 +
    | Only present if Has model is true.
 +
    |-
 +
    | Has camera overlay
 +
    | {{Type|Boolean}}
 +
    |
 +
    |-
 +
    | Camera overlay
 +
    | {{Type|Optional}} {{Type|Identifier}}
 +
    | Only present if Has camera overlay is true.
 +
    |-
 +
    | Has allowed entities
 +
    | {{Type|Boolean}}
 +
    |-
 +
    | Allowed entities
 +
    | {{Type|Optional}} {{Type|ID Set}}
 +
    | IDs in the <code>minecraft:entity_type</code> registry. Only present if Has allowed entities is true.
 +
    |-
 +
    | Dispensable
 +
    | {{Type|Boolean}}
 +
    |
 +
    |-
 +
    | Swappable
 +
    | {{Type|Boolean}}
 +
    |
 +
    |-
 +
    | Damage on hurt
 +
    | {{Type|Boolean}}
 +
    |
 +
    |}
 +
|- {{added}}
 +
| 29
 +
| <code>minecraft:repairable</code>
 +
| Items that can be combined with this item in an anvil to repair it.
 +
| As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Items
 +
    | {{Type|ID Set}}
 +
    | IDs in the <code>minecraft:item</code> registry.
 +
    |}
 +
|- {{added}}
 +
| 30
 +
| <code>minecraft:glider</code>
 +
| Makes the item function like elytra.
 +
| None.
 +
|- {{added}}
 +
| 31
 +
| <code>minecraft:tooltip_style</code>
 +
| Custom textures for the item tooltip.
 +
| As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Style
 +
    | {{Type|Identifier}}
 +
    |
 +
    |}
 +
|- {{added}}
 +
| 32
 +
  | <code>minecraft:death_protection</code>
 +
| Makes the item function like a totem of undying.
 +
| As follows:
 +
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Number of effects
 +
    | {{Type|VarInt}}
 +
    | Number of elements in the following array.
 +
    |-
 +
    | Effects
 +
    | {{Type|Array}} of [[#Consume Effect|Consume Effect]]
 +
    | Effects to apply on consumption. See [[#Consume Effect|Consume Effect]].
 +
    |}
 
  |-
 
  |-
  | 0x20
+
  | {{change|31|41}}
  | Is invisible
+
| <code>minecraft:potion_contents</code>
 +
| Visual and effects of a potion item.
 +
| As follows:
 +
  {| class="wikitable"
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Has Potion ID
 +
    | {{Type|Boolean}}
 +
    | Whether this potion has an ID in the potion registry. If true, it has the default effects associated with the potion type.
 +
    |-
 +
    | Potion ID
 +
    | {{Type|Optional}} {{Type|VarInt}}
 +
    | The ID of the potion type in the potion registry. Only present if Has Potion ID is true.
 +
    |-
 +
    | Has Custom Color
 +
    | {{Type|Boolean}}
 +
    | Whether this potion has a custom color. If false, it uses the default color associated with the potion type.
 +
    |-
 +
    | Custom Color
 +
    | {{Type|Optional}} {{Type|Int}}
 +
    | The RGB components of the color, encoded as an integer. Only present if Has Custom Color is true.
 +
    |-
 +
    | Number Of Custom Effects
 +
    | {{Type|VarInt}}
 +
    | The number of elements in the following array.
 +
    |-
 +
    | Custom Effects
 +
    | {{Type|Array}} of [[#Potion_Effect|Potion Effect]]
 +
    | Any custom effects the potion might have. See [[#Potion_Effect|Potion Effect]].
 +
    |- {{added}}
 +
    | Custom Name
 +
    | {{Type|String}}
 +
    |
 +
    |}
 +
  |}
 +
 
 +
=== Other types ===
 +
 
 +
==== Consume Effect ====
 +
 
 +
WIP
 +
 
 +
==== Instrument ====
 +
 
 +
{| class="wikitable"
 +
! Name
 +
! Type
 +
! Description
 
  |-
 
  |-
  | 0x40
+
  | Sound Event
  | has glowing effect
+
  | {{Type|Id or}} {{Type|Sound Event}}
 +
| The sound to be played.
 
  |-
 
  |-
  | 0x80
+
  | Use duration
  | Is flying with an {{Minecraft Wiki|elytra}}
+
  | {{change|{{Type|VarInt}}|{{Type|Float}}}}
 +
| The maximum range of the sound.
 
  |-
 
  |-
  | {{Metadata id|}}
+
| Range
  | VarInt
+
  | {{Type|Float}}
  |colspan="2"| Air ticks
+
  | The range of the instrument.
  | 300
+
|- {{added}}
 +
  | Description
 +
| {{Type|Text Component}}
 +
| Description shown in the item tooltip.
 +
  |}
 +
 
 +
== Particles ==
 +
 
 +
{| class="wikitable"
 
  |-
 
  |-
  | {{Metadata id|}}
+
  ! Particle Name
  | OptChat
+
  ! Particle ID
  |colspan="2"| Custom name
+
  ! Data
| empty
 
 
  |-
 
  |-
  | {{Metadata id|}}
+
  | <code>minecraft:dust</code>
  | Boolean
+
| 13
  |colspan="2"| Is custom name visible
+
  |
| false
+
  {| class="wikitable"
 +
  ! Field Name
 +
  ! Field Type
 +
  ! Meaning
 +
  |- {{removed}}
 +
  | Red
 +
  | {{Type|Float}}
 +
  | The red RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{removed}}
 +
  | Green
 +
  | {{Type|Float}}
 +
  | The green RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{removed}}
 +
  | Blue
 +
  | {{Type|Float}}
 +
  | The blue RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{added}}
 +
  | Color
 +
  | {{Type|Int}}
 +
  | The color, encoded as 0xRRGGBB; top bits are ignored.
 +
  |-
 +
  | Scale
 +
  | {{Type|Float}}
 +
  | The scale, will be clamped between 0.01 and 4.
 +
  |}
 
  |-
 
  |-
  | {{Metadata id|}}
+
  | <code>minecraft:dust_color_transition</code>
  | Boolean
+
| 14
  |colspan="2"| Is silent
+
  |
| false
+
  {| class="wikitable"
|-
+
  ! Field Name
| {{Metadata id|}}
+
  ! Field Type
| Boolean
+
  ! Meaning
|colspan="2"| Has no gravity
+
  |- {{removed}}
| false
+
  | From Red
|-
+
  | {{Type|Float}}
| {{Metadata id|}}
+
  | The start red RGB value, between 0 and 1. Divide actual RGB value by 255.
| Pose
+
  |- {{removed}}
|colspan="2"| Pose
+
  | From Green
| STANDING
+
  | {{Type|Float}}
|- {{added}}
+
  | The start green RGB value, between 0 and 1. Divide actual RGB value by 255.
| {{Metadata id|added}}
+
  |- {{removed}}
| VarInt
+
  | From Blue
|colspan="2"| Ticks frozen in powdered snow
+
  | {{Type|Float}}
| 0
+
  | The start blue RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{added}}
 +
  | From Color
 +
  | {{Type|Int}}
 +
  | The start color, encoded as 0xRRGGBB; top bits are ignored.
 +
  |- {{removed}}
 +
  | To Red
 +
  | {{Type|Float}}
 +
  | The end red RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{removed}}
 +
  | To Green
 +
  | {{Type|Float}}
 +
  | The end green RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{removed}}
 +
  | To Blue
 +
  | {{Type|Float}}
 +
  | The end blue RGB value, between 0 and 1. Divide actual RGB value by 255.
 +
  |- {{added}}
 +
  | To Color
 +
  | {{Type|Int}}
 +
  | The end color, encoded as 0xRRGGBB; top bits are ignored.
 +
  |-
 +
  | Scale
 +
  | {{Type|Float}}
 +
  | The scale, will be clamped between 0.01 and 4.
 +
  |}
 
  |}
 
  |}
  
== Block Actions ==
+
== Handshake ==
 +
 
 +
No changes so far.
 +
 
 +
== Status ==
  
 
No changes so far.
 
No changes so far.
  
== Inventories ==
+
== Login ==
  
 
No changes so far.
 
No changes so far.
  
== Plugin Channels ==
+
== Configuration ==
  
 
No changes so far.
 
No changes so far.
Line 256: Line 634:
 
=== Clientbound ===
 
=== Clientbound ===
  
==== Sculk Vibration Signal ====
+
==== Close Container ====
 +
 
 +
This packet is sent from the server to the client when a window is forcibly closed, such as when a chest is destroyed while it's open. The notchian client disregards the provided window ID and closes any active window.
  
{| class="wikitable" {{Added}}
+
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 266: Line 646:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x05
+
  | ''protocol:''<br/><code>0x12</code><br/><br/>''resource:''<br/><code>container_close</code>
  |rowspan="4"| Play
+
  | Play
  |rowspan="4"| Client
+
  | Client
  | Source Position
+
  | Window ID
  | Position
+
  | {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
| Source position for the vibration.
+
  | This is the ID of the window that was closed. 0 for inventory.
|-
 
| Destination Identifier
 
| Identifier
 
  | Identifier of the destination codec type.
 
|-
 
| Destination
 
| Varies
 
| Vanilla default destinations are a block position encoded as a [https://wiki.vg/Protocol#Data_types Position] for "block" or an entity id encoded as a VarInt for "entity".
 
|-
 
| Arrival Ticks
 
| VarInt
 
| Ticks for the signal to arrive at the destination.
 
 
  |}
 
  |}
This packet shows a permanent particle.
 
  
==== Clear Titles====
+
==== Set Container Content ====
 +
[[File:Inventory-slots.png|thumb|The inventory slots]]
 +
 
 +
Replaces the contents of a container window. Sent by the server upon initialization of a container window or the player's inventory, and in response to state ID mismatches (see [[#Click Container]]).
  
{| class="wikitable" {{Added}}
+
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 296: Line 666:
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
|- {{ Added }}
 
|rowspan="4"| 0x10
 
|rowspan="4"| Play
 
|rowspan="4"| Client
 
|- {{ Added }}
 
| Reset
 
| Boolean
 
|
 
 
  |-
 
  |-
 +
| rowspan="5"| ''protocol:''<br/><code>0x13</code><br/><br/>''resource:''<br/><code>container_set_content</code>
 +
| rowspan="5"| Play
 +
| rowspan="5"| Client
 +
| Window ID
 +
| {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
 +
| The ID of window which items are being sent for. 0 for player inventory. The client ignores any packets targeting a Window ID other than the current one. However, an exception is made for the player inventory, which may be targeted at any time. (The Notchian server does not appear to utilize this special case.)
 +
|-
 +
| State ID
 +
| {{Type|VarInt}}
 +
| A server-managed sequence number used to avoid desynchronization; see [[#Click Container]].
 +
|-
 +
| Count
 +
| {{Type|VarInt}}
 +
| Number of elements in the following array.
 +
|-
 +
| Slot Data
 +
| {{Type|Array}} of [[Slot Data|Slot]]
 +
|-
 +
| Carried Item
 +
| {{Type|Slot}}
 +
| Item being dragged with the mouse.
 
  |}
 
  |}
  
==== Explosion ====
+
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.
 +
Use [[#Open Screen|Open Screen]] to open the container on the client.
  
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).
+
==== Set Container Property ====
  
Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x
+
This packet is used to inform the client that part of a GUI window should be updated.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 321: Line 705:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="9"| 0x1B
+
  | rowspan="3"| ''protocol:''<br/><code>0x14</code><br/><br/>''resource:''<br/><code>container_set_data</code>
  |rowspan="9"| Play
+
  | rowspan="3"| Play
  |rowspan="9"| Client
+
  | rowspan="3"| Client
  | X
+
  | Window ID
  | Float
+
| {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
  |  
+
|
 +
|-
 +
| Property
 +
| {{Type|Short}}
 +
| The property to be updated, see below.
 +
|-
 +
| Value
 +
| {{Type|Short}}
 +
| The new value for the property, see below.
 +
|}
 +
 
 +
The meaning of the Property field depends on the type of the window. The following table shows the known combinations of window type and property, and how the value is to be interpreted.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Window type
 +
! Property
 +
! Value
 +
|-
 +
| rowspan="4"| Furnace
 +
| 0: Fire icon (fuel left)
 +
| counting from fuel burn time down to 0 (in-game ticks)
 +
|-
 +
| 1: Maximum fuel burn time
 +
| fuel burn time or 0 (in-game ticks)
 +
|-
 +
| 2: Progress arrow
 +
| counting from 0 to maximum progress (in-game ticks)
 +
|-
 +
| 3: Maximum progress
 +
| always 200 on the notchian server
 +
|-
 +
| rowspan="10"| Enchantment Table
 +
| 0: Level requirement for top enchantment slot
 +
| rowspan="3"| The enchantment's xp level requirement
 +
|-
 +
| 1: Level requirement for middle enchantment slot
 +
|-
 +
| 2: Level requirement for bottom enchantment slot
 +
|-
 +
| 3: The enchantment seed
 +
| Used for drawing the enchantment names (in [[Wikipedia:Standard Galactic Alphabet|SGA]]) clientside.  The same seed ''is'' used to calculate enchantments, but some of the data isn't sent to the client to prevent easily guessing the entire list (the seed value here is the regular seed bitwise and <code>0xFFFFFFF0</code>).
 +
|-
 +
| 4: Enchantment ID shown on mouse hover over top enchantment slot
 +
| rowspan="3"| The enchantment id (set to -1 to hide it), see below for values
 +
|-
 +
| 5: Enchantment ID shown on mouse hover over middle enchantment slot
 +
|-
 +
| 6: Enchantment ID shown on mouse hover over bottom enchantment slot
 +
|-
 +
| 7: Enchantment level shown on mouse hover over the top slot
 +
| rowspan="3"| The enchantment level (1 = I, 2 = II, 6 = VI, etc.), or -1 if no enchant
 +
|-
 +
| 8: Enchantment level shown on mouse hover over the middle slot
 +
|-
 +
| 9: Enchantment level shown on mouse hover over the bottom slot
 +
|-
 +
| rowspan="3"| Beacon
 +
  | 0: Power level
 +
  | 0-4, controls what effect buttons are enabled
 
  |-
 
  |-
  | Y
+
  | 1: First potion effect
  | Float
+
  | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the first effect, or -1 if no effect
|  
 
 
  |-
 
  |-
  | Z
+
  | 2: Second potion effect
  | Float
+
  | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the second effect, or -1 if no effect
|  
 
 
  |-
 
  |-
  | Strength
+
  | Anvil
  | Float
+
  | 0: Repair cost
  | A strength greater than or equal to 2.0 spawns a <code>minecraft:explosion_emitter</code> particle, while a lesser strength spawns a <code>minecraft:explosion</code> particle.
+
  | The repair's cost in xp levels
 
  |-
 
  |-
  | Record Count
+
  | rowspan="2"| Brewing Stand
  | {{change|Int|VarInt}}
+
  | 0: Brew time
  | Number of elements in the following array.
+
  | 0 – 400, with 400 making the arrow empty, and 0 making the arrow full
 
  |-
 
  |-
  | Records
+
  | 1: Fuel time
  | Array of (Byte, Byte, Byte)
+
  | 0 - 20, with 0 making the arrow empty, and 20 making the arrow full
| Each record is 3 signed bytes long; the 3 bytes are the XYZ (respectively) signed offsets of affected blocks.
 
 
  |-
 
  |-
  | Player Motion X
+
  | Stonecutter
  | Float
+
  | 0: Selected recipe
  | X velocity of the player being pushed by the explosion.
+
  | The index of the selected recipe. -1 means none is selected.
 
  |-
 
  |-
  | Player Motion Y
+
  | Loom
  | Float
+
  | 0: Selected pattern
  | Y velocity of the player being pushed by the explosion.
+
  | The index of the selected pattern. 0 means none is selected, 0 is also the internal id of the "base" pattern.
 
  |-
 
  |-
  | Player Motion Z
+
  | Lectern
  | Float
+
  | 0: Page number
  | Z velocity of the player being pushed by the explosion.
+
  | The current page number, starting from 0.
 
  |}
 
  |}
  
==== Initialize World Border ====
+
For an enchanting table, the following numerical IDs are used:
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  ! Numerical ID
  ! State
+
  ! Enchantment ID
  ! Bound To
+
  ! Enchantment Name
  ! Field Name
+
|-
  ! Field Type
+
| 0
  ! Notes
+
| minecraft:protection
  |- {{ Added }}
+
| Protection
  |rowspan="8"| 0x20
+
|-
  |rowspan="8"| Play
+
| 1
  |rowspan="8"| Client
+
| minecraft:fire_protection
  | X
+
| Fire Protection
  | Double
+
|-
  |  
+
| 2
  |- {{ Added }}
+
| minecraft:feather_falling
  | Z
+
| Feather Falling
  | Double
+
|-
  |  
+
| 3
  |- {{ Added }}
+
| minecraft:blast_protection
  | Old Diameter
+
| Blast Protection
  | Double
+
|-
  | Current length of a single side of the world border, in meters.
+
  | 4
  |- {{ Added }}
+
  | minecraft:projectile_protection
  | New Diameter
+
  | Projectile Protection
  | Double
+
  |-
  | Target length of a single side of the world border, in meters.
+
  | 5
  |- {{ Added }}
+
| minecraft:respiration
  | Speed
+
| Respiration
  | VarLong
+
|-
  | Number of real-time ''milli''seconds until New Diameter is reached. It appears that Notchian server does not sync world border speed to game ticks, so it gets out of sync with server lag. If the world border is not moving, this is set to 0.
+
  | 6
  |- {{ Added }}
+
| minecraft:aqua_affinity
  | Portal Teleport Boundary
+
  | Aqua Affinity
  | VarInt
+
|-
  | Resulting coordinates from a portal teleport are limited to ±value. Usually 29999984.
+
  | 7
  |- {{ Added }}
+
  | minecraft:thorns
  | Warning Blocks
+
  | Thorns
  | VarInt
+
  |-
  | In meters.
+
  | 8
  |- {{ Added }}
+
  | minecraft:depth_strider
  | Warning Time
+
  | Depth Strider
  | VarInt
+
  |-
  | In seconds as set by <code>/worldborder warning time</code>.
+
  | 9
  |- {{ Added }}
+
  | minecraft:frost_walker
 +
  | Frost Walker
 +
  |-
 +
  | 10
 +
  | minecraft:binding_curse
 +
  | Curse of Binding
 +
  |-
 +
  | 11
 +
| minecraft:soul_speed
 +
| Soul Speed
 +
  |-
 +
  | 12
 +
| minecraft:swift_sneak
 +
| Swift Sneak
 +
|-
 +
| 13
 +
| minecraft:sharpness
 +
| Sharpness
 +
|-
 +
| 14
 +
| minecraft:smite
 +
| Smite
 +
|-
 +
| 15
 +
| minecraft:bane_of_arthropods
 +
| Bane of Arthropods
 +
|-
 +
| 16
 +
| minecraft:knockback
 +
| Knockback
 +
|-
 +
| 17
 +
| minecraft:fire_aspect
 +
| Fire Aspect
 +
|-
 +
| 18
 +
| minecraft:looting
 +
| Looting
 +
|-
 +
| 19
 +
| minecraft:sweeping_edge
 +
| Sweeping Edge
 +
|-
 +
| 20
 +
| minecraft:efficiency
 +
| Efficiency
 +
|-
 +
| 21
 +
| minecraft:silk_touch
 +
| Silk Touch
 +
|-
 +
| 22
 +
| minecraft:unbreaking
 +
| Unbreaking
 +
|-
 +
| 23
 +
| minecraft:fortune
 +
| Fortune
 +
|-
 +
| 24
 +
| minecraft:power
 +
| Power
 +
|-
 +
| 25
 +
| minecraft:punch
 +
| Punch
 +
|-
 +
| 26
 +
| minecraft:flame
 +
| Flame
 +
|-
 +
| 27
 +
| minecraft:infinity
 +
| Infinity
 +
|-
 +
| 28
 +
| minecraft:luck_of_the_sea
 +
| Luck of the Sea
 +
|-
 +
| 29
 +
| minecraft:lure
 +
| Lure
 +
|-
 +
| 30
 +
| minecraft:loyalty
 +
| Loyalty
 +
|-
 +
| 31
 +
| minecraft:impaling
 +
| Impaling
 +
|-
 +
| 32
 +
| minecraft:riptide
 +
| Riptide
 +
|-
 +
| 33
 +
| minecraft:channeling
 +
| Channeling
 +
|-
 +
| 34
 +
| minecraft:multishot
 +
| Multishot
 +
|-
 +
| 35
 +
| minecraft:quick_charge
 +
| Quick Charge
 +
|-
 +
| 36
 +
| minecraft:piercing
 +
| Piercing
 +
|-
 +
| 37
 +
| minecraft:density
 +
| Density
 +
  |-
 +
  | 38
 +
  | minecraft:breach
 +
  | Breach
 +
  |-
 +
  | 39
 +
  | minecraft:wind_burst
 +
  | Wind Burst
 +
  |-
 +
  | 40
 +
  | minecraft:mending
 +
  | Mending
 +
  |-
 +
| 41
 +
| minecraft:vanishing_curse
 +
| Curse of Vanishing
 
  |}
 
  |}
  
The Notchian client determines how solid to display the warning by comparing to whichever is higher, the warning distance or whichever is lower, the distance from the current diameter to the target diameter or the place the border will be after warningTime seconds. In pseudocode:
+
==== Set Container Slot ====
 
 
<syntaxhighlight lang="java">
 
distance = max(min(resizeSpeed * 1000 * warningTime, abs(targetDiameter - currentDiameter)), warningDistance);
 
if (playerDistance < distance) {
 
    warning = 1.0 - playerDistance / distance;
 
} else {
 
    warning = 0.0;
 
}
 
</syntaxhighlight>
 
  
==== Chunk Data ====
+
Sent by the server when an item in a slot (in a window) is added/removed.
{{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 dimension 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"
 
{| class="wikitable"
Line 435: Line 989:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="13"| {{change|0x20|0x22}}
+
  | rowspan="4"| ''protocol:''<br/><code>0x15</code><br/><br/>''resource:''<br/><code>container_set_slot</code>
  |rowspan="13"| Play
+
  | rowspan="4"| Play
  |rowspan="13"| Client
+
  | rowspan="4"| Client
  | Chunk X
+
  | Window ID
  | Int
+
  | {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
| Chunk coordinate (block coordinate divided by 16, rounded down)
+
  | The window which is being updated. 0 for player inventory. The client ignores any packets targeting a Window ID other than the current one{{change|; see below for exceptions|, unless it is 0 (see below)}}.
|-
 
| Chunk Z
 
| Int
 
| Chunk coordinate (block coordinate divided by 16, rounded down)
 
|- {{removed}}
 
| Full chunk
 
| Boolean
 
| See [[Chunk Format#Full chunk|Chunk Format]]
 
|- {{removed}}
 
  | Primary Bit Mask
 
| VarInt
 
| 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).
 
|- {{added}}
 
| Bit Mask Length
 
| VarInt
 
| Length of the following array
 
|- {{added}}
 
| Primary Bit Mask
 
| Array of Long
 
| BitSet with bits (world height in blocks / 16) 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 the lowest y to 15 blocks above).
 
 
  |-
 
  |-
  | Heightmaps
+
  | State ID
| [[NBT]]
+
  | {{Type|VarInt}}
| 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.
+
  | A server-managed sequence number used to avoid desynchronization; see [[#Click Container]].
|-
 
| Biomes length
 
  | {{change|Optional|}} VarInt
 
  | Size of the following array; should always be 1024. {{change|Not present if full chunk is false.|}}
 
 
  |-
 
  |-
  | Biomes
+
  | Slot
  | {{change|Optional|}} Array of VarInt
+
  | {{Type|Short}}
  | 1024 biome IDs, ordered by x then z then y, in 4&times;4&times;4 blocks.  {{change|Not present if full chunk is false.|}}  See [[Chunk Format#Biomes|Chunk Format § Biomes]].
+
  | The slot that should be updated.
|-
 
| Size
 
| VarInt
 
| Size of Data in bytes
 
 
  |-
 
  |-
  | Data
+
  | Slot Data
  | Byte array
+
  | {{Type|Slot}}
| 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.
+
If Window ID is 0, the hotbar and offhand slots (slots 36 through 45) may be updated even when a different container window is open. (The Notchian server does not appear to utilize this special case.) Updates are also restricted to those slots when the player is looking at a creative inventory tab other than the survival inventory. (The Notchian server does ''not'' handle this restriction in any way, leading to [https://bugs.mojang.com/browse/MC-242392 MC-242392].)
 
 
The compacted array format has been adjusted so that individual entries no longer span across multiple longs, affecting the main data array and heightmaps.
 
  
New format, 5 bits per block, containing the following references to blocks in a palette (not shown): <span style="border: solid 2px hsl(0, 90%, 60%)">1</span><span style="border: solid 2px hsl(30, 90%, 60%)">2</span><span style="border: solid 2px hsl(60, 90%, 60%)">2</span><span style="border: solid 2px hsl(90, 90%, 60%)">3</span><span style="border: solid 2px hsl(120, 90%, 60%)">4</span><span style="border: solid 2px hsl(150, 90%, 60%)">4</span><span style="border: solid 2px hsl(180, 90%, 60%)">5</span><span style="border: solid 2px hsl(210, 90%, 60%)">6</span><span style="border: solid 2px hsl(240, 90%, 60%)">6</span><span style="border: solid 2px hsl(270, 90%, 60%)">4</span><span style="border: solid 2px hsl(300, 90%, 60%)">8</span><span style="border: solid 2px hsl(330, 90%, 60%)">0</span><span style="border: solid 2px hsl(0, 90%, 30%)">7</span><span style="border: solid 2px hsl(30, 90%, 30%)">4</span><span style="border: solid 2px hsl(60, 90%, 30%)">3</span><span style="border: solid 2px hsl(90, 90%, 30%)">13</span><span style="border: solid 2px hsl(120, 90%, 30%)">15</span><span style="border: solid 2px hsl(150, 90%, 30%)">16</span><span style="border: solid 2px hsl(180, 90%, 30%)">9</span><span style="border: solid 2px hsl(210, 90%, 30%)">14</span><span style="border: solid 2px hsl(240, 90%, 30%)">10</span><span style="border: solid 2px hsl(270, 90%, 30%)">12</span><span style="border: solid 2px hsl(300, 90%, 30%)">0</span><span style="border: solid 2px hsl(330, 90%, 30%)">2</span>
+
{{change|If Window ID is -1, the item being dragged with the mouse is set. In this case, State ID and Slot are ignored.|}}
  
<code>0020863148418841</code> <code><span style="outline: dashed 2px black">0000</span><span style="outline: solid 2px hsl(330, 90%, 60%)">00000</span><span style="outline: solid 2px hsl(300, 90%, 60%)">01000</span><span style="outline: solid 2px hsl(270, 90%, 60%)">00100</span><span style="outline: solid 2px hsl(240, 90%, 60%)">00110</span><span style="outline: solid 2px hsl(210, 90%, 60%)">00110</span><span style="outline: solid 2px hsl(180, 90%, 60%)">00101</span><span style="outline: solid 2px hsl(150, 90%, 60%)">00100</span><span style="outline: solid 2px hsl(120, 90%, 60%)">00100</span><span style="outline: solid 2px hsl(90, 90%, 60%)">00011</span><span style="outline: solid 2px hsl(60, 90%, 60%)">00010</span><span style="outline: solid 2px hsl(30, 90%, 60%)">00010</span><span style="outline: solid 2px hsl(0, 90%, 60%)">00001</span></code><br>
+
{{change|If Window ID is -2, any slot in the player's inventory can be updated irrespective of the current container window. In this case, State ID is ignored, and the Notchian server uses a bogus value of 0. Used by the Notchian server to implement the [[#Pick Item]] functionality.|}}
<code>01018A7260F68C87</code> <code><span style="outline: dashed 2px black">0000</span><span style="outline: solid 2px hsl(330, 90%, 30%)">00010</span><span style="outline: solid 2px hsl(300, 90%, 30%)">00000</span><span style="outline: solid 2px hsl(270, 90%, 30%)">01100</span><span style="outline: solid 2px hsl(240, 90%, 30%)">01010</span><span style="outline: solid 2px hsl(210, 90%, 30%)">01110</span><span style="outline: solid 2px hsl(180, 90%, 30%)">01001</span><span style="outline: solid 2px hsl(150, 90%, 30%)">10000</span><span style="outline: solid 2px hsl(120, 90%, 30%)">01111</span><span style="outline: solid 2px hsl(90, 90%, 30%)">01101</span><span style="outline: solid 2px hsl(60, 90%, 30%)">00011</span><span style="outline: solid 2px hsl(30, 90%, 30%)">00100</span><span style="outline: solid 2px hsl(0, 90%, 30%)">00111</span></code>
 
  
==== Entity Movement ====
+
When a container window is open, the server never sends updates targeting Window ID 0&mdash;all of the [[Inventory|window types]] include slots for the player inventory. The client must automatically apply changes targeting the inventory portion of a container window to the main inventory; the server does not resend them for ID 0 when the window is closed. However, since the armor and offhand slots are only present on ID 0, updates to those slots occurring while a window is open must be deferred by the server until the window's closure.
  
This packet may be used to initialize an entity.
+
==== Set Cooldown ====
  
For player entities, either this packet or any move/look packet is sent every game tick. So the meaning of this packet is basically that the entity did not move/look since the last such packet.
+
Applies a cooldown period to all items with the given type.  Used by the Notchian server with enderpearls.  This packet should be sent when the cooldown starts and also when the cooldown ends (to compensate for lag), although the client will end the cooldown automatically. Can be applied to any item, note that interactions still get sent to the server with the item but the client does not play the animation nor attempt to predict results (i.e block placing).
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 513: Line 1,028:
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
  |- {{removed}}  
+
  |-  
  | 0x2A
+
| rowspan="2"| ''protocol:''<br/><code>0x17</code><br/><br/>''resource:''<br/><code>cooldown</code>
  | Play
+
| rowspan="2"| Play
  | Client
+
| rowspan="2"| Client
  | Entity ID
+
| {{change|Item ID|Cooldown Group}}
  | VarInt
+
  | {{change|{{Type|VarInt}}|{{Type|Identifier}}}}
  |  
+
  | {{change|Numeric ID of the item|Group of items}} to apply a cooldown to.
 +
  |-
 +
  | Cooldown Ticks
 +
  | {{Type|VarInt}}
 +
  | Number of ticks to apply a cooldown for, or 0 to clear the cooldown.
 
  |}
 
  |}
  
==== Ping ====
+
==== Teleport Entity ====
 +
 
 +
{{Warning2|{{change||The Mojang-specified name of this packet was changed in 1.21.2 from <code>teleport_entity</code> to <code>entity_position_sync</code>. There is a new <code>teleport_entity</code>, which this document more appropriately calls [[#Synchronize Vehicle Position|Synchronize Vehicle Position]]. That packet has a different function and will lead to confusing results if used in place of this one.}}}}
  
Unknown what this packet does just yet, not used by the Notchian server or client.
+
This packet is sent by the server when an entity moves more than 8 blocks.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 533: Line 1,054:
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
 +
|-
 +
| rowspan="10"| ''protocol:''<br/><code>{{change|0x70|0x20}}</code><br/><br/>''resource:''<br/><code>{{change|teleport_entity|entity_position_sync}}</code>
 +
| rowspan="10"| Play
 +
| rowspan="10"| Client
 +
| Entity ID
 +
| {{Type|VarInt}}
 +
|
 +
|-
 +
| X
 +
| {{Type|Double}}
 +
|
 +
|-
 +
| Y
 +
| {{Type|Double}}
 +
|
 +
|-
 +
| Z
 +
| {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity X
 +
| {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity Y
 +
| {{Type|Double}}
 +
|
 
  |- {{added}}
 
  |- {{added}}
  | 0x30
+
  | Velocity Z
  | Play
+
  | {{Type|Double}}
  | Client
+
  |
  | ID
+
  |-
  | Int
+
  | Yaw
 +
| {{change|{{Type|Angle}}|{{Type|Float}}}}
 +
| Rotation on the X axis, in degrees.
 +
|-
 +
| Pitch
 +
| {{change|{{Type|Angle}}|{{Type|Float}}}}
 +
| Rotation on the Y axis, in degrees.
 +
|-
 +
| On Ground
 +
| {{Type|Boolean}}
 
  |
 
  |
|}
+
|}
 +
 
 +
==== Explosion ====
  
==== Update Light ====
+
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).
  
Updates light levels for a chunk.
+
{{change|Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x|}}
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 550: Line 1,109:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! colspan="2" | Field Name
  !colspan="2"| Field Type
+
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="21"| {{change|0x23|0x25}}
+
  | rowspan="16"| ''protocol:''<br/><code>{{change|0x20|0x21}}</code><br/><br/>''resource:''<br/><code>explode</code>
  |rowspan="21"| Play
+
  | rowspan="16"| Play
  |rowspan="21"| Client
+
  | rowspan="16"| Client
  |colspan="2"| Chunk X
+
  | X
  |colspan="2"| VarInt
+
  | {{Type|Double}}
  | Chunk coordinate (block coordinate divided by 16, rounded down)
+
  |
 
  |-
 
  |-
  |colspan="2"| Chunk Z
+
  | Y
  |colspan="2"| VarInt
+
  | {{Type|Double}}
  | Chunk coordinate (block coordinate divided by 16, rounded down)
+
  |
 
  |-
 
  |-
  |colspan="2"| Trust Edges
+
  | Z
  |colspan="2"| Boolean
+
  | {{Type|Double}}
  | If edges should be trusted for light updates.
+
  |
 
  |- {{removed}}
 
  |- {{removed}}
  |colspan="2"| Sky Light Mask
+
  | Strength
  |colspan="2"| VarInt
+
  | {{Type|Float}}
  | Mask containing 18 bits, with the lowest bit corresponding to chunk section -1 (in the void, y=-16 to y=-1) and the highest bit for chunk section 16 (above the world, y=256 to y=271)
+
  | If the strength is greater or equal to 2.0, or the block interaction is not 0 (keep), large explosion particles are used. Otherwise, small explosion particles are used.
 
  |- {{removed}}
 
  |- {{removed}}
  |colspan="2"| Block Light Mask
+
  | Record Count
  |colspan="2"| VarInt
+
  | {{Type|VarInt}}
  | Mask containing 18 bits, with the same order as sky light
+
  | Number of elements in the following array.
 
  |- {{removed}}
 
  |- {{removed}}
  |colspan="2"| Empty Sky Light Mask
+
  | Records
  |colspan="2"| VarInt
+
  | {{Type|Array}} of ({{Type|Byte}}, {{Type|Byte}}, {{Type|Byte}})
  | Mask containing 18 bits, which indicates sections that have 0 for all their sky light values.  If a section is set in both this mask and the main sky light mask, it is ignored for this mask and it is included in the sky light arrays (the notchian server does not create such masks).  If it is only set in this mask, it is not included in the sky light arrays.
+
  | Each record is 3 signed bytes long; the 3 bytes are the XYZ (respectively) signed offsets of affected blocks.
 +
|- {{added}}
 +
| Has Player Motion
 +
| {{Type|Boolean}}
 +
|
 +
|-
 +
| Player Motion X
 +
| {{change|{{Type|Float}}|{{Type|Optional}} {{Type|Double}}}}
 +
  | X velocity of the player being pushed by the explosion.{{change|| Only present if Has Player Motion is true.}}
 +
|-
 +
| Player Motion Y
 +
| {{change|{{Type|Float}}|{{Type|Optional}} {{Type|Double}}}}
 +
| Y velocity of the player being pushed by the explosion.{{change|| Only present if Has Player Motion is true.}}
 +
|-
 +
| Player Motion Z
 +
| {{change|{{Type|Float}}|{{Type|Optional}} {{Type|Double}}}}
 +
| Z velocity of the player being pushed by the explosion.{{change|| Only present if Has Player Motion is true.}}
 
  |- {{removed}}
 
  |- {{removed}}
  |colspan="2"| Empty Block Light Mask
+
  | Block Interaction
  |colspan="2"| VarInt
+
  | {{Type|VarInt}} {{Type|Enum}}
| Mask containing 18 bits, which indicates sections that have 0 for all their block light values.  If a section is set in both this mask and the main block light mask, it is ignored for this mask and it is included in the block light arrays (the notchian server does not create such masks).  If it is only set in this mask, it is not included in the block light arrays.
+
  | 0 = keep, 1 = destroy, 2 = destroy_with_decay, 3 = trigger_block.
|- {{Added}}
+
  |-
  |colspan="2"| Length 1
+
  | {{change|Small |}}Explosion Particle ID
|colspan="2"| VarInt
+
  | {{Type|VarInt}}
| Length of the following array
+
  | The particle ID listed in [[Particles]].
|- {{Added}}
+
  |-
|colspan="2"| Sky Light Mask
+
  | {{change|Small |}}Explosion Particle Data
|colspan="2"| Array of Long
+
  | Varies
  | BitSet containing bits for each sections in the world + 2 (lowest bit 16-1 blocks below min world height, highest 1-16 above max world height)
+
  | Particle data as specified in [[Particles]].
  |- {{Added}}
+
  |- {{removed}}
  |colspan="2"| Length 2
+
  | Large Explosion Particle ID
|colspan="2"| VarInt
+
  | {{Type|VarInt}}
| Length of the following array
+
  | The particle ID listed in [[Particles]].
|- {{Added}}
+
  |- {{removed}}
  |colspan="2"| Block Light Mask
+
  | Large Explosion Particle Data
  |colspan="2"| Array of Long
+
  | Varies
| BitSet containing bits for each sections in the world + 2, same order as sky light
+
  | Particle data as specified in [[Particles]].
  |- {{Added}}
 
  |colspan="2"| Length 3
 
  |colspan="2"| VarInt
 
| Length of the following array
 
  |- {{Added}}
 
  |colspan="2"| Empty Sky Light Mask
 
  |colspan="2"| Array of Long
 
| BitSet containing a variable amount of bits (see sky/block light) which indicates sections that have 0 for all their sky light values
 
|- {{Added}}
 
|colspan="2"| Length 4
 
|colspan="2"| VarInt
 
| Length of the following array
 
|- {{Added}}
 
  |colspan="2"| Empty Block Light Mask
 
|colspan="2"| Array of Long
 
| BitSet containing a variable amount of bits (see sky/block light) which indicates sections that have 0 for all their block light values
 
  |- {{added}}
 
  |colspan="2"| Sky Light array count
 
  |colspan="2"| VarInt
 
  | Number of entries in the following array
 
 
  |-
 
  |-
  |rowspan="2"| Sky Light arrays
+
  | Explosion Sound
  | Length
+
| {{Type|ID or}} {{Type|Sound Event}}
  |rowspan="2"| Array
+
  | ID in the <code>minecraft:sound_event</code> registry, or an inline definition.
  | VarInt
+
|}
  | Length of the following array in bytes (always 2048)
+
 
 +
==== Open Horse Screen ====
 +
 
 +
This packet is used exclusively for opening the horse GUI. [[#Open Screen|Open Screen]] is used for all other GUIs. The client will not open the inventory if the Entity ID does not point to an horse-like animal.
 +
 
 +
{| class="wikitable"
 +
  ! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | Sky Light array
+
  | rowspan="3"| ''protocol:''<br/><code>0x23</code><br/><br/>''resource:''<br/><code>horse_screen_open</code>
  | Array of 2048 bytes
+
  | rowspan="3"| Play
  | There is 1 array for each bit set to true in the sky light mask, starting with the lowest value. Half a byte per light value.
+
  | rowspan="3"| Client
  |- {{added}}
+
  | Window ID
|colspan="2"| Block Light array count
+
  | {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
|colspan="2"| VarInt
+
  |
  | Number of entries in the following array
 
 
  |-
 
  |-
  |rowspan="2"| Block Light arrays
+
  | Slot count
| Length
+
  | {{Type|VarInt}}
  |rowspan="2"| Array
+
  |
| VarInt
 
  | Length of the following array in bytes (always 2048)
 
 
  |-
 
  |-
  | Block Light array
+
  | Entity ID
  | Array of 2048 bytes
+
  | {{Type|Int}}
  | There is 1 array for each bit set to true in the block light mask, starting with the lowest value.  Half a byte per light value.
+
  |
 
  |}
 
  |}
  
==== Join Game ====
+
==== Login (play) ====
 +
 
 +
{{Need Info|Although the number of portal cooldown ticks is included in this packet, the whole portal usage process is still dictated entirely by the server. What kind of effect does this value have on the client, if any?}}
  
 
See [[Protocol Encryption]] for information on logging in.
 
See [[Protocol Encryption]] for information on logging in.
Line 658: Line 1,223:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="16"| 0x24
+
  | rowspan="23"| ''protocol:''<br/><code>{{change|0x2B|0x2C}}</code><br/><br/>''resource:''<br/><code>login</code>
  |rowspan="16"| Play
+
  | rowspan="23"| Play
  |rowspan="16"| Client
+
  | rowspan="23"| Client
 
  | Entity ID
 
  | Entity ID
  | Int
+
  | {{Type|Int}}
 
  | The player's Entity ID (EID).
 
  | The player's Entity ID (EID).
 
  |-
 
  |-
 
  | Is hardcore
 
  | Is hardcore
  | Boolean
+
  | {{Type|Boolean}}
 
  |
 
  |
 
  |-
 
  |-
  | Gamemode
+
  | Dimension Count
| Unsigned Byte
+
  | {{Type|VarInt}}
  | 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 
|-
 
| Previous Gamemode
 
| Byte
 
| 0: survival, 1: creative, 2: adventure, 3: spectator. The hardcore flag is not included. The previous gamemode. Defaults to -1 if there is no previous gamemode. (More information needed)
 
|-
 
| World Count
 
| VarInt
 
 
  | Size of the following array.
 
  | Size of the following array.
 
  |-
 
  |-
  | World Names
+
  | Dimension Names
  | Array of Identifier
+
  | {{Type|Array}} of {{Type|Identifier}}
  | Identifiers for all worlds on the server.
+
  | Identifiers for all dimensions on the server.
|-
 
| Dimension Codec
 
| [[NBT|NBT Tag Compound]]
 
| The full extent of these is still unknown, but the tag represents a dimension and biome registry. See below for the vanilla default.
 
|-
 
| Dimension
 
| [[NBT|NBT Tag Compound]]
 
| Valid dimensions are defined per dimension registry sent before this. The structure of this tag is a dimension type (see below).
 
|-
 
| World Name
 
| Identifier
 
| Name of the world being spawned into.
 
|-
 
| Hashed seed
 
| Long
 
| First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
 
 
  |-
 
  |-
 
  | Max Players
 
  | Max Players
  | VarInt
+
  | {{Type|VarInt}}
 
  | Was once used by the client to draw the player list, but now is ignored.
 
  | Was once used by the client to draw the player list, but now is ignored.
 
  |-
 
  |-
 
  | View Distance
 
  | View Distance
  | VarInt
+
  | {{Type|VarInt}}
 
  | Render distance (2-32).
 
  | Render distance (2-32).
 +
|-
 +
| Simulation Distance
 +
| {{Type|VarInt}}
 +
| The distance that the client will process specific things, such as entities.
 
  |-
 
  |-
 
  | Reduced Debug Info
 
  | Reduced Debug Info
  | Boolean
+
  | {{Type|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.
 
  | If true, a Notchian client shows reduced information on the {{Minecraft Wiki|debug screen}}.  For servers in development, this should almost always be false.
 
  |-
 
  |-
 
  | Enable respawn screen
 
  | Enable respawn screen
  | Boolean
+
  | {{Type|Boolean}}
 
  | Set to false when the doImmediateRespawn gamerule is true.
 
  | Set to false when the doImmediateRespawn gamerule is true.
 
  |-
 
  |-
  | Is Debug
+
  | Do limited crafting
  | Boolean
+
  | {{Type|Boolean}}
| True if the world is a {{Minecraft Wiki|debug mode}} world; debug mode worlds cannot be modified and have predefined blocks.
+
| Whether players can only craft recipes they have already unlocked. Currently unused by the client.
 
  |-
 
  |-
  | Is Flat
+
  | Dimension Type
| Boolean
+
  | {{Type|VarInt}}
  | True if the world is a {{Minecraft Wiki|superflat}} world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
+
  | The ID of the type of dimension in the <code>minecraft:dimension_type</code> registry, defined by the Registry Data packet.
  |}
 
 
 
 
 
The '''Dimension Codec''' NBT Tag Compound ([https://gist.githubusercontent.com/BomBardyGamer/c075a7a34b51f2df9d5aabdd2a762f4f/raw/c7352784dfadbca00d2282aeca04ed80081bfb09/dimension_codec.snbt Default value in SNBT]) includes two registries: "minecraft:dimension_type" and "minecraft:worldgen/biome".
 
 
 
{| class="wikitable"
 
!Name
 
!Type
 
!style="width: 250px;" colspan="2"| Notes
 
 
  |-
 
  |-
  | minecraft:dimension_type
+
  | Dimension Name
  | TAG_Compound
+
  | {{Type|Identifier}}
  | The dimension type registry (see below).
+
  | Name of the dimension being spawned into.
 
  |-
 
  |-
  | minecraft:worldgen/biome
+
  | Hashed seed
  | TAG_Compound
+
  | {{Type|Long}}
| The biome registry (see below).
+
  | First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
|}
 
 
 
Dimension type registry:
 
 
 
{| class="wikitable"
 
!Name
 
!Type
 
  !style="width: 250px;" colspan="2"| Notes
 
 
  |-
 
  |-
  | type
+
  | Game mode
  | TAG_String
+
  | {{Type|Unsigned Byte}}
  | The name of the registry. Always "minecraft:dimension_type".
+
  | 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 
  |-
 
  |-
  | value
+
  | Previous Game mode
  | TAG_List
+
  | {{Type|Byte}}
  | List of dimension types registry entries (see below).
+
  | -1: Undefined (null), 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. The previous game mode. Vanilla client uses this for the debug (F3 + N & F3 + F4) game mode switch. (More information needed)
|}
 
 
 
Dimension type registry entry:
 
 
 
{| class="wikitable"
 
!Name
 
!Type
 
!style="width: 250px;" colspan="2"| Notes
 
 
  |-
 
  |-
  | name
+
  | Is Debug
  | TAG_String
+
  | {{Type|Boolean}}
  | The name of the dimension type (for example, "minecraft:overworld").
+
  | True if the world is a {{Minecraft Wiki|debug mode}} world; debug mode worlds cannot be modified and have predefined blocks.
 
  |-
 
  |-
  | id
+
  | Is Flat
  | TAG_Int
+
  | {{Type|Boolean}}
  | The protocol ID of the dimension (matches the index of the element in the registry list).
+
  | True if the world is a {{Minecraft Wiki|superflat}} world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
|-
 
| element
 
| TAG_Compound
 
| The dimension type (see below).
 
|}
 
 
 
Dimension type:
 
 
 
{| class="wikitable"
 
! Name
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Values
 
 
  |-
 
  |-
  | piglin_safe
+
  | Has death location
  | TAG_Byte
+
  | {{Type|Boolean}}
|colspan="2"| Whether piglins shake and transform to zombified piglins.
+
  | If true, then the next two fields are present.
  | 1: true, 0: false.
 
 
  |-
 
  |-
  | natural
+
  | Death dimension name
  | TAG_Byte
+
  | {{Type|Optional}} {{Type|Identifier}}
|colspan="2"| When false, compasses spin randomly. When true, nether portals can spawn zombified piglins.
+
  | Name of the dimension the player died in.
  | 1: true, 0: false.
 
 
  |-
 
  |-
  | ambient_light
+
  | Death location
  | TAG_Float
+
  | {{Type|Optional}} {{Type|Position}}
|colspan="2"| How much light the dimension has.
+
  | The location that the player died at.
  | 0.0 to 1.0.
 
 
  |-
 
  |-
  | fixed_time
+
  | Portal cooldown
  | Optional TAG_Long
+
  | {{Type|VarInt}}
  |colspan="2"| If set, the time of the day is the specified value.
+
  | The number of ticks until the player can use the portal again.
| If set, 0 to 24000.
+
  |- {{added}}
|-
+
  | Sea level
| infiniburn
+
  | {{Type|VarInt}}
| TAG_String
 
|colspan="2"| A resource location defining what block tag to use for infiniburn.
 
| "" or minecraft resource "minecraft:...".
 
|-
 
| respawn_anchor_works
 
| TAG_Byte
 
|colspan="2"| Whether players can charge and use respawn anchors.
 
| 1: true, 0: false.
 
|-
 
| has_skylight
 
| TAG_Byte
 
|colspan="2"| Whether the dimension has skylight access or not.
 
| 1: true, 0: false.
 
  |-
 
  | bed_works
 
| TAG_Byte
 
|colspan="2"| Whether players can use a bed to sleep.
 
| 1: true, 0: false.
 
|-
 
| effects
 
| TAG_String
 
|colspan="2"| ?
 
| "minecraft:overworld", "minecraft:the_nether", "minecraft:the_end" or something else.
 
|-
 
| has_raids
 
| TAG_Byte
 
|colspan="2"| Whether players with the Bad Omen effect can cause a raid.
 
  | 1: true, 0: false.
 
|-
 
| min_y
 
| TAG_Int
 
|colspan="2"| The minimum Y level.
 
 
  |
 
  |
 
  |-
 
  |-
  | height
+
  | Enforces Secure Chat
  | TAG_Int
+
  | {{Type|Boolean}}
|colspan="2"| The maximum height.
 
 
  |
 
  |
|-
 
| logical_height
 
| TAG_Int
 
|colspan="2"| The maximum height to which chorus fruits and nether portals can bring players within this dimension.
 
| 0-256.
 
|-
 
| coordinate_scale
 
| TAG_Float
 
|colspan="2"| The multiplier applied to coordinates when traveling to the dimension.
 
| 1: true, 0: false.
 
|-
 
| ultrawarm
 
| TAG_Byte
 
|colspan="2"| Whether the dimensions behaves like the nether (water evaporates and sponges dry) or not. Also causes lava to spread thinner.
 
| 1: true, 0: false.
 
|-
 
| has_ceiling
 
| TAG_Byte
 
|colspan="2"| Whether the dimension has a bedrock ceiling or not. When true, causes lava to spread faster.
 
| 1: true, 0: false.
 
 
  |}
 
  |}
  
Biome registry:
+
==== Move Minecart Along Track ====
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
  !Name
+
  ! Packet ID
  !Type
+
! State
  !style="width: 250px;" colspan="2"| Notes
+
! Bound To
 +
  ! colspan="2"| Field Name
 +
  ! colspan="2"| Field Type
 +
! colspan="2"| Notes
 
  |-
 
  |-
  | type
+
  | rowspan="11"| ''protocol:''<br/><code>0x31</code><br/><br/>''resource:''<br/><code>move_minecart_along_track</code>
  | TAG_String
+
  | rowspan="11"| Play
  | The name of the registry. Always "minecraft:worldgen/biome".
+
  | rowspan="11"| Client
 +
| colspan="2"| Entity ID
 +
| colspan="2"| {{Type|VarInt}}
 +
|
 
  |-
 
  |-
  | value
+
  | colspan="2"| Step Count
| TAG_List
+
  | colspan="2"| {{Type|VarInt}}
  | List of biome registry entries (see below).
+
  | Number of elements in the following array.
|}
 
 
 
Biome registry entry:
 
 
 
{| class="wikitable"
 
!Name
 
!Type
 
  !style="width: 250px;" colspan="2"| Notes
 
 
  |-
 
  |-
  | name
+
  | rowspan="9"| Steps
  | TAG_String
+
  | X
  | The name of the biome (for example, "minecraft:ocean").
+
  | rowspan="9"| {{Type|Array}}
 +
| {{Type|Double}}
 +
|
 
  |-
 
  |-
  | id
+
  | Y
  | TAG_Int
+
  | {{Type|Double}}
  | The protocol ID of the biome (matches the index of the element in the registry list).
+
  |  
 
  |-
 
  |-
  | element
+
  | Z
  | TAG_Compound
+
  | {{Type|Double}}
| The biome properties (see below).
+
  |  
|}
 
 
 
Biome properties:
 
 
 
{| class="wikitable"
 
!colspan="2"|Name
 
!colspan="2"|Type
 
!style="width: 250px;" colspan="2"| Meaning
 
  !colspan="2"|Values
 
 
  |-
 
  |-
  |colspan="2"|precipitation
+
  | Velocity X
|colspan="2"|TAG_String
+
  | {{Type|Double}}
  |colspan="2"| The type of precipitation in the biome.
+
  |
  |colspan="2"|"rain", "snow", or "none".
 
 
  |-
 
  |-
  |colspan="2"| depth
+
  | Velocity Y
|colspan="2"| TAG_Float
+
  | {{Type|Double}}
  |colspan="2"| The depth factor of the biome.
+
  |
  |colspan="2"| The default values vary between 1.5 and -1.8.
 
 
  |-
 
  |-
  |colspan="2"| temperature
+
  | Velocity Z
|colspan="2"| TAG_Float
+
  | {{Type|Double}}
  |colspan="2"| The temperature factor of the biome.
+
  |
  |colspan="2"| The default values vary between 2.0 and -0.5.
 
 
  |-
 
  |-
  |colspan="2"| scale
+
  | Yaw
|colspan="2"| TAG_Float
+
  | {{Type|Angle}}
  |colspan="2"| ?
+
  |
  |colspan="2"| The default values vary between 1.225 and 0.0.
 
 
  |-
 
  |-
  |colspan="2"| downfall
+
  | Pitch
|colspan="2"| TAG_Float
+
  | {{Type|Angle}}
|colspan="2"| ?
+
  |
|colspan="2"| The default values vary between 1.0 and 0.0.
 
|-
 
|colspan="2"| category
 
|colspan="2"| TAG_String
 
|colspan="2"| The category of the biome.
 
|colspan="2"| Known values are "ocean", "plains", "desert", "forest", "extreme_hills", "taiga", "swamp", "river", "nether", "the_end", "icy", "mushroom", "beach", "jungle", "mesa", "savanna", and "none".
 
|-
 
|colspan="2"| temperature_modifier
 
|colspan="2"| Optional TAG_String
 
|colspan="2"| ?
 
|colspan="2"| The only known value is "frozen".
 
|-
 
|rowspan="11"| effects
 
| sky_color
 
|rowspan="11"| TAG_Compound
 
| TAG_Int
 
|colspan="2"| The color of the sky.
 
| Example: 8364543, which is #7FA1FF in RGB.
 
|-
 
| water_fog_color
 
| TAG_Int
 
|colspan="2"| Possibly the tint color when swimming.
 
| Example: 8364543, which is #7FA1FF in RGB.
 
|-
 
| fog_color
 
| TAG_Int
 
|colspan="2"| Possibly the color of the fog effect when looking past the view distance.
 
| Example: 8364543, which is #7FA1FF in RGB.
 
|-
 
| water_color
 
| TAG_Int
 
|colspan="2"| The tint color of the water blocks.
 
| Example: 8364543, which is #7FA1FF in RGB.
 
|-
 
| foliage_color
 
| Optional TAG_Int
 
|colspan="2"| The tint color of the grass.
 
| Example: 8364543, which is #7FA1FF in RGB.
 
|-
 
| grass_color
 
| Optional TAG_Int
 
| colspan="2"| ?
 
| Example: 8364543, which is #7FA1FF in RGB.
 
|-
 
| grass_color_modifier
 
| Optional TAG_String
 
|colspan="2"| Unknown, likely affects foliage color.
 
| If set, known values are "swamp" and "dark_forest".
 
|-
 
| music
 
| Optional TAG_Compound
 
|colspan="2"| Music properties for the biome.
 
| If present, contains the fields: replace_current_music (TAG_Byte), sound (TAG_String), max_delay (TAG_Int), min_delay (TAG_Int).
 
|-
 
| ambient_sound
 
| Optional TAG_String
 
|colspan="2"| Ambient soundtrack.
 
| If present, the ID of a soundtrack. Example: "minecraft:ambient.basalt_deltas.loop".
 
|-
 
| additions_sound
 
| Optional TAG_Compound
 
|colspan="2"| Additional ambient sound that plays randomly.
 
| If present, contains the fields: sound (TAG_String), tick_chance (TAG_Double).
 
|-
 
| mood_sound
 
| Optional TAG_Compound
 
  |colspan="2"| Additional ambient sound that plays at an interval.
 
  | If present, contains the fields: sound (TAG_String), tick_delay (TAG_Int), offset (TAG_Double), block_search_extent (TAG_Int).
 
 
  |-
 
  |-
  | particle
+
  | Weight
  | Optional TAG_Compound
+
  | {{Type|Float}}
|colspan="2"| Particles that appear randomly in the biome.
+
|}
| If present, contains the fields: probability (TAG_Float), options (TAG_Compound). The "options" compound contains the field "type" (TAG_String), which identifies the particle type.
 
|}
 
 
 
==== Map Data ====
 
  
Updates a rectangular area on a {{Minecraft Wiki|map}} item.
+
==== Player Info Update ====
  
 +
Sent by the server to update the user list (<tab> in the client).
 
{| class="wikitable"
 
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! colspan="2"| Field Name
  !colspan="2"| Field Type
+
  ! colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="18"| {{change|0x25|0x27}}
+
  | rowspan="4"| ''protocol:''<br/><code>{{change|0x3E|0x40}}</code><br/><br/>''resource:''<br/><code>player_info_update</code>
  |rowspan="18"| Play
+
  | rowspan="4"| Play
  |rowspan="18"| Client
+
  | rowspan="4"| Client
  |colspan="2"| Map ID
+
  | colspan="2"| Actions
  |colspan="2"| VarInt
+
  | colspan="2"| {{Type|Byte}}
  | Map ID of the map being modified
+
  | Determines what actions are present.
 
  |-
 
  |-
  |colspan="2"| Scale
+
  | colspan="2"| Number Of Players
  |colspan="2"| Byte
+
  | colspan="2"| {{Type|VarInt}}
| From 0 for a fully zoomed-in map (1 block per pixel) to 4 for a fully zoomed-out map (16 blocks per pixel)
+
  | Number of elements in the following array.
|- {{removed}}
 
  |colspan="2"| Tracking Position
 
|colspan="2"| Boolean
 
| Specifies whether player and item frame icons are shown
 
 
  |-
 
  |-
  |colspan="2"| Locked
+
  | rowspan="2" | Players
  |colspan="2"| Boolean
+
  | UUID
  | True if the map has been locked in a cartography table
+
  | rowspan="2" | {{Type|Array}}
|-
+
  | {{Type|UUID}}
|- {{added}}
+
  | The player UUID
|colspan="2"| Tracking Position
 
|colspan="2"| Boolean
 
| Specifies whether player and item frame icons are shown
 
|-
 
|colspan="2"| Icon Count
 
|colspan="2"| VarInt
 
| Number of elements in the following array. {{change||Only present if "Tracking Position" is true.}}
 
  |-
 
|rowspan="6"| Icon
 
| Type
 
|rowspan="6"| Array
 
  | VarInt enum
 
| See below
 
 
  |-
 
  |-
  | X
+
  | Player Actions
  | Byte
+
  | {{Type|Array}} of [[#player-info:player-actions|Player&nbsp;Actions]]
| Map coordinates: -128 for furthest left, +127 for furthest right
+
  | The length of this array is determined by the number of [[#player-info:player-actions|Player Actions]] that give a non-zero value when applying its mask to the actions flag. For example given the decimal number 5, binary 00000101. The masks 0x01 and 0x04 would return a non-zero value, meaning the Player Actions array would include two actions: Add Player and Update Game Mode.
|-
 
| Z
 
| Byte
 
| Map coordinates: -128 for highest, +127 for lowest
 
|-
 
| Direction
 
| Byte
 
| 0-15
 
|-
 
| Has Display Name
 
| Boolean
 
|
 
|-
 
| Display Name
 
| Optional [[Chat]]
 
  | Only present if previous Boolean is true
 
|-
 
|colspan="2"| Columns
 
|colspan="2"| Unsigned Byte
 
| Number of columns updated
 
|-
 
|colspan="2"| Rows
 
|colspan="2"| Optional Byte
 
| Only if Columns is more than 0; number of rows updated
 
|-
 
|colspan="2"| X
 
|colspan="2"| Optional Byte
 
| Only if Columns is more than 0; x offset of the westernmost column
 
|-
 
|colspan="2"| Z
 
|colspan="2"| Optional Byte
 
| Only if Columns is more than 0; z offset of the northernmost row
 
|-
 
|colspan="2"| Length
 
|colspan="2"| Optional VarInt
 
| Only if Columns is more than 0; length of the following array
 
|-
 
|colspan="2"| Data
 
|colspan="2"| Optional Array of Unsigned Byte
 
| Only if Columns is more than 0; see {{Minecraft Wiki|Map item format}}
 
 
  |}
 
  |}
 
For icons, a direction of 0 is a vertical icon and increments by 22.5&deg; (360/16).
 
 
Types are based off of rows and columns in <code>map_icons.png</code>:
 
  
 
{| class="wikitable"
 
{| class="wikitable"
 +
|+ id="player-info:player-actions" | Player Actions
 +
! Action
 +
! Mask
 +
! colspan="2" | Field Name
 +
! colspan="2" | Type
 +
! Notes
 
  |-
 
  |-
  ! Icon type
+
  | rowspan="6" | Add Player
  ! Result
+
  | rowspan="6" | 0x01
 +
| colspan="2" | Name
 +
| colspan="2" | {{Type|String}} (16)
 
  |-
 
  |-
  | 0
+
  | colspan="2" | Number Of Properties
  | White arrow (players)
+
| colspan="2" | {{Type|VarInt}}
 +
  | Number of elements in the following array.
 
  |-
 
  |-
  | 1
+
  | rowspan="4" | Property
  | Green arrow (item frames)
+
| Name
 +
  | rowspan="4"| {{Type|Array}}
 +
| {{Type|String}} (32767)
 +
|
 
  |-
 
  |-
  | 2
+
  | Value
  | Red arrow
+
| {{Type|String}} (32767)
 +
  |
 
  |-
 
  |-
  | 3
+
  | Is Signed
  | Blue arrow
+
| {{Type|Boolean}}
 +
  |
 
  |-
 
  |-
  | 4
+
  | Signature
  | White cross
+
  | {{Type|Optional}} {{Type|String}} (32767)
 +
| Only if Is Signed is true.
 
  |-
 
  |-
  | 5
+
  | rowspan="7" | Initialize Chat
  | Red pointer
+
| rowspan="7" | 0x02
 +
  | colspan="2" | Has Signature Data
 +
| colspan="2" | {{Type|Boolean}}
 
  |-
 
  |-
  | 6
+
  | colspan="2" | Chat session ID
  | White circle (off-map players)
+
| colspan="2" | {{Type|UUID}}
 +
  | Only sent if Has Signature Data is true.
 
  |-
 
  |-
  | 7
+
  | colspan="2" | Public key expiry time
  | Small white circle (far-off-map players)
+
| colspan="2" | {{Type|Long}}
 +
  | Key expiry time, as a UNIX timestamp in milliseconds. Only sent if Has Signature Data is true.
 
  |-
 
  |-
  | 8
+
  | colspan="2" | Encoded public key size
  | Mansion
+
| colspan="2" | {{Type|VarInt}}
 +
  | Size of the following array. Only sent if Has Signature Data is true. Maximum length is 512 bytes.
 
  |-
 
  |-
  | 9
+
  | colspan="2" | Encoded public key
  | Temple
+
| colspan="2" | {{Type|Byte Array}} (512)
 +
  | The player's public key, in bytes. Only sent if Has Signature Data is true.
 
  |-
 
  |-
  | 10
+
  | colspan="2" | Public key signature size
  | White Banner
+
| colspan="2" | {{Type|VarInt}}
 +
  | Size of the following array. Only sent if Has Signature Data is true. Maximum length is 4096 bytes.
 
  |-
 
  |-
  | 11
+
  | colspan="2" | Public key signature
  | Orange Banner
+
| colspan="2" | {{Type|Byte Array}} (4096)
 +
  | The public key's digital signature. Only sent if Has Signature Data is true.
 
  |-
 
  |-
  | 12
+
  | Update Game Mode
  | Magenta Banner
+
  | 0x04
 +
| colspan="2" | Game Mode
 +
| colspan="2" | {{Type|VarInt}}
 
  |-
 
  |-
  | 13
+
  | Update Listed
  | Light Blue Banner
+
  | 0x08
 +
| colspan="2" | Listed
 +
| colspan="2" | {{Type|Boolean}}
 +
| Whether the player should be listed on the player list.
 
  |-
 
  |-
  | 14
+
  | Update Latency
  | Yellow Banner
+
  | 0x10
  |-
+
  | colspan="2" | Ping
  | 15
+
  | colspan="2" | {{Type|VarInt}}
  | Lime Banner
+
  | Measured in milliseconds.
 
  |-
 
  |-
  | 16
+
  | rowspan="2" | Update Display Name
  | Pink Banner
+
| rowspan="2" | 0x20
 +
  | colspan="2" | Has Display Name
 +
| colspan="2" | {{Type|Boolean}}
 
  |-
 
  |-
  | 17
+
  | colspan="2" | Display Name
| Gray Banner
+
  | colspan="2" | {{Type|Optional}} {{Type|Text Component}}
|-
+
  | Only sent if Has Display Name is true.
| 18
+
  |- {{added}}
| Light Gray Banner
+
  | Update List Priority
|-
+
  | 0x40
| 19
+
  | colspan="2" | Priority
| Cyan Banner
+
  | colspan="2" | {{Type|VarInt}}
|-
+
  | See below.
| 20
 
| Purple Banner
 
|-
 
| 21
 
| Blue Banner
 
|-
 
| 22
 
| Brown Banner
 
|-
 
| 23
 
| Green Banner
 
|-
 
| 24
 
| Red Banner
 
|-
 
| 25
 
| Black Banner
 
|-
 
| 26
 
| Treasure marker
 
|}
 
 
 
==== Combat Event ====
 
 
 
Originally used for metadata for twitch streaming circa 1.8.  Now only used to display the game over screen (with enter combat and end combat completely ignored by the Notchain client)
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
!colspan="2"| Field Name
 
! Field Type
 
! Notes
 
|- {{Removed}}
 
|rowspan="8"| 0x31
 
|rowspan="8"| Play
 
|rowspan="8"| Client
 
  |colspan="2"| Event
 
| VarInt Enum
 
| Determines the layout of the remaining packet.
 
|- {{Removed}}
 
! Event
 
! Field Name
 
!
 
!
 
|- {{Removed}}
 
| 0: enter combat
 
| ''no fields''
 
| ''no fields''
 
|
 
|- {{Removed}}
 
|rowspan="2"| 1: end combat
 
| Duration
 
| VarInt
 
| Length of the combat in ticks.
 
|- {{Removed}}
 
  | Entity ID
 
| Int
 
| ID of the primary opponent of the ended combat, or -1 if there is no obvious primary opponent.
 
|- {{Removed}}
 
|rowspan="3"| 2: entity dead
 
| Player ID
 
| VarInt
 
| Entity ID of the player that died (should match the client's entity ID).
 
  |- {{Removed}}
 
  | Entity ID
 
  | Int
 
  | The killing entity's ID, or -1 if there is no obvious killer.
 
|- {{Removed}}
 
| Message
 
| [[Chat]]
 
| The death message.
 
|}
 
 
 
==== End Combat Event ====
 
 
 
Unused by the Notchain client.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
!colspan="2"| Field Name
 
! Field Type
 
! Notes
 
  |- {{Added}}
 
|rowspan="8"| 0x32
 
|rowspan="8"| Play
 
|rowspan="8"| Client
 
| Duration
 
| VarInt
 
| Length of the combat in ticks.
 
|- {{Added}}
 
| Entity ID
 
| Int
 
| ID of the primary opponent of the ended combat, or -1 if there is no obvious primary opponent.
 
|- {{Added}}
 
  |}
 
 
 
==== Enter Combat Event ====
 
 
 
Unused by the Notchain client.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
!colspan="2"| Field Name
 
! Field Type
 
! Notes
 
|- {{Added}}
 
|rowspan="8"| 0x33
 
|rowspan="8"| Play
 
|rowspan="8"| Client
 
 
  |}
 
  |}
  
 +
The properties included in this packet are the same as in [[#Login Success|Login Success]], for the current player.
  
==== Death Combat Event ====
+
Ping values correspond with icons in the following way:
 
+
* A ping that negative (i.e. not known to the server yet) will result in the no connection icon.
Used to send a respawn screen.
+
* A ping under 150 milliseconds will result in 5 bars
 
+
* A ping under 300 milliseconds will result in 4 bars
{| class="wikitable"
+
* A ping under 600 milliseconds will result in 3 bars
! Packet ID
+
* A ping under 1000 milliseconds (1 second) will result in 2 bars
! State
+
* A ping greater than or equal to 1 second will result in 1 bar.
! Bound To
 
!colspan="2"| Field Name
 
! Field Type
 
! Notes
 
|- {{Added}}
 
|rowspan="8"| 0x34
 
|rowspan="8"| Play
 
|rowspan="8"| Client
 
| Player ID
 
| VarInt
 
| Entity ID of the player that died (should match the client's entity ID).
 
|- {{Added}}
 
| Entity ID
 
| Int
 
| The killing entity's ID, or -1 if there is no obvious killer.
 
|- {{Added}}
 
| Message
 
| [[Chat]]
 
| The death message.
 
|}
 
  
==== Player Position And Look (clientbound) ====
+
The order of players in the player list is determined as follows:
 +
* {{change||Players with higher priorities are sorted before those with lower priorities.}}
 +
* {{change||Among players of equal priorities, }}spectators are sorted after non-spectators.
 +
* Within each of those groups, players are sorted into teams. The teams are ordered case-sensitively by team name in ascending order. Players with no team are listed first.
 +
* The players of each team (and non-team) are sorted case-insensitively by name in ascending order.
  
Updates the player's position on the server. This packet will also close the “Downloading Terrain” screen when joining/respawning.
+
==== Synchronize Player Position ====
  
If the distance between the last known position of the player on the server and the new position set by this packet is greater than 100 meters, the client will be kicked for “You moved too quickly :( (Hacking?)”.
+
Teleports the client, e.g. during login, when using an ender pearl, in response to invalid move packets, etc.
  
Also if the fixed-point number of X or Z is set greater than <code>3.2E7D</code> the client will be kicked for “Illegal position”.
+
Due to latency, the server may receive outdated movement packets sent before the client was aware of the teleport. To account for this, the server ignores all movement packets from the client until a [[#Confirm Teleportation|Confirm Teleportation]] packet with an ID matching the one sent in the teleport packet is received.
  
Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0, -1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.
+
Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0, -1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360 (see [https://bugs.mojang.com/browse/MC-90097 MC-90097]).
  
 
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.
 
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.
Line 1,335: Line 1,542:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="8"| {{change|0x34|0x38}}
+
  | rowspan="11"| ''protocol:''<br/><code>{{change|0x40|0x42}}</code><br/><br/>''resource:''<br/><code>player_position</code>
  |rowspan="8"| Play
+
  | rowspan="11"| Play
  |rowspan="8"| Client
+
  | rowspan="11"| Client
 +
| {{added}} | Teleport ID
 +
| {{added}} | {{Type|VarInt}}
 +
| {{added}} | Client should confirm this packet with [[#Confirm Teleportation|Confirm Teleportation]] containing the same Teleport ID.
 +
|-
 
  | X
 
  | X
  | Double
+
  | {{Type|Double}}
 
  | Absolute or relative position, depending on Flags.
 
  | Absolute or relative position, depending on Flags.
 
  |-
 
  |-
 
  | Y
 
  | Y
  | Double
+
  | {{Type|Double}}
 
  | Absolute or relative position, depending on Flags.
 
  | Absolute or relative position, depending on Flags.
 
  |-
 
  |-
 
  | Z
 
  | Z
  | Double
+
  | {{Type|Double}}
 
  | Absolute or relative position, depending on Flags.
 
  | Absolute or relative position, depending on Flags.
 +
|- {{added}}
 +
| Velocity X
 +
| {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity Y
 +
| {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity Z
 +
| {{Type|Double}}
 +
|
 
  |-
 
  |-
 
  | Yaw
 
  | Yaw
  | Float
+
  | {{Type|Float}}
 
  | Absolute or relative rotation on the X axis, in degrees.
 
  | Absolute or relative rotation on the X axis, in degrees.
 
  |-
 
  |-
 
  | Pitch
 
  | Pitch
  | Float
+
  | {{Type|Float}}
 
  | Absolute or relative rotation on the Y axis, in degrees.
 
  | Absolute or relative rotation on the Y axis, in degrees.
 
  |-
 
  |-
 
  | Flags
 
  | Flags
  | Byte
+
  | {{change|{{Type|Byte}}|{{Type|Teleport Flags}}}}
  | Bit field, see below.
+
  | {{change|Reference the Flags table below. When the value of the this byte masked is zero the field is absolute, otherwise relative.|}}
  |-
+
  |- {{removed}}
 
  | Teleport ID
 
  | Teleport ID
  | VarInt
+
  | {{Type|VarInt}}
  | Client should confirm this packet with [[#Teleport Confirm|Teleport Confirm]] containing the same Teleport ID.
+
  | Client should confirm this packet with [[#Confirm Teleportation|Confirm Teleportation]] containing the same Teleport ID.
|- {{added}}
 
| Dismount Vehicle
 
| Boolean
 
| True if the player should dismount their vehicle.
 
 
  |}
 
  |}
  
About the Flags field:
+
==== Player Rotation ====
  
<Dinnerbone> It's a bitfield, X/Y/Z/Y_ROT/X_ROT. If X is set, the x value is relative and not absolute.
+
{| class="wikitable" {{added}}
 
+
! Packet ID
{| class="wikitable"
+
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  ! Field
+
  | rowspan="2"| ''protocol:''<br/><code>0x43</code><br/><br/>''resource:''<br/><code>player_rotation</code>
  ! Bit
+
  | rowspan="2"| Play
 +
| rowspan="2"| Client
 +
| Yaw
 +
| {{Type|Float}}
 +
| Rotation on the X axis, in degrees.
 
  |-
 
  |-
  | X
+
  | Pitch
  | 0x01
+
  | {{Type|Float}}
|-
+
  | Rotation on the Y axis, in degrees.
  | Y
 
| 0x02
 
|-
 
| Z
 
| 0x04
 
|-
 
| Y_ROT
 
| 0x08
 
|-
 
| X_ROT
 
| 0x10
 
 
  |}
 
  |}
  
==== Destroy Entity ====
+
==== Place Ghost Recipe ====
  
Sent by the server when {{change|a list of entities|an entity}} is to be destroyed on the client.
+
Response to the serverbound packet ([[#Place Recipe|Place Recipe]]), with the same recipe ID. Appears to be used to notify the UI.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,408: Line 1,624:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x36
+
  | rowspan="4"| ''protocol:''<br/><code>{{change|0x37|0x39}}</code><br/><br/>''resource:''<br/><code>place_ghost_recipe</code>
  |rowspan="4"| Play
+
  | rowspan="4"| Play
  |rowspan="4"| Client
+
  | rowspan="4"| Client
 +
| Window ID
 +
| {{change|{{Type|Byte}}|{{Type|VarInt}}}}
 +
|
 
  |- {{removed}}
 
  |- {{removed}}
  | Count
+
  | Recipe
  | VarInt
+
  | {{Type|Identifier}}
  | Number of elements in the following array.
+
  | A recipe ID.
  |- {{Removed}}
+
  |- {{added}}
  | Array of VarInt
+
  | Recipe Display ID
  | The list of entities of destroy.
+
| {{Type|VarInt}}
  |- {{Added}}
+
  | ID in the <code>minecraft:recipe_display</code> registry.
  | Entity ID
+
  |- {{added}}
  | VarInt
+
  | Recipe Data
 +
| Varies
 +
  | Depends on Recipe Type; see below.
 
  |}
 
  |}
  
==== Resource Pack Send ====  
+
''below''
 +
 
 +
==== Recipe Book Add ====
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  ! colspan="2"| Field Name
  ! Field Type
+
  ! colspan="2"| Field Type
  ! Notes
+
  ! colspan="2"| Notes
 +
|-
 +
| rowspan="10"| ''protocol:''<br/><code>0x44</code><br/><br/>''resource:''<br/><code>recipe_book_add</code>
 +
| rowspan="10"| Play
 +
| rowspan="10"| Client
 +
| colspan="2"| Recipe Count
 +
| colspan="2"| {{Type|VarInt}}
 +
| Number of elements in the following array.
 +
|-
 +
| rowspan="8"| Recipes
 +
| Recipe ID
 +
| rowspan="8"| {{Type|Array}}
 +
| {{Type|VarInt}}
 +
| ID to assign to the recipe.
 +
|-
 +
| Display ID
 +
| {{Type|VarInt}}
 +
| ID in the <code>minecraft:recipe_display</code> registry.
 +
|-
 +
| Group ID
 +
| {{Type|VarInt}}
 +
|
 +
|-
 +
| Category ID
 +
| {{Type|VarInt}}
 +
| ID in the <code>minecraft:recipe_book_category</code> registry.
 +
|-
 +
| Has Ingredients
 +
| {{Type|Boolean}}
 +
|
 +
|-
 +
| Ingredient Count
 +
| {{Type|Optional}} {{Type|VarInt}}
 +
| Number of elements in the following array. Only present if Has Ingredients is true.
 +
|-
 +
| Ingredients
 +
| {{Type|Optional}} {{Type|Array}} of {{Type|ID Set}}
 +
| IDs in the <code>minecraft:item</code> registry, or an inline definition. Only present if Has Ingredients is true.
 
  |-
 
  |-
  |rowspan="4"| {{change|0x38|0x3B}}
+
  | Flags
  |rowspan="4"| Play
+
| {{Type|Byte}}
|rowspan="4"| Client
+
  | 0x01: show notification; 0x02: highlight as new
| URL
 
| String (32767)
 
| The URL to the resource pack.
 
 
  |-
 
  |-
  | Hash
+
  | colspan="2"| Replace
| String (40)
+
  | colspan="2"| {{Type|Boolean}}
  | A 40 character hexadecimal and lowercase [[wikipedia:SHA-1|SHA-1]] hash of the resource pack file. (must be lower case in order to work)<br />If it's not a 40 character hexadecimal string, the client will not use it for hash verification and likely waste bandwidth — but it will still treat it as a unique id
+
  | Replace or Add to known recipes
|- {{Added}}
 
| Forced
 
| Boolean
 
| The notchian client will be forced to use the resource pack from the server. If they decline they will be kicked from the server.
 
|- {{Added}}
 
  | Forced Message
 
| [[Chat]]
 
| This is sent with the force resourcepack popup.
 
 
  |}
 
  |}
==== Title ====
 
  
{| class="wikitable"
+
==== Recipe Book Remove ====
 +
 
 +
{| class="wikitable" {{added}}
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
  |- {{ Removed }}
+
  |-
  |rowspan="10"| 0x4F
+
  | rowspan="2"| ''protocol:''<br/><code>0x45</code><br/><br/>''resource:''<br/><code>recipe_book_remove</code>
  |rowspan="10"| Play
+
  | rowspan="2"| Play
  |rowspan="10"| Client
+
  | rowspan="2"| Client
  |colspan="2"| Action
+
  | Recipe Count
| VarInt Enum
+
  | {{Type|VarInt}}
  |  
+
  | Number of elements in the following array.
|- {{ Removed }}
+
  |-
! Action
+
  | Recipes
! Field Name
+
  | {{Type|Array}} of {{Type|VarInt}}
!
+
  | IDs of recipes to remove.
!
 
|- {{ Removed }}
 
  | 0: set title
 
| Title Text
 
| [[Chat]]
 
|
 
  |- {{ Removed }}
 
  | 1: set subtitle
 
  | Subtitle Text
 
| [[Chat]]
 
|
 
|- {{ Removed }}
 
| 2: set action bar
 
| Action bar text
 
| [[Chat]]
 
| Displays a message above the hotbar (the same as position 2 in [[#Chat Message (clientbound)|Chat Message (clientbound)]].
 
|- {{ Removed }}
 
|rowspan="3"| 3: set times and display
 
| Fade In
 
| Int
 
| Ticks to spend fading in.
 
|- {{ Removed }}
 
| Stay
 
| Int
 
| Ticks to keep the title displayed.
 
|- {{ Removed }}
 
  | Fade Out
 
| Int
 
| Ticks to spend out, not when to start fading out.
 
|- {{ Removed }}
 
| 4: hide
 
| ''no fields''
 
| ''no fields''
 
|
 
|- {{ Removed }}
 
| 5: reset
 
| ''no fields''
 
| ''no fields''
 
|
 
 
  |}
 
  |}
  
“Hide” makes the title disappear, but if you run times again the same title will appear. “Reset” erases the text.
+
==== Recipe Book Settings ====
 
 
The title is visible on screen for Fade In + Stay + Fade Out ticks.
 
 
 
==== Action Bar ====
 
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 1,526: Line 1,733:
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
  |- {{ Added }}
+
  |-
  |rowspan="4"| 0x40
+
  | rowspan="8"| ''protocol:''<br/><code>0x46</code><br/><br/>''resource:''<br/><code>recipe_book_settings</code>
  |rowspan="4"| Play
+
  | rowspan="8"| Play
  |rowspan="4"| Client
+
  | rowspan="8"| Client
  | Action bar text
+
  | Crafting Recipe Book Open
  | [[Chat]]
+
  | {{Type|Boolean}}
  | Displays a message above the hotbar (the same as position 2 in [[#Chat Message (clientbound)|Chat Message (clientbound)]].
+
  | If true, then the crafting recipe book will be open when the player opens its inventory.
  |- {{ Added }}
+
|-
 +
| Crafting Recipe Book Filter Active
 +
| {{Type|Boolean}}
 +
| If true, then the filtering option is active when the players opens its inventory.
 +
|-
 +
| Smelting Recipe Book Open
 +
| {{Type|Boolean}}
 +
| If true, then the smelting recipe book will be open when the player opens its inventory.
 +
  |-
 +
| Smelting Recipe Book Filter Active
 +
| {{Type|Boolean}}
 +
| If true, then the filtering option is active when the players opens its inventory.
 +
|-
 +
| Blast Furnace Recipe Book Open
 +
| {{Type|Boolean}}
 +
| If true, then the blast furnace recipe book will be open when the player opens its inventory.
 +
|-
 +
| Blast Furnace Recipe Book Filter Active
 +
| {{Type|Boolean}}
 +
| If true, then the filtering option is active when the players opens its inventory.
 +
|-
 +
| Smoker Recipe Book Open
 +
| {{Type|Boolean}}
 +
| If true, then the smoker recipe book will be open when the player opens its inventory.
 +
|-
 +
| Smoker Recipe Book Filter Active
 +
| {{Type|Boolean}}
 +
| If true, then the filtering option is active when the players opens its inventory.
 
  |}
 
  |}
==== World Border Center ====  
+
 
 +
==== Respawn ====
 +
 
 +
{{Need Info|Although the number of portal cooldown ticks is included in this packet, the whole portal usage process is still dictated entirely by the server. What kind of effect does this value have on the client, if any?}}
 +
 
 +
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"
 
{| class="wikitable"
Line 1,544: Line 1,783:
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
  |- {{ Added }}
+
  |-
  |rowspan="18"| 0x41
+
  | rowspan="13"| ''protocol:''<br/><code>{{change|0x47|0x4C}}</code><br/><br/>''resource:''<br/><code>respawn</code>
  |rowspan="18"| Play
+
  | rowspan="13"| Play
  |rowspan="18"| Client
+
  | rowspan="13"| Client
  | X
+
  | Dimension Type
  | Double
+
| {{Type|VarInt}}
  |  
+
| The ID of type of dimension in the <code>minecraft:dimension_type</code> registry, defined by the [[Protocol#Registry_Data|Registry Data]] packet.
  |- {{ Added }}
+
|-
  | Z
+
| Dimension Name
  | Double
+
| {{Type|Identifier}}
  |  
+
| Name of the dimension being spawned into.
  |- {{ Added }}
+
|-
 +
| Hashed seed
 +
| {{Type|Long}}
 +
| First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
 +
|-
 +
  | Game mode
 +
  | {{Type|Unsigned Byte}}
 +
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 +
  |-
 +
| Previous Game mode
 +
| {{Type|Byte}}
 +
  | -1: Undefined (null), 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. The previous game mode. Vanilla client uses this for the debug (F3 + N & F3 + F4) game mode switch. (More information needed)
 +
|-
 +
  | Is Debug
 +
| {{Type|Boolean}}
 +
  | True if the world is a {{Minecraft Wiki|debug mode}} world; debug mode worlds cannot be modified and have predefined blocks.
 +
  |-
 +
| Is Flat
 +
| {{Type|Boolean}}
 +
| True if the world is a {{Minecraft Wiki|superflat}} world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
 +
|-
 +
| Has death location
 +
| {{Type|Boolean}}
 +
| If true, then the next two fields are present.
 +
|-
 +
| Death dimension Name
 +
| {{Type|Optional}} {{Type|Identifier}}
 +
| Name of the dimension the player died in.
 +
|-
 +
| Death location
 +
| {{Type|Optional}} {{Type|Position}}
 +
| The location that the player died at.
 +
|-
 +
| Portal cooldown
 +
| {{Type|VarInt}}
 +
| The number of ticks until the player can use the portal again.
 +
|- {{added}}
 +
| Sea level
 +
| {{Type|VarInt}}
 +
|
 +
|-
 +
| Data kept
 +
| {{Type|Byte}}
 +
| Bit mask. 0x01: Keep attributes, 0x02: Keep metadata. Tells which data should be kept on the client side once the player has respawned.
 +
In the Notchian implementation, this is context dependent:
 +
* normal respawns (after death) keep no data;
 +
* exiting the end poem/credits keeps the attributes;
 +
* other dimension changes (portals or teleports) keep all data.
 
  |}
 
  |}
==== World Border Lerp Size ====
 
  
{| class="wikitable"
+
{{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).
 +
 
 +
Before 1.16, 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.}}
 +
 
 +
==== Set Cursor Item ====
 +
 
 +
{| class="wikitable" {{added}}
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 1,566: Line 1,857:
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
|- {{ Added }}
 
|rowspan="4"| 0x42
 
|rowspan="4"| Play
 
|rowspan="4"| Client
 
| Old Diameter
 
| Double
 
| Current length of a single side of the world border, in meters.
 
|- {{ Added }}
 
| New Diameter
 
| Double
 
| Target length of a single side of the world border, in meters.
 
|- {{ Added }}
 
| Speed
 
| VarLong
 
| Number of real-time ''milli''seconds until New Diameter is reached. It appears that Notchian server does not sync world border speed to game ticks, so it gets out of sync with server lag. If the world border is not moving, this is set to 0.
 
 
  |-
 
  |-
 +
| 0x5A
 +
| Play
 +
| Client
 +
| Slot Data
 +
| {{Type|Slot}}
 +
|
 
  |}
 
  |}
==== World Border Size ====  
+
 
 +
==== Update Time ====
 +
 
 +
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.
 +
 
 +
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 the time by <code>20</code> every second.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,592: Line 1,881:
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
  |- {{ Added }}
+
  |-
  |rowspan="4"| 0x43
+
  | rowspan="3"| ''protocol:''<br/><code>{{change|0x64|0x6B}}</code><br/><br/>''resource:''<br/><code>set_time</code>
  |rowspan="4"| Play
+
  | rowspan="3"| Play
  |rowspan="4"| Client
+
  | rowspan="3"| Client
  | Diameter
+
  | World Age
  | Double
+
| {{Type|Long}}
  | Length of a single side of the world border, in meters.
+
| In ticks; not changed by server commands.
  |- {{ Added }}
+
  |-
 +
  | Time of day
 +
| {{Type|Long}}
 +
| The world (or region) time, in ticks. {{change|If negative the sun will stop moving at the Math.abs of the time.|}}
 +
  |- {{added}}
 +
| Time of day increasing
 +
| {{Type|Boolean}}
 +
| If true, the client should automatically advance the time of day according to its ticking rate.
 
  |}
 
  |}
  
==== World Border Warning Delay====  
+
==== Set Player Inventory Slot ====
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 1,611: Line 1,907:
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
  |- {{ Added }}
+
  |-
  |rowspan="4"| 0x44
+
  | rowspan="2"| ''protocol:''<br/><code>0x66</code><br/><br/>''resource:''<br/><code>set_player_inventory</code>
  |rowspan="4"| Play
+
  | rowspan="2"| Play
  |rowspan="4"| Client
+
  | rowspan="2"| Client
  | Warning Time
+
  | Slot
  | VarInt
+
  | {{Type|VarInt}}
  | In seconds as set by <code>/worldborder warning time</code>.
+
  |
  |- {{ Added }}
+
  |-
 +
| Slot Data
 +
| {{Type|Slot}}
 +
|
 
  |}
 
  |}
  
==== World Border Warning Reach====  
+
==== Synchronize Vehicle Position ====
 +
 
 +
Teleports the entity on the client without changing the reference point of movement deltas in future [[#Update Entity Position|Update Entity Position]] packets. Seems to be used to make relative adjustments to vehicle positions; more information needed.
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 1,630: Line 1,931:
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
  |- {{ Added }}
+
  |-
  |rowspan="4"| 0x45
+
  | rowspan="11"| ''protocol:''<br/><code>0x77</code><br/><br/>''resource:''<br/><code>teleport_entity</code>
  |rowspan="4"| Play
+
  | rowspan="11"| Play
  |rowspan="4"| Client
+
  | rowspan="11"| Client
  | Warning Blocks
+
  | Entity ID
  | VarInt
+
  | {{Type|VarInt}}
  | In meters.
+
|
  |- {{ Added }}
+
|-
 +
| X
 +
| {{Type|Double}}
 +
|
 +
|-
 +
| Y
 +
| {{Type|Double}}
 +
|
 +
|-
 +
| Z
 +
| {{Type|Double}}
 +
|
 +
|-
 +
| Velocity X
 +
| {{Type|Double}}
 +
|
 +
|-
 +
| Velocity Y
 +
| {{Type|Double}}
 +
|
 +
|-
 +
| Velocity Z
 +
| {{Type|Double}}
 +
  |
 +
|-
 +
| Yaw
 +
| {{Type|Float}}
 +
| Rotation on the Y axis, in degrees.  
 +
  |-
 +
| Pitch
 +
| {{Type|Float}}
 +
| Rotation on the Y axis, in degrees.
 +
|- {{added}}
 +
| Flags
 +
| {{Type|Teleport Flags}}
 +
|
 +
|-
 +
| On Ground
 +
| {{Type|Boolean}}
 +
|
 
  |}
 
  |}
  
==== Spawn Position ====
+
==== Update Recipes ====
 
 
Sent by the server after login to specify the coordinates of the spawn point (the point at which players spawn at, and which the compass points to). It can be sent at any time to update the point compasses point at.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,648: Line 1,986:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  ! Field Name
+
  ! colspan="2"| Field Name
  ! Field Type
+
  ! colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| {{change|0x42|0x4B}}
+
  | rowspan="8"| ''protocol:''<br/><code>{{change|0x77|0x7e}}</code><br/><br/>''resource:''<br/><code>update_recipes</code>
  |rowspan="4"| Play
+
  | rowspan="8"| Play
  |rowspan="4"| Client
+
  | rowspan="8"| Client
  | Location
+
  | {{removed}} colspan="2"| Num Recipes
  | Position
+
| {{removed}} colspan="2"| {{Type|VarInt}}
  | Spawn location.
+
| {{removed}}| Number of elements in the following array.
 +
|- {{removed}}
 +
| rowspan="3"| Recipe
 +
  | Recipe ID
 +
| rowspan="3"| {{Type|Array}}
 +
| {{Type|Identifier}}
 +
|
 +
|- {{removed}}
 +
| Type ID
 +
| {{Type|VarInt}} {{Type|Enum}}
 +
| The recipe type, see below.
 +
|- {{removed}}
 +
| Data
 +
| Varies
 +
| Additional data for the recipe.
 +
|- {{added}}
 +
| colspan="2"| Property Set Count
 +
| colspan="2"| {{Type|VarInt}}
 +
  | Number of elements in the following array.
 
  |- {{added}}
 
  |- {{added}}
  | Angle
+
  | rowspan="3"| Property Sets
  | Float
+
| Property Set ID
 +
| rowspan="3"| {{Type|Array}}
 +
  | {{Type|Identifier}}
 
  |
 
  |
 +
|- {{added}}
 +
| Item Count
 +
| {{Type|VarInt}}
 +
| Number of elements in the following array.
 +
|- {{added}}
 +
| Items
 +
| {{Type|Array}} of {{Type|VarInt}}
 +
| IDs in the <code>minecraft:item</code> registry.
 +
|}
 +
 +
{{change|Recipe types:|}}
 +
 +
{| class="wikitable" {{removed}}
 +
! ID
 +
! Type
 +
! Description
 +
! Data
 +
|-
 +
| 0
 +
| <code>minecraft:crafting_shaped</code>
 +
| Shaped crafting recipe. All items must be present in the same pattern (which may be flipped horizontally or translated).
 +
| As follows:
 +
  {| class="wikitable" {{removed}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Group
 +
    | {{Type|String}} (32767)
 +
    | Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
 +
    |-
 +
    |Category
 +
    |{{Type|VarInt}} {{Type|Enum}}
 +
    |Building = 0, Redstone = 1, Equipment = 2, Misc = 3
 +
    |-
 +
    | Width
 +
    | {{Type|VarInt}}
 +
    |
 +
    |-
 +
    | Height
 +
    | {{Type|VarInt}}
 +
    |
 +
    |-
 +
    | Ingredients
 +
    | {{Type|Array}} of Ingredient
 +
    | Length is <code>width * height</code>. Indexed by <code>x + (y * width)</code>.
 +
    |-
 +
    | Result
 +
    | {{Type|Slot}}
 +
    |-
 +
    | Show notification
 +
    | {{Type|Boolean}}
 +
    | Show a toast when the recipe is [[Protocol#Update_Recipe_Book|added]].
 +
    |}
 +
|-
 +
| 1
 +
| <code>minecraft:crafting_shapeless</code>
 +
| Shapeless crafting recipe. All items in the ingredient list must be present, but in any order/slot.
 +
| As follows:
 +
  {| class="wikitable" {{removed}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Group
 +
    | {{Type|String}} (32767)
 +
    | Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
 +
    |-
 +
    |Category
 +
    |{{Type|VarInt}} {{Type|Enum}}
 +
    |Building = 0, Redstone = 1, Equipment = 2, Misc = 3
 +
    |-
 +
    | Ingredient count
 +
    | {{Type|VarInt}}
 +
    | Number of elements in the following array.
 +
    |-
 +
    | Ingredients
 +
    | {{Type|Array}} of Ingredient.
 +
    |
 +
    |-
 +
    | Result
 +
    | {{Type|Slot}}
 +
    |
 +
    |}
 +
|-
 +
| 2
 +
| <code>minecraft:crafting_special_armordye</code>
 +
| Recipe for dying leather armor
 +
| rowspan="14" | As follows:
 +
  {| class="wikitable" {{removed}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    |Category
 +
    |{{Type|VarInt}} {{Type|Enum}}
 +
    |Building = 0, Redstone = 1, Equipment = 2, Misc = 3
 +
    |}
 +
|-
 +
| 3
 +
| <code>minecraft:crafting_special_bookcloning</code>
 +
| Recipe for copying contents of written books
 +
|-
 +
| 4
 +
| <code>minecraft:crafting_special_mapcloning</code>
 +
| Recipe for copying maps
 +
|-
 +
| 5
 +
| <code>minecraft:crafting_special_mapextending</code>
 +
| Recipe for adding paper to maps
 +
|-
 +
| 6
 +
| <code>minecraft:crafting_special_firework_rocket</code>
 +
| Recipe for making firework rockets
 +
|-
 +
| 7
 +
| <code>minecraft:crafting_special_firework_star</code>
 +
| Recipe for making firework stars
 +
|-
 +
| 8
 +
| <code>minecraft:crafting_special_firework_star_fade</code>
 +
| Recipe for making firework stars fade between multiple colors
 +
|-
 +
| 9
 +
| <code>minecraft:crafting_special_tippedarrow</code>
 +
| Recipe for crafting tipped arrows
 +
|-
 +
| 10
 +
| <code>minecraft:crafting_special_bannerduplicate</code>
 +
| Recipe for copying banner patterns
 +
|-
 +
| 11
 +
| <code>minecraft:crafting_special_shielddecoration</code>
 +
| Recipe for applying a banner's pattern to a shield
 +
|-
 +
| 12
 +
| <code>minecraft:crafting_special_shulkerboxcoloring</code>
 +
| Recipe for recoloring a shulker box
 +
|-
 +
| 13
 +
| <code>minecraft:crafting_special_suspiciousstew</code>
 +
| Recipe for crafting suspicious stews
 +
|-
 +
| 14
 +
| <code>minecraft:crafting_special_repairitem</code>
 +
| Recipe for repairing items via crafting
 +
|-
 +
| 22
 +
| <code>minecraft:crafting_decorated_pot</code>
 +
| Recipe for crafting decorated pots
 +
|-
 +
| 15
 +
| <code>minecraft:smelting</code>
 +
| Smelting recipe
 +
| rowspan="4"| As follows:
 +
  {| class="wikitable" {{removed}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Group
 +
    | {{Type|String}} (32767)
 +
    | Used to group similar recipes together in the recipe book.
 +
    |-
 +
    |Category
 +
    |{{Type|VarInt}} {{Type|Enum}}
 +
    |Food = 0, Blocks = 1, Misc = 2
 +
    |-
 +
    | Ingredient
 +
    | Ingredient
 +
    |
 +
    |-
 +
    | Result
 +
    | {{Type|Slot}}
 +
    |
 +
    |-
 +
    | Experience
 +
    | {{Type|Float}}
 +
    |
 +
    |-
 +
    | Cooking time
 +
    | {{Type|VarInt}}
 +
    |
 +
    |}
 +
|-
 +
| 16
 +
| <code>minecraft:blasting</code>
 +
| Blast furnace recipe
 +
|-
 +
| 17
 +
| <code>minecraft:smoking</code>
 +
| Smoker recipe
 +
|-
 +
| 18
 +
| <code>minecraft:campfire_cooking</code>
 +
| Campfire recipe
 +
|-
 +
| 19
 +
| <code>minecraft:stonecutting</code>
 +
| Stonecutter recipe
 +
| As follows:
 +
  {| class="wikitable" {{removed}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Group
 +
    | {{Type|String}} (32767)
 +
    | Used to group similar recipes together in the recipe book.  Tag is present in recipe JSON.
 +
    |-
 +
    | Ingredient
 +
    | Ingredient
 +
    |
 +
    |-
 +
    | Result
 +
    | {{Type|Slot}}
 +
    |
 +
    |}
 +
|-
 +
| 20
 +
| <code>minecraft:smithing_transform</code>
 +
| Recipe for smithing netherite gear
 +
| As follows:
 +
  {| class="wikitable" {{removed}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Template
 +
    | Ingredient
 +
    | The smithing template.
 +
    |-
 +
    | Base
 +
    | Ingredient
 +
    | The base item.
 +
    |-
 +
    | Addition
 +
    | Ingredient
 +
    | The additional ingredient.
 +
    |-
 +
    | Result
 +
    | {{Type|Slot}}
 +
    |
 +
    |}
 +
|-
 +
| 21
 +
| <code>minecraft:smithing_trim</code>
 +
| Recipe for applying armor trims
 +
| As follows:
 +
  {| class="wikitable" {{removed}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Template
 +
    | Ingredient
 +
    | The smithing template.
 +
    |-
 +
    | Base
 +
    | Ingredient
 +
    | The base item.
 +
    |-
 +
    | Addition
 +
    | Ingredient
 +
    | The additional ingredient.
 +
    |}
 
  |}
 
  |}
  
==== Set Title SubTitle ====
+
{{change|Ingredient is defined as:|}}
  
{| class="wikitable"
+
{| class="wikitable" {{removed}}
  ! Packet ID
+
  ! Name
! State
+
  ! Type
! Bound To
+
  ! Description
! Field Name
+
  |-
  ! Field Type
+
  | Count
  ! Notes
+
  | {{Type|VarInt}}
  |- {{ Added }}
+
  | Number of elements in the following array.
  |rowspan="4"| 0x56
+
  |-
  |rowspan="4"| Play
+
  | Items
  |rowspan="4"| Client
+
  | {{Type|Array}} of {{Type|Slot}}
  | Subtitle Text
+
| Any item in this array may be used for the recipe.  The count of each item should be 1.
  | [[Chat]]
 
  |- {{ Added }}
 
 
  |}
 
  |}
  
 +
=== Serverbound ===
  
==== Set Title Text ====  
+
==== Bundle Item Selected ====
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 1,692: Line 2,315:
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
  |- {{ Added }}
+
  |-
  |rowspan="4"| 0x58
+
  | rowspan="2"| ''protocol:''<br/><code>0x02</code><br/><br/>''resource:''<br/><code>bundle_item_selected</code>
  |rowspan="4"| Play
+
  | rowspan="2"| Play
  |rowspan="4"| Client
+
  | rowspan="2"| Server
  | Title Text
+
  | Slot of Bundle
  | [[Chat]]
+
| {{Type|VarInt}}
  |- {{ Added }}
+
  |
 +
  |-
 +
| Slot in Bundle
 +
| {{Type|VarInt}}
 +
|
 
  |}
 
  |}
  
==== Set Title Time====  
+
==== Client Tick End ====
  
{| class="wikitable"
+
{| class="wikitable" {{added}}
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 1,710: Line 2,337:
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
  |- {{ Added }}
+
  |-
  |rowspan="4"| 0x59
+
  | ''protocol:''<br/><code>0x0B</code><br/><br/>''resource:''<br/><code>client_tick_end</code>
  |rowspan="4"| Play
+
| Play
  |rowspan="4"| Client
+
  | Server
| Fade In
+
  | colspan="3"| ''no fields''
| Int
 
| Ticks to spend fading in.
 
|- {{ Added }}
 
| Stay
 
| Int
 
| Ticks to keep the title displayed.
 
|- {{ Added }}
 
| Fade Out
 
| Int
 
| Ticks to spend out, not when to start fading out.
 
 
  |}
 
  |}
  
 +
==== Click Container ====
  
==== Entity Properties ====
+
This packet is sent by the client when the player clicks on a slot in a window.
 
 
Sets {{Minecraft Wiki|Attribute|attributes}} on the given entity.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,736: Line 2,352:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! colspan="2"| Field Name
  !colspan="2"| Field Type
+
  ! colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="6"| {{change|0x58|0x63}}
+
  | rowspan="9"| ''protocol:''<br/><code>{{change|0x0E|0x10}}</code><br/><br/>''resource:''<br/><code>container_click</code>
  |rowspan="6"| Play
+
  | rowspan="9"| Play
  |rowspan="6"| Client
+
  | rowspan="9"| Server
  |colspan="2"| Entity ID
+
  | colspan="2"| Window ID
  |colspan="2"| VarInt
+
  | colspan="2"| {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
  |  
+
| colspan="2"| The ID of the window which was clicked. 0 for player inventory. The server ignores any packets targeting a Window ID other than the current one, including ignoring 0 when any other window is open.
 +
|-
 +
| colspan="2"| State ID
 +
| colspan="2"| {{Type|VarInt}}
 +
  | colspan="2"| The last received State ID from either a [[#Set Container Slot|Set Container Slot]] or a [[#Set Container Content|Set Container Content]] packet.
 +
|-
 +
| colspan="2"| Slot
 +
| colspan="2"| {{Type|Short}}
 +
| colspan="2"| The clicked slot number, see below.
 +
|-
 +
| colspan="2"| Button
 +
| colspan="2"| {{Type|Byte}}
 +
| colspan="2"| The button used in the click, see below.
 
  |-
 
  |-
  |colspan="2"| Number Of Properties
+
  | colspan="2"| Mode
  |colspan="2"| {{change|Int|VarInt}}
+
  | colspan="2"| {{Type|VarInt}} {{Type|Enum}}
  | Number of elements in the following array.
+
  | colspan="2"| Inventory operation mode, see below.
 
  |-
 
  |-
  |rowspan="4"| Property
+
  | colspan="2"| Length of the array
  | Key
+
  | colspan="2"| {{Type|VarInt}}
|rowspan="4"| Array
+
  | colspan="2"| Maximum value for Notchian server is 128 slots.
  | Identifier
 
| See below.
 
 
  |-
 
  |-
  | Value
+
  | rowspan="2"| Array of changed slots
  | Double
+
| Slot number
  | See below.
+
| rowspan="2"| {{Type|Array}} (128)
 +
  | {{Type|Short}}
 +
  |
 
  |-
 
  |-
  | Number Of Modifiers
+
  | Slot data
  | VarInt
+
  | {{Type|Slot}}
  | Number of elements in the following array.
+
  | New data for this slot, in the client's opinion; see below.
 
  |-
 
  |-
  | Modifiers
+
  | colspan="2"| Carried item
  | Array of Modifier Data
+
  | colspan="2"| [[Slot Data|Slot]]
  | See {{Minecraft Wiki|Attribute#Modifiers}}. Modifier Data defined below.
+
  | colspan="2"| Item carried by the cursor. Has to be empty (item ID = -1) for drop mode, otherwise nothing will happen.
 
  |}
 
  |}
  
Known Key values (see also {{Minecraft Wiki|Attribute#Modifiers}}):
+
See [[Inventory]] for further information about how slots are indexed.
 +
 
 +
After performing the action, the server compares the results to the slot change information included in the packet, as applied on top of the server's view of the container's state prior to the action. For any slots that do not match, it sends [[#Set Container Slot|Set Container Slot]] packets containing the correct results. If State ID does not match the last ID sent by the server, it will instead send a full [[#Set Container Content|Set Container Content]] to resynchronize the client.
 +
 
 +
When right-clicking on a stack of items, half the stack will be picked up and half left in the slot. If the stack is an odd number, the half left in the slot will be smaller of the amounts.
 +
 
 +
The distinct type of click performed by the client is determined by the combination of the Mode and Button fields.
  
 
{| class="wikitable"
 
{| class="wikitable"
 +
! Mode
 +
! Button
 +
! Slot
 +
! Trigger
 
  |-
 
  |-
  ! Key
+
  ! rowspan="4"| 0
  ! Default
+
  | 0
  ! Min
+
  | Normal
  ! Max
+
  | Left mouse click
! Label
 
 
  |-
 
  |-
  | generic.max_health
+
  | 1
  | 20.0
+
  | Normal
  | 0.0
+
  | Right mouse click
| 1024.0
 
| Max Health.
 
 
  |-
 
  |-
  | generic.follow_range
+
  | 0
| 32.0
+
  | -999
  | 0.0
+
  | Left click outside inventory (drop cursor stack)
| 2048.0
 
  | Follow Range.
 
 
  |-
 
  |-
  | generic.knockback_resistance
+
  | 1
| 0.0
+
  | -999
| 0.0
+
  | Right click outside inventory (drop cursor single item)
  | 1.0
 
  | Knockback Resistance.
 
 
  |-
 
  |-
  | generic.movement_speed
+
  ! rowspan="2"| 1
  | 0.7
+
  | 0
  | 0.0
+
  | Normal
| 1024.0
+
  | Shift + left mouse click
  | Movement Speed.
 
 
  |-
 
  |-
  | generic.attack_damage
+
  | 1
  | 2.0
+
  | Normal
  | 0.0
+
  | Shift + right mouse click ''(identical behavior)''
| 2048.0
 
| Attack Damage.
 
 
  |-
 
  |-
  | generic.attack_speed
+
  ! rowspan="7"| 2
  | 4.0
+
  | 0
  | 0.0
+
  | Normal
| 1024.0
+
  | Number key 1
  | Attack Speed.
 
 
  |-
 
  |-
  | generic.flying_speed
+
  | 1
  | 0.4
+
  | Normal
  | 0.0
+
  | Number key 2
| 1024.0
 
| Flying Speed.
 
 
  |-
 
  |-
  | generic.armor
+
  | 2
  | 0.0
+
  | Normal
  | 0.0
+
  | Number key 3
| 30.0
 
| Armor.
 
 
  |-
 
  |-
  | generic.armor_toughness
+
  |
  | 0.0
+
  |
  | 0.0
+
  |
| 20.0
 
| Armor Toughness.
 
 
  |-
 
  |-
  | generic.attack_knockback
+
  | 8
  | 0.0
+
  | Normal
  | 0.0
+
  | Number key 9
| 5.0
 
| &mdash;
 
 
  |-
 
  |-
  | generic.luck
+
  |
  | 0.0
+
  |
  | -1024.0
+
  | Button is used as the slot index (impossible in vanilla clients)
| 1024.0
 
| Luck.
 
 
  |-
 
  |-
  | horse.jump_strength
+
  | 40
  | 0.7
+
  | Normal
  | 0.0
+
  | Offhand swap key F
| 2.0
 
| Jump Strength.
 
 
  |-
 
  |-
  | zombie.spawn_reinforcements
+
! 3
  | 0.0
+
  | 2
  | 0.0
+
| Normal
  | 1.0
+
| Middle click, only defined for creative players in non-player inventories.
  | Spawn Reinforcements Chance.
+
|-
 +
! rowspan="2"| 4
 +
  | 0
 +
| Normal*
 +
| Drop key (Q) (* Clicked item is always empty)
 +
|-
 +
| 1
 +
| Normal*
 +
| Control + Drop key (Q) (* Clicked item is always empty)
 +
|-
 +
! rowspan="9"| 5
 +
| 0
 +
  | -999
 +
| Starting left mouse drag
 +
|-
 +
| 4
 +
| -999
 +
| Starting right mouse drag
 +
|-
 +
| 8
 +
| -999
 +
| Starting middle mouse drag, only defined for creative players in non-player inventories.
 +
|-
 +
  | 1
 +
| Normal
 +
| Add slot for left-mouse drag
 +
|-
 +
| 5
 +
| Normal
 +
| Add slot for right-mouse drag
 +
|-
 +
| 9
 +
| Normal
 +
| Add slot for middle-mouse drag, only defined for creative players in non-player inventories.
 +
  |-
 +
| 2
 +
| -999
 +
| Ending left mouse drag
 +
|-
 +
| 6
 +
| -999
 +
| Ending right mouse drag
 +
|-
 +
| 10
 +
| -999
 +
| Ending middle mouse drag, only defined for creative players in non-player inventories.
 
  |-
 
  |-
  | generic.reachDistance
+
  ! rowspan="2"| 6
  | 5.0
+
  | 0
  | 0.0
+
  | Normal
| 1024.0
+
  | Double click
  | Player Reach Distance (Forge only).
 
 
  |-
 
  |-
| forge.swimSpeed
+
  | 1
  | 1.0
+
  | Normal
| 0.0
+
  | Pickup all but check items in reverse order (impossible in vanilla clients)
  | 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.
+
Starting from version 1.5, “painting mode” is available for use in inventory windows. It is done by picking up stack of something (more than 1 item), then holding mouse button (left, right or middle) and dragging held stack over empty (or same type in case of right button) slots. In that case client sends the following to server after mouse button release (omitting first pickup packet which is sent as usual):
 +
 
 +
# packet with mode 5, slot -999, button (0 for left | 4 for right);
 +
# packet for every slot painted on, mode is still 5, button (1 | 5);
 +
# packet with mode 5, slot -999, button (2 | 6);
 +
 
 +
If any of the painting packets other than the “progress” ones are sent out of order (for example, a start, some slots, then another start; or a left-click in the middle) the painting status will be reset.
 +
 
 +
==== Close Container ====
 +
 
 +
This packet is sent by the client when closing a window.
  
''Modifier Data'' structure:
+
Notchian clients send a Close Window packet with Window ID 0 to close their inventory even though there is never an [[#Open Screen|Open Screen]] packet for the inventory.
  
 
{| class="wikitable"
 
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
 +
| ''protocol:''<br/><code>{{change|0x0F|0x11}}</code><br/><br/>''resource:''<br/><code>container_close</code>
 +
| Play
 +
| Server
 +
| Window ID
 +
| {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
 +
| This is the ID of the window that was closed. 0 for player inventory.
 +
|}
 +
 +
==== Edit Book ====
 +
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 
  ! Field Name
 
  ! Field Name
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  | UUID
+
  | rowspan="5"| ''protocol:''<br/><code>{{change|0x14|0x16}}</code><br/><br/>''resource:''<br/><code>edit_book</code>
  | UUID
+
| rowspan="5"| Play
  |  
+
| rowspan="5"| Server
 +
| Slot
 +
| {{Type|VarInt}}
 +
| The hotbar slot where the written book is located
 +
|-
 +
| Count
 +
  | {{Type|VarInt}}
 +
  | Number of elements in the following array. Maximum array size is {{change|200|100}}.
 +
|-
 +
| Entries
 +
| {{Type|Array}} ({{change|200|100}}) of {{Type|String}} ({{change|8192|1024}})
 +
| Text from each page. Maximum string length is {{change|8192|1024}} chars.
 
  |-
 
  |-
  | Amount
+
  | Has title
  | Double
+
  | {{Type|Boolean}}
  | May be positive or negative.
+
  | If true, the next field is present. true if book is being signed, false if book is being edited.
 
  |-
 
  |-
  | Operation
+
  | Title
  | Byte
+
  | {{Type|Optional}} {{Type|String}} ({{change|128|32}})
  | See below.
+
  | Title of book.
 
  |}
 
  |}
  
The operation controls how the base value of the modifier is changed.
+
==== Set Player Position ====
 +
 
 +
Updates the player's XYZ position on the server.
 +
 
 +
If the player is in a vehicle, the position is ignored (but in case of [[#Set Player Position and Rotation|Set Player Position and Rotation]], the rotation is still used as normal). No validation steps other than value range clamping are performed in this case.
  
* 0: Add/subtract amount
+
If the player is sleeping, the position (or rotation) is not changed, and a [[#Synchronize Player Position|Synchronize Player Position]] is sent if the received position deviated from the server's view by more than a meter.
* 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.
+
The Notchian server silently clamps the x and z coordinates between -30,000,000 and 30,000,000, and the y coordinate between -20,000,000 and 20,000,000. A similar condition has historically caused a kick for "Illegal position"; this is no longer the case. However, infinite or NaN coordinates (or angles) still result in a kick for <code>multiplayer.disconnect.invalid_player_movement</code>.
  
==== Tags ====
+
As of 1.20.6, checking for moving too fast is achieved like this (sic):
 +
 
 +
* Each server tick, the player's current position is stored.
 +
* When the player moves, the offset from the stored position to the requested position is computed (&Delta;x, &Delta;y, &Delta;z).
 +
* The requested movement distance squared is computed as &Delta;x&sup2; + &Delta;y&sup2; + &Delta;z&sup2;.
 +
* The baseline expected movement distance squared is computed based on  the player's server-side velocity as Vx&sup2; + Vy&sup2; + Vz&sup2;. The player's server-side velocity is a somewhat ill-defined quantity that includes among other things gravity, jump velocity and knockback, but ''not'' regular horizontal movement. A proper description would bring much of Minecraft's physics engine with it. It is accessible as the <code>Motion</code> NBT tag on the player entity.
 +
* The maximum permitted movement distance squared is computed as 100 (300 if the player is using an elytra), multiplied by the number of movement packets received since the last tick, including this one, unless that value is greater than 5, in which case no multiplier is applied.
 +
* If the requested movement distance squared minus the baseline distance squared is more than the maximum squared, the player is moving too fast.
 +
 
 +
If the player is moving too fast, it is logged that "<player> moved too quickly! " followed by the change in x, y, and z, and the player is teleported back to their current (before this packet) server-side position.
 +
 
 +
Checking for block collisions is achieved like this:
 +
 
 +
* A temporary collision-checked move of the player is attempted from its current position to the requested one.
 +
* The offset from the resulting position to the requested position is computed. If the absolute value of the offset on the y axis is less than 0.5, it (only the y component) is rounded down to 0.
 +
* If the magnitude of the offset is greater than 0.25 and the player isn't in creative or spectator mode, it is logged that "<player> moved wrongly!", and the player is teleported back to their current (before this packet) server-side position.
 +
* In addition, if the player's hitbox stationary at the requested position would intersect with a block, and they aren't in spectator mode, they are teleported back without a log message.
 +
 
 +
Checking for illegal flight is achieved like this:
 +
 
 +
* When a movement packet is received, a flag indicating whether or not the player is floating mid-air is updated. The flag is set if the move test described above detected no collision below the player ''and'' the y component of the offset from the player's current position to the requested one is greater than -0.5, unless any of various conditions permitting flight (creative mode, elytra, levitation effect, etc., but not jumping) are met.
 +
* Each server tick, it is checked if the flag has been set for more than 80 consecutive ticks. If so, and the player isn't currently sleeping, dead or riding a vehicle, they are kicked for <code>multiplayer.disconnect.flying</code>.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,908: Line 2,629:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
  !colspan="2"| Field Type
+
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="8"| {{change|0x5B|0x65}}
+
  | rowspan="5"| ''protocol:''<br/><code>{{change|0x1A|0x1C}}</code><br/><br/>''resource:''<br/><code>move_player_pos</code>
  |rowspan="8"| Play
+
  | rowspan="5"| Play
  |rowspan="8"| Client
+
  | rowspan="5"| Server
  |- {{removed}}
+
| X
  | colspan="2"| Block Tags
+
  | {{Type|Double}}
  | colspan="2"| (See below)
+
  | Absolute position.
  | IDs are block IDs
+
  |-
  |- {{removed}}
+
  | Feet Y
  | colspan="2"| Item Tags
+
  | {{Type|Double}}
  | colspan="2"| (See below)
+
  | Absolute feet position, normally Head Y - 1.62.
  | IDs are item IDs
+
  |-
  |- {{removed}}
+
  | Z
  | colspan="2"| Fluid Tags
+
  | {{Type|Double}}
| colspan="2"| (See below)
+
  | Absolute position.
| IDs are fluid IDs
 
 
  |- {{removed}}
 
  |- {{removed}}
  | colspan="2"| Entity Tags
+
  | On Ground
  | colspan="2"| (See below)
+
  | {{Type|Boolean}}
  | IDs are entity IDs
+
  | True if the client is on the ground, false otherwise.
 
  |- {{added}}
 
  |- {{added}}
  | colspan="2"| Length of the array
+
  | Flags
| colspan="2"| VarInt
+
  | {{Type|Byte}}
  |  
+
  | Bit field: 0x01: on ground, 0x02: pushing against wall.
|- {{added}}
 
  |rowspan="2"| Array of tags
 
| Tag type
 
|rowspan="2"| Array
 
| Identifier
 
| Tag identifier (Vanilla required tags are <code>minecraft:block</code>, <code>minecraft:item</code>, <code>minecraft:fluid</code>, <code>minecraft:entity_type</code>, and <code>minecraft:game_event</code>)
 
|-
 
| Array of Tag
 
| (See below)
 
|
 
 
  |}
 
  |}
  
Tags look like:
+
==== Set Player Position and Rotation ====
 +
 
 +
A combination of [[#Set Player Rotation|Move Player Rotation]] and [[#Set Player Position|Move Player Position]].
  
 
{| class="wikitable"
 
{| class="wikitable"
  !colspan="2"| Field Name
+
  ! Packet ID
  !colspan="2"| Field Type
+
! State
 +
! Bound To
 +
! Field Name
 +
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |colspan="2"| Length
+
  | rowspan="7"| ''protocol:''<br/><code>{{change|0x1B|0x1D}}</code><br/><br/>''resource:''<br/><code>move_player_pos_rot</code>
  |colspan="2"| VarInt
+
  | rowspan="7"| Play
  | Number of elements in the following array
+
| rowspan="7"| Server
 +
| X
 +
| {{Type|Double}}
 +
| Absolute position.
 +
|-
 +
| Feet Y
 +
| {{Type|Double}}
 +
  | Absolute feet position, normally Head Y - 1.62.
 
  |-
 
  |-
  |rowspan="3"| Tags
+
  | Z
| Tag name
+
  | {{Type|Double}}
  |rowspan="3"| Array
+
  | Absolute position.
| Identifier
 
  |
 
 
  |-
 
  |-
  | Count
+
  | Yaw
  | VarInt
+
  | {{Type|Float}}
  | Number of elements in the following array
+
  | Absolute rotation on the X Axis, in degrees.
 
  |-
 
  |-
  | Entries
+
  | Pitch
  | Array of VarInt
+
  | {{Type|Float}}
  | Numeric ID of the given type (block, item, etc.).
+
  | Absolute rotation on the Y Axis, in degrees.
 +
|- {{removed}}
 +
| On Ground
 +
| {{Type|Boolean}}
 +
| True if the client is on the ground, false otherwise.
 +
|- {{added}}
 +
| Flags
 +
| {{Type|Byte}}
 +
| Bit field: 0x01: on ground, 0x02: pushing against wall.
 
  |}
 
  |}
  
 +
==== Set Player Rotation ====
 +
[[File:Minecraft-trig-yaw.png|thumb|The unit circle for yaw]]
 +
[[File:Yaw.png|thumb|The unit circle of yaw, redrawn]]
 +
 +
Updates the direction the player is looking in.
 +
 +
Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0,-1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.
 +
 +
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.
 +
 +
The yaw and pitch of player (in degrees), standing at point (x0, y0, z0) and looking towards point (x, y, z) can be calculated with:
  
=== Serverbound ===
+
dx = x-x0
 +
dy = y-y0
 +
dz = z-z0
 +
r = sqrt( dx*dx + dy*dy + dz*dz )
 +
yaw = -atan2(dx,dz)/PI*180
 +
if yaw < 0 then
 +
    yaw = 360 + yaw
 +
pitch = -arcsin(dy/r)/PI*180
  
==== Client Settings ====
+
You can get a unit vector from a given yaw/pitch via:
  
Sent when the player connects, or when settings are changed.
+
x = -cos(pitch) * sin(yaw)
 +
y = -sin(pitch)
 +
z =  cos(pitch) * cos(yaw)
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 1,988: Line 2,736:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="7"| 0x05
+
  | rowspan="4"| ''protocol:''<br/><code>{{change|0x1C|0x1E}}</code><br/><br/>''resource:''<br/><code>move_player_rot</code>
  |rowspan="7"| Play
+
  | rowspan="4"| Play
  |rowspan="7"| Server
+
  | rowspan="4"| Server
  | Locale
+
  | Yaw
  | String (16)
+
  | {{Type|Float}}
  | e.g. <code>en_GB</code>.
+
  | Absolute rotation on the X Axis, in degrees.
 
  |-
 
  |-
  | View Distance
+
  | Pitch
  | Byte
+
  | {{Type|Float}}
  | Client-side render distance, in chunks.
+
  | Absolute rotation on the Y Axis, in degrees.
  |-
+
  |- {{removed}}
  | Chat Mode
+
  | On Ground
  | VarInt Enum
+
  | {{Type|Boolean}}
| 0: enabled, 1: commands only, 2: hidden.  See [[Chat#Processing chat|processing chat]] for more information.
+
  | True if the client is on the ground, false otherwise.
|-
+
  |- {{added}}
| Chat Colors
+
  | Flags
| Boolean
+
  | {{Type|Byte}}
  | “Colors” multiplayer setting.
+
  | Bit field: 0x01: on ground, 0x02: pushing against wall.
|-
 
| Displayed Skin Parts
 
| Unsigned Byte
 
| Bit mask, see below.
 
  |-
 
  | Main Hand
 
| VarInt Enum
 
| 0: Left, 1: Right.
 
  |- {{Added}}
 
  | Disable text filtering
 
| Boolean
 
| Disables filtering of text on signs and written book titles. Currently always true (i.e. the filtering is disabled)
 
 
  |}
 
  |}
 +
{{Anchor|Set Player Movement Flags}}
 +
==== Set Player {{change|On Ground|Movement Flags}} ====
  
''Displayed Skin Parts'' flags:
+
This packet as well as [[#Set Player Position|Set Player Position]], [[#Set Player Rotation|Set Player Rotation]], and [[#Set Player Position and Rotation|Set Player Position and Rotation]] are called the “serverbound movement packets”. Vanilla clients will send Move Player Position once every 20 ticks even for a stationary player.
  
* Bit 0 (0x01): Cape enabled
+
This packet is used to indicate whether the player is on ground (walking/swimming), or airborne (jumping/falling).
* Bit 1 (0x02): Jacket enabled
 
* Bit 2 (0x04): Left Sleeve enabled
 
* Bit 3 (0x08): Right Sleeve enabled
 
* Bit 4 (0x10): Left Pants Leg enabled
 
* Bit 5 (0x20): Right Pants Leg enabled
 
* Bit 6 (0x40): Hat enabled
 
  
The most significant bit (bit 7, 0x80) appears to be unused.
+
When dropping from sufficient height, fall damage is applied when this state goes from false to true. The amount of damage applied is based on the point where it last changed from true to false. Note that there are several movement related packets containing this state.
  
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| rowspan="2"| ''protocol:''<br/><code>{{change|0x1D|0x1F}}</code><br/><br/>''resource:''<br/><code>move_player_status_only</code>
 +
| rowspan="2"| Play
 +
| rowspan="2"| Server
 +
| {{removed}} | On Ground
 +
| {{removed}} | {{Type|Boolean}}
 +
| {{removed}} | True if the client is on the ground, false otherwise.
 +
|- {{added}}
 +
| Flags
 +
| {{Type|Byte}}
 +
| Bit field: 0x01: on ground, 0x02: pushing against wall.
 +
|}
  
==== Window Confirmation (serverbound) ====
+
==== Place Recipe ====
  
If a confirmation sent by the client was not accepted, the server will reply with a [[#Window Confirmation (clientbound)|Window Confirmation (clientbound)]] packet with the Accepted field set to false. When this happens, the client must send this packet to apologize (as with movement), otherwise the server ignores any successive confirmations.
+
This packet is sent when a player clicks a recipe in the crafting book that is craftable (white border).
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,044: Line 2,795:
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
  |- {{ Removed }}
+
  |-
  |rowspan="3"| 0x07
+
  | rowspan="3"| ''protocol:''<br/><code>{{change|0x22|0x24}}</code><br/><br/>''resource:''<br/><code>place_recipe</code>
  |rowspan="3"| Play
+
  | rowspan="3"| Play
  |rowspan="3"| Server
+
  | rowspan="3"| Server
 
  | Window ID
 
  | Window ID
  | Byte
+
  | {{Type|Byte}}
  | The ID of the window that the action occurred in.
+
  |
  |- {{ Removed }}
+
  |-
  | Action Number
+
| Recipe{{change|| ID}}
  | Short
+
  | {{change|{{Type|Identifier}}|{{Type|VarInt}}}}
| Every action that is to be accepted has a unique number. This number is an incrementing integer (starting at 1) with separate counts for each window ID.
+
  | {{change|A recipe ID.|ID of recipe previously defined in [[#Recipe Book Add|Recipe Book Add]].}}
  |- {{ Removed }}
+
  |-
  | Accepted
+
  | Make all
  | Boolean
+
  | {{Type|Boolean}}
  | Whether the action was accepted.
+
  | Affects the amount of items processed; true if shift is down when clicked.
 
  |}
 
  |}
  
==== Pong ====
+
==== Player Input ====
 
 
A response to the ping packet. Unknown what this is used for, this is ignored by the Notchian client and server.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,072: Line 2,821:
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
  |- {{added}}
+
  |-
  | 0x1D
+
| rowspan="3"| ''protocol:''<br/><code>{{change|0x26|0x28}}</code><br/><br/>''resource:''<br/><code>player_input</code>
  | Play
+
  | rowspan="3"| Play
  | Server
+
  | rowspan="3"| Server
  | ID
+
| {{removed}} | Sideways
  | Int
+
| {{removed}} | {{Type|Float}}
  |
+
| {{removed}} | Positive to the left of the player.
 +
|- {{removed}}
 +
| Forward
 +
| {{Type|Float}}
 +
| Positive forward.
 +
  |-
 +
  | Flags
 +
  | {{Type|Unsigned Byte}}
 +
  | Bit mask{{change|. 0x1: jump, 0x2: unmount.|; see below.}}
 
  |}
 
  |}
  
== Handshaking ==
+
The flags are as follows:
  
=== Clientbound ===
+
{| class="wikitable" {{added}}
 +
|-
 +
! Hex Mask
 +
! Field
 +
|-
 +
| 0x01
 +
| Forward
 +
|-
 +
| 0x02
 +
| Backward
 +
|-
 +
| 0x04
 +
| Left
 +
|-
 +
| 0x08
 +
| Right
 +
|-
 +
| 0x10
 +
| Jump
 +
|-
 +
| 0x20
 +
| Sneak
 +
|-
 +
| 0x40
 +
| Sprint
 +
|}
  
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.
+
==== Set Seen Recipe ====
  
=== Serverbound ===
+
Sent when recipe is first seen in recipe book. Replaces Recipe Book Data, type 0.
  
==== Handshake ====
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| ''protocol:''<br/><code>{{change|0x29|0x2B}}</code><br/><br/>''resource:''<br/><code>recipe_book_seen_recipe</code>
 +
| Play
 +
| Server
 +
| Recipe ID
 +
| {{change|{{Type|Identifier}}|{{Type|VarInt}}}}
 +
| ID of recipe previously defined in [[#Recipe Book Add|Recipe Book Add]].
 +
|}
  
This causes the server to switch into the target state.
+
==== Use Item On ====
  
 
{| class="wikitable"
 
{| class="wikitable"
 +
|-
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,101: Line 2,898:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x00
+
  | rowspan="9"| ''protocol:''<br/><code>{{change|0x38|0x3A}}</code><br/><br/>''resource:''<br/><code>use_item_on</code>
  |rowspan="4"| Handshaking
+
  | rowspan="9"| Play
  |rowspan="4"| Server
+
  | rowspan="9"| Server
  | Protocol Version
+
  | Hand
  | VarInt
+
  | {{Type|VarInt}} {{Type|Enum}}
  | See [[protocol version numbers]] (currently {{change|754|{{Snapshot PVN|1073741839}}}})
+
  | The hand from which the block is placed; 0: main hand, 1: off hand.
 +
|-
 +
| Location
 +
| {{Type|Position}}
 +
| Block position.
 +
|-
 +
| Face
 +
| {{Type|VarInt}} {{Type|Enum}}
 +
| The face on which the block is placed (as documented at [[#Player Action|Player Action]]).
 +
|-
 +
| Cursor Position X
 +
| {{Type|Float}}
 +
| The position of the crosshair on the block, from 0 to 1 increasing from west to east.
 +
|-
 +
| Cursor Position Y
 +
| {{Type|Float}}
 +
| The position of the crosshair on the block, from 0 to 1 increasing from bottom to top.
 +
|-
 +
| Cursor Position Z
 +
| {{Type|Float}}
 +
| The position of the crosshair on the block, from 0 to 1 increasing from north to south.
 
  |-
 
  |-
  | Server Address
+
  | Inside block
  | String
+
  | {{Type|Boolean}}
| 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 {{change|complete|simple}} redirect, e.g. if _minecraft._tcp.example.com points to mc.example.org, users connecting to example.com will provide {{change|mc.|}}example.org as server address in addition to connecting to it.
+
| True when the player's head is inside of a block.
  |-
+
|- {{added}}
  | Server Port
+
  | World border hit
| Unsigned Short
+
  | {{Type|Boolean}}
  | Default is 25565.  The Notchian server does not use this information.
+
  | Seems to always be false, even when interacting with blocks around or outside the world border, or while the player is outside the border.
 
  |-
 
  |-
  | Next State
+
  | Sequence
  | VarInt Enum
+
  | {{Type|VarInt}}
  | 1 for [[#Status|status]], 2 for [[#Login|login]]
+
  | Block change sequence number (see [[#Acknowledge Block Change]]).
 
  |}
 
  |}
  
== Status ==
+
Upon placing a block, this packet is sent once.
 
 
=== Clientbound ===
 
  
No changes so far.
+
The Cursor Position X/Y/Z fields (also known as in-block coordinates) are calculated using raytracing. The unit corresponds to sixteen pixels in the default resource pack. For example, let's say a slab is being placed against the south face of a full block. The Cursor Position X will be higher if the player was pointing near the right (east) edge of the face, lower if pointing near the left. The Cursor Position Y will be used to determine whether it will appear as a bottom slab (values 0.0–0.5) or as a top slab (values 0.5-1.0). The Cursor Position Z should be 1.0 since the player was looking at the southernmost part of the block.
 
 
=== Serverbound ===
 
 
 
No changes so far.
 
 
 
== Login ==
 
 
 
=== Clientbound ===
 
 
 
No changes so far.
 
 
 
=== Serverbound ===
 
 
 
No changes so far.
 
  
 +
Inside block is true when a player's head (specifically eyes) are inside of a block's collision. In 1.13 and later versions, collision is rather complicated and individual blocks can have multiple collision boxes. For instance, a ring of vines has a non-colliding hole in the middle. This value is only true when the player is directly in the box. In practice, though, this value is only used by scaffolding to place in front of the player when sneaking inside of it (other blocks will place behind when you intersect with them -- try with glass for instance).
  
 
[[Category:Minecraft Modern]]
 
[[Category:Minecraft Modern]]

Latest revision as of 00:32, 24 November 2024

This page documents the changes from release 1.21.1 (protocol 767) to the current release (1.21.3, protocol 768). The stable protocol documentation is currently lagging behind, and the changes documented here will be merged soon, once they are complete. The current pre-release (snapshot 24w44a) is not yet 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

Name Size (bytes) Encodes Notes
Teleport Flags 4 Bit field specifying how a teleportation is to be applied on each axis. See #Teleport Flags

Teleport Flags

A bit field represented as an Int, specifying how a teleportation is to be applied on each axis.

In the lower 8 bits of the bit field, a set bit means the teleportation on the corresponding axis is relative, and an unset bit that it is absolute.

Hex Mask Field
0x0001 Relative X
0x0002 Relative Y
0x0004 Relative Z
0x0008 Relative Yaw
0x0010 Relative Pitch
0x0020 Relative Velocity X
0x0040 Relative Velocity Y
0x0080 Relative Velocity Z
0x0100 Rotate velocity according to the change in rotation, before applying the velocity change in this packet. Combining this with absolute rotation works as expected—the difference in rotation is still used.

Packets

ID Packet name Documentation
Play clientbound
0x12 Close Container Current Pre
0x13 Set Container Content Current Pre
0x14 Set Container Property Current Pre
0x15 Set Container Slot Current Pre
0x17 Set Cooldown Current Pre
0x70 0x20 Teleport Entity Current Pre
0x20 0x21 Explosion Current Pre
0x23 0x24 Open Horse Screen Current Pre
0x2B 0x2C Login (play) Current Pre
0x31 Move Minecart Along Track Pre
0x37 0x39 Place Ghost Recipe Current Pre
0x3E 0x40 Player Info Update Current Pre
0x40 0x42 Synchronize Player Position Current Pre
0x41 Update Recipe Book Current
0x43 Player Rotation Pre
0x44 Recipe Book Add Pre
0x45 Recipe Book Remove Pre
0x46 Recipe Book Settings Pre
0x47 0x4C Respawn Current Pre
0x5a Set Cursor Item Pre
0x53 0x63 Set Held Item Current (unchanged)
0x66 Set Player Inventory Slot Pre
0x64 0x6b Update Time Current Pre
0x77 Synchronize Vehicle Position Pre
0x77 0x7e Update Recipes Current Pre
Play serverbound
0x02 Bundle Item Selected Pre
0x0b Client Tick End Pre
0x0E 0x10 Click Container Current Pre
0x0F 0x11 Close Container Current Pre
0x14 0x16 Edit Book Current Pre
0x1A 0x1C Set Player Position Current Pre
0x1B 0x1D Set Player Position and Rotation Current Pre
0x1C 0x1E Set Player Rotation Current Pre
0x1D Set Player On Ground Current
0x1F Set Player Movement Flags Pre
0x22 0x24 Place Recipe Current Pre
0x26 0x28 Player Input Current Pre
0x29 0x2B Set Seen Recipe Current Pre
0x38 0x3A Use Item On Current Pre

Entity Metadata

Entity Metadata Format

Painting Variant

See also: Registry Data#Painting Variant
Name Type Meaning
Width Int The width of the painting, in blocks.
Height Int The height of the painting, in blocks.
Asset ID Identifier The texture for the painting.

The Notchian client uses the corresponding asset located at textures/painting.

Has title Boolean
Title Optional Text Component The displayed title of the painting. Only present if Has title is true.
Has author Boolean
Author Optional Text Component The displayed author of the painting. Only present if Has author is true.

Registry Data

Painting Variant

The minecraft:painting_variant registry. It defines the textures and dimensions for the game's paintings.

Name Type Meaning Values
asset_id String Tag The texture for the painting.

The Notchian client uses the corresponding asset located at textures/painting.

Example: "minecraft:backyard".
height Int Tag The height of the painting, in blocks. Example: 2
width Int Tag The width of the painting, in blocks.
title Compound Tag or String Tag The displayed title of the painting. See Text formatting. Example: {"color": "gray", "translate": "painting.minecraft.skeleton.title"}
author Compound Tag or String Tag The displayed author of the painting. See Text formatting. Example: {"color": "gray", "translate": "painting.minecraft.skeleton.author"}

Slot Data

Structured components

Type Name Description Data
6 minecraft:item_model Item's model. As follows:
Name Type Description
Model Identifier
20 21 minecraft:food Makes the item consumable restore the player's hunger bar when consumed. As follows:
Name Type Description
Nutrition VarInt Non-negative
Saturation Modifier Float How much saturation will be given after consuming the item.
Can Always Eat Boolean Whether the item can always be eaten, even at full hunger.
Seconds To Eat Float How long it takes to consume the item.
Using converts to Slot Data This specifies the item produced after consuming the current item. In the Notchian server, this is used for stews, which turn into bowls. Set this to Air if the item should be consumed normally without leaving any other item after.
Number of effects VarInt Number of elements in the following array.
Effect Type ID Array Potion Effect The potion effect. See Potion Effect.
Probability Float The probability for this effect to be chosen.
22 minecraft:consumable Makes the item consumable. As follows:
Name Type Description
Consume seconds Float How long it takes to consume the item.
Animation VarInt Enum 0: none, 1: eat, 2: drink, 3: block, 4: bow, 5: spear, 6: crossbow, 7: spyglass, 8: toot_horn, 9: brush
Sound ID or Sound Event ID in the minecraft:sound_event registry, or an inline definition.
Has consume particles Boolean
Number of effects VarInt Number of elements in the following array.
Effects Array of Consume Effect Effects to apply on consumption. See Consume Effect.
23 minecraft:use_remainder This specifies the item produced after using the current item. In the Notchian server, this is used for stews, which turn into bowls. As follows:
Name Type Description
Remainder Slot
24 minecraft:use_cooldown Cooldown to apply on use of the item. As follows:
Name Type Description
Seconds Float
Cooldown group Optional Identifier Group of items to apply the cooldown to. Only present if Has cooldown group is true; otherwise defaults to the item's identifier.
21 25 minecraft:fire damage_resistant Marks this item as fire damage resistant.
The client won't render the item as being on-fire if this component is present.
None. As follows:
Name Type Description
Types Identifier Tag specifying damage types the item is immune to. Not prefixed by '#'!.
27 minecraft:enchantable Allows the item to be enchanted by an enchanting table. As follows:
Name Type Description
Value VarInt Opaque internal value controlling how expensive enchantments may be offered.
28 minecraft:equippable Allows the item to be equipped by the player. As follows:
Name Type Description
Slot VarInt Enum 0: mainhand, 1: feet, 2: legs, 3: chest, 4: head, 5: offhand, 6: body
Equip sound ID or Sound Event ID in the minecraft:sound_event registry, or an inline definition.
Has model Boolean
Model Optional Identifier Only present if Has model is true.
Has camera overlay Boolean
Camera overlay Optional Identifier Only present if Has camera overlay is true.
Has allowed entities Boolean
Allowed entities Optional ID Set IDs in the minecraft:entity_type registry. Only present if Has allowed entities is true.
Dispensable Boolean
Swappable Boolean
Damage on hurt Boolean
29 minecraft:repairable Items that can be combined with this item in an anvil to repair it. As follows:
Name Type Description
Items ID Set IDs in the minecraft:item registry.
30 minecraft:glider Makes the item function like elytra. None.
31 minecraft:tooltip_style Custom textures for the item tooltip. As follows:
Name Type Description
Style Identifier
32 minecraft:death_protection Makes the item function like a totem of undying. As follows:
Name Type Description
Number of effects VarInt Number of elements in the following array.
Effects Array of Consume Effect Effects to apply on consumption. See Consume Effect.
31 41 minecraft:potion_contents Visual and effects of a potion item. As follows:
Name Type Description
Has Potion ID Boolean Whether this potion has an ID in the potion registry. If true, it has the default effects associated with the potion type.
Potion ID Optional VarInt The ID of the potion type in the potion registry. Only present if Has Potion ID is true.
Has Custom Color Boolean Whether this potion has a custom color. If false, it uses the default color associated with the potion type.
Custom Color Optional Int The RGB components of the color, encoded as an integer. Only present if Has Custom Color is true.
Number Of Custom Effects VarInt The number of elements in the following array.
Custom Effects Array of Potion Effect Any custom effects the potion might have. See Potion Effect.
Custom Name String

Other types

Consume Effect

WIP

Instrument

Name Type Description
Sound Event Id or Sound Event The sound to be played.
Use duration VarInt Float The maximum range of the sound.
Range Float The range of the instrument.
Description Text Component Description shown in the item tooltip.

Particles

Particle Name Particle ID Data
minecraft:dust 13
Field Name Field Type Meaning
Red Float The red RGB value, between 0 and 1. Divide actual RGB value by 255.
Green Float The green RGB value, between 0 and 1. Divide actual RGB value by 255.
Blue Float The blue RGB value, between 0 and 1. Divide actual RGB value by 255.
Color Int The color, encoded as 0xRRGGBB; top bits are ignored.
Scale Float The scale, will be clamped between 0.01 and 4.
minecraft:dust_color_transition 14
Field Name Field Type Meaning
From Red Float The start red RGB value, between 0 and 1. Divide actual RGB value by 255.
From Green Float The start green RGB value, between 0 and 1. Divide actual RGB value by 255.
From Blue Float The start blue RGB value, between 0 and 1. Divide actual RGB value by 255.
From Color Int The start color, encoded as 0xRRGGBB; top bits are ignored.
To Red Float The end red RGB value, between 0 and 1. Divide actual RGB value by 255.
To Green Float The end green RGB value, between 0 and 1. Divide actual RGB value by 255.
To Blue Float The end blue RGB value, between 0 and 1. Divide actual RGB value by 255.
To Color Int The end color, encoded as 0xRRGGBB; top bits are ignored.
Scale Float The scale, will be clamped between 0.01 and 4.

Handshake

No changes so far.

Status

No changes so far.

Login

No changes so far.

Configuration

No changes so far.

Play

Clientbound

Close Container

This packet is sent from the server to the client when a window is forcibly closed, such as when a chest is destroyed while it's open. The notchian client disregards the provided window ID and closes any active window.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x12

resource:
container_close
Play Client Window ID Unsigned Byte VarInt This is the ID of the window that was closed. 0 for inventory.

Set Container Content

The inventory slots

Replaces the contents of a container window. Sent by the server upon initialization of a container window or the player's inventory, and in response to state ID mismatches (see #Click Container).

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x13

resource:
container_set_content
Play Client Window ID Unsigned Byte VarInt The ID of window which items are being sent for. 0 for player inventory. The client ignores any packets targeting a Window ID other than the current one. However, an exception is made for the player inventory, which may be targeted at any time. (The Notchian server does not appear to utilize this special case.)
State ID VarInt A server-managed sequence number used to avoid desynchronization; see #Click Container.
Count VarInt Number of elements in the following array.
Slot Data Array of Slot
Carried Item Slot Item being dragged with the mouse.

See inventory windows for further information about how slots are indexed. Use Open Screen to open the container on the client.

Set Container Property

This packet is used to inform the client that part of a GUI window should be updated.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x14

resource:
container_set_data
Play Client Window ID Unsigned Byte VarInt
Property Short The property to be updated, see below.
Value Short The new value for the property, see below.

The meaning of the Property field depends on the type of the window. The following table shows the known combinations of window type and property, and how the value is to be interpreted.

Window type Property Value
Furnace 0: Fire icon (fuel left) counting from fuel burn time down to 0 (in-game ticks)
1: Maximum fuel burn time fuel burn time or 0 (in-game ticks)
2: Progress arrow counting from 0 to maximum progress (in-game ticks)
3: Maximum progress always 200 on the notchian server
Enchantment Table 0: Level requirement for top enchantment slot The enchantment's xp level requirement
1: Level requirement for middle enchantment slot
2: Level requirement for bottom enchantment slot
3: The enchantment seed Used for drawing the enchantment names (in SGA) clientside. The same seed is used to calculate enchantments, but some of the data isn't sent to the client to prevent easily guessing the entire list (the seed value here is the regular seed bitwise and 0xFFFFFFF0).
4: Enchantment ID shown on mouse hover over top enchantment slot The enchantment id (set to -1 to hide it), see below for values
5: Enchantment ID shown on mouse hover over middle enchantment slot
6: Enchantment ID shown on mouse hover over bottom enchantment slot
7: Enchantment level shown on mouse hover over the top slot The enchantment level (1 = I, 2 = II, 6 = VI, etc.), or -1 if no enchant
8: Enchantment level shown on mouse hover over the middle slot
9: Enchantment level shown on mouse hover over the bottom slot
Beacon 0: Power level 0-4, controls what effect buttons are enabled
1: First potion effect Potion effect ID for the first effect, or -1 if no effect
2: Second potion effect Potion effect ID for the second effect, or -1 if no effect
Anvil 0: Repair cost The repair's cost in xp levels
Brewing Stand 0: Brew time 0 – 400, with 400 making the arrow empty, and 0 making the arrow full
1: Fuel time 0 - 20, with 0 making the arrow empty, and 20 making the arrow full
Stonecutter 0: Selected recipe The index of the selected recipe. -1 means none is selected.
Loom 0: Selected pattern The index of the selected pattern. 0 means none is selected, 0 is also the internal id of the "base" pattern.
Lectern 0: Page number The current page number, starting from 0.

For an enchanting table, the following numerical IDs are used:

Numerical ID Enchantment ID Enchantment Name
0 minecraft:protection Protection
1 minecraft:fire_protection Fire Protection
2 minecraft:feather_falling Feather Falling
3 minecraft:blast_protection Blast Protection
4 minecraft:projectile_protection Projectile Protection
5 minecraft:respiration Respiration
6 minecraft:aqua_affinity Aqua Affinity
7 minecraft:thorns Thorns
8 minecraft:depth_strider Depth Strider
9 minecraft:frost_walker Frost Walker
10 minecraft:binding_curse Curse of Binding
11 minecraft:soul_speed Soul Speed
12 minecraft:swift_sneak Swift Sneak
13 minecraft:sharpness Sharpness
14 minecraft:smite Smite
15 minecraft:bane_of_arthropods Bane of Arthropods
16 minecraft:knockback Knockback
17 minecraft:fire_aspect Fire Aspect
18 minecraft:looting Looting
19 minecraft:sweeping_edge Sweeping Edge
20 minecraft:efficiency Efficiency
21 minecraft:silk_touch Silk Touch
22 minecraft:unbreaking Unbreaking
23 minecraft:fortune Fortune
24 minecraft:power Power
25 minecraft:punch Punch
26 minecraft:flame Flame
27 minecraft:infinity Infinity
28 minecraft:luck_of_the_sea Luck of the Sea
29 minecraft:lure Lure
30 minecraft:loyalty Loyalty
31 minecraft:impaling Impaling
32 minecraft:riptide Riptide
33 minecraft:channeling Channeling
34 minecraft:multishot Multishot
35 minecraft:quick_charge Quick Charge
36 minecraft:piercing Piercing
37 minecraft:density Density
38 minecraft:breach Breach
39 minecraft:wind_burst Wind Burst
40 minecraft:mending Mending
41 minecraft:vanishing_curse Curse of Vanishing

Set Container Slot

Sent by the server when an item in a slot (in a window) is added/removed.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x15

resource:
container_set_slot
Play Client Window ID Unsigned Byte VarInt The window which is being updated. 0 for player inventory. The client ignores any packets targeting a Window ID other than the current one; see below for exceptions , unless it is 0 (see below).
State ID VarInt A server-managed sequence number used to avoid desynchronization; see #Click Container.
Slot Short The slot that should be updated.
Slot Data Slot

If Window ID is 0, the hotbar and offhand slots (slots 36 through 45) may be updated even when a different container window is open. (The Notchian server does not appear to utilize this special case.) Updates are also restricted to those slots when the player is looking at a creative inventory tab other than the survival inventory. (The Notchian server does not handle this restriction in any way, leading to MC-242392.)

If Window ID is -1, the item being dragged with the mouse is set. In this case, State ID and Slot are ignored.

If Window ID is -2, any slot in the player's inventory can be updated irrespective of the current container window. In this case, State ID is ignored, and the Notchian server uses a bogus value of 0. Used by the Notchian server to implement the #Pick Item functionality.

When a container window is open, the server never sends updates targeting Window ID 0—all of the window types include slots for the player inventory. The client must automatically apply changes targeting the inventory portion of a container window to the main inventory; the server does not resend them for ID 0 when the window is closed. However, since the armor and offhand slots are only present on ID 0, updates to those slots occurring while a window is open must be deferred by the server until the window's closure.

Set Cooldown

Applies a cooldown period to all items with the given type. Used by the Notchian server with enderpearls. This packet should be sent when the cooldown starts and also when the cooldown ends (to compensate for lag), although the client will end the cooldown automatically. Can be applied to any item, note that interactions still get sent to the server with the item but the client does not play the animation nor attempt to predict results (i.e block placing).

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x17

resource:
cooldown
Play Client Item ID Cooldown Group VarInt Identifier Numeric ID of the item Group of items to apply a cooldown to.
Cooldown Ticks VarInt Number of ticks to apply a cooldown for, or 0 to clear the cooldown.

Teleport Entity

Warning.png The Mojang-specified name of this packet was changed in 1.21.2 from teleport_entity to entity_position_sync. There is a new teleport_entity, which this document more appropriately calls Synchronize Vehicle Position. That packet has a different function and will lead to confusing results if used in place of this one.

This packet is sent by the server when an entity moves more than 8 blocks.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x70 0x20

resource:
teleport_entity entity_position_sync
Play Client Entity ID VarInt
X Double
Y Double
Z Double
Velocity X Double
Velocity Y Double
Velocity Z Double
Yaw Angle Float Rotation on the X axis, in degrees.
Pitch Angle Float Rotation on the Y axis, in degrees.
On Ground Boolean

Explosion

Sent when an explosion occurs (creepers, TNT, and ghast fireballs).

Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x20 0x21

resource:
explode
Play Client X Double
Y Double
Z Double
Strength Float If the strength is greater or equal to 2.0, or the block interaction is not 0 (keep), large explosion particles are used. Otherwise, small explosion particles are used.
Record Count VarInt Number of elements in the following array.
Records Array of (Byte, Byte, Byte) Each record is 3 signed bytes long; the 3 bytes are the XYZ (respectively) signed offsets of affected blocks.
Has Player Motion Boolean
Player Motion X Float Optional Double X velocity of the player being pushed by the explosion. Only present if Has Player Motion is true.
Player Motion Y Float Optional Double Y velocity of the player being pushed by the explosion. Only present if Has Player Motion is true.
Player Motion Z Float Optional Double Z velocity of the player being pushed by the explosion. Only present if Has Player Motion is true.
Block Interaction VarInt Enum 0 = keep, 1 = destroy, 2 = destroy_with_decay, 3 = trigger_block.
Small Explosion Particle ID VarInt The particle ID listed in Particles.
Small Explosion Particle Data Varies Particle data as specified in Particles.
Large Explosion Particle ID VarInt The particle ID listed in Particles.
Large Explosion Particle Data Varies Particle data as specified in Particles.
Explosion Sound ID or Sound Event ID in the minecraft:sound_event registry, or an inline definition.

Open Horse Screen

This packet is used exclusively for opening the horse GUI. Open Screen is used for all other GUIs. The client will not open the inventory if the Entity ID does not point to an horse-like animal.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x23

resource:
horse_screen_open
Play Client Window ID Unsigned Byte VarInt
Slot count VarInt
Entity ID Int

Login (play)

Huh.png The following information needs to be added to this page:
Although the number of portal cooldown ticks is included in this packet, the whole portal usage process is still dictated entirely by the server. What kind of effect does this value have on the client, if any?

See Protocol Encryption for information on logging in.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x2B 0x2C

resource:
login
Play Client Entity ID Int The player's Entity ID (EID).
Is hardcore Boolean
Dimension Count VarInt Size of the following array.
Dimension Names Array of Identifier Identifiers for all dimensions on the server.
Max Players VarInt Was once used by the client to draw the player list, but now is ignored.
View Distance VarInt Render distance (2-32).
Simulation Distance VarInt The distance that the client will process specific things, such as entities.
Reduced Debug Info Boolean If true, a Notchian client shows reduced information on the debug screen. For servers in development, this should almost always be false.
Enable respawn screen Boolean Set to false when the doImmediateRespawn gamerule is true.
Do limited crafting Boolean Whether players can only craft recipes they have already unlocked. Currently unused by the client.
Dimension Type VarInt The ID of the type of dimension in the minecraft:dimension_type registry, defined by the Registry Data packet.
Dimension Name Identifier Name of the dimension being spawned into.
Hashed seed Long First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
Game mode Unsigned Byte 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
Previous Game mode Byte -1: Undefined (null), 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. The previous game mode. Vanilla client uses this for the debug (F3 + N & F3 + F4) game mode switch. (More information needed)
Is Debug Boolean True if the world is a debug mode world; debug mode worlds cannot be modified and have predefined blocks.
Is Flat Boolean True if the world is a superflat world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
Has death location Boolean If true, then the next two fields are present.
Death dimension name Optional Identifier Name of the dimension the player died in.
Death location Optional Position The location that the player died at.
Portal cooldown VarInt The number of ticks until the player can use the portal again.
Sea level VarInt
Enforces Secure Chat Boolean

Move Minecart Along Track

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x31

resource:
move_minecart_along_track
Play Client Entity ID VarInt
Step Count VarInt Number of elements in the following array.
Steps X Array Double
Y Double
Z Double
Velocity X Double
Velocity Y Double
Velocity Z Double
Yaw Angle
Pitch Angle
Weight Float

Player Info Update

Sent by the server to update the user list (<tab> in the client).

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x3E 0x40

resource:
player_info_update
Play Client Actions Byte Determines what actions are present.
Number Of Players VarInt Number of elements in the following array.
Players UUID Array UUID The player UUID
Player Actions Array of Player Actions The length of this array is determined by the number of Player Actions that give a non-zero value when applying its mask to the actions flag. For example given the decimal number 5, binary 00000101. The masks 0x01 and 0x04 would return a non-zero value, meaning the Player Actions array would include two actions: Add Player and Update Game Mode.
Player Actions
Action Mask Field Name Type Notes
Add Player 0x01 Name String (16)
Number Of Properties VarInt Number of elements in the following array.
Property Name Array String (32767)
Value String (32767)
Is Signed Boolean
Signature Optional String (32767) Only if Is Signed is true.
Initialize Chat 0x02 Has Signature Data Boolean
Chat session ID UUID Only sent if Has Signature Data is true.
Public key expiry time Long Key expiry time, as a UNIX timestamp in milliseconds. Only sent if Has Signature Data is true.
Encoded public key size VarInt Size of the following array. Only sent if Has Signature Data is true. Maximum length is 512 bytes.
Encoded public key Byte Array (512) The player's public key, in bytes. Only sent if Has Signature Data is true.
Public key signature size VarInt Size of the following array. Only sent if Has Signature Data is true. Maximum length is 4096 bytes.
Public key signature Byte Array (4096) The public key's digital signature. Only sent if Has Signature Data is true.
Update Game Mode 0x04 Game Mode VarInt
Update Listed 0x08 Listed Boolean Whether the player should be listed on the player list.
Update Latency 0x10 Ping VarInt Measured in milliseconds.
Update Display Name 0x20 Has Display Name Boolean
Display Name Optional Text Component Only sent if Has Display Name is true.
Update List Priority 0x40 Priority VarInt See below.

The properties included in this packet are the same as in Login Success, for the current player.

Ping values correspond with icons in the following way:

  • A ping that negative (i.e. not known to the server yet) will result in the no connection icon.
  • A ping under 150 milliseconds will result in 5 bars
  • A ping under 300 milliseconds will result in 4 bars
  • A ping under 600 milliseconds will result in 3 bars
  • A ping under 1000 milliseconds (1 second) will result in 2 bars
  • A ping greater than or equal to 1 second will result in 1 bar.

The order of players in the player list is determined as follows:

  • Players with higher priorities are sorted before those with lower priorities.
  • Among players of equal priorities, spectators are sorted after non-spectators.
  • Within each of those groups, players are sorted into teams. The teams are ordered case-sensitively by team name in ascending order. Players with no team are listed first.
  • The players of each team (and non-team) are sorted case-insensitively by name in ascending order.

Synchronize Player Position

Teleports the client, e.g. during login, when using an ender pearl, in response to invalid move packets, etc.

Due to latency, the server may receive outdated movement packets sent before the client was aware of the teleport. To account for this, the server ignores all movement packets from the client until a Confirm Teleportation packet with an ID matching the one sent in the teleport packet is received.

Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0, -1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360 (see MC-90097).

Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x40 0x42

resource:
player_position
Play Client Teleport ID VarInt Client should confirm this packet with Confirm Teleportation containing the same Teleport ID.
X Double Absolute or relative position, depending on Flags.
Y Double Absolute or relative position, depending on Flags.
Z Double Absolute or relative position, depending on Flags.
Velocity X Double
Velocity Y Double
Velocity Z Double
Yaw Float Absolute or relative rotation on the X axis, in degrees.
Pitch Float Absolute or relative rotation on the Y axis, in degrees.
Flags Byte Teleport Flags Reference the Flags table below. When the value of the this byte masked is zero the field is absolute, otherwise relative.
Teleport ID VarInt Client should confirm this packet with Confirm Teleportation containing the same Teleport ID.

Player Rotation

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x43

resource:
player_rotation
Play Client Yaw Float Rotation on the X axis, in degrees.
Pitch Float Rotation on the Y axis, in degrees.

Place Ghost Recipe

Response to the serverbound packet (Place Recipe), with the same recipe ID. Appears to be used to notify the UI.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x37 0x39

resource:
place_ghost_recipe
Play Client Window ID Byte VarInt
Recipe Identifier A recipe ID.
Recipe Display ID VarInt ID in the minecraft:recipe_display registry.
Recipe Data Varies Depends on Recipe Type; see below.

below

Recipe Book Add

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x44

resource:
recipe_book_add
Play Client Recipe Count VarInt Number of elements in the following array.
Recipes Recipe ID Array VarInt ID to assign to the recipe.
Display ID VarInt ID in the minecraft:recipe_display registry.
Group ID VarInt
Category ID VarInt ID in the minecraft:recipe_book_category registry.
Has Ingredients Boolean
Ingredient Count Optional VarInt Number of elements in the following array. Only present if Has Ingredients is true.
Ingredients Optional Array of ID Set IDs in the minecraft:item registry, or an inline definition. Only present if Has Ingredients is true.
Flags Byte 0x01: show notification; 0x02: highlight as new
Replace Boolean Replace or Add to known recipes

Recipe Book Remove

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x45

resource:
recipe_book_remove
Play Client Recipe Count VarInt Number of elements in the following array.
Recipes Array of VarInt IDs of recipes to remove.

Recipe Book Settings

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x46

resource:
recipe_book_settings
Play Client Crafting Recipe Book Open Boolean If true, then the crafting recipe book will be open when the player opens its inventory.
Crafting Recipe Book Filter Active Boolean If true, then the filtering option is active when the players opens its inventory.
Smelting Recipe Book Open Boolean If true, then the smelting recipe book will be open when the player opens its inventory.
Smelting Recipe Book Filter Active Boolean If true, then the filtering option is active when the players opens its inventory.
Blast Furnace Recipe Book Open Boolean If true, then the blast furnace recipe book will be open when the player opens its inventory.
Blast Furnace Recipe Book Filter Active Boolean If true, then the filtering option is active when the players opens its inventory.
Smoker Recipe Book Open Boolean If true, then the smoker recipe book will be open when the player opens its inventory.
Smoker Recipe Book Filter Active Boolean If true, then the filtering option is active when the players opens its inventory.

Respawn

Huh.png The following information needs to be added to this page:
Although the number of portal cooldown ticks is included in this packet, the whole portal usage process is still dictated entirely by the server. What kind of effect does this value have on the client, if any?

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.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x47 0x4C

resource:
respawn
Play Client Dimension Type VarInt The ID of type of dimension in the minecraft:dimension_type registry, defined by the Registry Data packet.
Dimension Name Identifier Name of the dimension being spawned into.
Hashed seed Long First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
Game mode Unsigned Byte 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
Previous Game mode Byte -1: Undefined (null), 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. The previous game mode. Vanilla client uses this for the debug (F3 + N & F3 + F4) game mode switch. (More information needed)
Is Debug Boolean True if the world is a debug mode world; debug mode worlds cannot be modified and have predefined blocks.
Is Flat Boolean True if the world is a superflat world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
Has death location Boolean If true, then the next two fields are present.
Death dimension Name Optional Identifier Name of the dimension the player died in.
Death location Optional Position The location that the player died at.
Portal cooldown VarInt The number of ticks until the player can use the portal again.
Sea level VarInt
Data kept Byte Bit mask. 0x01: Keep attributes, 0x02: Keep metadata. Tells which data should be kept on the client side once the player has respawned.

In the Notchian implementation, this is context dependent:

  • normal respawns (after death) keep no data;
  • exiting the end poem/credits keeps the attributes;
  • other dimension changes (portals or teleports) keep all data.

Warning.png 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).

Before 1.16, 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.

Set Cursor Item

Packet ID State Bound To Field Name Field Type Notes
0x5A Play Client Slot Data Slot

Update Time

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.

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 the time by 20 every second.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x64 0x6B

resource:
set_time
Play Client World Age Long In ticks; not changed by server commands.
Time of day Long The world (or region) time, in ticks. If negative the sun will stop moving at the Math.abs of the time.
Time of day increasing Boolean If true, the client should automatically advance the time of day according to its ticking rate.

Set Player Inventory Slot

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x66

resource:
set_player_inventory
Play Client Slot VarInt
Slot Data Slot

Synchronize Vehicle Position

Teleports the entity on the client without changing the reference point of movement deltas in future Update Entity Position packets. Seems to be used to make relative adjustments to vehicle positions; more information needed.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x77

resource:
teleport_entity
Play Client Entity ID VarInt
X Double
Y Double
Z Double
Velocity X Double
Velocity Y Double
Velocity Z Double
Yaw Float Rotation on the Y axis, in degrees.
Pitch Float Rotation on the Y axis, in degrees.
Flags Teleport Flags
On Ground Boolean

Update Recipes

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x77 0x7e

resource:
update_recipes
Play Client Num Recipes VarInt Number of elements in the following array.
Recipe Recipe ID Array Identifier
Type ID VarInt Enum The recipe type, see below.
Data Varies Additional data for the recipe.
Property Set Count VarInt Number of elements in the following array.
Property Sets Property Set ID Array Identifier
Item Count VarInt Number of elements in the following array.
Items Array of VarInt IDs in the minecraft:item registry.

Recipe types:

ID Type Description Data
0 minecraft:crafting_shaped Shaped crafting recipe. All items must be present in the same pattern (which may be flipped horizontally or translated). As follows:
Name Type Description
Group String (32767) Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
Category VarInt Enum Building = 0, Redstone = 1, Equipment = 2, Misc = 3
Width VarInt
Height VarInt
Ingredients Array of Ingredient Length is width * height. Indexed by x + (y * width).
Result Slot
Show notification Boolean Show a toast when the recipe is added.
1 minecraft:crafting_shapeless Shapeless crafting recipe. All items in the ingredient list must be present, but in any order/slot. As follows:
Name Type Description
Group String (32767) Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
Category VarInt Enum Building = 0, Redstone = 1, Equipment = 2, Misc = 3
Ingredient count VarInt Number of elements in the following array.
Ingredients Array of Ingredient.
Result Slot
2 minecraft:crafting_special_armordye Recipe for dying leather armor As follows:
Name Type Description
Category VarInt Enum Building = 0, Redstone = 1, Equipment = 2, Misc = 3
3 minecraft:crafting_special_bookcloning Recipe for copying contents of written books
4 minecraft:crafting_special_mapcloning Recipe for copying maps
5 minecraft:crafting_special_mapextending Recipe for adding paper to maps
6 minecraft:crafting_special_firework_rocket Recipe for making firework rockets
7 minecraft:crafting_special_firework_star Recipe for making firework stars
8 minecraft:crafting_special_firework_star_fade Recipe for making firework stars fade between multiple colors
9 minecraft:crafting_special_tippedarrow Recipe for crafting tipped arrows
10 minecraft:crafting_special_bannerduplicate Recipe for copying banner patterns
11 minecraft:crafting_special_shielddecoration Recipe for applying a banner's pattern to a shield
12 minecraft:crafting_special_shulkerboxcoloring Recipe for recoloring a shulker box
13 minecraft:crafting_special_suspiciousstew Recipe for crafting suspicious stews
14 minecraft:crafting_special_repairitem Recipe for repairing items via crafting
22 minecraft:crafting_decorated_pot Recipe for crafting decorated pots
15 minecraft:smelting Smelting recipe As follows:
Name Type Description
Group String (32767) Used to group similar recipes together in the recipe book.
Category VarInt Enum Food = 0, Blocks = 1, Misc = 2
Ingredient Ingredient
Result Slot
Experience Float
Cooking time VarInt
16 minecraft:blasting Blast furnace recipe
17 minecraft:smoking Smoker recipe
18 minecraft:campfire_cooking Campfire recipe
19 minecraft:stonecutting Stonecutter recipe As follows:
Name Type Description
Group String (32767) Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
Ingredient Ingredient
Result Slot
20 minecraft:smithing_transform Recipe for smithing netherite gear As follows:
Name Type Description
Template Ingredient The smithing template.
Base Ingredient The base item.
Addition Ingredient The additional ingredient.
Result Slot
21 minecraft:smithing_trim Recipe for applying armor trims As follows:
Name Type Description
Template Ingredient The smithing template.
Base Ingredient The base item.
Addition Ingredient The additional ingredient.

Ingredient is defined as:

Name Type Description
Count VarInt Number of elements in the following array.
Items Array of Slot Any item in this array may be used for the recipe. The count of each item should be 1.

Serverbound

Bundle Item Selected

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x02

resource:
bundle_item_selected
Play Server Slot of Bundle VarInt
Slot in Bundle VarInt

Client Tick End

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x0B

resource:
client_tick_end
Play Server no fields

Click Container

This packet is sent by the client when the player clicks on a slot in a window.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x0E 0x10

resource:
container_click
Play Server Window ID Unsigned Byte VarInt The ID of the window which was clicked. 0 for player inventory. The server ignores any packets targeting a Window ID other than the current one, including ignoring 0 when any other window is open.
State ID VarInt The last received State ID from either a Set Container Slot or a Set Container Content packet.
Slot Short The clicked slot number, see below.
Button Byte The button used in the click, see below.
Mode VarInt Enum Inventory operation mode, see below.
Length of the array VarInt Maximum value for Notchian server is 128 slots.
Array of changed slots Slot number Array (128) Short
Slot data Slot New data for this slot, in the client's opinion; see below.
Carried item Slot Item carried by the cursor. Has to be empty (item ID = -1) for drop mode, otherwise nothing will happen.

See Inventory for further information about how slots are indexed.

After performing the action, the server compares the results to the slot change information included in the packet, as applied on top of the server's view of the container's state prior to the action. For any slots that do not match, it sends Set Container Slot packets containing the correct results. If State ID does not match the last ID sent by the server, it will instead send a full Set Container Content to resynchronize the client.

When right-clicking on a stack of items, half the stack will be picked up and half left in the slot. If the stack is an odd number, the half left in the slot will be smaller of the amounts.

The distinct type of click performed by the client is determined by the combination of the Mode and Button fields.

Mode Button Slot Trigger
0 0 Normal Left mouse click
1 Normal Right mouse click
0 -999 Left click outside inventory (drop cursor stack)
1 -999 Right click outside inventory (drop cursor single item)
1 0 Normal Shift + left mouse click
1 Normal Shift + right mouse click (identical behavior)
2 0 Normal Number key 1
1 Normal Number key 2
2 Normal Number key 3
8 Normal Number key 9
Button is used as the slot index (impossible in vanilla clients)
40 Normal Offhand swap key F
3 2 Normal Middle click, only defined for creative players in non-player inventories.
4 0 Normal* Drop key (Q) (* Clicked item is always empty)
1 Normal* Control + Drop key (Q) (* Clicked item is always empty)
5 0 -999 Starting left mouse drag
4 -999 Starting right mouse drag
8 -999 Starting middle mouse drag, only defined for creative players in non-player inventories.
1 Normal Add slot for left-mouse drag
5 Normal Add slot for right-mouse drag
9 Normal Add slot for middle-mouse drag, only defined for creative players in non-player inventories.
2 -999 Ending left mouse drag
6 -999 Ending right mouse drag
10 -999 Ending middle mouse drag, only defined for creative players in non-player inventories.
6 0 Normal Double click
1 Normal Pickup all but check items in reverse order (impossible in vanilla clients)

Starting from version 1.5, “painting mode” is available for use in inventory windows. It is done by picking up stack of something (more than 1 item), then holding mouse button (left, right or middle) and dragging held stack over empty (or same type in case of right button) slots. In that case client sends the following to server after mouse button release (omitting first pickup packet which is sent as usual):

  1. packet with mode 5, slot -999, button (0 for left | 4 for right);
  2. packet for every slot painted on, mode is still 5, button (1 | 5);
  3. packet with mode 5, slot -999, button (2 | 6);

If any of the painting packets other than the “progress” ones are sent out of order (for example, a start, some slots, then another start; or a left-click in the middle) the painting status will be reset.

Close Container

This packet is sent by the client when closing a window.

Notchian clients send a Close Window packet with Window ID 0 to close their inventory even though there is never an Open Screen packet for the inventory.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x0F 0x11

resource:
container_close
Play Server Window ID Unsigned Byte VarInt This is the ID of the window that was closed. 0 for player inventory.

Edit Book

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x14 0x16

resource:
edit_book
Play Server Slot VarInt The hotbar slot where the written book is located
Count VarInt Number of elements in the following array. Maximum array size is 200 100.
Entries Array (200 100) of String (8192 1024) Text from each page. Maximum string length is 8192 1024 chars.
Has title Boolean If true, the next field is present. true if book is being signed, false if book is being edited.
Title Optional String (128 32) Title of book.

Set Player Position

Updates the player's XYZ position on the server.

If the player is in a vehicle, the position is ignored (but in case of Set Player Position and Rotation, the rotation is still used as normal). No validation steps other than value range clamping are performed in this case.

If the player is sleeping, the position (or rotation) is not changed, and a Synchronize Player Position is sent if the received position deviated from the server's view by more than a meter.

The Notchian server silently clamps the x and z coordinates between -30,000,000 and 30,000,000, and the y coordinate between -20,000,000 and 20,000,000. A similar condition has historically caused a kick for "Illegal position"; this is no longer the case. However, infinite or NaN coordinates (or angles) still result in a kick for multiplayer.disconnect.invalid_player_movement.

As of 1.20.6, checking for moving too fast is achieved like this (sic):

  • Each server tick, the player's current position is stored.
  • When the player moves, the offset from the stored position to the requested position is computed (Δx, Δy, Δz).
  • The requested movement distance squared is computed as Δx² + Δy² + Δz².
  • The baseline expected movement distance squared is computed based on the player's server-side velocity as Vx² + Vy² + Vz². The player's server-side velocity is a somewhat ill-defined quantity that includes among other things gravity, jump velocity and knockback, but not regular horizontal movement. A proper description would bring much of Minecraft's physics engine with it. It is accessible as the Motion NBT tag on the player entity.
  • The maximum permitted movement distance squared is computed as 100 (300 if the player is using an elytra), multiplied by the number of movement packets received since the last tick, including this one, unless that value is greater than 5, in which case no multiplier is applied.
  • If the requested movement distance squared minus the baseline distance squared is more than the maximum squared, the player is moving too fast.

If the player is moving too fast, it is logged that "<player> moved too quickly! " followed by the change in x, y, and z, and the player is teleported back to their current (before this packet) server-side position.

Checking for block collisions is achieved like this:

  • A temporary collision-checked move of the player is attempted from its current position to the requested one.
  • The offset from the resulting position to the requested position is computed. If the absolute value of the offset on the y axis is less than 0.5, it (only the y component) is rounded down to 0.
  • If the magnitude of the offset is greater than 0.25 and the player isn't in creative or spectator mode, it is logged that "<player> moved wrongly!", and the player is teleported back to their current (before this packet) server-side position.
  • In addition, if the player's hitbox stationary at the requested position would intersect with a block, and they aren't in spectator mode, they are teleported back without a log message.

Checking for illegal flight is achieved like this:

  • When a movement packet is received, a flag indicating whether or not the player is floating mid-air is updated. The flag is set if the move test described above detected no collision below the player and the y component of the offset from the player's current position to the requested one is greater than -0.5, unless any of various conditions permitting flight (creative mode, elytra, levitation effect, etc., but not jumping) are met.
  • Each server tick, it is checked if the flag has been set for more than 80 consecutive ticks. If so, and the player isn't currently sleeping, dead or riding a vehicle, they are kicked for multiplayer.disconnect.flying.
Packet ID State Bound To Field Name Field Type Notes
protocol:
0x1A 0x1C

resource:
move_player_pos
Play Server X Double Absolute position.
Feet Y Double Absolute feet position, normally Head Y - 1.62.
Z Double Absolute position.
On Ground Boolean True if the client is on the ground, false otherwise.
Flags Byte Bit field: 0x01: on ground, 0x02: pushing against wall.

Set Player Position and Rotation

A combination of Move Player Rotation and Move Player Position.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x1B 0x1D

resource:
move_player_pos_rot
Play Server X Double Absolute position.
Feet Y Double Absolute feet position, normally Head Y - 1.62.
Z Double Absolute position.
Yaw Float Absolute rotation on the X Axis, in degrees.
Pitch Float Absolute rotation on the Y Axis, in degrees.
On Ground Boolean True if the client is on the ground, false otherwise.
Flags Byte Bit field: 0x01: on ground, 0x02: pushing against wall.

Set Player Rotation

The unit circle for yaw
The unit circle of yaw, redrawn

Updates the direction the player is looking in.

Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0,-1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.

Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.

The yaw and pitch of player (in degrees), standing at point (x0, y0, z0) and looking towards point (x, y, z) can be calculated with:

dx = x-x0
dy = y-y0
dz = z-z0
r = sqrt( dx*dx + dy*dy + dz*dz )
yaw = -atan2(dx,dz)/PI*180
if yaw < 0 then
    yaw = 360 + yaw
pitch = -arcsin(dy/r)/PI*180

You can get a unit vector from a given yaw/pitch via:

x = -cos(pitch) * sin(yaw)
y = -sin(pitch)
z =  cos(pitch) * cos(yaw)
Packet ID State Bound To Field Name Field Type Notes
protocol:
0x1C 0x1E

resource:
move_player_rot
Play Server Yaw Float Absolute rotation on the X Axis, in degrees.
Pitch Float Absolute rotation on the Y Axis, in degrees.
On Ground Boolean True if the client is on the ground, false otherwise.
Flags Byte Bit field: 0x01: on ground, 0x02: pushing against wall.

Set Player On Ground Movement Flags

This packet as well as Set Player Position, Set Player Rotation, and Set Player Position and Rotation are called the “serverbound movement packets”. Vanilla clients will send Move Player Position once every 20 ticks even for a stationary player.

This packet is used to indicate whether the player is on ground (walking/swimming), or airborne (jumping/falling).

When dropping from sufficient height, fall damage is applied when this state goes from false to true. The amount of damage applied is based on the point where it last changed from true to false. Note that there are several movement related packets containing this state.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x1D 0x1F

resource:
move_player_status_only
Play Server On Ground Boolean True if the client is on the ground, false otherwise.
Flags Byte Bit field: 0x01: on ground, 0x02: pushing against wall.

Place Recipe

This packet is sent when a player clicks a recipe in the crafting book that is craftable (white border).

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x22 0x24

resource:
place_recipe
Play Server Window ID Byte
Recipe ID Identifier VarInt A recipe ID. ID of recipe previously defined in Recipe Book Add.
Make all Boolean Affects the amount of items processed; true if shift is down when clicked.

Player Input

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x26 0x28

resource:
player_input
Play Server Sideways Float Positive to the left of the player.
Forward Float Positive forward.
Flags Unsigned Byte Bit mask. 0x1: jump, 0x2: unmount. ; see below.

The flags are as follows:

Hex Mask Field
0x01 Forward
0x02 Backward
0x04 Left
0x08 Right
0x10 Jump
0x20 Sneak
0x40 Sprint

Set Seen Recipe

Sent when recipe is first seen in recipe book. Replaces Recipe Book Data, type 0.

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x29 0x2B

resource:
recipe_book_seen_recipe
Play Server Recipe ID Identifier VarInt ID of recipe previously defined in Recipe Book Add.

Use Item On

Packet ID State Bound To Field Name Field Type Notes
protocol:
0x38 0x3A

resource:
use_item_on
Play Server Hand VarInt Enum The hand from which the block is placed; 0: main hand, 1: off hand.
Location Position Block position.
Face VarInt Enum The face on which the block is placed (as documented at Player Action).
Cursor Position X Float The position of the crosshair on the block, from 0 to 1 increasing from west to east.
Cursor Position Y Float The position of the crosshair on the block, from 0 to 1 increasing from bottom to top.
Cursor Position Z Float The position of the crosshair on the block, from 0 to 1 increasing from north to south.
Inside block Boolean True when the player's head is inside of a block.
World border hit Boolean Seems to always be false, even when interacting with blocks around or outside the world border, or while the player is outside the border.
Sequence VarInt Block change sequence number (see #Acknowledge Block Change).

Upon placing a block, this packet is sent once.

The Cursor Position X/Y/Z fields (also known as in-block coordinates) are calculated using raytracing. The unit corresponds to sixteen pixels in the default resource pack. For example, let's say a slab is being placed against the south face of a full block. The Cursor Position X will be higher if the player was pointing near the right (east) edge of the face, lower if pointing near the left. The Cursor Position Y will be used to determine whether it will appear as a bottom slab (values 0.0–0.5) or as a top slab (values 0.5-1.0). The Cursor Position Z should be 1.0 since the player was looking at the southernmost part of the block.

Inside block is true when a player's head (specifically eyes) are inside of a block's collision. In 1.13 and later versions, collision is rather complicated and individual blocks can have multiple collision boxes. For instance, a ring of vines has a non-colliding hole in the middle. This value is only true when the player is directly in the box. In practice, though, this value is only used by scaffolding to place in front of the player when sneaking inside of it (other blocks will place behind when you intersect with them -- try with glass for instance).