Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
(1.14.2 Pre-Release 4)
 
(394 intermediate revisions by 36 users not shown)
Line 1: Line 1:
This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently [[Protocol version numbers|1.13.2, protocol 404]]) to the current pre-release (currently [[Protocol version numbers|1.14.2 Pre-Release 3, protocol 484]]). 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 ===
  
==== Position ====
+
{| class="wikitable"
 
+
|-
64-bit value split in to three parts
+
! Name
 +
! Size (bytes)
 +
! Encodes
 +
! Notes
 +
|- {{added}}
 +
! id=Type:Teleport_Flags | {{Type|Teleport Flags}}
 +
| 4
 +
| See [[#Teleport Flags]]
 +
| Bit field specifying how a teleportation is to be applied on each axis.
 +
|- {{added}}
 +
! id=Type:Recipe_Display | {{Type|Recipe Display}}
 +
| Varies
 +
| See [[Recipes#Recipe Display structure]]
 +
| Description of a recipe for use for use by the client.
 +
|}
  
* x: 26 MSBs
+
==== Teleport Flags ====
* z: 26 {{change|LSBs|middle bits}}
 
* y: 12 {{change|bits between them|LSBs}}
 
  
Encoded as followed:
+
A bit field represented as an {{Type|Int}}, specifying how a teleportation is to be applied on each axis.
 
 
((x & 0x3FFFFFF) << 38) | {{change|((y & 0xFFF) << 26) {{!}} (z & 0x3FFFFFF)|((z & 0x3FFFFFF) << 12) {{!}} (y & 0xFFF)}}
 
 
 
And decoded as:
 
 
 
val = read_unsigned_long();
 
x = val >> 38;
 
y = {{change|(val >> 26) & 0xFFF|val & 0xFFF}};
 
z = {{change|val << 38 >> 38|(val << 26 >> 38)}};
 
 
 
Note: The details of bit shifting are rather language dependent; the above may work in Java but probably won't in other languages without some tweaking. In particular, you will usually receive positive numbers even if the actual coordinates are negative. This can be fixed by adding something like the following:
 
 
 
if x >= 2^25 { x -= 2^26 }
 
if y >= 2^11 { y -= 2^12 }
 
if z >= 2^25 { z -= 2^26 }
 
 
 
==== Particle ====
 
  
 +
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"
 
{| class="wikitable"
 
  |-
 
  |-
  ! Particle Name
+
  ! Hex Mask
  ! Particle ID
+
  ! Field
! Data
 
 
  |-
 
  |-
  | <code>minecraft:falling_lava</code>
+
  | 0x0001
  | {{change||10}}
+
  | Relative X
| None
 
 
  |-
 
  |-
  | <code>minecraft:landing_lava</code>
+
  | 0x0002
  | {{change||11}}
+
  | Relative Y
| None
 
 
  |-
 
  |-
  | <code>minecraft:dripping_water</code>
+
  | 0x0004
  | {{change|10|12}}
+
  | Relative Z
| None
 
 
  |-
 
  |-
  | <code>minecraft:falling_water</code>
+
  | 0x0008
  | {{change||13}}
+
  | Relative Yaw
| None
 
 
  |-
 
  |-
  | <code>minecraft:dust</code>
+
  | 0x0010
  | {{change|11|14}}
+
  | Relative Pitch
  | None
+
|- {{added}}
  |-
+
  | 0x0020
  | <code>minecraft:effect</code>
+
| Relative Velocity X
  | {{change|12|15}}
+
  |- {{added}}
  | None
+
| 0x0040
  |-
+
  | Relative Velocity Y
| <code>minecraft:elder_guardian</code>
+
  |- {{added}}
  | {{change|13|16}}
+
  | 0x0080
  | None
+
  | Relative Velocity Z
  |-
+
  |- {{added}}
  | <code>minecraft:enchanted_hit</code>
+
  | 0x0100
| {{change|14|17}}
+
  | Rotate velocity according to the change in rotation, ''before'' applying the velocity change in this packet. Combining this with absolute rotation works as expected&mdash;the difference in rotation is still used.
  | None
+
  |}
 +
 
 +
=== Packets ===
 +
 
 +
{| class="wikitable"
 +
! ID
 +
! Packet name
 +
  !colspan="2"| Documentation
 
  |-
 
  |-
  | <code>minecraft:enchant</code>
+
  !colspan="4"| Play clientbound
  | {{change|15|18}}
+
  {{PacketList|0x12|Close Container}}
  | None
+
{{PacketList|0x13|Set Container Content}}
 +
{{PacketList|0x14|Set Container Property}}
 +
{{PacketList|0x15|Set Container Slot}}
 +
{{PacketList|0x17|Set Cooldown}}
 +
{{PacketList|{{change|0x70|0x20}}|Teleport Entity}}
 +
{{PacketList|{{change|0x20|0x21}}|Explosion}}
 +
{{PacketList|{{change|0x23|0x24}}|Open Horse Screen}}
 +
{{PacketList|{{change|0x2B|0x2C}}|Login (play)}}
 +
{{PacketList|0x31|Move Minecart Along Track|rel=added}}
 +
{{PacketList|{{change|0x37|0x39}}|Place Ghost Recipe}}
 +
{{PacketList|{{change|0x3E|0x40}}|Player Info Update}}
 +
{{PacketList|{{change|0x40|0x42}}|Synchronize Player Position}}
 +
{{PacketList|0x41|Update Recipe Book|pre=removed}}
 +
  {{PacketList|0x43|Player Rotation|rel=added}}
 +
{{PacketList|0x44|Recipe Book Add|rel=added}}
 +
{{PacketList|0x45|Recipe Book Remove|rel=added}}
 +
{{PacketList|0x46|Recipe Book Settings|rel=added}}
 +
{{PacketList|{{change|0x47|0x4C}}|Respawn}}
 +
{{PacketList|0x5a|Set Cursor Item|rel=added}}
 +
{{PacketList|{{change|0x53|0x63}}|Set Held Item|pre=unchanged}}
 +
{{PacketList|0x66|Set Player Inventory Slot|rel=added}}
 +
{{PacketList|{{change|0x64|0x6b}}|Update Time}}
 +
{{PacketList|0x77|Synchronize Vehicle Position|rel=added}}
 +
{{PacketList|{{change|0x77|0x7e}}|Update Recipes}}
 
  |-
 
  |-
  | <code>minecraft:end_rod</code>
+
  !colspan="4"| Play serverbound
  | {{change|16|19}}
+
  {{PacketList|0x02|Bundle Item Selected|rel=added}}
  | None
+
{{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}}
 +
  |}
 +
 
 +
== Entity Metadata ==
 +
 
 +
=== Entity Metadata Format ===
 +
 
 +
==== Painting Variant ====
 +
 
 +
{{See also|Registry Data#Painting Variant}}
 +
 
 +
{| class="wikitable"
 +
! Name
 +
! Type
 +
! Meaning
 
  |-
 
  |-
  | <code>minecraft:entity_effect</code>
+
  | Width
  | {{change|17|20}}
+
  | {{Type|Int}}
  | None
+
  | The width of the painting, in blocks.
 
  |-
 
  |-
  | <code>minecraft:explosion_emitter</code>
+
  | Height
  | {{change|18|21}}
+
  | {{Type|Int}}
  | None
+
  | The height of the painting, in blocks.
 
  |-
 
  |-
  | <code>minecraft:explosion</code>
+
  | Asset ID
  | {{change|19|22}}
+
| {{Type|Identifier}}
  | None
+
| The texture for the painting.
  |-
+
The Notchian client uses the corresponding asset located at
  | <code>minecraft:falling_dust</code>
+
<code>textures/painting</code>.
  | {{change|20|23}}
+
  |- {{added}}
  | None
+
| Has title
  |-
+
| {{Type|Boolean}}
  | <code>minecraft:firework</code>
+
  |
  | {{change|21|24}}
+
  |- {{added}}
  | None
+
  | Title
  |-
+
  | {{Type|Optional}} {{Type|Text Component}}
  | <code>minecraft:fishing</code>
+
  | The displayed title of the painting. Only present if Has title is true.
| {{change|22|25}}
+
  |- {{added}}
  | None
+
  | Has author
 +
  | {{Type|Boolean}}
 +
|
 +
|- {{added}}
 +
  | Author
 +
| {{Type|Optional}} {{Type|Text Component}}
 +
  | The displayed author of the painting. Only present if Has author is true.
 +
  |}
 +
 
 +
== Registry Data ==
 +
 
 +
=== Painting Variant ===
 +
 
 +
The <code>minecraft:painting_variant</code> registry. It defines the textures and dimensions for the game's paintings.
 +
 
 +
{| class="wikitable"
 +
! Name
 +
! Type
 +
! Meaning
 +
  ! Values
 
  |-
 
  |-
  | <code>minecraft:flame</code>
+
  | asset_id
  | {{change|23|26}}
+
| [[NBT#Specification:string_tag|String Tag]]
| None
+
| The texture for the painting.
 +
The Notchian client uses the corresponding asset located at
 +
<code>textures/painting</code>.
 +
  | Example: "minecraft:backyard".
 
  |-
 
  |-
  | <code>minecraft:flash</code>
+
  | height
  | {{change||27}}
+
  | [[NBT#Specification:int_tag|Int Tag]]
  | None
+
| The height of the painting, in blocks.
 +
  | Example: <code>2</code>
 
  |-
 
  |-
  | <code>minecraft:happy_villager</code>
+
  | width
  | {{change|24|28}}
+
  | [[NBT#Specification:int_tag|Int Tag]]
  | None
+
| The width of the painting, in blocks.
  |-
+
  |
  | <code>minecraft:composter</code>
+
  |- {{added}}
  | {{change||29}}
+
  | title
  | None
+
  | [[NBT#Specification:compound_tag|Compound Tag]] or [[NBT#Specification:string_tag|String Tag]]
|-
+
  | The displayed title of the painting. See [[Text formatting]].
  | <code>minecraft:heart</code>
+
  | Example: <code>{"color": "gray", "translate": "painting.minecraft.skeleton.title"}</code>
  | {{change|25|30}}
+
  |- {{added}}
  | None
+
  | author
  |-
+
  | [[NBT#Specification:compound_tag|Compound Tag]] or [[NBT#Specification:string_tag|String Tag]]
  | <code>minecraft:instant_effect</code>
+
| The displayed author of the painting. See [[Text formatting]].
  | {{change|26|31}}
+
  | Example: <code>{"color": "gray", "translate": "painting.minecraft.skeleton.author"}</code>
  | None
+
  |}
  |-
+
 
  | <code>minecraft:item</code>
+
== Slot Data ==
  | {{change|27|32}}
+
 
  | None
+
=== Structured components ===
|-
+
 
  | <code>minecraft:item_slime</code>
+
{| class="wikitable"
  | {{change|28|33}}
+
! Type
| None
+
  ! Name
|-
+
  ! Description
  | <code>minecraft:item_snowball</code>
+
  ! style="width: 50%" | Data
| {{change|29|34}}
+
  |- {{added}}
| None
+
  | 6
|-
+
  | <code>minecraft:item_model</code>
| <code>minecraft:large_smoke</code>
+
  | Item's model.
| {{change|30|35}}
+
  | As follows:
| None
+
  {| class="wikitable" {{added}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    | Model
 +
    | {{Type|Identifier}}
 +
    |
 +
    |}
 
  |-
 
  |-
  | <code>minecraft:lava</code>
+
| {{change|20|21}}
  | {{change|31|36}}
+
  | <code>minecraft:food</code>
  | None
+
  | Makes the item {{change|consumable|restore the player's hunger bar when consumed}}.
|-
+
  | As follows:
| <code>minecraft:mycelium</code>
+
  {| class="wikitable"
| {{change|32|37}}
+
    ! colspan="2"| Name
| None
+
    ! colspan="2"| Type
|-
+
    ! Description
| <code>minecraft:note</code>
+
    |-
| {{change|33|38}}
+
    | colspan="2"| Nutrition
| None
+
    | colspan="2"| {{Type|VarInt}}
|-
+
    | Non-negative
| <code>minecraft:poof</code>
+
    |-
| {{change|34|39}}
+
    | colspan="2"| Saturation Modifier
| None
+
    | colspan="2"| {{Type|Float}}
|-
+
    | How much saturation will be given after consuming the item.
| <code>minecraft:portal</code>
+
    |-
| {{change|35|40}}
+
    | colspan="2"| Can Always Eat
| None
+
    | colspan="2"| {{Type|Boolean}}
|-
+
    | Whether the item can always be eaten, even at full hunger.
| <code>minecraft:rain</code>
+
    |- {{removed}}
| {{change|36|41}}
+
    | colspan="2"| Seconds To Eat
| None
+
    | colspan="2"| {{Type|Float}}
|-
+
    | How long it takes to consume the item.
| <code>minecraft:smoke</code>
+
    |- {{removed}}
| {{change|37|42}}
+
    | colspan="2"| Using converts to
| None
+
    | 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.
| <code>minecraft:sneeze</code>
+
    |- {{removed}}
| {{change||43}}
+
    | colspan="2"| Number of effects
| None
+
    | colspan="2"| {{Type|VarInt}}
|-
+
    | Number of elements in the following array.
| <code>minecraft:spit</code>
+
    |- {{removed}}
| {{change|38|44}}
+
    | rowspan="2"| Effect
  | None
+
    | Type ID
  |-
+
    | rowspan="2"| {{Type|Array}}
  | <code>minecraft:squid_ink</code>
+
    | [[#Potion_Effect|Potion Effect]]
  | {{change|39|45}}
+
    | The potion effect. See [[#Potion_Effect|Potion Effect]].
| None
+
    |- {{removed}}
|-
+
    | Probability
| <code>minecraft:sweep_attack</code>
+
    | {{Type|Float}}
| {{change|40|46}}
+
    | The probability for this effect to be chosen.
| None
+
    |}
|-
+
  |- {{added}}
| <code>minecraft:totem_of_undying</code>
+
  | 22
| {{change|41|47}}
+
  | <code>minecraft:consumable</code>
| None
+
  | Makes the item consumable.
|-
+
| As follows:
| <code>minecraft:underwater</code>
+
  {| class="wikitable" {{added}}
| {{change|42|48}}
+
    ! Name
| None
+
    ! Type
|-
+
    ! Description
| <code>minecraft:splash</code>
+
    |-
| {{change|43|49}}
+
    | Consume seconds
| None
+
    | {{Type|Float}}
|-
+
    | How long it takes to consume the item.
| <code>minecraft:witch</code>
+
    |-
| {{change|44|50}}
+
    | Animation
| None
+
    | {{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
| <code>minecraft:bubble_pop</code>
+
    |-
| {{change|45|51}}
+
    | Sound
  | None
+
    | {{Type|ID or}} {{Type|Sound Event}}
  |-
+
    | ID in the <code>minecraft:sound_event</code> registry, or an inline definition.
  | <code>minecraft:current_down</code>
+
    |-
  | {{change|46|52}}
+
    | Has consume particles
| None
+
    | {{Type|Boolean}}
|-
+
    |  
| <code>minecraft:bubble_column_up</code>
+
    |-
| {{change|47|53}}
+
    | Number of effects
  | None
+
    | {{Type|VarInt}}
  |-
+
    | Number of elements in the following array.
  | <code>minecraft:nautilus</code>
+
    |-
  | {{change|48|54}}
+
    | Effects
| None
+
    | {{Type|Array}} of [[#Consume Effect|Consume Effect]]
|-
+
    | Effects to apply on consumption. See [[#Consume Effect|Consume Effect]].
| <code>minecraft:dolphin</code>
+
    |}
| {{change|49|55}}
+
  |- {{added}}
| None
+
  | 23
|-
+
  | <code>minecraft:use_remainder</code>
| <code>minecraft:campfire_cosy_smoke</code>
+
  | This specifies the item produced after using the current item. In the Notchian server, this is used for stews, which turn into bowls.
| {{change||56}}
+
| As follows:
| None
+
  {| 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.
 +
    |}
 
  |-
 
  |-
| <code>minecraft:campfire_signal_smoke</code>
+
  | {{change|21|25}}
  | {{change||57}}
+
  | <code>minecraft:{{change|fire|damage}}_resistant</code>
  | None
+
  | 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}}
=== Packets ===
+
    ! Name
 
+
    ! Type
{| class="wikitable"
+
    ! Description
! ID
+
    |-
! Packet name
+
    | Types
!colspan="2"| Documentation
+
    | {{Type|Identifier}}
|-
+
    | Tag specifying damage types the item is immune to. Not prefixed by '#'!.
!colspan="4"| Handshaking serverbound
+
    |}
{{PacketList|0x00|Handshake}}
+
|- {{added}}
  |-
+
| 27
!colspan="4"| Play clientbound
+
| <code>minecraft:enchantable</code>
{{PacketList|0x00|Spawn Object}}
+
| Allows the item to be enchanted by an enchanting table.
{{PacketList|0x01|Spawn Experience Orb|pre=unchanged}}
+
| As follows:
{{PacketList|0x02|Spawn Global Entity|pre=unchanged}}
+
  {| class="wikitable" {{added}}
{{PacketList|0x03|Spawn Mob|pre=unchanged}}
+
    ! Name
{{PacketList|0x04|Spawn Painting|pre=unchanged}}
+
    ! Type
{{PacketList|0x05|Spawn Player|pre=unchanged}}
+
    ! Description
{{PacketList|0x06|Animation (clientbound)|pre=unchanged}}
+
    |-
{{PacketList|0x07|Statistics|pre=unchanged}}
+
    | Value
{{PacketList|0x08|Block Break Animation|pre=unchanged}}
+
    | {{Type|VarInt}}
{{PacketList|0x09|Update Block Entity}}
+
    | Opaque internal value controlling how expensive enchantments may be offered.
{{PacketList|0x0A|Block Action|pre=unchanged}}
+
    |}
{{PacketList|0x0B|Block Change|pre=unchanged}}
+
|- {{added}}
{{PacketList|0x0C|Boss Bar|pre=unchanged}}
+
| 28
{{PacketList|0x0D|Server Difficulty}}
+
| <code>minecraft:equippable</code>
{{PacketList|0x0E|Chat Message (clientbound)|pre=unchanged}}
+
| Allows the item to be equipped by the player.
{{PacketList|0x0F|Multi Block Change|pre=unchanged}}
+
| As follows:
{{PacketList|0x10|Tab-Complete (clientbound)|pre=unchanged}}
+
  {| class="wikitable" {{added}}
{{PacketList|0x11|Declare Commands|pre=unchanged}}
+
    ! Name
{{PacketList|0x12|Confirm Transaction (clientbound)|pre=unchanged}}
+
    ! Type
{{PacketList|0x13|Close Window (clientbound)|pre=unchanged}}
+
    ! Description
{{PacketList|{{change|0x15|0x14}}|Window Items|pre=unchanged}}
+
    |-
{{PacketList|{{change|0x16|0x15}}|Window Property|pre=unchanged}}
+
    | Slot
{{PacketList|{{change|0x17|0x16}}|Set Slot|pre=unchanged}}
+
    | {{Type|VarInt}} {{Type|Enum}}
{{PacketList|{{change|0x18|0x17}}|Set Cooldown|pre=unchanged}}
+
    | 0: mainhand, 1: feet, 2: legs, 3: chest, 4: head, 5: offhand, 6: body
{{PacketList|{{change|0x19|0x18}}|Plugin Message (clientbound)}}
+
    |-
{{PacketList|{{change|0x1A|0x19}}|Named Sound Effect|pre=unchanged}}
+
    | Equip sound
{{PacketList|{{change|0x1B|0x1A}}|Disconnect (play)|pre=unchanged}}
+
    | {{Type|ID or}} {{Type|Sound Event}}
{{PacketList|{{change|0x1C|0x1B}}|Entity Status|pre=unchanged}}
+
    | ID in the <code>minecraft:sound_event</code> registry, or an inline definition.
{{PacketList|{{change|0x1E|0x1C}}|Explosion|pre=unchanged}}
+
    |-
{{PacketList|{{change|0x1F|0x1D}}|Unload Chunk|pre=unchanged}}
+
    | Has model
{{PacketList|{{change|0x20|0x1E}}|Change Game State|pre=unchanged}}
+
    | {{Type|Boolean}}
{{PacketList|0x1F|Open Horse Window|rel=added}}
+
    |
{{PacketList|{{change|0x21|0x20}}|Keep Alive (clientbound)|pre=unchanged}}
+
    |-
{{PacketList|{{change|0x22|0x21}}|Chunk Data}}
+
    | Model
{{PacketList|{{change|0x23|0x22}}|Effect|pre=unchanged}}
+
    | {{Type|Optional}} {{Type|Identifier}}
{{PacketList|{{change|0x24|0x23}}|Particle|pre=unchanged}}
+
    | Only present if Has model is true.
{{PacketList|0x24|Update Light|rel=added}}
+
    |-
{{PacketList|0x25|Join Game}}
+
    | Has camera overlay
{{PacketList|0x26|Map Data}}
+
    | {{Type|Boolean}}
{{PacketList|0x27|Trade List|rel=added}}
+
    |
{{PacketList|0x28|Entity Relative Move|pre=unchanged}}
+
    |-
{{PacketList|0x29|Entity Look And Relative Move|pre=unchanged}}
+
    | Camera overlay
{{PacketList|0x2A|Entity Look|pre=unchanged}}
+
    | {{Type|Optional}} {{Type|Identifier}}
{{PacketList|{{change|0x27|0x2B}}|Entity|pre=unchanged}}
+
    | Only present if Has camera overlay is true.
{{PacketList|{{change|0x2B|0x2C}}|Vehicle Move (clientbound)|pre=unchanged}}
+
    |-
{{PacketList|0x2D|Open Book|rel=added}}
+
    | Has allowed entities
{{PacketList|{{change|0x14|0x2E}}|Open Window}}
+
    | {{Type|Boolean}}
{{PacketList|{{change|0x2C|0x2F}}|Open Sign Editor|pre=unchanged}}
+
    |-
{{PacketList|{{change|0x2D|0x30}}|Craft Recipe Response|pre=unchanged}}
+
    | Allowed entities
{{PacketList|{{change|0x2E|0x31}}|Player Abilities (clientbound)|pre=unchanged}}
+
    | {{Type|Optional}} {{Type|ID Set}}
{{PacketList|{{change|0x2F|0x32}}|Combat Event|pre=unchanged}}
+
    | IDs in the <code>minecraft:entity_type</code> registry. Only present if Has allowed entities is true.
{{PacketList|{{change|0x33}}|Use Bed|pre=removed}}
+
    |-
{{PacketList|{{change|0x30|0x33}}|Player Info|pre=unchanged}}
+
    | Dispensable
{{PacketList|{{change|0x31|0x34}}|Face Player|pre=unchanged}}
+
    | {{Type|Boolean}}
{{PacketList|{{change|0x32|0x35}}|Player Position And Look (clientbound)|pre=unchanged}}
+
    |
{{PacketList|{{change|0x34|0x36}}|Unlock Recipes|pre=unchanged}}
+
    |-
{{PacketList|{{change|0x35|0x37}}|Destroy Entities|pre=unchanged}}
+
    | Swappable
{{PacketList|{{change|0x36|0x38}}|Remove Entity Effect|pre=unchanged}}
+
    | {{Type|Boolean}}
{{PacketList|{{change|0x37|0x39}}|Resource Pack Send|pre=unchanged}}
+
    |
{{PacketList|{{change|0x38|0x3A}}|Respawn}}
+
    |-
{{PacketList|{{change|0x39|0x3B}}|Entity Head Look|pre=unchanged}}
+
    | Damage on hurt
{{PacketList|{{change|0x3A|0x3C}}|Select Advancement Tab|pre=unchanged}}
+
    | {{Type|Boolean}}
{{PacketList|{{change|0x3B|0x3D}}|World Border|pre=unchanged}}
+
    |
{{PacketList|{{change|0x3C|0x3E}}|Camera|pre=unchanged}}
+
    |}
{{PacketList|{{change|0x3D|0x3F}}|Held Item Change (clientbound)|pre=unchanged}}
+
|- {{added}}
{{PacketList|0x40|Update View Position|rel=added}}
+
| 29
{{PacketList|0x41|Update View Distance|rel=added}}
+
  | <code>minecraft:repairable</code>
{{PacketList|{{change|0x3E|0x42}}|Display Scoreboard|pre=unchanged}}
+
| Items that can be combined with this item in an anvil to repair it.
{{PacketList|{{change|0x3F|0x43}}|Entity Metadata|pre=unchanged}}
+
| As follows:
{{PacketList|{{change|0x40|0x44}}|Attach Entity|pre=unchanged}}
+
  {| class="wikitable" {{added}}
{{PacketList|{{change|0x41|0x45}}|Entity Velocity|pre=unchanged}}
+
    ! Name
{{PacketList|{{change|0x42|0x46}}|Entity Equipment|pre=unchanged}}
+
    ! Type
{{PacketList|{{change|0x43|0x47}}|Set Experience|pre=unchanged}}
+
    ! Description
{{PacketList|{{change|0x44|0x48}}|Update Health|pre=unchanged}}
+
    |-
{{PacketList|{{change|0x45|0x49}}|Scoreboard Objective|pre=unchanged}}
+
    | Items
{{PacketList|{{change|0x46|0x4A}}|Set Passengers|pre=unchanged}}
+
    | {{Type|ID Set}}
{{PacketList|{{change|0x47|0x4B}}|Teams|pre=unchanged}}
+
    | IDs in the <code>minecraft:item</code> registry.
{{PacketList|{{change|0x48|0x4C}}|Update Score|pre=unchanged}}
+
    |}
{{PacketList|{{change|0x49|0x4D}}|Spawn Position|pre=unchanged}}
+
|- {{added}}
{{PacketList|{{change|0x4A|0x4E}}|Time Update|pre=unchanged}}
+
| 30
{{PacketList|{{change|0x4B|0x4F}}|Title|pre=unchanged}}
+
| <code>minecraft:glider</code>
{{PacketList|0x50|Entity Sound Effect}}
+
| Makes the item function like elytra.
{{PacketList|{{change|0x4D|0x51}}|Sound Effect|pre=unchanged}}
+
| None.
{{PacketList|{{change|0x4C|0x52}}|Stop Sound|pre=unchanged}}
+
|- {{added}}
{{PacketList|{{change|0x4E|0x53}}|Player List Header And Footer|pre=unchanged}}
+
| 31
{{PacketList|{{change|0x1D|0x54}}|NBT Query Response|pre=unchanged}}
+
| <code>minecraft:tooltip_style</code>
{{PacketList|{{change|0x4F|0x55}}|Collect Item|pre=unchanged}}
+
| Custom textures for the item tooltip.
{{PacketList|{{change|0x50|0x56}}|Entity Teleport|pre=unchanged}}
+
| As follows:
{{PacketList|{{change|0x51|0x57}}|Advancements|pre=unchanged}}
+
  {| class="wikitable" {{added}}
{{PacketList|{{change|0x52|0x58}}|Entity Properties|pre=unchanged}}
+
    ! Name
{{PacketList|{{change|0x53|0x59}}|Entity Effect|pre=unchanged}}
+
    ! Type
{{PacketList|{{change|0x54|0x5A}}|Declare Recipes}}
+
    ! Description
{{PacketList|{{change|0x55|0x5B}}|Tags}}
+
    |-
  |-
+
    | Style
!colspan="4"| Play serverbound
+
    | {{Type|Identifier}}
{{PacketList|0x00|Teleport Confirm|pre=unchanged}}
+
    |
{{PacketList|0x01|Query Block NBT|pre=unchanged}}
+
    |}
{{PacketList|0x02|Set Difficulty}}
+
|- {{added}}
{{PacketList|{{change|0x02|0x03}}|Chat Message (serverbound)|pre=unchanged}}
+
| 32
{{PacketList|{{change|0x03|0x04}}|Client Status|pre=unchanged}}
+
  | <code>minecraft:death_protection</code>
{{PacketList|{{change|0x04|0x05}}|Client Settings|pre=unchanged}}
+
| Makes the item function like a totem of undying.
{{PacketList|{{change|0x05|0x06}}|Tab-Complete (serverbound)|pre=unchanged}}
+
  | As follows:
{{PacketList|{{change|0x06|0x07}}|Confirm Transaction (serverbound)|pre=unchanged}}
+
  {| class="wikitable" {{added}}
{{PacketList|{{change|0x07|0x08}}|Click Window Button}}
+
    ! Name
{{PacketList|{{change|0x08|0x09}}|Click Window|pre=unchanged}}
+
    ! Type
{{PacketList|{{change|0x09|0x0A}}|Close Window (serverbound)|pre=unchanged}}
+
    ! Description
{{PacketList|{{change|0x0A|0x0B}}|Plugin Message (serverbound)|pre=unchanged}}
+
    |-
{{PacketList|{{change|0x0B|0x0C}}|Edit Book|pre=unchanged}}
+
    | Number of effects
{{PacketList|{{change|0x0C|0x0D}}|Query Entity NBT|pre=unchanged}}
+
    | {{Type|VarInt}}
{{PacketList|{{change|0x0D|0x0E}}|Use Entity|pre=unchanged}}
+
    | Number of elements in the following array.
{{PacketList|{{change|0x0E|0x0F}}|Keep Alive (serverbound)|pre=unchanged}}
+
    |-
{{PacketList|0x10|Lock Difficulty}}
+
    | Effects
{{PacketList|{{change|0x10|0x11}}|Player Position|pre=unchanged}}
+
    | {{Type|Array}} of [[#Consume Effect|Consume Effect]]
{{PacketList|{{change|0x11|0x12}}|Player Position And Look (serverbound)|pre=unchanged}}
+
    | Effects to apply on consumption. See [[#Consume Effect|Consume Effect]].
{{PacketList|{{change|0x12|0x13}}|Player Look|pre=unchanged}}
+
    |}
{{PacketList|{{change|0x0F|0x14}}|Player|pre=unchanged}}
 
{{PacketList|{{change|0x13|0x15}}|Vehicle Move (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x14|0x16}}|Steer Boat|pre=unchanged}}
 
{{PacketList|{{change|0x15|0x17}}|Pick Item|pre=unchanged}}
 
{{PacketList|{{change|0x16|0x18}}|Craft Recipe Request|pre=unchanged}}
 
{{PacketList|{{change|0x17|0x19}}|Player Abilities (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x18|0x1A}}|Player Digging|pre=unchanged}}
 
{{PacketList|{{change|0x19|0x1B}}|Entity Action|pre=unchanged}}
 
{{PacketList|{{change|0x1A|0x1C}}|Steer Vehicle|pre=unchanged}}
 
{{PacketList|{{change|0x1B|0x1D}}|Recipe Book Data}}
 
{{PacketList|{{change|0x1C|0x1E}}|Name Item|pre=unchanged}}
 
{{PacketList|{{change|0x1D|0x1F}}|Resource Pack Status|pre=unchanged}}
 
{{PacketList|{{change|0x1E|0x20}}|Advancement Tab|pre=unchanged}}
 
{{PacketList|{{change|0x1F|0x21}}|Select Trade|pre=unchanged}}
 
{{PacketList|{{change|0x20|0x22}}|Set Beacon Effect|pre=unchanged}}
 
{{PacketList|{{change|0x21|0x23}}|Held Item Change (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x22|0x24}}|Update Command Block|pre=unchanged}}
 
{{PacketList|{{change|0x23|0x25}}|Update Command Block Minecart|pre=unchanged}}
 
{{PacketList|{{change|0x24|0x26}}|Creative Inventory Action|pre=unchanged}}
 
{{PacketList|0x27|Update Jigsaw Block|rel=added}}
 
{{PacketList|{{change|0x25|0x28}}|Update Structure Block|pre=unchanged}}
 
{{PacketList|{{change|0x26|0x29}}|Update Sign|pre=unchanged}}
 
{{PacketList|{{change|0x27|0x2A}}|Animation (serverbound)|pre=unchanged}}
 
{{PacketList|{{change|0x28|0x2B}}|Spectate|pre=unchanged}}
 
{{PacketList|{{change|0x29|0x2C}}|Player Block Placement}}
 
{{PacketList|{{change|0x2A|0x2D}}|Use Item|pre=unchanged}}
 
  |}
 
 
 
== New/modified data types ==
 
 
 
No changes so far.
 
 
 
== Entity Metadata ==
 
 
 
{{Warning2|Entity metadata shifted in 19w08a; not all entities are copied here.  All subclasses of entity had shift of 1; all subclasses of living had a second shift (2 total). All entities listed in the article have been updated, but there are ones not listed here. }}
 
 
 
=== Entity Metadata Format ===
 
 
 
Note that entity metadata is a totally distinct concept from block metadata. It is not required to send all metadata fields, or even any metadata fields, so long as the terminating entry is correctly sent.
 
 
 
Entity Metadata is an array of entries, each of which looks like the following:
 
 
 
{| class="wikitable"
 
! Name
 
! Type
 
! Meaning
 
|-
 
| Index
 
| Unsigned Byte
 
| Unique index key determining the meaning of the following value, see the table below. If this is <code>0xff</code> then the it is the end of the Entity Metadata array and no more is read.
 
|-
 
| Type
 
| Optional VarInt Enum
 
| Only if Index is not <code>0xff</code>; the type of the index, see the table below
 
|-
 
| Value
 
| Optional ''value of Type''
 
| Only if Index is not <code>0xff</code>: the value of the metadata field
 
|}
 
 
 
{| class="wikitable"
 
! Value of Type field
 
! [[Data types|Type]] of Value field
 
! Notes
 
|-
 
| 0
 
| Byte
 
|
 
|-
 
| 1
 
| VarInt
 
|
 
|-
 
| 2
 
| Float
 
|
 
 
  |-
 
  |-
  | 3
+
  | {{change|31|41}}
  | String
+
  | <code>minecraft:potion_contents</code>
  |
+
  | Visual and effects of a potion item.
  |-
+
  | As follows:
| 4
+
  {| class="wikitable"
| [[Chat]]
+
    ! Name
|
+
    ! Type
|-
+
    ! Description
| 5
+
    |-
| OptChat (Boolean + Optional [[Chat]])
+
    | Has Potion ID
| [[Chat]] is present if the Boolean is set to true
+
    | {{Type|Boolean}}
|-
+
    | Whether this potion has an ID in the potion registry. If true, it has the default effects associated with the potion type.
  | 6
+
    |-
  | [[Slot]]
+
    | 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
 
  |-
 
  |-
  | 7
+
  | Sound Event
  | Boolean
+
  | {{Type|Id or}} {{Type|Sound Event}}
  |
+
  | The sound to be played.
 
  |-
 
  |-
  | 8
+
  | Use duration
  | Rotation
+
  | {{change|{{Type|VarInt}}|{{Type|Float}}}}
  | 3 floats: rotation on x, rotation on y, rotation on z
+
  | The maximum range of the sound.
 
  |-
 
  |-
  | 9
+
  | Range
  | [[Data Types#Position|Position]]
+
  | {{Type|Float}}
  |
+
  | The range of the instrument.
 +
|- {{added}}
 +
| Description
 +
| {{Type|Text Component}}
 +
| Description shown in the item tooltip.
 +
|}
 +
 
 +
== Particles ==
 +
 
 +
{| class="wikitable"
 
  |-
 
  |-
  | 10
+
  ! Particle Name
  | OptPosition (Boolean + Optional Position)
+
  ! Particle ID
  | Position is present if the Boolean is set to true
+
  ! Data
|-
 
| 11
 
| Direction (VarInt)
 
| (Down = 0, Up = 1, North = 2, South = 3, West = 4, East = 5)
 
|-
 
| 12
 
| OptUUID (Boolean + Optional UUID)
 
| UUID is present if the Boolean is set to true
 
 
  |-
 
  |-
 +
| <code>minecraft:dust</code>
 
  | 13
 
  | 13
  | OptBlockID (VarInt)
+
  |
  | 0 for absent otherwise, <code><nowiki>id &lt;&lt; 4 | data</nowiki></code>
+
  {| 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.
 +
  |}
 
  |-
 
  |-
 +
| <code>minecraft:dust_color_transition</code>
 
  | 14
 
  | 14
| [[NBT]]
 
 
  |
 
  |
  |-
+
  {| class="wikitable"
| 15
+
  ! Field Name
| [[Data Types#Particle|Particle]]
+
  ! Field Type
|
+
  ! Meaning
|- {{Added}}
+
  |- {{removed}}
| 16
+
  | From Red
| Villager Data
+
  | {{Type|Float}}
| 3 VarInts: villager type, villager profession, level
+
  | The start red RGB value, between 0 and 1. Divide actual RGB value by 255.
|- {{Added}}
+
  |- {{removed}}
| 17
+
  | From Green
| OptVarInt
+
  | {{Type|Float}}
| 0 for absent; 1 + actual value otherwise. Used for entity IDs.
+
  | The start green RGB value, between 0 and 1. Divide actual RGB value by 255.
|- {{Added}}
+
  |- {{removed}}
| 18
+
  | From Blue
| Pose
+
  | {{Type|Float}}
| A VarInt enum: 0: STANDING, 1: FALL_FLYING, 2: SLEEPING, 3: SWIMMING, 4: SPIN_ATTACK, 5: SNEAKING, 6: DYING
+
  | 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.
 +
  |}
 
  |}
 
  |}
  
Villager type (<code>minecraft:villager_type</code> registry):
+
== Recipes ==
 +
 
 +
(this is meant to become a new page.)
 +
 
 +
=== Recipe Display structure ===
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Name !! ID
+
  ! Name
 +
! Type
 +
! Description
 
  |-
 
  |-
  | <code>minecraft:desert</code> || 0
+
  | Recipe Display Type
 +
| {{Type|VarInt}}
 +
| ID in the <code>minecraft:recipe_display</code> registry.
 
  |-
 
  |-
  | <code>minecraft:jungle</code> || 1
+
  | Data
|-
+
  | Varies
| <code>minecraft:plains</code> || 2
+
  | See [[#Recipe Display types]] below.
|-
 
| <code>minecraft:savanna</code> || 3
 
|-
 
| <code>minecraft:snow</code> || 4
 
|-
 
  | <code>minecraft:swamp</code> || 5
 
  |-
 
| <code>minecraft:taiga</code> || 6
 
 
  |}
 
  |}
  
Villager professions (<code>minecraft:villager_profession</code> registry):
+
==== Recipe Display types ====
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Name !! ID
+
! ID
 +
  ! Name
 +
! Data
 
  |-
 
  |-
  | <code>minecraft:none</code> || 0
+
| 0
 +
  | <code>minecraft:crafting_shapeless</code>
 +
| [[#minecraft:crafting_shapeless|data]]
 
  |-
 
  |-
  | <code>minecraft:armorer</code> || 1
+
| 1
 +
  | <code>minecraft:crafting_shaped</code>
 +
| [[#minecraft:crafting_shaped|data]]
 
  |-
 
  |-
  | <code>minecraft:butcher</code> || 2
+
| 2
 +
  | <code>minecraft:furnace</code>
 +
| [[#minecraft:furnace|data]]
 
  |-
 
  |-
  | <code>minecraft:cartographer</code> || 3
+
| 3
 +
  | <code>minecraft:stonecutter</code>
 +
| [[#minecraft:stonecutter|data]]
 
  |-
 
  |-
  | <code>minecraft:cleric</code> || 4
+
| 4
 +
  | <code>minecraft:smithing</code>
 +
| [[#minecraft:smithing|data]]
 +
|}
 +
 
 +
===== <code>minecraft:crafting_shapeless</code> =====
 +
 
 +
{| class="wikitable"
 +
! Name
 +
! Type
 +
! Description
 
  |-
 
  |-
  | <code>minecraft:farmer</code> || 5
+
  | Ingredient Count
 +
| {{Type|VarInt}}
 +
| Number of elements in the following array.
 
  |-
 
  |-
  | <code>minecraft:fisherman</code> || 6
+
  | Ingredients
 +
| {{Type|Array}} of [[#Slot Display structure|Slot Display]]
 +
|
 
  |-
 
  |-
  | <code>minecraft:fletcher</code> || 7
+
  | Result
 +
| [[#Slot Display structure|Slot Display]]
 +
|
 
  |-
 
  |-
  | <code>minecraft:leatherworker</code> || 8
+
  | Crafting Station
 +
| [[#Slot Display structure|Slot Display]]
 +
| Crafting station icon to display in the recipe notification.
 +
|}
 +
 
 +
===== <code>minecraft:crafting_shaped</code> =====
 +
 
 +
{| class="wikitable"
 +
! Name
 +
! Type
 +
! Description
 
  |-
 
  |-
  | <code>minecraft:librarian</code> || 9
+
  | Width
 +
| {{Type|VarInt}}
 +
|
 
  |-
 
  |-
  | <code>minecraft:mason</code> || 10
+
  | Height
 +
| {{Type|VarInt}}
 +
|
 
  |-
 
  |-
  | <code>minecraft:nitwit</code> || 11
+
  | Ingredient Count
 +
| {{Type|VarInt}}
 +
| Number of elements in the following array. Always equal to Width * Height.
 
  |-
 
  |-
  | <code>minecraft:shepherd</code> || 12
+
  | Ingredients
 +
| {{Type|Array}} of [[#Slot Display structure|Slot Display]]
 +
|
 
  |-
 
  |-
  | <code>minecraft:toolsmith</code> || 13
+
  | Result
 +
| [[#Slot Display structure|Slot Display]]
 +
|
 
  |-
 
  |-
  | <code>minecraft:weaponsmith</code> || 14
+
  | Crafting Station
 +
| [[#Slot Display structure|Slot Display]]
 +
| Crafting station icon to display in the recipe notification.
 
  |}
 
  |}
  
=== Mobs ===
+
===== <code>minecraft:furnace</code> =====
 
 
Entity IDs have shifted with the addition of some new mobs.
 
 
 
=== Entity ===
 
 
 
The base class.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Index
+
  ! Name
 
  ! Type
 
  ! Type
  !style="width: 250px;" colspan="2"| Meaning
+
  ! Description
! Default
 
 
  |-
 
  |-
  |rowspan="9"| 0
+
  | Ingredient
  |rowspan="9"| Byte
+
  | [[#Slot Display structure|Slot Display]]
! Bit mask
+
  |
! Meaning
 
  |rowspan="9"| 0
 
 
  |-
 
  |-
  | 0x01
+
  | Fuel
  | On Fire
+
| [[#Slot Display structure|Slot Display]]
 +
  |
 
  |-
 
  |-
  | 0x02
+
  | Result
  | Crouched
+
| [[#Slot Display structure|Slot Display]]
 +
  |
 
  |-
 
  |-
  | 0x04
+
  | Crafting Station
  | Unused (previously riding)
+
  | [[#Slot Display structure|Slot Display]]
 +
| Crafting station icon to display in the recipe notification.
 
  |-
 
  |-
  | 0x08
+
  | Cooking Time
  | Sprinting
+
  | {{Type|VarInt}}
 +
| Time to smelt in a regular furnace, in ticks.
 
  |-
 
  |-
  | 0x10
+
  | Experience
  | Swimming
+
  | {{Type|Float}}
 +
|
 +
|}
 +
 
 +
===== <code>minecraft:stonecutter</code> =====
 +
 
 +
{| class="wikitable"
 +
! Name
 +
! Type
 +
! Description
 
  |-
 
  |-
  | 0x20
+
  | Ingredient
  | Invisible
+
| [[#Slot Display structure|Slot Display]]
 +
  |
 
  |-
 
  |-
  | 0x40
+
  | Result
  | Glowing effect
+
| [[#Slot Display structure|Slot Display]]
 +
  |
 
  |-
 
  |-
  | 0x80
+
  | Crafting Station
  | Flying with {{Minecraft Wiki|elytra}}
+
  | [[#Slot Display structure|Slot Display]]
 +
| Crafting station icon to display in the recipe notification.
 +
|}
 +
 
 +
===== <code>minecraft:smithing</code> =====
 +
 
 +
{| class="wikitable"
 +
! Name
 +
! Type
 +
! Description
 
  |-
 
  |-
  | 1
+
  | Template
  | VarInt
+
  | [[#Slot Display structure|Slot Display]]
|colspan="2"| Air
+
  |
  | 300
 
 
  |-
 
  |-
  | 2
+
  | Base
  | OptChat
+
  | [[#Slot Display structure|Slot Display]]
|colspan="2"| Custom name
+
  |
  | empty
 
 
  |-
 
  |-
  | 3
+
  | Addition
  | Boolean
+
  | [[#Slot Display structure|Slot Display]]
|colspan="2"| Is custom name visible
+
  |
  | false
 
 
  |-
 
  |-
  | 4
+
  | Result
  | Boolean
+
  | [[#Slot Display structure|Slot Display]]
|colspan="2"| Is silent
+
  |
  | false
 
 
  |-
 
  |-
  | 5
+
  | Crafting Station
  | Boolean
+
  | [[#Slot Display structure|Slot Display]]
|colspan="2"| No gravity
+
  | Crafting station icon to display in the recipe notification.
| false
 
|- {{Added}}
 
| 6
 
| Pose
 
|colspan="2"| Pose
 
  | STANDING
 
 
  |}
 
  |}
  
=== Itemed Throwable ===
+
=== Slot Display structure ===
  
Extends [[#Throwable|Throwable]].
+
{| class="wikitable"
 
+
  ! Name
Used for all things that previously extended throwable other than potions, which already had an item.
 
 
 
{| class="wikitable" {{added}}
 
  ! Index
 
 
  ! Type
 
  ! Type
  !style="width: 250px;" colspan="2"| Meaning
+
  ! Description
  ! Default
+
|-
 +
| Slot Display Type
 +
| {{Type|VarInt}}
 +
  | ID in the <code>minecraft:slot_display</code> registry.
 
  |-
 
  |-
  | 7
+
  | Data
  | Slot
+
  | Varies
  |colspan="2"| Item
+
  | See [[#Slot Display types]] below.
| empty (which behaves as if it were a specific item, depending on the subclass)
 
 
  |}
 
  |}
  
=== Egg ===
+
==== Slot Display types ====
  
Extends [[#Itemed_Throwable|Itemed Throwable]].
+
{| class="wikitable"
 +
! ID
 +
! Name
 +
! Data
 +
|-
 +
| 0
 +
| <code>minecraft:empty</code>
 +
| no data
 +
|-
 +
| 1
 +
| <code>minecraft:any_fuel</code>
 +
| no data
 +
|-
 +
| 2
 +
| <code>minecraft:item</code>
 +
| [[#minecraft:item|data]]
 +
|-
 +
| 3
 +
| <code>minecraft:item_stack</code>
 +
| [[#minecraft:item_stack|data]]
 +
|-
 +
| 4
 +
| <code>minecraft:tag</code>
 +
| [[#minecraft:tag|data]]
 +
|-
 +
| 5
 +
| <code>minecraft:smithing_trim</code>
 +
| [[#minecraft:smithing_trim|data]]
 +
|-
 +
| 6
 +
| <code>minecraft:with_remainder</code>
 +
| [[#minecraft:with_remainder|data]]
 +
|-
 +
| 7
 +
| <code>minecraft:composite</code>
 +
| [[#minecraft:composite|data]]
 +
|}
  
No additional metadata.
+
===== <code>minecraft:item</code> =====
  
An empty item behaves as if the item were a <code>minecraft:egg</code>.
 
  
=== Ender Pearl ===
+
{| class="wikitable"
 
+
! Name
Extends [[#Itemed_Throwable|Itemed Throwable]].
+
! Type
 
+
! Description
No additional metadata.
+
|-
 +
| Item Type
 +
| {{Type|VarInt}}
 +
| ID in the <code>minecraft:item</code> registry.
 +
|}
  
An empty item behaves as if the item were a <code>minecraft:ender_pearl</code>.
+
===== <code>minecraft:item_stack</code> =====
  
=== Experience Bottle ===
+
{| class="wikitable"
 
+
  ! Name
Extends [[#Itemed_Throwable|Itemed Throwable]].
 
 
 
No additional metadata.
 
 
 
<code>minecraft:experience_bottle</code>
 
 
 
=== Snowball ===
 
 
 
Extends [[#Itemed_Throwable|Itemed Throwable]].
 
 
 
No additional metadata.
 
 
 
<code>minecraft:snowball</code>
 
 
 
=== Eye of Ender ===
 
 
 
Extends [[#Entity|Entity]].
 
 
 
{| class="wikitable" {{added}}
 
  ! Index
 
 
  ! Type
 
  ! Type
  !style="width: 250px;" colspan="2"| Meaning
+
  ! Description
! Default
 
 
  |-
 
  |-
  | 7
+
  | Item Stack
  | Slot
+
  | {{Type|Slot}}
  |colspan="2"| Item
+
  |
| empty (which behaves as if it were a <code>minecraft:ender_eye</code>)
 
 
  |}
 
  |}
  
=== Arrow ===
+
===== <code>minecraft:tag</code> =====
 
 
Extends [[#Entity|Entity]].
 
 
 
Abstract base class for [[#TippedArrow|TippedArrow]] (which is used for regular arrows as well as tipped ones) and Spectral Arrow.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Index
+
  ! Name
 
  ! Type
 
  ! Type
  !style="width: 250px;" colspan="2"| Meaning
+
  ! Description
! Default
 
 
  |-
 
  |-
  | rowspan="3" | {{change|6|7}}
+
  | Tag
  | rowspan="3" | Byte
+
| {{Type|Identifier}}
  ! Bit mask
+
  | Tag in the <code>minecraft:item</code> registry. Not prefixed by '#'!.
  ! Meaning
+
|}
  | rowspan="3" | 0
+
 
 +
===== <code>minecraft:smithing_trim</code> =====
 +
 
 +
{| class="wikitable"
 +
  ! Name
 +
  ! Type
 +
  ! Description
 
  |-
 
  |-
  | 0x01
+
  | Base
  | Is critical
+
| [[#Slot Display structure|Slot Display]]
 +
  |
 
  |-
 
  |-
  | 0x02
+
  | Material
  | Is noclip (used by loyalty tridents when returning)
+
| [[#Slot Display structure|Slot Display]]
 +
  |
 
  |-
 
  |-
  | {{change|7|8}}
+
  | Pattern
| OptUUID
+
  | [[#Slot Display structure|Slot Display]]
|colspan="2"| Shooter UUID
+
  |
| Empty
 
|- {{added}}
 
| 9
 
| Byte
 
  |colspan="2"| Piercing level
 
  | 0
 
 
  |}
 
  |}
  
=== TippedArrow ===
+
===== <code>minecraft:with_remainder</code> =====
 
 
Extends [[#Arrow|Arrow]].
 
 
 
Used for both tipped and regular arrows.  If not tipped, then color is set to -1 and no tipped arrow particles are used.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Index
+
  ! Name
 
  ! Type
 
  ! Type
  !style="width: 250px;" colspan="2"| Meaning
+
  ! Description
! Default
 
 
  |-
 
  |-
  | {{change|8|10}}
+
  | Ingredient
  | VarInt
+
| [[#Slot Display structure|Slot Display]]
  |colspan="2"| Color (-1 for no particles)
+
  |
  | -1
+
  |-
 +
| Remainder
 +
| [[#Slot Display structure|Slot Display]]
 +
  |
 
  |}
 
  |}
  
=== Trident ===
+
===== <code>minecraft:composite</code> =====
 
 
Extends [[#Arrow|Arrow]].
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Index
+
  ! Name
 
  ! Type
 
  ! Type
  !style="width: 250px;" colspan="2"| Meaning
+
  ! Description
  ! Default
+
|-
 +
| Option Count
 +
  | {{Type|VarInt}}
 +
| Number of elements in the following array.
 
  |-
 
  |-
  | {{change|8|10}}
+
| Options
| VarInt
+
  | {{Type|Array}} of [[#Slot Display structure|Slot Display]]
|colspan="2"| Loyalty level (enchantment)
+
  |
  | 0
 
 
  |}
 
  |}
  
=== Itemed Fireball ===
+
== Handshake ==
  
Extends [[#Entity|Entity]].
+
No changes so far.
  
Used for regular and small fireballs.  Not used for dragon fireballs and wither skulls.  Interestingly, regular fireballs do not come from an item.
+
== Status ==
  
{| class="wikitable" {{added}}
+
No changes so far.
! Index
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
|-
 
| 7
 
| Slot
 
|colspan="2"| Item
 
| empty (which behaves as if it were a <code>minecraft:fire_charge</code>)
 
|}
 
  
=== Fireball ===
+
== Login ==
  
Extends {{change|[[#Abstract Fireball|Abstract Fireball]]|[[#Itemed Fireball|Itemed Fireball]]}}.  This is the large fireball shot by ghasts.
+
No changes so far.
  
No additional metadata.
+
== Configuration ==
  
=== Small Fireball ===
+
No changes so far.
  
Extends {{change|[[#Abstract Fireball|Abstract Fireball]]|[[#Itemed Fireball|Itemed Fireball]]}}.  This is the fireball shot by blazes and dispensers with fire charges.
+
== Play ==
  
No additional metadata.
+
=== Clientbound ===
  
=== Fireworks ===
+
==== Close Container ====
  
Extends [[#Entity|Entity]].
+
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"
 
{| class="wikitable"
  ! Index
+
  ! Packet ID
  ! Type
+
  ! State
  !style="width: 250px;" colspan="2"| Meaning
+
! Bound To
  ! Default
+
! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | {{change|6|7}}
+
  | ''protocol:''<br/><code>0x12</code><br/><br/>''resource:''<br/><code>container_close</code>
  | [[Slot]]
+
  | Play
  |colspan="2"| Firework info
+
  | Client
  | empty
+
  | Window ID
|-
+
  | {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
  | {{change|7|8}}
+
  | This is the ID of the window that was closed. 0 for inventory.
| {{Change|VarInt|OptVarInt}}
 
  |colspan="2"| Entity ID of entity which used firework (for elytra boosting)
 
| 0
 
|- {{Added}}
 
| 9
 
| Boolean
 
|colspan="2"| Shot at angle (from a crossbow)
 
| false
 
 
  |}
 
  |}
  
=== Living ===
+
==== Set Container Content ====
 +
[[File:Inventory-slots.png|thumb|The inventory slots]]
  
Extends [[#Entity|Entity]].
+
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"
 
{| class="wikitable"
  ! Index
+
  ! Packet ID
  ! Type
+
  ! State
  !style="width: 250px;" colspan="2"| Meaning
+
! Bound To
  ! Default
+
! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| {{change|6|7}}
+
  | rowspan="5"| ''protocol:''<br/><code>0x13</code><br/><br/>''resource:''<br/><code>container_set_content</code>
  |rowspan="5"| Byte
+
  | rowspan="5"| Play
|colspan="2"| Hand states, used to trigger blocking/eating/drinking animation.
+
  | rowspan="5"| Client
  |rowspan="5"| 0
+
  | Window ID
  |-
+
  | {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
  ! Bit mask
+
  | 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.)
  ! Meaning
 
 
  |-
 
  |-
  | 0x01
+
  | State ID
  | Is hand active
+
  | {{Type|VarInt}}
 +
| A server-managed sequence number used to avoid desynchronization; see [[#Click Container]].
 
  |-
 
  |-
  | 0x02
+
  | Count
  | Active hand (0 = main hand, 1 = offhand)
+
  | {{Type|VarInt}}
 +
| Number of elements in the following array.
 
  |-
 
  |-
  | 0x04
+
  | Slot Data
  | In riptide spin attack
+
  | {{Type|Array}} of [[Slot Data|Slot]]
 
  |-
 
  |-
  | {{change|7|8}}
+
  | Carried Item
| Float
+
  | {{Type|Slot}}
|colspan="2"| Health
+
  | Item being dragged with the mouse.
| 1.0
 
|-
 
  | {{change|8|9}}
 
  | VarInt
 
|colspan="2"| Potion effect color (or 0 if there is no effect)
 
| 0
 
|-
 
| {{change|9|10}}
 
| Boolean
 
|colspan="2"| Is potion effect ambient: reduces the number of particles generated by potions to 1/5 the normal amount
 
| false
 
|-
 
| {{change|10|11}}
 
| VarInt
 
|colspan="2"| Number of arrows in entity
 
| 0
 
|- {{Added}}
 
| 12
 
| OptBlockPos
 
|colspan="2"| Unknown (Bed location?)
 
| Absent
 
 
  |}
 
  |}
  
=== Panda ===
+
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.
  
Extends [[#Animal|Animal]].
+
==== Set Container Property ====
  
{| class="wikitable" {{added}}
+
This packet is used to inform the client that part of a GUI window should be updated.
  ! Index
+
 
  ! Type
+
{| class="wikitable"
  !style="width: 250px;" colspan="2"| Meaning
+
  ! Packet ID
  ! Default
+
  ! State
  |-
+
  ! Bound To
  | 15
+
  ! Field Name
  | Integer
+
  ! Field Type
  |colspan="2"| Breed timer?  Set to 32 when something happens, and then counts down to 0 again.  At 29 and 14 (before counting down), will play the <code>entity.panda.cant_breed</code> sound event.
+
  ! Notes
  | 0
+
  |-
 +
  | rowspan="3"| ''protocol:''<br/><code>0x14</code><br/><br/>''resource:''<br/><code>container_set_data</code>
 +
  | rowspan="3"| Play
 +
| rowspan="3"| Client
 +
| Window ID
 +
| {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
 +
|
 
  |-
 
  |-
  | 16
+
  | Property
  | Integer
+
  | {{Type|Short}}
  |colspan="2"| Sneeze timer.  Counts up from 0; when it hits 1 the <code>entity.panda.pre_sneeze</code> event plays and when it hits 21 the <code>entity.panda.sneeze</code> event plays (and it is set back to 0 and the sneeze flag is cleared).
+
  | The property to be updated, see below.
| 0
 
 
  |-
 
  |-
  | 17
+
  | Value
  | Integer
+
  | {{Type|Short}}
  |colspan="2"| Eat timer. If nonzero, counts upwards.
+
  | The new value for the property, see below.
| 0
+
|}
 +
 
 +
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"
 
  |-
 
  |-
  | 18
+
  ! Window type
  | Byte
+
  ! Property
  |colspan="2"| Main Gene
+
  ! Value
| 0
 
 
  |-
 
  |-
  | 19
+
  | rowspan="4"| Furnace
| Byte
+
  | 0: Fire icon (fuel left)
  |colspan="2"| Hidden Gene
+
  | counting from fuel burn time down to 0 (in-game ticks)
  | 0
 
 
  |-
 
  |-
  |rowspan="6"| 20
+
  | 1: Maximum fuel burn time
|rowspan="6"| Byte
+
  | fuel burn time or 0 (in-game ticks)
! Bit mask
 
  ! Meaning
 
|rowspan="6"| 0
 
 
  |-
 
  |-
  | 0x01
+
  | 2: Progress arrow
  | Unused
+
  | counting from 0 to maximum progress (in-game ticks)
 
  |-
 
  |-
  | 0x02
+
  | 3: Maximum progress
  | Is sneezing
+
  | always 200 on the notchian server
 
  |-
 
  |-
  | 0x04
+
  | rowspan="10"| Enchantment Table
  | Is eating
+
  | 0: Level requirement for top enchantment slot
 +
| rowspan="3"| The enchantment's xp level requirement
 
  |-
 
  |-
  | 0x08
+
  | 1: Level requirement for middle enchantment slot
| Unknown
 
 
  |-
 
  |-
  | 0x10
+
  | 2: Level requirement for bottom enchantment slot
  | Unknown
+
  |-
  |}
+
  | 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>).
=== Fox ===
+
|-
 
+
| 4: Enchantment ID shown on mouse hover over top enchantment slot
Extends [[#Animal|Animal]].
+
| rowspan="3"| The enchantment id (set to -1 to hide it), see below for values
 
+
  |-
{| class="wikitable" {{added}}
+
  | 5: Enchantment ID shown on mouse hover over middle enchantment slot
  ! Index
+
  |-
  ! Type
+
  | 6: Enchantment ID shown on mouse hover over bottom enchantment slot
  !style="width: 250px;" colspan="2"| Meaning
 
  ! Default
 
 
  |-
 
  |-
  | 15
+
  | 7: Enchantment level shown on mouse hover over the top slot
| VarInt
+
  | rowspan="3"| The enchantment level (1 = I, 2 = II, 6 = VI, etc.), or -1 if no enchant
  | colspan="2" | Type (0: red, 1: snow)
 
| 0 (red)
 
 
  |-
 
  |-
  | rowspan="9" | 16
+
  | 8: Enchantment level shown on mouse hover over the middle slot
| rowspan="9" | Byte
 
! Bit mask
 
! Meaning
 
| rowspan="9" | 0
 
 
  |-
 
  |-
  | 0x01 || Sitting
+
  | 9: Enchantment level shown on mouse hover over the bottom slot
 
  |-
 
  |-
  | 0x02 || ''Unused''
+
  | rowspan="3"| Beacon
 +
| 0: Power level
 +
| 0-4, controls what effect buttons are enabled
 
  |-
 
  |-
  | 0x04 || Crouching
+
  | 1: First potion effect
 +
| {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the first effect, or -1 if no effect
 
  |-
 
  |-
  | 0x08 || Unknown
+
  | 2: Second potion effect
 +
| {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the second effect, or -1 if no effect
 
  |-
 
  |-
  | 0x10 || Unknown
+
  | Anvil
 +
| 0: Repair cost
 +
| The repair's cost in xp levels
 
  |-
 
  |-
  | 0x20 || Sleeping
+
  | rowspan="2"| Brewing Stand
  |-
+
  | 0: Brew time
  | 0x40 || Unknown
+
  | 0 – 400, with 400 making the arrow empty, and 0 making the arrow full
 
  |-
 
  |-
  | 0x80 || Unknown
+
  | 1: Fuel time
 +
| 0 - 20, with 0 making the arrow empty, and 20 making the arrow full
 
  |-
 
  |-
  | 17
+
  | Stonecutter
  | OptUUID
+
  | 0: Selected recipe
  | colspan="2" | First UUID (in <code>UUIDs</code> NBT)?
+
  | The index of the selected recipe. -1 means none is selected.
  | Absent
+
|-
 +
| 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.
 
  |-
 
  |-
  | 18
+
  | Lectern
  | OptUUID
+
  | 0: Page number
  | colspan="2" | Second UUID (in <code>UUIDs</code> NBT)?
+
  | The current page number, starting from 0.
| Absent
 
 
  |}
 
  |}
  
=== Mooshroom ===
+
For an enchanting table, the following numerical IDs are used:
  
Extends [[#Cow|Cow]].
+
{| class="wikitable"
 
+
  ! Numerical ID
{{change|No additional metadata.}}
+
  ! Enchantment ID
 
+
  ! Enchantment Name
{| class="wikitable" {{added}}
 
  ! Index
 
  ! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
  ! Default
 
 
  |-
 
  |-
  | 15
+
  | 0
  | String
+
  | minecraft:protection
  | colspan="2"| Variant ("red" or "brown")
+
  | Protection
  | red
+
  |-
  |}
+
  | 1
 
+
| minecraft:fire_protection
=== Raid Participent ===
+
  | Fire Protection
 
 
{{change||Extends [[#Monster|Monster]].}}
 
 
 
{| class="wikitable" {{added}}
 
  ! Index
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
 
  |-
 
  |-
  | 14
+
  | 2
| boolean
+
  | minecraft:feather_falling
| colspan="2"| Is celebrating
+
  | Feather Falling
  | false
 
|}
 
 
 
"Is celebrating" appears to control the pose for vindicators and does not appear to be used by other types.
 
 
 
=== Abstract Illager ===
 
 
 
Extends {{change|[[#Monster|Monster]]|[[#Raid Participent|Raid Participent]]}}.
 
 
 
{| class="wikitable" {{removed}}
 
! Index
 
! Type
 
  !style="width: 250px;" colspan="2"| Meaning
 
! Default
 
 
  |-
 
  |-
  |rowspan="2"| 12
+
  | 3
  |rowspan="2"| Byte
+
  | minecraft:blast_protection
! Bit mask
+
  | Blast Protection
  ! Meaning
 
|rowspan="2"| 0
 
 
  |-
 
  |-
  | 0x01
+
  | 4
  | Has target (aggressive state)
+
  | minecraft:projectile_protection
  |}
+
  | Projectile Protection
 
 
{{Change||Replaced with pose (presumably?)}}
 
 
 
=== Spellcaster Illager ===
 
 
 
Extends [[#Abstract Illager|Abstract Illlager]].
 
 
 
{| class="wikitable"
 
! Index
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
 
  |-
 
  |-
  | {{change|13|15}}
+
  | 5
  | Byte
+
  | minecraft:respiration
  | colspan="2"| Spell (0: none, 1: summon vex, 2: attack, 3: wololo, 4: disappear, 5: blindness)
+
  | Respiration
  | 0
+
  |-
  |}
+
  | 6
 
+
| minecraft:aqua_affinity
=== {{change|EvocationIllager|Evoker}} ===
+
  | Aqua Affinity
 
 
Extends [[#Spellcaster Illager|Spellcaster Illager]].
 
 
 
=== {{change|IllusionIllager|Illusioner}} ===
 
 
 
Extends [[#Spellcaster Illager|Spellcaster Illager]].
 
 
 
=== Pillager ===
 
 
 
Extends [[#Abstract Illager|Abstract Illlager]].
 
 
 
{| class="wikitable" {{added}}
 
! Index
 
! Type
 
  !style="width: 250px;" colspan="2"| Meaning
 
! Default
 
 
  |-
 
  |-
  | 15
+
  | 7
  | Boolean
+
  | minecraft:thorns
  | colspan="2"| Using crossbow
+
  | Thorns
| false
 
|}
 
 
 
=== {{change|VindicationIllager|Vindicator}} ===
 
 
 
Extends [[#Abstract Illager|Abstract Illager]].
 
 
 
=== Ravager ===
 
 
 
Extends [[#Raid Participent|Raid Participent]]
 
 
 
No additional metadata.
 
 
 
{| class="wikitable" {{added}}
 
! Status
 
!colspan="2"| Description
 
 
  |-
 
  |-
  | 4
+
  | 8
  |colspan="2"| Starts the attack animation.
+
  | minecraft:depth_strider
 +
| Depth Strider
 
  |-
 
  |-
  | 39
+
  | 9
  |colspan="2"| Starts the stun animation.
+
  | minecraft:frost_walker
  |}
+
  | Frost Walker
 
+
|-
=== Witch ===
+
| 10
 
+
  | minecraft:binding_curse
Extends {{change|[[#Monster|Monster]]|[[#Raid Participent|Raid Participent]]}}.
+
  | Curse of Binding
 
 
{| class="wikitable"
 
  ! Index
 
  ! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
 
  |-
 
  |-
  | {{change|12|15}}
+
  | 11
  | Boolean
+
  | minecraft:soul_speed
|colspan="2"| Is drinking potion
+
  | Soul Speed
| false
 
|}
 
 
 
=== AbstractSkeleton ===
 
 
 
Extends [[#Monster|Monster]].
 
 
 
{| class="wikitable" {{removed}}
 
! Index
 
! Type
 
  !style="width: 250px;" colspan="2"| Meaning
 
! Default
 
 
  |-
 
  |-
  | {{change|12|14}}
+
  | 12
  | Boolean
+
  | minecraft:swift_sneak
|colspan="2"| Is swinging arms
+
  | Swift Sneak
| false
 
|}
 
 
 
{{Change||Replaced with pose (presumably?)}}
 
 
 
=== Zombie ===
 
 
 
Extends [[#Monster|Monster]].
 
 
 
{| class="wikitable"
 
! Index
 
! Type
 
  !style="width: 250px;" colspan="2"| Meaning
 
! Default
 
 
  |-
 
  |-
  | {{change|12|14}}
+
  | 13
| Boolean
+
  | minecraft:sharpness
  |colspan="2"| Is baby
+
  | Sharpness
  | false
 
 
  |-
 
  |-
| {{change|13|15}}
 
| VarInt
 
|colspan="2"| Unused (previously type)
 
| 0
 
|- {{removed}}
 
 
  | 14
 
  | 14
  | Boolean
+
  | minecraft:smite
  |colspan="2"| Are hands held up
+
  | Smite
| false
 
 
  |-
 
  |-
  | {{change|15|16}}
+
  | 15
  | Boolean
+
  | minecraft:bane_of_arthropods
|colspan="2"| Is becoming a drowned
+
  | Bane of Arthropods
| false
 
|}
 
 
 
{{Change||Replaced with pose (presumably?)}}
 
 
 
=== Zombie Villager ===
 
 
 
Extends [[#Zombie|Zombie]].
 
 
 
{| class="wikitable"
 
! Index
 
! Type
 
  !style="width: 250px;" colspan="2"| Meaning
 
! Default
 
 
  |-
 
  |-
  | {{change|16|17}}
+
  | 16
  | Boolean
+
  | minecraft:knockback
|colspan="2"| Is converting
+
  | Knockback
| false
 
|-
 
| {{change|17|18}}
 
| {{Change|VarInt|Villager Data}}
 
|colspan="2"| {{Change|Profession|Villager Data}}
 
| {{change|0|Plains/None/1}}
 
|}
 
 
 
 
 
=== Ocelot ===
 
 
 
Extends {{change|[[#TameableAnimal|TameableAnimal]]|[[#Ageable|Ageable]]}}.
 
 
 
{| class="wikitable"
 
! Index
 
! Type
 
!style="width: 250px;" colspan="2"| Meaning
 
! Default
 
|- {{removed}}
 
| 15
 
| VarInt
 
|colspan="2"| Type (0 = untamed, 1 = tuxedo, 2 = tabby, 3 = siamese).  Used to render regardless as to whether it is tamed or not.
 
| 0
 
|- {{added}}
 
| 15
 
| Boolean
 
|colspan="2"| Is trusting
 
| false
 
|}
 
 
 
{| class="wikitable" {{added}}
 
! Status
 
  !colspan="2"| Description
 
 
  |-
 
  |-
  | 40
+
  | 17
  |colspan="2"| Spawn smoke particles (trust gaining failed)
+
  | minecraft:fire_aspect
 +
| Fire Aspect
 
  |-
 
  |-
  | 41
+
  | 18
  |colspan="2"| Spawn heart particles (trust gaining succeeded)
+
  | minecraft:looting
|}
+
  | Looting
 
 
=== Cat ===
 
 
 
Extends [[#TameableAnimal|TameableAnimal]].
 
 
 
{| class="wikitable" {{added}}
 
! Index
 
! Type
 
  !style="width: 250px;" colspan="2"| Meaning
 
! Default
 
 
  |-
 
  |-
  | 17
+
  | 19
  | VarInt
+
  | minecraft:sweeping_edge
  |colspan="2"| Type (0 = tabby, 1 = black, 2 = red, 3 = siamese, 4 = british_shorthair, 5 = calico, 6 = persian, 7 = ragdoll, 8 = white, 9 = all_black)
+
  | Sweeping Edge
| 1
 
 
  |-
 
  |-
  | 18
+
  | 20
  | Boolean
+
  | minecraft:efficiency
  |colspan="2"| Unknown
+
  | Efficiency
| false
 
 
  |-
 
  |-
  | 19
+
  | 21
  | Boolean
+
  | minecraft:silk_touch
  |colspan="2"| Unknown
+
  | Silk Touch
| false
 
 
  |-
 
  |-
  | 20
+
  | 22
  | VarInt
+
  | minecraft:unbreaking
|colspan="2"| Collar color (values are those {{Minecraft Wiki|Data_values#Dyes|used with dyes}})
+
  | Unbreaking
| 14 (Red)
 
|}
 
 
 
=== Horse ===
 
 
 
Extends [[#AbstractHorse|AbstractHorse]].
 
 
 
{| class="wikitable"
 
! Index
 
! Type
 
  !style="width: 250px;" colspan="2"| Meaning
 
! Default
 
 
  |-
 
  |-
  | {{change|15|17}}
+
  | 23
  | VarInt
+
| minecraft:fortune
  |colspan="2"| Variant (Color & Style)
+
| Fortune
  | 0
+
  |-
  |- {{removed}}
+
  | 24
  | 16
+
| minecraft:power
  | VarInt
+
  | Power
  |colspan="2"| Armor (0: none, 1: iron, 2: gold, 3: diamond)
+
  |-
  | 0 (none)
+
  | 25
  |- {{removed}}
+
  | minecraft:punch
  | 17
+
  | Punch
  | [[Slot]]
+
|-
  |colspan="2"| Armor Item (Forge only)
+
| 26
  | Empty
+
| 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
 
  |}
 
  |}
  
{{change||Replaced with [[#Entity Equipment|Entity Equipment]] packet. (Uses chestplate slot)}}
+
==== Set Container Slot ====
  
=== Trader Llama ===
+
Sent by the server when an item in a slot (in a window) is added/removed.
  
Extends [[#Llama|Llama]].
+
{| class="wikitable"
 
+
! Packet ID
No additional metadata.
+
! State
 
+
! Bound To
=== Abstract Merchant ===
+
! Field Name
 
+
! Field Type
Extends [[#Ageable|Ageable]].
+
! Notes
 
+
|-
{| class="wikitable" {{added}}
+
| rowspan="4"| ''protocol:''<br/><code>0x15</code><br/><br/>''resource:''<br/><code>container_set_slot</code>
  ! Index
+
| rowspan="4"| Play
  ! Type
+
| rowspan="4"| Client
  !style="width: 250px;" colspan="2"| Meaning
+
| Window ID
  ! Default
+
| {{change|{{Type|Unsigned Byte}}|{{Type|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{{change|; see below for exceptions|, unless it is 0 (see below)}}.
 +
|-
 +
  | State ID
 +
  | {{Type|VarInt}}
 +
  | A server-managed sequence number used to avoid desynchronization; see [[#Click Container]].
 
  |-
 
  |-
  | 15
+
  | Slot
  | VarInt
+
  | {{Type|Short}}
|colspan="2"| Head shake timer (starts at 40, decrements each tick)
+
  | The slot that should be updated.
| 0
 
|}
 
 
 
=== Villager ===
 
 
 
Extends {{change|[[#Ageable|Ageable]]|[[#Abstract Merchant|Abstract Merchant]]}}.
 
 
 
{| class="wikitable"
 
! Index
 
! Type
 
  !style="width: 250px;" colspan="2"| Meaning
 
! Default
 
 
  |-
 
  |-
  | {{change|13|16}}
+
  | Slot Data
| {{change|VarInt|Villager Data}}
+
  | {{Type|Slot}}
  |colspan="2"| {{Change|Profession (Farmer = 0, Librarian = 1, Priest = 2, Blacksmith = 3, Butcher = 4, Nitwit = 5)|Villager Data}}
+
  |
  | {{change|0|Plains/None/1}}
 
 
  |}
 
  |}
  
=== Wandering Trader ===
+
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].)
 
 
Extends [[#Abstract Merchant|Abstract Merchant]].
 
  
No additional metadata.
+
{{change|If Window ID is -1, the item being dragged with the mouse is set. In this case, State ID and Slot are ignored.|}}
  
== Block Actions ==
+
{{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.|}}
  
No changes so far.
+
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.
  
== Inventories ==
+
==== Set Cooldown ====
  
{{Need Info|Most of the new inventories have buttons, which are ''probably'' implemented using [[#Click Window Button]].  This needs to be confirmed and the button IDs should be checked.}}
+
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).
  
=== Blast Furnace ===
+
{| class="wikitable"
[[File:1.14-blast_furnace-slots.png|thumb|Blast Furnace slots]]
+
! Packet ID
 
+
! State
The GUI that appears when a blast furnace is opened. Same layout as a furnace; however, the recipe book displays blast furnace recipes instead of regular furnace recipes.
+
! Bound To
 
+
! Field Name
{| class="wikitable" {{added}}
+
! Field Type
  |-
+
! Notes
  ! Slot range
+
|-  
! Description
+
| rowspan="2"| ''protocol:''<br/><code>0x17</code><br/><br/>''resource:''<br/><code>cooldown</code>
 +
| rowspan="2"| Play
 +
  | rowspan="2"| Client
 +
| {{change|Item ID|Cooldown Group}}
 +
  | {{change|{{Type|VarInt}}|{{Type|Identifier}}}}
 +
  | {{change|Numeric ID of the item|Group of items}} to apply a cooldown to.
 
  |-
 
  |-
  | 0
+
  | Cooldown Ticks
  | ingredient
+
  | {{Type|VarInt}}
|-
+
  | Number of ticks to apply a cooldown for, or 0 to clear the cooldown.
  | 1
 
| fuel
 
|-
 
| 2
 
| output
 
|-
 
| 3–29
 
| main inventory
 
|-
 
| 30–38
 
| hotbar
 
 
  |}
 
  |}
  
{{-}}
+
==== Teleport Entity ====
  
=== Smoker ===
+
{{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.}}}}
[[File:1.14-smoker-slots.png|thumb|Smoker slots]]
 
  
The GUI that appears when a smoker is opened.  Same layout as a furnace; however, the recipe book displays blast furnace recipes instead of regular furnace recipes.
+
This packet is sent by the server when an entity moves more than 8 blocks.
  
{| class="wikitable" {{added}}
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  ! Slot range
+
  | rowspan="10"| ''protocol:''<br/><code>{{change|0x70|0x20}}</code><br/><br/>''resource:''<br/><code>{{change|teleport_entity|entity_position_sync}}</code>
  ! Description
+
  | rowspan="10"| Play
 +
| rowspan="10"| Client
 +
| Entity ID
 +
| {{Type|VarInt}}
 +
|
 +
|-
 +
| X
 +
| {{Type|Double}}
 +
|
 
  |-
 
  |-
  | 0
+
  | Y
  | ingredient
+
| {{Type|Double}}
 +
  |
 
  |-
 
  |-
  | 1
+
  | Z
  | fuel
+
| {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity X
 +
| {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity Y
 +
| {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity Z
 +
| {{Type|Double}}
 +
  |
 
  |-
 
  |-
  | 2
+
  | Yaw
  | output
+
  | {{change|{{Type|Angle}}|{{Type|Float}}}}
 +
| Rotation on the X axis, in degrees.
 
  |-
 
  |-
  | 3–29
+
  | Pitch
  | main inventory
+
  | {{change|{{Type|Angle}}|{{Type|Float}}}}
 +
| Rotation on the Y axis, in degrees.
 
  |-
 
  |-
  | 30–38
+
  | On Ground
  | hotbar
+
  | {{Type|Boolean}}
  |}
+
  |
 +
|}
  
{{-}}
+
==== Explosion ====
  
=== Cartography Table ===
+
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).
[[File:1.14-cartography-slots.png|thumb|Cartography table slots]]
 
  
The GUI that appears when a cartography table is opened.
+
{{change|Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x|}}
  
{| class="wikitable" {{added}}
+
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! colspan="2" | Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  ! Slot range
+
  | rowspan="16"| ''protocol:''<br/><code>{{change|0x20|0x21}}</code><br/><br/>''resource:''<br/><code>explode</code>
  ! Description
+
  | rowspan="16"| Play
 +
| rowspan="16"| Client
 +
| X
 +
| {{Type|Double}}
 +
|
 
  |-
 
  |-
  | 0
+
  | Y
  | map
+
| {{Type|Double}}
 +
  |
 
  |-
 
  |-
  | 1
+
  | Z
  | paper
+
| {{Type|Double}}
 +
|
 +
|- {{removed}}
 +
| Strength
 +
| {{Type|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.
 +
|- {{removed}}
 +
| Record Count
 +
| {{Type|VarInt}}
 +
| Number of elements in the following array.
 +
|- {{removed}}
 +
| Records
 +
| {{Type|Array}} of ({{Type|Byte}}, {{Type|Byte}}, {{Type|Byte}})
 +
| 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}}
 +
  |
 
  |-
 
  |-
  | 2
+
  | Player Motion X
  | output
+
  | {{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.}}
 
  |-
 
  |-
  | 3–29
+
  | Player Motion Y
  | main inventory
+
  | {{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.}}
 
  |-
 
  |-
  | 30–38
+
  | Player Motion Z
  | hotbar
+
  | {{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}}
{{-}}
+
| Block Interaction
 
+
| {{Type|VarInt}} {{Type|Enum}}
=== Grindstone ===
+
| 0 = keep, 1 = destroy, 2 = destroy_with_decay, 3 = trigger_block.
[[File:1.14-grindstone-slots.png|thumb|Grindstone slots]]
 
 
 
{| class="wikitable" {{added}}
 
 
  |-
 
  |-
  ! Slot range
+
  | {{change|Small |}}Explosion Particle ID
  ! Description
+
  | {{Type|VarInt}}
 +
| The particle ID listed in [[Particles]].
 
  |-
 
  |-
  | 0
+
  | {{change|Small |}}Explosion Particle Data
  | first item
+
| Varies
 +
| Particle data as specified in [[Particles]].
 +
|- {{removed}}
 +
| Large Explosion Particle ID
 +
| {{Type|VarInt}}
 +
| The particle ID listed in [[Particles]].
 +
|- {{removed}}
 +
| Large Explosion Particle Data
 +
| Varies
 +
  | Particle data as specified in [[Particles]].
 
  |-
 
  |-
  | 1
+
  | Explosion Sound
  | second item
+
  | {{Type|ID or}} {{Type|Sound Event}}
 +
| ID in the <code>minecraft:sound_event</code> registry, or an inline definition.
 +
|}
 +
 
 +
==== 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
 
  |-
 
  |-
  | 2
+
  | rowspan="3"| ''protocol:''<br/><code>0x23</code><br/><br/>''resource:''<br/><code>horse_screen_open</code>
  | result
+
| rowspan="3"| Play
 +
| rowspan="3"| Client
 +
| Window ID
 +
| {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
 +
  |
 
  |-
 
  |-
  | 3–29
+
  | Slot count
  | main inventory
+
| {{Type|VarInt}}
 +
  |
 
  |-
 
  |-
  | 30–38
+
  | Entity ID
  | hotbar
+
| {{Type|Int}}
 +
  |
 
  |}
 
  |}
  
{{-}}
+
==== Login (play) ====
  
=== Lectern ===
+
{{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?}}
[[File:1.14-lectern.png|thumb|Lectern UI]]
 
  
This is a regular container, unlike with held books opened via [[#Open Book]].
+
See [[Protocol Encryption]] for information on logging in.
  
{{Need Info|Is the player inventory also included on this?}}
+
{| class="wikitable"
 
+
! Packet ID
 
+
! State
{| class="wikitable" {{added}}
+
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| rowspan="23"| ''protocol:''<br/><code>{{change|0x2B|0x2C}}</code><br/><br/>''resource:''<br/><code>login</code>
 +
| rowspan="23"| Play
 +
| rowspan="23"| Client
 +
| Entity ID
 +
| {{Type|Int}}
 +
| The player's Entity ID (EID).
 
  |-
 
  |-
  ! Slot range
+
  | Is hardcore
  ! Description
+
  | {{Type|Boolean}}
 +
|
 
  |-
 
  |-
  | 0
+
  | Dimension Count
  | book
+
  | {{Type|VarInt}}
 +
| Size of the following array.
 
  |-
 
  |-
  | 1–27
+
  | Dimension Names
  | main inventory?
+
  | {{Type|Array}} of {{Type|Identifier}}
 +
| Identifiers for all dimensions on the server.
 
  |-
 
  |-
  | 28–36
+
  | Max Players
  | hotbar?
+
  | {{Type|VarInt}}
|}
+
| Was once used by the client to draw the player list, but now is ignored.
 
 
{{-}}
 
 
 
=== Loom ===
 
[[File:1.14-loom-slots.png|thumb|Loom slots]]
 
 
 
{| class="wikitable" {{added}}
 
 
  |-
 
  |-
  ! Slot range
+
  | View Distance
  ! Description
+
  | {{Type|VarInt}}
 +
| Render distance (2-32).
 
  |-
 
  |-
  | 0
+
  | Simulation Distance
  | banner
+
  | {{Type|VarInt}}
 +
| The distance that the client will process specific things, such as entities.
 
  |-
 
  |-
  | 1
+
  | Reduced Debug Info
  | dye
+
  | {{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.
 
  |-
 
  |-
  | 2
+
  | Enable respawn screen
  | pattern
+
  | {{Type|Boolean}}
 +
| Set to false when the doImmediateRespawn gamerule is true.
 
  |-
 
  |-
  | 3
+
  | Do limited crafting
  | result
+
  | {{Type|Boolean}}
 +
| Whether players can only craft recipes they have already unlocked. Currently unused by the client.
 
  |-
 
  |-
  | 4–30
+
  | Dimension Type
  | main inventory
+
  | {{Type|VarInt}}
 +
| The ID of the type of dimension in the <code>minecraft:dimension_type</code> registry, defined by the Registry Data packet.
 
  |-
 
  |-
  | 31–39
+
  | Dimension Name
  | hotbar
+
  | {{Type|Identifier}}
  |}
+
  | Name of the dimension being spawned into.
 
+
|-
{{-}}
+
| Hashed seed
 
+
| {{Type|Long}}
=== Stonecutter ===
+
| First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
[[File:1.14-stonecutter-slots.png|thumb|Stonecutter slots]]
+
|-
 
+
| Game mode
{| class="wikitable" {{added}}
+
| {{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.
 
  |-
 
  |-
  ! Slot range
+
  | Has death location
  ! Description
+
  | {{Type|Boolean}}
 +
| If true, then the next two fields are present.
 
  |-
 
  |-
  | 0
+
  | Death dimension name
  | input
+
  | {{Type|Optional}} {{Type|Identifier}}
 +
| Name of the dimension the player died in.
 
  |-
 
  |-
  | 1
+
  | Death location
  | result
+
  | {{Type|Optional}} {{Type|Position}}
 +
| The location that the player died at.
 
  |-
 
  |-
  | 2–28
+
  | Portal cooldown
  | main inventory
+
| {{Type|VarInt}}
 +
| The number of ticks until the player can use the portal again.
 +
|- {{added}}
 +
| Sea level
 +
| {{Type|VarInt}}
 +
  |
 
  |-
 
  |-
  | 29–37
+
  | Enforces Secure Chat
  | hotbar
+
| {{Type|Boolean}}
 +
  |
 
  |}
 
  |}
  
{{-}}
+
==== Move Minecart Along Track ====
  
== Plugin Channels ==
+
{| class="wikitable" {{added}}
 
+
! Packet ID
=== <code>minecraft:book_open</code> ===
+
! State
{{change|''Server to client''}}
+
! Bound To
 
+
! colspan="2"| Field Name
{{change|When a player right clicks with a signed book. This tells the client to open the book GUI.}}
+
! colspan="2"| Field Type
 
+
! colspan="2"| Notes
{{change|The payload is a VarInt enum for the selected hand: 0 for the main hand, 1 for the offhand.}}
+
|-
 
+
| rowspan="11"| ''protocol:''<br/><code>0x31</code><br/><br/>''resource:''<br/><code>move_minecart_along_track</code>
{{change||Replaced with [[#Open Book|Open Book]] packet.}}
+
| rowspan="11"| Play
 
+
  | rowspan="11"| Client
=== <code>minecraft:trader_list</code> ===
+
  | colspan="2"| Entity ID
{{change|''Server to client''}}
+
  | colspan="2"| {{Type|VarInt}}
 
+
  |
{{change|The list of trades a villager NPC is offering.}}
+
  |-
 
+
  | colspan="2"| Step Count
{{change||Replaced with [[#Trade List|Trade List]] packet.}}
+
  | colspan="2"| {{Type|VarInt}}
 
+
  | Number of elements in the following array.
=== <code>minecraft:debug/poi_ticket_count</code> ===
 
{{Need Info|Unknown channel}}
 
=== <code>minecraft:debug/poi_added</code> ===
 
{{Need Info|Unknown channel}}
 
=== <code>minecraft:debug/poi_removed</code> ===
 
{{Need Info|Unknown channel}}
 
=== <code>minecraft:debug/village_sections</code> ===
 
{{Need Info|Unknown channel}}
 
=== <code>minecraft:debug/goal_selector</code> ===
 
{{Need Info|Unknown channel}}
 
=== <code>minecraft:debug/brain</code> ===
 
{{Need Info|Unknown channel}}
 
 
 
== Play ==
 
 
 
=== Clientbound ===
 
 
 
==== Spawn Object ====
 
 
 
Sent by the server when a vehicle or other object is created.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
  |rowspan="12"| 0x00
 
  |rowspan="12"| Play
 
  |rowspan="12"| Client
 
| Entity ID
 
| VarInt
 
  | EID of the object
 
  |-
 
  | Object UUID
 
| UUID
 
  |  
 
|-
 
| Type
 
| {{change|Byte|VarInt}}
 
  | The type of object. {{change|(see [[Entities#Objects]])|Uses the same entity type IDs as in Spawn Mob}}
 
 
  |-
 
  |-
 +
| rowspan="9"| Steps
 
  | X
 
  | X
  | Double
+
  | rowspan="9"| {{Type|Array}}
 +
| {{Type|Double}}
 
  |  
 
  |  
 
  |-
 
  |-
 
  | Y
 
  | Y
  | Double
+
  | {{Type|Double}}
 
  |  
 
  |  
 
  |-
 
  |-
 
  | Z
 
  | Z
  | Double
+
  | {{Type|Double}}
 
  |  
 
  |  
 
  |-
 
  |-
  | Pitch
+
  | Velocity X
  | Angle
+
  | {{Type|Double}}
  |  
+
  |
 
  |-
 
  |-
  | Yaw
+
  | Velocity Y
  | Angle
+
  | {{Type|Double}}
  |  
+
  |
 
  |-
 
  |-
  | Data
+
  | Velocity Z
  | Int
+
  | {{Type|Double}}
  | Meaning dependent on the value of the Type field, see [[Object Data]] for details.
+
  |
 
  |-
 
  |-
  | Velocity X
+
  | Yaw
  | Short
+
  | {{Type|Angle}}
  |rowspan="3"| Same units as [[#Entity Velocity|Entity Velocity]].  Always sent, but only used when Data is greater than 0 (except for some entities which always ignore it; see [[Object Data]] for details).
+
  |
 
  |-
 
  |-
  | Velocity Y
+
  | Pitch
  | Short
+
| {{Type|Angle}}
 +
  |
 
  |-
 
  |-
  | Velocity Z
+
  | Weight
  | Short
+
  | {{Type|Float}}
|}
+
|}
 
 
==== Update Block Entity ====
 
  
Sets the block entity associated with the block at the given location.
+
==== 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
  ! Field Name
+
  ! colspan="2"| Field Name
  ! Field Type
+
  ! colspan="2"| Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="3"| 0x09
+
  | rowspan="4"| ''protocol:''<br/><code>{{change|0x3E|0x40}}</code><br/><br/>''resource:''<br/><code>player_info_update</code>
  |rowspan="3"| Play
+
  | rowspan="4"| Play
  |rowspan="3"| Client
+
  | rowspan="4"| Client
  | Location
+
  | colspan="2"| Actions
  | Position
+
  | colspan="2"| {{Type|Byte}}
  |  
+
  | Determines what actions are present.
 
  |-
 
  |-
  | Action
+
  | colspan="2"| Number Of Players
  | Unsigned Byte
+
  | colspan="2"| {{Type|VarInt}}
  | The type of update to perform, see below
+
  | Number of elements in the following array.
 
  |-
 
  |-
  | NBT Data
+
  | rowspan="2" | Players
  | [[NBT|NBT Tag]]
+
| UUID
  | Data to set. May be a TAG_END (0), in which case the block entity at the given location is removed (though this is not required since the client will remove the block entity automatically on chunk unload or block removal)
+
| rowspan="2" | {{Type|Array}}
 +
  | {{Type|UUID}}
 +
| The player UUID
 +
|-
 +
| Player Actions
 +
| {{Type|Array}} of [[#player-info:player-actions|Player&nbsp;Actions]]
 +
  | 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.
 
  |}
 
  |}
 
''Action'' field:
 
 
* '''1''': Set data of a mob spawner (everything except for SpawnPotentials: current delay, min/max delay, mob to be spawned, spawn count, spawn range, etc.)
 
* '''2''': Set command block text (command and last execution status)
 
* '''3''': Set the level, primary, and secondary powers of a beacon
 
* '''4''': Set rotation and skin of mob head
 
* '''5''': Declare a conduit
 
* '''6''': Set base color and patterns on a banner
 
* '''7''': Set the data for a Structure tile entity
 
* '''8''': Set the destination for a end gateway
 
* '''9''': Set the text on a sign
 
* '''10''': {{change|Declare a shulker box, no data appears to be sent and the client seems to do fine without this packet. Perhaps it is a leftover from earlier versions?}}
 
* '''11''': Declare a bed
 
* '''12''': {{Change||Set data of a jigsaw block}}
 
* '''13''': {{Change||Set items in a campfire}}
 
 
==== Server Difficulty ====
 
 
Changes the difficulty setting in the client's option menu
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Packet ID
+
  |+ id="player-info:player-actions" | Player Actions
  ! State
+
  ! Action
  ! Bound To
+
  ! Mask
  ! Field Name
+
  ! colspan="2" | Field Name
  ! Field Type
+
  ! colspan="2" | Type
  ! Notes
+
  ! Notes
 +
|-
 +
| rowspan="6" | Add Player
 +
| rowspan="6" | 0x01
 +
| colspan="2" | Name
 +
| colspan="2" | {{Type|String}} (16)
 +
|-
 +
| colspan="2" | Number Of Properties
 +
| colspan="2" | {{Type|VarInt}}
 +
| Number of elements in the following array.
 
  |-
 
  |-
  |rowspan="2"| 0x0D
+
  | rowspan="4" | Property
  |rowspan="2"| Play
+
  | Name
  |rowspan="2"| Client
+
  | rowspan="4"| {{Type|Array}}
| Difficulty
+
  | {{Type|String}} (32767)
| Unsigned Byte
 
| 0: peaceful, 1: easy, 2: normal, 3: hard
 
  |- {{Added}}
 
| Difficulty locked?
 
| Boolean
 
 
  |
 
  |
|}
 
 
==== Open Horse Window ====
 
 
{{Change||This packet is used exclusively for opening the horse GUI.  [[#Open Window|Open Window]] is used for all other GUIs, and now has ID 0x59.}}
 
 
{| class="wikitable" {{added}}
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="3"| 0x1F
+
  | Value
|rowspan="3"| Play
+
  | {{Type|String}} (32767)
  |rowspan="3"| Client
 
| Window ID?
 
| Byte
 
 
  |
 
  |
 
  |-
 
  |-
  | Number of slots?
+
  | Is Signed
  | VarInt
+
  | {{Type|Boolean}}
 
  |
 
  |
 
  |-
 
  |-
  | Entity ID?
+
  | Signature
  | Integer
+
  | {{Type|Optional}} {{Type|String}} (32767)
  |
+
  | Only if Is Signed is true.
  |}
+
  |-
 
+
| rowspan="7" | Initialize Chat
==== Chunk Data ====
+
| rowspan="7" | 0x02
{{Main|Chunk Format}}
+
| colspan="2" | Has Signature Data
{{See also|#Unload Chunk}}
+
| colspan="2" | {{Type|Boolean}}
 
+
|-
The server only sends skylight information for chunk pillars in the {{Minecraft Wiki|Overworld}}, it's up to the client to know in which dimenison the player is currently located. You can also infer this information from the primary bitmask and the amount of uncompressed bytes sent.  This packet also sends all block entities in the chunk (though sending them is not required; it is still legal to send them with [[#Update Block Entity|Update Block Entity]] later).
+
| colspan="2" | Chat session ID
 
+
| colspan="2" | {{Type|UUID}}
{| class="wikitable"
+
| Only sent if Has Signature Data is true.
  ! Packet ID
+
|-
  ! State
+
| colspan="2" | Public key expiry time
  ! Bound To
+
| colspan="2" | {{Type|Long}}
  ! Field Name
+
| Key expiry time, as a UNIX timestamp in milliseconds. Only sent if Has Signature Data is true.
  ! Field Type
+
  |-
  ! Notes
+
| colspan="2" | Encoded public key size
 +
  | colspan="2" | {{Type|VarInt}}
 +
  | Size of the following array. Only sent if Has Signature Data is true. Maximum length is 512 bytes.
 +
  |-
 +
  | colspan="2" | Encoded public key
 +
  | colspan="2" | {{Type|Byte Array}} (512)
 +
  | The player's public key, in bytes. Only sent if Has Signature Data is true.
 
  |-
 
  |-
  |rowspan="9"| {{Change|0x22|0x21}}
+
  | colspan="2" | Public key signature size
  |rowspan="9"| Play
+
  | colspan="2" | {{Type|VarInt}}
|rowspan="9"| Client
+
  | Size of the following array. Only sent if Has Signature Data is true. Maximum length is 4096 bytes.
| Chunk X
 
| Int
 
  | Chunk coordinate (block coordinate divided by 16, rounded down)
 
 
  |-
 
  |-
  | Chunk Z
+
  | colspan="2" | Public key signature
  | Int
+
  | colspan="2" | {{Type|Byte Array}} (4096)
  | Chunk coordinate (block coordinate divided by 16, rounded down)
+
  | The public key's digital signature. Only sent if Has Signature Data is true.
 
  |-
 
  |-
  | Full chunk
+
  | Update Game Mode
  | Boolean
+
  | 0x04
  | See [[Chunk Format#Full chunk|Chunk Format]]
+
  | colspan="2" | Game Mode
 +
| colspan="2" | {{Type|VarInt}}
 
  |-
 
  |-
  | Primary Bit Mask
+
  | Update Listed
  | VarInt
+
  | 0x08
  | 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).
+
  | colspan="2" | Listed
  |- {{Added}}
+
  | colspan="2" | {{Type|Boolean}}
  | Heightmaps
+
  | Whether the player should be listed on the player list.
| [[NBT]]
 
| 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).
 
|-
 
| Size
 
| VarInt
 
| Size of Data in bytes
 
 
  |-
 
  |-
  | Data
+
  | Update Latency
  | Byte array
+
  | 0x10
  | See [[Chunk Format#Data structure|data structure]] in Chunk Format
+
  | colspan="2" | Ping
 +
| colspan="2" | {{Type|VarInt}}
 +
| Measured in milliseconds.
 
  |-
 
  |-
  | Number of block entities
+
  | rowspan="2" | Update Display Name
  | VarInt
+
| rowspan="2" | 0x20
  | Number of elements in the following array
+
  | colspan="2" | Has Display Name
 +
  | colspan="2" | {{Type|Boolean}}
 
  |-
 
  |-
  | Block entities
+
  | colspan="2" | Display Name
  | Array of [[NBT]]
+
  | colspan="2" | {{Type|Optional}} {{Type|Text Component}}
  | All block entities in the chunkUse the x, y, and z tags in the NBT to determine their positions.
+
  | Only sent if Has Display Name is true.
 +
|- {{added}}
 +
| Update List Priority
 +
| 0x40
 +
| colspan="2" | Priority
 +
| colspan="2" | {{Type|VarInt}}
 +
  | See below.
 
  |}
 
  |}
  
===== Data structure =====
+
The properties included in this packet are the same as in [[#Login Success|Login Success]], for the current player.
  
The data section of the packet contains most of the useful data for the chunk.
+
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:
 +
* {{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.
 +
 
 +
==== 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|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 [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.
  
 
{| class="wikitable"
 
{| class="wikitable"
  |-
+
  ! Packet ID
 +
! State
 +
! Bound To
 
  ! Field Name
 
  ! Field Name
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  | Data
+
  | rowspan="11"| ''protocol:''<br/><code>{{change|0x40|0x42}}</code><br/><br/>''resource:''<br/><code>player_position</code>
  | Array of [[#Chunk Section structure|Chunk Section]]
+
| rowspan="11"| Play
  | The number of elements in the array is equal to the number of bits set in Primary Bit Mask. Sections are sent bottom-to-top, i.e. the first section, if sent, extends from Y=0 to Y=15.
+
| 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
 +
| {{Type|Double}}
 +
| Absolute or relative position, depending on Flags.
 
  |-
 
  |-
  | Biomes
+
  | Y
  | Optional Int Array
+
  | {{Type|Double}}
| Only sent if full chunk is true; 256 entries if present
+
  | Absolute or relative position, depending on Flags.
  |}
 
 
 
===== Chunk Section structure =====
 
 
 
A Chunk Section is defined in terms of other [[data types]]. A Chunk Section consists of the following fields:
 
 
 
{| class="wikitable"
 
 
  |-
 
  |-
  ! Field Name
+
  | Z
  ! Field Type
+
  | {{Type|Double}}
  ! Notes
+
  | Absolute or relative position, depending on Flags.
 +
|- {{added}}
 +
| Velocity X
 +
| {{Type|Double}}
 +
|
 +
|- {{added}}
 +
| Velocity Y
 +
| {{Type|Double}}
 +
|
 
  |- {{added}}
 
  |- {{added}}
  | Block count
+
  | Velocity Z
  | Short
+
  | {{Type|Double}}
  | Number of non-air blocks present in the chunk section, for lighting purposes.  "Non-air" is defined as any block other than air, cave air, and void air (in particular, note that fluids such as water are still counted).
+
  |
 
  |-
 
  |-
  | Bits Per Block
+
  | Yaw
  | Unsigned Byte
+
  | {{Type|Float}}
  | Determines how many bits are used to encode a block. Note that not all numbers are valid here.
+
  | Absolute or relative rotation on the X axis, in degrees.
 
  |-
 
  |-
  | Palette
+
  | Pitch
  | Varies
+
  | {{Type|Float}}
  | See below for the format.
+
  | Absolute or relative rotation on the Y axis, in degrees.
|-
 
| Data Array Length
 
| VarInt
 
| Number of longs in the following array
 
 
  |-
 
  |-
  | Data Array
+
  | Flags
  | Array of Long
+
  | {{change|{{Type|Byte}}|{{Type|Teleport Flags}}}}
  | Compacted list of 4096 indices pointing to state IDs in the Palette
+
  | {{change|Reference the Flags table below. When the value of the this byte masked is zero the field is absolute, otherwise relative.|}}
 
  |- {{removed}}
 
  |- {{removed}}
  | Block Light
+
  | Teleport ID
  | Byte Array
+
  | {{Type|VarInt}}
| Half byte per block
+
  | Client should confirm this packet with [[#Confirm Teleportation|Confirm Teleportation]] containing the same Teleport ID.
|- {{removed}}
 
  | Sky Light
 
| Optional Byte Array
 
| Only if in the Overworld; half byte per block
 
 
  |}
 
  |}
  
Data Array{{change|, Block Light, and Sky Light are|is}} given for each block with increasing x coordinates, within rows of increasing z coordinates, within layers of increasing y coordinates.  {{change|For the half-byte light arrays, even-indexed items (those with an even x coordinate, starting at 0) are packed into the ''low bits'', odd-indexed into the ''high bits''.}}
+
==== Player Rotation ====
  
==== Join Game ====
+
{| class="wikitable" {{added}}
 
 
See [[Protocol Encryption]] for information on logging in.
 
 
 
{| class="wikitable"
 
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 1,841: Line 1,934:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="8"| 0x25
+
  | rowspan="2"| ''protocol:''<br/><code>0x43</code><br/><br/>''resource:''<br/><code>player_rotation</code>
  |rowspan="8"| Play
+
  | rowspan="2"| Play
  |rowspan="8"| Client
+
  | rowspan="2"| Client
  | Entity ID
+
  | Yaw
  | Int
+
  | {{Type|Float}}
  | The player's Entity ID (EID)
+
  | Rotation on the X axis, in degrees.
 
  |-
 
  |-
  | Gamemode
+
  | Pitch
  | Unsigned Byte
+
  | {{Type|Float}}
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. Bit 3 (0x8) is the hardcore flag.
+
  | Rotation on the Y axis, in degrees.
|-
 
| Dimension
 
| Int Enum
 
| -1: Nether, 0: Overworld, 1: End; also, note that this is not a VarInt but instead a regular int.
 
|- {{removed}}
 
| Difficulty
 
| Unsigned Byte
 
| 0: peaceful, 1: easy, 2: normal, 3: hard
 
|-
 
| Max Players
 
| Unsigned Byte
 
| Was once used by the client to draw the player list, but now is ignored
 
|-
 
| Level Type
 
| String Enum (16)
 
| default, flat, largeBiomes, amplified, default_1_1
 
|- {{added}}
 
  | View Distance
 
| VarInt
 
| Render distance (2-32)
 
|-
 
| Reduced Debug Info
 
| Boolean
 
| If true, a Notchian client shows reduced information on the {{Minecraft Wiki|debug screen}}.  For servers in development, this should almost always be false.
 
 
  |}
 
  |}
  
==== Map Data ====
+
==== Place Ghost Recipe ====
  
Updates a rectangular area on a {{Minecraft Wiki|map}} item.
+
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,885: Line 1,954:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
  !colspan="2"| Field Type
+
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="17"| 0x26
+
  | rowspan="4"| ''protocol:''<br/><code>{{change|0x37|0x39}}</code><br/><br/>''resource:''<br/><code>place_ghost_recipe</code>
  |rowspan="17"| Play
+
  | rowspan="4"| Play
  |rowspan="17"| Client
+
  | rowspan="4"| Client
  |colspan="2"| Map ID
+
  | Window ID
  |colspan="2"| VarInt
+
  | {{change|{{Type|Byte}}|{{Type|VarInt}}}}
  | Map ID of the map being modified
+
  |
  |-
+
  |- {{removed}}
  |colspan="2"| Scale
+
  | Recipe
  |colspan="2"| Byte
+
  | {{Type|Identifier}}
  | From 0 for a fully zoomed-in map (1 block per pixel) to 4 for a fully zoomed-out map (16 blocks per pixel)
+
  | A recipe ID.
  |-  
+
  |- {{added}}
  |colspan="2"| Tracking Position
+
  | Recipe Display
  |colspan="2"| Boolean
+
  | {{Type|Recipe Display}}
  | Specifies whether player and item frame icons are shown
+
  |
  |- {{Added}}
+
  |}
|colspan="2"| Locked
+
 
  |colspan="2"| Boolean
+
==== Recipe Book Add ====
  | True if the map has been locked in a cartography table
+
 
  |-
+
{| class="wikitable" {{added}}
  |colspan="2"| Icon Count
+
  ! Packet ID
  |colspan="2"| VarInt
+
  ! State
| Number of elements in the following array
+
  ! Bound To
|-
+
  ! colspan="2"| Field Name
|rowspan="5"| Icon
+
  ! colspan="2"| Field Type
| Type
+
  ! colspan="2"| Notes
  |rowspan="6"| Array
 
| VarInt enum
 
| See below
 
 
  |-
 
  |-
  | X
+
  | rowspan="10"| ''protocol:''<br/><code>0x44</code><br/><br/>''resource:''<br/><code>recipe_book_add</code>
  | Byte
+
| rowspan="10"| Play
  | Map coordinates: -128 for furthest left, +127 for furthest right
+
| rowspan="10"| Client
 +
  | colspan="2"| Recipe Count
 +
  | colspan="2"| {{Type|VarInt}}
 +
| Number of elements in the following array.
 
  |-
 
  |-
  | Z
+
  | rowspan="8"| Recipes
  | Byte
+
| Recipe ID
  | Map coordinates: -128 for highest, +127 for lowest
+
| rowspan="8"| {{Type|Array}}
 +
  | {{Type|VarInt}}
 +
  | ID to assign to the recipe.
 
  |-
 
  |-
  | Direction
+
  | Display
  | Byte
+
  | {{Type|Recipe Display}}
  | 0-15
+
  |
 
  |-
 
  |-
  | Has Display Name
+
  | Group ID
  | Boolean
+
  | {{Type|VarInt}}
 
  |
 
  |
 
  |-
 
  |-
  | Display Name
+
  | Category ID
  | Optional [[Chat]]
+
  | {{Type|VarInt}}
| Only present if previous Boolean is true
+
  | ID in the <code>minecraft:recipe_book_category</code> registry.
|-
 
|colspan="2"| Columns
 
|colspan="2"| Byte
 
  | Number of columns updated
 
 
  |-
 
  |-
  |colspan="2"| Rows
+
  | Has Ingredients
  |colspan="2"| Optional Byte
+
  | {{Type|Boolean}}
  | Only if Columns is more than 0; number of rows updated
+
  |
 
  |-
 
  |-
  |colspan="2"| X
+
  | Ingredient Count
  |colspan="2"| Optional Byte
+
  | {{Type|Optional}} {{Type|VarInt}}
  | Only if Columns is more than 0; x offset of the westernmost column
+
  | Number of elements in the following array. Only present if Has Ingredients is true.
 
  |-
 
  |-
  |colspan="2"| Z
+
  | Ingredients
  |colspan="2"| Optional Byte
+
  | {{Type|Optional}} {{Type|Array}} of {{Type|ID Set}}
  | Only if Columns is more than 0; z offset of the northernmost row
+
  | IDs in the <code>minecraft:item</code> registry, or an inline definition. Only present if Has Ingredients is true.
 
  |-
 
  |-
  |colspan="2"| Length
+
  | Flags
  |colspan="2"| Optional VarInt
+
  | {{Type|Byte}}
  | Only if Columns is more than 0; length of the following array
+
  | 0x01: show notification; 0x02: highlight as new
 
  |-
 
  |-
  |colspan="2"| Data
+
  | colspan="2"| Replace
  |colspan="2"| Optional Array of Unsigned Byte
+
  | colspan="2"| {{Type|Boolean}}
| Only if Columns is more than 0; see {{Minecraft Wiki|Map item format}}
+
| Replace or Add to known recipes
 
  |}
 
  |}
  
For icons, a direction of 0 is a vertical icon and increments by 22.5&deg; (360/16).
+
==== Recipe Book Remove ====
  
Types are based off of rows and columns in <code>map_icons.png</code>:
+
{| class="wikitable" {{added}}
 
+
! Packet ID
{| class="wikitable"
+
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  ! Icon type
+
  | rowspan="2"| ''protocol:''<br/><code>0x45</code><br/><br/>''resource:''<br/><code>recipe_book_remove</code>
  ! Result
+
  | rowspan="2"| Play
 +
| rowspan="2"| Client
 +
| Recipe Count
 +
| {{Type|VarInt}}
 +
| Number of elements in the following array.
 
  |-
 
  |-
  | 0
+
  | Recipes
  | White arrow (players)
+
  | {{Type|Array}} of {{Type|VarInt}}
  |-
+
  | IDs of recipes to remove.
  | 1
+
  |}
  | Green arrow (item frames)
+
 
 +
==== Recipe Book Settings ====
 +
 
 +
{| class="wikitable" {{added}}
 +
! Packet ID
 +
! State
 +
  ! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | 2
+
  | rowspan="8"| ''protocol:''<br/><code>0x46</code><br/><br/>''resource:''<br/><code>recipe_book_settings</code>
  | Red arrow
+
| rowspan="8"| Play
 +
| rowspan="8"| Client
 +
| Crafting Recipe Book Open
 +
| {{Type|Boolean}}
 +
  | If true, then the crafting recipe book will be open when the player opens its inventory.
 
  |-
 
  |-
  | 3
+
  | Crafting Recipe Book Filter Active
  | Blue arrow
+
  | {{Type|Boolean}}
 +
| If true, then the filtering option is active when the players opens its inventory.
 
  |-
 
  |-
  | 4
+
  | Smelting Recipe Book Open
  | White cross
+
  | {{Type|Boolean}}
 +
| If true, then the smelting recipe book will be open when the player opens its inventory.
 
  |-
 
  |-
  | 5
+
  | Smelting Recipe Book Filter Active
  | Red pointer
+
  | {{Type|Boolean}}
 +
| If true, then the filtering option is active when the players opens its inventory.
 
  |-
 
  |-
  | 6
+
  | Blast Furnace Recipe Book Open
  | White circle (off-map players)
+
  | {{Type|Boolean}}
 +
| If true, then the blast furnace recipe book will be open when the player opens its inventory.
 
  |-
 
  |-
  | 7
+
  | Blast Furnace Recipe Book Filter Active
  | Small white circle (far-off-map players)
+
  | {{Type|Boolean}}
 +
| If true, then the filtering option is active when the players opens its inventory.
 
  |-
 
  |-
  | 8
+
  | Smoker Recipe Book Open
  | Mansion
+
  | {{Type|Boolean}}
 +
| If true, then the smoker recipe book will be open when the player opens its inventory.
 
  |-
 
  |-
  | 9
+
  | Smoker Recipe Book Filter Active
  | Temple
+
  | {{Type|Boolean}}
  |-
+
  | If true, then the filtering option is active when the players opens its inventory.
  | 10
+
  |}
  | White Banner
+
 
  |-
+
==== Respawn ====
  | 11
+
 
  | Orange Banner
+
{{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"
 +
  ! Packet ID
 +
! State
 +
! Bound To
 +
  ! Field Name
 +
  ! Field Type
 +
  ! Notes
 
  |-
 
  |-
  | 12
+
  | rowspan="13"| ''protocol:''<br/><code>{{change|0x47|0x4C}}</code><br/><br/>''resource:''<br/><code>respawn</code>
  | Magenta Banner
+
| rowspan="13"| Play
 +
  | rowspan="13"| Client
 +
| Dimension Type
 +
| {{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.
 
  |-
 
  |-
  | 13
+
  | Dimension Name
  | Light Blue Banner
+
  | {{Type|Identifier}}
 +
| Name of the dimension being spawned into.
 
  |-
 
  |-
  | 14
+
  | Hashed seed
  | Yellow Banner
+
  | {{Type|Long}}
 +
| First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
 
  |-
 
  |-
  | 15
+
  | Game mode
  | Lime Banner
+
  | {{Type|Unsigned Byte}}
 +
| 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
 
  |-
 
  |-
  | 16
+
  | Previous Game mode
  | Pink Banner
+
  | {{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)
 
  |-
 
  |-
  | 17
+
  | Is Debug
  | Gray Banner
+
  | {{Type|Boolean}}
 +
| True if the world is a {{Minecraft Wiki|debug mode}} world; debug mode worlds cannot be modified and have predefined blocks.
 
  |-
 
  |-
  | 18
+
  | Is Flat
  | Light Gray Banner
+
  | {{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.
 
  |-
 
  |-
  | 19
+
  | Has death location
  | Cyan Banner
+
  | {{Type|Boolean}}
 +
| If true, then the next two fields are present.
 
  |-
 
  |-
  | 20
+
  | Death dimension Name
  | Purple Banner
+
  | {{Type|Optional}} {{Type|Identifier}}
 +
| Name of the dimension the player died in.
 
  |-
 
  |-
  | 21
+
  | Death location
  | Blue Banner
+
  | {{Type|Optional}} {{Type|Position}}
 +
| The location that the player died at.
 
  |-
 
  |-
  | 22
+
  | Portal cooldown
  | Brown Banner
+
| {{Type|VarInt}}
 +
| The number of ticks until the player can use the portal again.
 +
|- {{added}}
 +
| Sea level
 +
| {{Type|VarInt}}
 +
  |
 
  |-
 
  |-
  | 23
+
  | Data kept
  | Green Banner
+
  | {{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.
| 24
+
In the Notchian implementation, this is context dependent:
  | Red Banner
+
* normal respawns (after death) keep no data;
|-
+
* exiting the end poem/credits keeps the attributes;
| 25
+
* other dimension changes (portals or teleports) keep all data.
| Black Banner
+
  |}
|-
+
 
  | 26
+
{{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).
| Treasure marker
 
|}
 
  
==== Open Book ====
+
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.}}
  
{{change||Replaces the [[#minecraft:book_open|minecraft:book_open]] plugin channel.}}
+
==== Set Cursor Item ====
  
Sent when a player right clicks with a signed book. This tells the client to open the book GUI.
+
{| class="wikitable" {{added}}
 
 
{| class="wikitable" {{Added}}
 
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,068: Line 2,186:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="1"| 0x2D
+
  | 0x5A
  |rowspan="1"| Play
+
  | Play
  |rowspan="1"| Client
+
  | Client
  | Hand
+
  | Slot Data
  | VarInt enum
+
  | {{Type|Slot}}
  | 0: Main hand, 1: Off hand
+
  |
 
  |}
 
  |}
  
==== Use Bed ====  
+
==== Update Time ====
  
{{change|This packet tells that a player goes to bed.}}
+
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.
  
{{change|The client with the matching Entity ID will go into bed mode.}}
+
The time of day is based on the timestamp modulo 24000. 0 is sunrise, 6000 is noon, 12000 is sunset, and 18000 is midnight.
  
{{change|This Packet is sent to all nearby players including the one sent to bed.}}
+
The default SMP server increments the time by <code>20</code> every second.
  
{{change|Any packets sent with a location not currently occupied by a bed will be ignored by clients.}}
+
{| class="wikitable"
 
 
{| class="wikitable" {{removed}}
 
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,094: Line 2,210:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x33
+
  | rowspan="3"| ''protocol:''<br/><code>{{change|0x64|0x6B}}</code><br/><br/>''resource:''<br/><code>set_time</code>
  |rowspan="2"| Play
+
  | rowspan="3"| Play
  |rowspan="2"| Client
+
  | rowspan="3"| Client
  | Entity ID
+
  | World Age
  | VarInt
+
  | {{Type|Long}}
  | Sleeping player's EID
+
  | In ticks; not changed by server commands.
 
  |-
 
  |-
  | Location
+
  | Time of day
  | Position
+
  | {{Type|Long}}
  | Block location of the head part of the bed
+
  | 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.
 
  |}
 
  |}
  
==== Respawn ====
+
==== Set Player Inventory Slot ====
  
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" {{added}}
 
 
{| class="wikitable"
 
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,118: Line 2,236:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x3A
+
  | 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
  | Dimension
+
  | Slot
| Int Enum
+
  | {{Type|VarInt}}
| -1: The Nether, 0: The Overworld, 1: The End
+
  |
  |- {{removed}}
 
  | Difficulty
 
| Unsigned Byte
 
| 0: Peaceful, 1: Easy, 2: Normal, 3: Hard
 
 
  |-
 
  |-
  | Gamemode
+
  | Slot Data
  | Unsigned Byte
+
  | {{Type|Slot}}
| 0: survival, 1: creative, 2: adventure, 3: spectator. The hardcore flag is not included
+
  |
|-
 
| Level Type
 
| String (16)
 
  | Same as [[#Join Game|Join Game]]
 
 
  |}
 
  |}
  
{{Warning2|Avoid changing player's dimension to same dimension they were already in unless they are dead. If you change the dimension to one they are already in, weird bugs can occur, such as the player being unable to attack other players in new world (until they die and respawn).
+
==== Synchronize Vehicle Position ====
  
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.}}
+
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.
  
==== Entity Sound Effect ====
+
{| class="wikitable" {{added}}
 
 
Plays a sound effect from an entity.
 
 
 
{| class="wikitable"
 
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,154: Line 2,260:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="5"| 0x50
+
  | rowspan="11"| ''protocol:''<br/><code>0x77</code><br/><br/>''resource:''<br/><code>teleport_entity</code>
  |rowspan="5"| Play
+
  | rowspan="11"| Play
  |rowspan="5"| Client
+
  | rowspan="11"| Client
| Sound ID
 
| VarInt
 
| ID of hardcoded sound event ([https://pokechu22.github.io/Burger/1.14.1.html#sounds events] as of 1.14.1)
 
|-
 
| Sound Category
 
| VarInt Enum
 
| The category that this sound will be played from ([https://gist.github.com/konwboj/7c0c380d3923443e9d55 current categories])
 
|-
 
 
  | Entity ID
 
  | Entity ID
  | VarInt
+
  | {{Type|VarInt}}
 
  |
 
  |
 
  |-
 
  |-
  | Volume
+
  | X
  | Float
+
  | {{Type|Double}}
  | 1.0 is 100%, capped between 0.0 and 1.0 by Notchian clients
+
  |
 
  |-
 
  |-
  | Pitch
+
  | Y
  | Float
+
  | {{Type|Double}}
| Float between 0.5 and 2.0 by Notchian clients
+
  |
|}
 
 
 
==== Declare Recipes ====
 
 
 
{| class="wikitable"
 
! Packet ID
 
  ! State
 
! Bound To
 
!colspan="2"| Field Name
 
!colspan="2"| Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="5"| {{Change|0x54|0x5A}}
+
  | Z
  |rowspan="5"| Play
+
| {{Type|Double}}
|rowspan="5"| Client
+
  |
|colspan="2"| Num Recipes
 
|colspan="2"| VarInt
 
| Number of elements in the following array
 
 
  |-
 
  |-
  |rowspan="4"| Recipe
+
  | Velocity X
  |{{removed}}| Recipe ID
+
  | {{Type|Double}}
|rowspan="4"| Array
+
  |
|{{removed}}| Identifier
 
  |{{removed}}|
 
 
  |-
 
  |-
  | Type
+
  | Velocity Y
  | {{Change|String|Identifier}}
+
  | {{Type|Double}}
| The recipe serializer, see below
 
|- {{Added}}
 
| Recipe ID
 
| Identifier
 
 
  |
 
  |
 
  |-
 
  |-
  | Data
+
  | Velocity Z
  | Optional, varies
+
  | {{Type|Double}}
  | Additional data for the recipeFor some types, there will be no data.
+
|
 +
|-
 +
| 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}}
 +
|
 
  |}
 
  |}
  
Recipe serializers:
+
==== Update Recipes ====
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Serializer
+
  ! Packet ID
  ! Description
+
  ! State
  ! Data
+
  ! Bound To
 +
! colspan="2"| Field Name
 +
! colspan="2"| Field Type
 +
! Notes
 
  |-
 
  |-
  | <code>{{change||minecraft:}}crafting_shapeless</code>
+
  | rowspan="8"| ''protocol:''<br/><code>{{change|0x77|0x7e}}</code><br/><br/>''resource:''<br/><code>update_recipes</code>
  | Shapeless crafting recipe. All items in the ingredient list must be present, but in any order/slot.
+
| rowspan="8"| Play
  | As follows:
+
| rowspan="8"| Client
   {| class="wikitable"
+
| {{removed}} colspan="2"| Num Recipes
     ! Name
+
| {{removed}} colspan="2"| {{Type|VarInt}}
     ! Type
+
| {{removed}}| Number of elements in the following array.
     ! Description
+
|- {{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}}
 +
| rowspan="3"| Property Sets
 +
| 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
 
     | Group
     | String
+
     | {{Type|String}} (32767)
     | Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
+
     | Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
 
     |-
 
     |-
     | Ingredient count
+
     |Category
     | VarInt
+
     |{{Type|VarInt}} {{Type|Enum}}
     | Number of elements in the following array
+
     |Building = 0, Redstone = 1, Equipment = 2, Misc = 3
 
     |-
 
     |-
     | Ingredients
+
     | Width
     | Array of Ingredient
+
     | {{Type|VarInt}}
 
     |
 
     |
 
     |-
 
     |-
     | Result
+
     | Height
     | [[Slot]]
+
     | {{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]].
 
     |}
 
     |}
 
  |-
 
  |-
  | <code>{{change||minecraft:}}crafting_shaped</code>
+
| 1
  | Shaped crafting recipe. All items must be present in the same pattern (which may be flipped horizontally or translated)
+
  | <code>minecraft:crafting_shapeless</code>
 +
  | Shapeless crafting recipe. All items in the ingredient list must be present, but in any order/slot.
 
  | As follows:
 
  | As follows:
   {| class="wikitable"
+
   {| class="wikitable" {{removed}}
 
     ! Name
 
     ! Name
 
     ! Type
 
     ! Type
 
     ! Description
 
     ! Description
 
     |-
 
     |-
     | Width
+
     | Group
     | VarInt
+
     | {{Type|String}} (32767)
     |
+
     | Used to group similar recipes together in the recipe book. Tag is present in recipe JSON.
 
     |-
 
     |-
     | Height
+
     |Category
     | VarInt
+
     |{{Type|VarInt}} {{Type|Enum}}
     |
+
     |Building = 0, Redstone = 1, Equipment = 2, Misc = 3
 
     |-
 
     |-
     | Group
+
     | Ingredient count
     | String
+
     | {{Type|VarInt}}
     | Used to group similar recipes together in the recipe book.  Tag is present in recipe JSON.
+
     | Number of elements in the following array.
 
     |-
 
     |-
 
     | Ingredients
 
     | Ingredients
     | Array of Ingredient
+
     | {{Type|Array}} of Ingredient.
     | Length is width * height.  Indexed by x + (y * width).
+
     |
 
     |-
 
     |-
 
     | Result
 
     | Result
     | [[Slot]]
+
     | {{Type|Slot}}
 
     |
 
     |
 
     |}
 
     |}
 
  |-
 
  |-
  | <code>{{change||minecraft:}}crafting_special_armordye</code>
+
| 2
 +
  | <code>minecraft:crafting_special_armordye</code>
 
  | Recipe for dying leather armor
 
  | Recipe for dying leather armor
  | None
+
  | rowspan="14" | As follows:
 +
  {| class="wikitable" {{removed}}
 +
    ! Name
 +
    ! Type
 +
    ! Description
 +
    |-
 +
    |Category
 +
    |{{Type|VarInt}} {{Type|Enum}}
 +
    |Building = 0, Redstone = 1, Equipment = 2, Misc = 3
 +
    |}
 
  |-
 
  |-
  | <code>{{change||minecraft:}}crafting_special_bookcloning</code>
+
| 3
 +
  | <code>minecraft:crafting_special_bookcloning</code>
 
  | Recipe for copying contents of written books
 
  | Recipe for copying contents of written books
| None
 
 
  |-
 
  |-
  | <code>{{change||minecraft:}}crafting_special_mapcloning</code>
+
| 4
 +
  | <code>minecraft:crafting_special_mapcloning</code>
 
  | Recipe for copying maps
 
  | Recipe for copying maps
| None
 
 
  |-
 
  |-
  | <code>{{change||minecraft:}}crafting_special_mapextending</code>
+
| 5
 +
  | <code>minecraft:crafting_special_mapextending</code>
 
  | Recipe for adding paper to maps
 
  | Recipe for adding paper to maps
| None
 
 
  |-
 
  |-
  | <code>{{change||minecraft:}}crafting_special_firework_rocket</code>
+
| 6
 +
  | <code>minecraft:crafting_special_firework_rocket</code>
 
  | Recipe for making firework rockets
 
  | Recipe for making firework rockets
| None
 
 
  |-
 
  |-
  | <code>{{change||minecraft:}}crafting_special_firework_star</code>
+
| 7
 +
  | <code>minecraft:crafting_special_firework_star</code>
 
  | Recipe for making firework stars
 
  | Recipe for making firework stars
| None
 
 
  |-
 
  |-
  | <code>{{change||minecraft:}}crafting_special_firework_star_fade</code>
+
| 8
 +
  | <code>minecraft:crafting_special_firework_star_fade</code>
 
  | Recipe for making firework stars fade between multiple colors
 
  | Recipe for making firework stars fade between multiple colors
| None
 
 
  |-
 
  |-
  | <code>{{change||minecraft:}}crafting_special_repairitem</code>
+
  | 9
| Recipe for repairing items via crafting
+
  | <code>minecraft:crafting_special_tippedarrow</code>
| None
 
|-
 
  | <code>{{change||minecraft:}}crafting_special_tippedarrow</code>
 
 
  | Recipe for crafting tipped arrows
 
  | Recipe for crafting tipped arrows
| None
 
 
  |-
 
  |-
  | <code>{{change||minecraft:}}crafting_special_bannerduplicate</code>
+
| 10
 +
  | <code>minecraft:crafting_special_bannerduplicate</code>
 
  | Recipe for copying banner patterns
 
  | Recipe for copying banner patterns
| None
 
 
  |-
 
  |-
  | <code>{{change||minecraft:}}crafting_special_banneraddpattern</code>
+
  | 11
| Recipe for adding patterns to banners
+
  | <code>minecraft:crafting_special_shielddecoration</code>
| None
 
|-
 
  | <code>{{change||minecraft:}}crafting_special_shielddecoration</code>
 
 
  | Recipe for applying a banner's pattern to a shield
 
  | Recipe for applying a banner's pattern to a shield
| None
 
 
  |-
 
  |-
  | <code>{{change||minecraft:}}crafting_special_shulkerboxcoloring</code>
+
| 12
 +
  | <code>minecraft:crafting_special_shulkerboxcoloring</code>
 
  | Recipe for recoloring a shulker box
 
  | Recipe for recoloring a shulker box
  | None
+
  |-
  |- {{Added}}
+
  | 13
 
  | <code>minecraft:crafting_special_suspiciousstew</code>
 
  | <code>minecraft:crafting_special_suspiciousstew</code>
  | Recipe for crafting suspicious stew with various affects.
+
  | Recipe for crafting suspicious stews
| None
 
 
  |-
 
  |-
  | <code>{{change||minecraft:}}smelting</code>
+
  | 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
 
  | Smelting recipe
  |rowspan="4"| All of these have the same format, as follows:
+
  | rowspan="4"| As follows:
   {| class="wikitable"
+
   {| class="wikitable" {{removed}}
 
     ! Name
 
     ! Name
 
     ! Type
 
     ! Type
Line 2,340: Line 2,509:
 
     |-
 
     |-
 
     | Group
 
     | Group
     | String
+
     | {{Type|String}} (32767)
 
     | Used to group similar recipes together in the recipe book.
 
     | Used to group similar recipes together in the recipe book.
 +
    |-
 +
    |Category
 +
    |{{Type|VarInt}} {{Type|Enum}}
 +
    |Food = 0, Blocks = 1, Misc = 2
 
     |-
 
     |-
 
     | Ingredient
 
     | Ingredient
Line 2,348: Line 2,521:
 
     |-
 
     |-
 
     | Result
 
     | Result
     | [[Slot]]
+
     | {{Type|Slot}}
 
     |
 
     |
 
     |-
 
     |-
 
     | Experience
 
     | Experience
     | Float
+
     | {{Type|Float}}
 
     |
 
     |
 
     |-
 
     |-
 
     | Cooking time
 
     | Cooking time
     | VarInt
+
     | {{Type|VarInt}}
 
     |
 
     |
 
     |}
 
     |}
  |- {{Added}}
+
  |-
 +
| 16
 
  | <code>minecraft:blasting</code>
 
  | <code>minecraft:blasting</code>
  | Recipes in a blast furnace.
+
  | Blast furnace recipe
  |- {{Added}}
+
  |-
 +
| 17
 
  | <code>minecraft:smoking</code>
 
  | <code>minecraft:smoking</code>
  | Recipes in a smoker.
+
  | Smoker recipe
  |- {{Added}}
+
  |-
 +
| 18
 
  | <code>minecraft:campfire_cooking</code>
 
  | <code>minecraft:campfire_cooking</code>
  | Recipes in a campfire.
+
  | Campfire recipe
  |- {{Added}}
+
  |-
  | <code>{{change||minecraft:stonecutting}}</code>
+
| 19
  | {{change||Stonecutting recipe.}}
+
  | <code>minecraft:stonecutting</code>
 +
  | Stonecutter recipe
 
  | As follows:
 
  | As follows:
   {| class="wikitable"
+
   {| class="wikitable" {{removed}}
 
     ! Name
 
     ! Name
 
     ! Type
 
     ! Type
Line 2,378: Line 2,555:
 
     |-
 
     |-
 
     | Group
 
     | Group
     | String
+
     | {{Type|String}} (32767)
 
     | Used to group similar recipes together in the recipe book.  Tag is present in recipe JSON.
 
     | Used to group similar recipes together in the recipe book.  Tag is present in recipe JSON.
 
     |-
 
     |-
 
     | Ingredient
 
     | Ingredient
 
     | Ingredient
 
     | Ingredient
     | The ingredient
+
     |
 
     |-
 
     |-
 
     | Result
 
     | Result
     | [[Slot]]
+
     | {{Type|Slot}}
 
     |
 
     |
 
     |}
 
     |}
 
  |-
 
  |-
  |}
+
  | 20
 
+
| <code>minecraft:smithing_transform</code>
Ingredient is defined as:
+
| Recipe for smithing netherite gear
 
+
| As follows:
{| class="wikitable"
+
  {| class="wikitable" {{removed}}
  ! Name
+
    ! Name
  ! Type
+
    ! Type
  ! Description
+
    ! Description
  |-
+
    |-
  | Count
+
    | Template
  | VarInt
+
    | Ingredient
  | Number of elements in the following array
+
    | 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.
 +
    |}
 +
|}
 +
 
 +
{{change|Ingredient is defined as:|}}
 +
 
 +
{| class="wikitable" {{removed}}
 +
  ! Name
 +
  ! Type
 +
  ! Description
 +
  |-
 +
  | Count
 +
  | {{Type|VarInt}}
 +
  | Number of elements in the following array.
 
  |-
 
  |-
 
  | Items
 
  | Items
  | Array of [[Slot]]
+
  | {{Type|Array}} of {{Type|Slot}}
 
  | Any item in this array may be used for the recipe.  The count of each item should be 1.
 
  | Any item in this array may be used for the recipe.  The count of each item should be 1.
 
  |}
 
  |}
  
==== Tags ====
+
=== Serverbound ===
  
{| class="wikitable"
+
==== Bundle Item Selected ====
 +
 
 +
{| class="wikitable" {{added}}
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,418: Line 2,644:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| {{change|0x55|0x5B}}
+
  | 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
  | Block Tags
+
  | Slot of Bundle
  | (See below)
+
  | {{Type|VarInt}}
  | IDs are block IDs
+
  |
 
  |-
 
  |-
  | Item Tags
+
  | Slot in Bundle
  | (See below)
+
  | {{Type|VarInt}}
| IDs are item IDs
+
  |
|-
 
| Fluid Tags
 
| (See below)
 
| IDs are fluid IDs
 
|- {{added}}
 
  | Entity Tags
 
| (See below)
 
| IDs are entity type IDs
 
 
  |}
 
  |}
  
==== Update Light ====
+
==== Client Tick End ====
 
 
Updates light levels for a chunk.
 
  
 
{| class="wikitable" {{added}}
 
{| class="wikitable" {{added}}
Line 2,446: Line 2,662:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
  !colspan="2"| Field Type
+
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="10"| 0x24
+
  | ''protocol:''<br/><code>0x0B</code><br/><br/>''resource:''<br/><code>client_tick_end</code>
  |rowspan="10"| Play
+
| Play
  |rowspan="10"| Client
+
| Server
  |colspan="2"| Chunk X
+
  | colspan="3"| ''no fields''
  |colspan="2"| VarInt
+
  |}
  | Chunk coordinate (block coordinate divided by 16, rounded down)
+
 
 +
==== Click Container ====
 +
 
 +
This packet is sent by the client when the player clicks on a slot in a window.
 +
 
 +
{| class="wikitable"
 +
  ! Packet ID
 +
! State
 +
! Bound To
 +
! colspan="2"| Field Name
 +
  ! colspan="2"| Field Type
 +
  ! Notes
 
  |-
 
  |-
  |colspan="2"| Chunk Z
+
| rowspan="9"| ''protocol:''<br/><code>{{change|0x0E|0x10}}</code><br/><br/>''resource:''<br/><code>container_click</code>
  |colspan="2"| VarInt
+
| rowspan="9"| Play
  | Chunk coordinate (block coordinate divided by 16, rounded down)
+
| rowspan="9"| Server
 +
  | colspan="2"| Window ID
 +
  | 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"| Sky Light Mask
+
  | colspan="2"| State ID
  |colspan="2"| VarInt
+
  | colspan="2"| {{Type|VarInt}}
  | 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)
+
  | 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"| Block Light Mask
+
  | colspan="2"| Slot
  |colspan="2"| VarInt
+
  | colspan="2"| {{Type|Short}}
  | Mask containing 18 bits, with the same order as sky light
+
  | colspan="2"| The clicked slot number, see below.
 
  |-
 
  |-
  |colspan="2"| Empty Sky Light Mask
+
  | colspan="2"| Button
  |colspan="2"| VarInt
+
  | colspan="2"| {{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.
+
  | colspan="2"| The button used in the click, see below.
 
  |-
 
  |-
  |colspan="2"| Empty Block Light Mask
+
  | colspan="2"| Mode
  |colspan="2"| VarInt
+
  | colspan="2"| {{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.
+
  | colspan="2"| Inventory operation mode, see below.
 
  |-
 
  |-
  |rowspan="2"| Sky Light arrays
+
  | colspan="2"| Length of the array
| Length
+
  | colspan="2"| {{Type|VarInt}}
  |rowspan="2"| Array
+
  | colspan="2"| Maximum value for Notchian server is 128 slots.
| VarInt
 
  | Length of the following array in bytes (always 2048)
 
 
  |-
 
  |-
  | Sky Light array
+
  | rowspan="2"| Array of changed slots
  | Array of 2048 bytes
+
| Slot number
  | 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="2"| {{Type|Array}} (128)
 +
  | {{Type|Short}}
 +
  |
 
  |-
 
  |-
  |rowspan="2"| Block Light arrays
+
  | Slot data
  | Length
+
  | {{Type|Slot}}
|rowspan="2"| Array
+
  | New data for this slot, in the client's opinion; see below.
  | VarInt
 
| Length of the following array in bytes (always 2048)
 
 
  |-
 
  |-
  | Block Light array
+
  | colspan="2"| Carried item
  | Array of 2048 bytes
+
  | colspan="2"| [[Slot Data|Slot]]
  | 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.
+
  | colspan="2"| Item carried by the cursor. Has to be empty (item ID = -1) for drop mode, otherwise nothing will happen.
 
  |}
 
  |}
  
Individual block or sky light arrays are is given for each block with increasing x coordinates, within rows of increasing z coordinates, within layers of increasing y coordinates. Even-indexed items (those with an even x coordinate, starting at 0) are packed into the low bits, odd-indexed into the high bits.
+
See [[Inventory]] for further information about how slots are indexed.
  
==== Open Window ====
+
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.
  
This is sent to the client when it should open an inventory, such as a chest, workbench, or furnace. This message is not sent anywhere for clients opening their own inventory. {{change||For horses, use [[#Open Horse Window|Open Horse Window]]}}
+
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"
  ! Packet ID
+
  ! Mode
  ! State
+
  ! Button
  ! Bound To
+
  ! Slot
  ! Field Name
+
  ! Trigger
  ! Field Type
+
|-
  ! Notes
+
  ! rowspan="4"| 0
 +
| 0
 +
  | Normal
 +
| Left mouse click
 
  |-
 
  |-
  |rowspan="5"| {{change|0x14|0x2E}}
+
  | 1
|rowspan="5"| Play
+
  | Normal
|rowspan="5"| Client
+
  | Right mouse click
  | Window ID
 
  | {{change|Unsigned Byte|VarInt}}
 
| A unique id number for the window to be displayed. Notchian server implementation is a counter, starting at 1.
 
 
  |-
 
  |-
  | Window Type
+
  | 0
  | {{change|String (32)|VarInt}}
+
  | -999
| The window type to use for display. {{change|See [[Inventory]] for a list|contained in the <code>minecraft:menu</code> regisry}}.
+
| Left click outside inventory (drop cursor stack)
 
  |-
 
  |-
  | Window Title
+
  | 1
| [[Chat]]
+
  | -999
| The title of the window
+
  | Right click outside inventory (drop cursor single item)
  |- {{removed}}
+
  |-
  | Number Of Slots
+
  ! rowspan="2"| 1
| Unsigned Byte
+
  | 0
| Number of slots in the window (excluding the number of slots in the player inventory). Always 0 for non-storage windows (e.g. Workbench, Anvil).
+
  | Normal
  |- {{removed}}
+
  | Shift + left mouse click
  | Entity ID
+
|-
  | Optional Int
+
| 1
  | EntityHorse's EID. Only sent when Window Type is “EntityHorse”
+
  | Normal
  |}
+
  | Shift + right mouse click ''(identical behavior)''
 
 
==== Trade List ====
 
 
 
{{change||Replaces the [[#minecraft:trader_list|minecraft:trader_list]] plugin channel.}}
 
 
 
The list of trades a villager NPC is offering.
 
 
 
{| class="wikitable"
 
! Packet ID
 
  ! State
 
! Bound To
 
!colspan="2"| Field Name
 
  !colspan="2"| Field Type
 
! Notes
 
 
  |-
 
  |-
  |rowspan="16"| 0x27
+
  ! rowspan="7"| 2
  |rowspan="16"| Play
+
  | 0
  |rowspan="16"| Client
+
| Normal
 +
  | Number key 1
 
  |-
 
  |-
  | colspan="2" | Window ID
+
  | 1
  | colspan="2" | VarInt
+
  | Normal
  | The ID of the window that is open; this is an int rather than a byte.
+
  | Number key 2
 
  |-
 
  |-
  | colspan="2" | Size
+
  | 2
  | colspan="2" | Byte
+
  | Normal
  | The number of trades in the following array
+
  | Number key 3
 
  |-
 
  |-
  | rowspan="10" | Trades
+
  |
| Input item 1
+
  |
| rowspan="10" | Array
+
  |
  | [[Slot]]
 
  | The first item the villager is buying
 
 
  |-
 
  |-
  | Output item
+
  | 8
  | [[Slot]]
+
  | Normal
  | The item the villager is selling
+
  | Number key 9
 
  |-
 
  |-
  | Has second item
+
  |
  | Boolean
+
  |
  | Whether there is a second item
+
  | Button is used as the slot index (impossible in vanilla clients)
 
  |-
 
  |-
  | Input item 2
+
  | 40
  | Optional [[Slot]]
+
  | Normal
  | The second item the villager is buying; only present if they have a second item.
+
  | Offhand swap key F
 
  |-
 
  |-
  | Trade disabled
+
! 3
  | Boolean
+
  | 2
  | True if the trade is disabled; false if the trade is enabled.
+
  | Normal
 +
  | Middle click, only defined for creative players in non-player inventories.
 
  |-
 
  |-
  | Number of trade uses
+
  ! rowspan="2"| 4
  | Integer
+
  | 0
  | Number of times the trade has been used so far
+
  | Normal*
 +
| Drop key (Q) (* Clicked item is always empty)
 
  |-
 
  |-
  | Maximum number of trade uses
+
  | 1
  | Integer
+
| Normal*
  | Number of times this trade can be used
+
| Control + Drop key (Q) (* Clicked item is always empty)
  |- {{Added}}
+
|-
  | XP
+
  ! rowspan="9"| 5
  | Integer
+
  | 0
  |
+
  | -999
  |- {{Added}}
+
  | Starting left mouse drag
  | Special Price
+
  |-
  | Integer
+
  | 4
  |
+
  | -999
  |- {{Added}}
+
  | Starting right mouse drag
  | Price Multiplier
+
  |-
  | Float
+
  | 8
  |
+
  | -999
  |- {{Added}}
+
  | Starting middle mouse drag, only defined for creative players in non-player inventories.
  |colspan="2"| Villager level
+
  |-
  |colspan="2"| VarInt
+
  | 1
  | Appears on the trade GUI; meaning comes from the translation key <code>merchant.level.</code> + level.
+
  | Normal
1: Novice, 2: Apprentice, 3: Journeyman, 4: Expert, 5: Master
+
| Add slot for left-mouse drag
  |- {{Added}}
+
  |-
  |colspan="2"| Experience
+
| 5
  |colspan="2"| VarInt
+
| Normal
  | Total experience for this villager (always 0 for the wandering trader)
+
| Add slot for right-mouse drag
  |- {{Added}}
+
|-
  |colspan="2"| Is regular villager
+
  | 9
  |colspan="2"| Boolean
+
| Normal
  | True if this is a regular villager; false for the wandering trader. When false, hides the villager level and some other GUI elements.
+
  | 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.
 +
  |-
 +
  ! rowspan="2"| 6
 +
  | 0
 +
| Normal
 +
| Double click
 +
|-
 +
| 1
 +
  | Normal
 +
  | Pickup all but check items in reverse order (impossible in vanilla clients)
 
  |}
 
  |}
  
[[File:1.14-merchant-slots.png|thumb|The merchant UI, for reference]]
+
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);
  
==== Update View Position ====
+
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.
  
{{Need Info|Why is this even needed?  Is there a better name for it?  My guess is that it's something to do with logical behavior with latency, but it still seems weird.}}
+
==== Close Container ====
  
Updates the client's location.  This is used to determine what chunks should remain loaded and if a chunk load should be ignored; chunks outside of the view distance may be unloaded.
+
This packet is sent by the client when closing a window.
  
Sent whenever the player moves across a chunk border horizontally, and also (according to testing) for any integer change in the vertical axis, even if it doesn't go across a chunk section border.
+
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" {{added}}
+
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,637: Line 2,878:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x40
+
  | ''protocol:''<br/><code>{{change|0x0F|0x11}}</code><br/><br/>''resource:''<br/><code>container_close</code>
  |rowspan="2"| Play
+
  | Play
  |rowspan="2"| Client
+
  | Server
  | Chunk X
+
  | Window ID
  | VarInt
+
  | {{change|{{Type|Unsigned Byte}}|{{Type|VarInt}}}}
| Chunk X coordinate of the player's position
+
  | This is the ID of the window that was closed. 0 for player inventory.
|-
 
| Chunk Z
 
| VarInt
 
  | Chunk Z coordinate of the player's position
 
 
  |}
 
  |}
  
==== Update View Distance ====
+
==== Edit Book ====
  
Sent by the integrated singleplayer server when changing render distance.  Does not appear to be used by the dedicated server, as <code>view-distance</code> in server.properties cannot be changed at runtime.
+
{| class="wikitable"
 
 
{| class="wikitable" {{added}}
 
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,661: Line 2,896:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="1"| 0x41
+
  | rowspan="5"| ''protocol:''<br/><code>{{change|0x14|0x16}}</code><br/><br/>''resource:''<br/><code>edit_book</code>
  |rowspan="1"| Play
+
  | rowspan="5"| Play
  |rowspan="1"| Client
+
  | rowspan="5"| Server
  | View Distance
+
  | Slot
  | VarInt
+
  | {{Type|VarInt}}
  | Render distance (2-32)  
+
| 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.
 +
|-
 +
| Has title
 +
| {{Type|Boolean}}
 +
| If true, the next field is present. true if book is being signed, false if book is being edited.
 +
|-
 +
| Title
 +
| {{Type|Optional}} {{Type|String}} ({{change|128|32}})
 +
| Title of book.
 
  |}
 
  |}
  
=== Serverbound ===
+
==== 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.
 +
 
 +
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.
 +
 
 +
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>.
 +
 
 +
As of 1.20.6, checking for moving too fast is achieved like this (sic):
  
==== Set Difficulty ====
+
* 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.
  
Must have at least op level 2 to use.  Appears to only be used on singleplayer; the difficulty buttons are still disabled in multiplayer.
+
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.
  
{| class="wikitable" {{added}}
+
Checking for block collisions is achieved like this:
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
|rowspan="1"| 0x02
 
|rowspan="1"| Play
 
|rowspan="1"| Server
 
| New difficulty
 
| Byte
 
| 0: peaceful, 1: easy, 2: normal, 3: hard
 
|}
 
  
==== Click Window Button ====
+
* 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.
  
{{Change|Was named Enchant Item}}
+
Checking for illegal flight is achieved like this:
  
{{Change||Used more generally than just for enchanting in 1.14, although the code internally supported general use in earlier versions.}}
+
* 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 2,705: Line 2,961:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="2"| 0x07
+
  | rowspan="5"| ''protocol:''<br/><code>{{change|0x1A|0x1C}}</code><br/><br/>''resource:''<br/><code>move_player_pos</code>
  |rowspan="2"| Play
+
  | rowspan="5"| Play
  |rowspan="2"| Server
+
  | rowspan="5"| Server
  | Window ID
+
  | X
| Byte
+
  | {{Type|Double}}
| The ID of the {{change|enchantment table}} window sent by [[#Open Window|Open Window]]
+
  | Absolute position.
|-
 
  | {{Change|Enchantment|Button ID}}
 
  | Byte
 
| {{change|The position of the enchantment on the enchantment table window, starting with 0 as the topmost one|Meaning depends on window type; see below}}
 
|}
 
 
 
{| class="wikitable"
 
! Window type
 
! ID
 
! Meaning
 
 
  |-
 
  |-
  |rowspan="3"| Enchantment Table
+
  | Feet Y
  | 0 || Topmost enchantment
+
  | {{Type|Double}}
 +
| Absolute feet position, normally Head Y - 1.62.
 
  |-
 
  |-
  | 1 || Middle enchantment
+
  | Z
|-
+
  | {{Type|Double}}
  | 2 || Bottom enchantment
+
  | Absolute position.
  |-
+
  |- {{removed}}
  |rowspan="4"| Lectern
+
  | On Ground
| 1 || Unknown - maybe previous page?  (which does give a redstone output)
+
  | {{Type|Boolean}}
  |-
+
  | True if the client is on the ground, false otherwise.
  | 2 || Unknown - maybe next page?
+
  |- {{added}}
  |-
+
  | Flags
| 3 || Take Book
+
  | {{Type|Byte}}
|-
+
  | Bit field: 0x01: on ground, 0x02: pushing against wall.
| 100? || Unknown - actual value is 100 + some parameter, so there may be multiple
 
  |-
 
  | Stonecutter
 
  |colspan="2"| Recipe button number - 4*row + col.  Depends on the item.
 
|-
 
| Loom
 
  |colspan="2"| Recipe button number - 4*row + col.  Depends on the item.
 
 
  |}
 
  |}
  
==== Lock Difficulty ====
+
==== Set Player Position and Rotation ====
  
Must have at least op level 2 to use.  Appears to only be used on singleplayer; the difficulty buttons are still disabled in multiplayer.
+
A combination of [[#Set Player Rotation|Move Player Rotation]] and [[#Set Player Position|Move Player Position]].
  
{| class="wikitable" {{added}}
+
{| class="wikitable"
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,757: Line 2,997:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="1"| 0x0F
+
  | rowspan="7"| ''protocol:''<br/><code>{{change|0x1B|0x1D}}</code><br/><br/>''resource:''<br/><code>move_player_pos_rot</code>
  |rowspan="1"| Play
+
  | rowspan="7"| Play
  |rowspan="1"| Server
+
  | rowspan="7"| Server
  | Locked
+
  | X
  | Boolean
+
| {{Type|Double}}
  |
+
| Absolute position.
  |}
+
|-
 +
| Feet Y
 +
| {{Type|Double}}
 +
| Absolute feet position, normally Head Y - 1.62.
 +
|-
 +
| Z
 +
| {{Type|Double}}
 +
| Absolute position.
 +
  |-
 +
| Yaw
 +
| {{Type|Float}}
 +
| Absolute rotation on the X Axis, in degrees.
 +
|-
 +
| Pitch
 +
| {{Type|Float}}
 +
| 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.
  
==== Recipe Book Data ====
+
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)
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,771: Line 3,060:
 
  ! State
 
  ! State
 
  ! Bound To
 
  ! Bound To
  !colspan="2"| Field Name
+
  ! Field Name
 
  ! Field Type
 
  ! Field Type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="11"| {{change|0x1B|0x1D}}
+
  | rowspan="4"| ''protocol:''<br/><code>{{change|0x1C|0x1E}}</code><br/><br/>''resource:''<br/><code>move_player_rot</code>
  |rowspan="11"| Play
+
  | rowspan="4"| Play
  |rowspan="11"| Server
+
  | rowspan="4"| Server
  |colspan="2"| Type
+
  | Yaw
| VarInt
+
| {{Type|Float}}
  | Determines the format of the rest of the packet
+
  | Absolute rotation on the X Axis, in degrees.
 
  |-
 
  |-
  ! Type
+
  | Pitch
  ! Field Name
+
  | {{Type|Float}}
  !
+
  | Absolute rotation on the Y Axis, in degrees.
  !
+
  |- {{removed}}
  |-
+
  | On Ground
  | 0: Displayed Recipe
+
  | {{Type|Boolean}}
  | Recipe ID
+
  | True if the client is on the ground, false otherwise.
  | Identifier
+
  |- {{added}}
  | A recipe ID
+
  | Flags
  |-
+
  | {{Type|Byte}}
  |rowspan="8"| 1: Recipe Book States
+
  | Bit field: 0x01: on ground, 0x02: pushing against wall.
  | Crafting Recipe Book Open
+
  |}
| Boolean
+
{{Anchor|Set Player Movement Flags}}
| Whether the player has the crafting recipe book currently opened/active.
+
==== Set Player {{change|On Ground|Movement 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.
 +
 
 +
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.
 +
 
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 
  |-
 
  |-
  | Crafting Recipe Filter Active
+
  | rowspan="2"| ''protocol:''<br/><code>{{change|0x1D|0x1F}}</code><br/><br/>''resource:''<br/><code>move_player_status_only</code>
| Boolean
+
  | rowspan="2"| Play
| Whether the player has the crafting recipe book filter option currently active.
+
  | rowspan="2"| Server
|-
+
  | {{removed}} | On Ground
| Smelting Recipe Book Open
+
  | {{removed}} | {{Type|Boolean}}
  | Boolean
+
  | {{removed}} | True if the client is on the ground, false otherwise.
| Whether the player has the smelting recipe book currently opened/active.
+
  |- {{added}}
  |-
+
  | Flags
| Smelting Recipe Filter Active
+
  | {{Type|Byte}}
  | Boolean
+
  | Bit field: 0x01: on ground, 0x02: pushing against wall.
| Whether the player has the smelting recipe book filter option currently active.
 
  |- {{Added}}
 
| Blasting Recipe Book Open
 
| Boolean
 
  | May be swapped with smoking recipe book.  Also, the notchian client appears to use the same value for both of those books currently.
 
|- {{Added}}
 
| Blasting Recipe Filter Active
 
| Boolean
 
| May be swapped with smoking recipe book.  Also, the notchian client appears to use the same value for both of those books currently.
 
  |- {{Added}}
 
  | Smoking Recipe Book Open
 
| Boolean
 
|
 
  |- {{Added}}
 
  | Smoking Recipe Filter Active
 
| Boolean
 
|
 
 
  |}
 
  |}
  
The Recipe Book Status type is sent when one of the states changes.
+
==== Place Recipe ====
  
==== Update Jigsaw Block ====
+
This packet is sent when a player clicks a recipe in the crafting book that is craftable (white border).
  
Sent when Done is pressed on the {{Minecraft Wiki|Jigsaw Block}} interface.
+
{| class="wikitable"
 
 
{| class="wikitable" {{added}}
 
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,840: Line 3,124:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="4"| 0x27
+
  | rowspan="3"| ''protocol:''<br/><code>{{change|0x22|0x24}}</code><br/><br/>''resource:''<br/><code>place_recipe</code>
  |rowspan="4"| Play
+
  | rowspan="3"| Play
  |rowspan="4"| Server
+
  | rowspan="3"| Server
  | Location
+
  | Window ID
  | Position
+
  | {{Type|Byte}}
  | Block entity location
+
  |
 
  |-
 
  |-
  | Attachment type
+
  | Recipe{{change|| ID}}
  | Identifier
+
  | {{change|{{Type|Identifier}}|{{Type|VarInt}}}}
|  
+
  | {{change|A recipe ID.|ID of recipe previously defined in [[#Recipe Book Add|Recipe Book Add]].}}
  |-
 
| Target pool
 
| Identifier
 
|  
 
 
  |-
 
  |-
  | Final state
+
  | Make all
  | String
+
  | {{Type|Boolean}}
  | "Turns into" on the GUI, <code>final_state</code> in NBT
+
  | Affects the amount of items processed; true if shift is down when clicked.
 
  |}
 
  |}
  
==== Player Block Placement ====
+
==== Player Input ====
  
 
{| class="wikitable"
 
{| class="wikitable"
|-
 
 
  ! Packet ID
 
  ! Packet ID
 
  ! State
 
  ! State
Line 2,871: Line 3,150:
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  |rowspan="9"| {{change|0x29|0x2C}}
+
  | rowspan="3"| ''protocol:''<br/><code>{{change|0x26|0x28}}</code><br/><br/>''resource:''<br/><code>player_input</code>
  |rowspan="9"| Play
+
  | rowspan="3"| Play
  |rowspan="9"| Server
+
  | rowspan="3"| Server
  |{{removed}}| Location
+
  | {{removed}} | Sideways
  |{{removed}}| Position
+
  | {{removed}} | {{Type|Float}}
  |{{removed}}| Block position
+
  | {{removed}} | Positive to the left of the player.
 
  |- {{removed}}
 
  |- {{removed}}
  | Face
+
  | Forward
  | VarInt Enum
+
  | {{Type|Float}}
  | The face on which the block is placed (as documented at [[#Player Digging|Player Digging]])
+
| Positive forward.
 +
  |-
 +
| Flags
 +
| {{Type|Unsigned Byte}}
 +
| Bit mask{{change|. 0x1: jump, 0x2: unmount.|; see below.}}
 +
|}
 +
 
 +
The flags are as follows:
 +
 
 +
{| class="wikitable" {{added}}
 +
|-
 +
! Hex Mask
 +
! Field
 +
|-
 +
| 0x01
 +
| Forward
 +
|-
 +
| 0x02
 +
| Backward
 +
|-
 +
| 0x04
 +
| Left
 +
|-
 +
| 0x08
 +
| Right
 +
|-
 +
| 0x10
 +
| Jump
 +
|-
 +
| 0x20
 +
| Sneak
 
  |-
 
  |-
  | Hand
+
| 0x40
  | VarInt Enum
+
| Sprint
  | The hand from which the block is placed; 0: main hand, 1: off hand
+
|}
  |- {{added}}
+
 
  | Location
+
==== Set Seen Recipe ====
  | Position
+
 
  | Block position
+
Sent when recipe is first seen in recipe book. Replaces Recipe Book Data, type 0.
 +
 
 +
{| 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]].
 +
|}
 +
 
 +
==== Use Item On ====
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
| rowspan="9"| ''protocol:''<br/><code>{{change|0x38|0x3A}}</code><br/><br/>''resource:''<br/><code>use_item_on</code>
 +
| rowspan="9"| Play
 +
| rowspan="9"| Server
 +
  | Hand
 +
  | {{Type|VarInt}} {{Type|Enum}}
 +
  | 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.
 +
|-
 +
| Inside block
 +
| {{Type|Boolean}}
 +
| True when the player's head is inside of a block.
 
  |- {{added}}
 
  |- {{added}}
  | Face
+
  | World border hit
  | VarInt Enum
+
  | {{Type|Boolean}}
| The face on which the block is placed (as documented at [[#Player Digging|Player Digging]])
+
  | Seems to always be false, even when interacting with blocks around or outside the world border, or while the player is outside the border.
  |-
 
| 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
+
  | Sequence
  | Float
+
  | {{Type|VarInt}}
| The position of the crosshair on the block, from 0 to 1 increasing from north to south
+
  | Block change sequence number (see [[#Acknowledge Block Change]]).
|- {{added}}
 
  | Inside block
 
| Boolean
 
| True when the player's head is inside of a block.
 
 
  |}
 
  |}
  
 
Upon placing a block, this packet is sent once.
 
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 pixel 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.
+
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.
 
 
{{Change||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).}}
 
 
 
== Handshaking ==
 
 
 
=== Clientbound ===
 
 
 
There are no clientbound packets in the Handshaking state, since the protocol immediately switches to a different state after the client sends the first packet.
 
 
 
=== Serverbound ===
 
 
 
==== Handshake ====
 
 
 
This causes the server to switch into the target state.
 
 
 
{| class="wikitable"
 
! Packet ID
 
! State
 
! Bound To
 
! Field Name
 
! Field Type
 
! Notes
 
|-
 
|rowspan="4"| 0x00
 
|rowspan="4"| Handshaking
 
|rowspan="4"| Server
 
| Protocol Version
 
| VarInt
 
| See [[protocol version numbers]] (currently {{change|404|484}})
 
|-
 
| Server Address
 
| String
 
| Hostname or IP, e.g. localhost or 127.0.0.1, that was used to connect.  The Notchian server does not use this information.
 
|-
 
| Server Port
 
| Unsigned Short
 
| Default is 25565.  The Notchian server does not use this information.
 
|-
 
| Next State
 
| VarInt Enum
 
| 1 for [[#Status|status]], 2 for [[#Login|login]]
 
|}
 
 
 
== Status ==
 
 
 
=== Clientbound ===
 
 
 
No changes so far.
 
 
 
=== Serverbound ===
 
 
 
No changes so far.
 
 
 
== Login ==
 
 
 
=== Clientbound ===
 
 
 
No changes so far.
 
 
 
=== Serverbound ===
 
 
 
No changes so far.
 
  
 +
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 04:42, 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

Contents

Data types

Name Size (bytes) Encodes Notes
Teleport Flags 4 See #Teleport Flags Bit field specifying how a teleportation is to be applied on each axis.
Recipe Display Varies See Recipes#Recipe Display structure Description of a recipe for use for use by the client.

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.

Recipes

(this is meant to become a new page.)

Recipe Display structure

Name Type Description
Recipe Display Type VarInt ID in the minecraft:recipe_display registry.
Data Varies See #Recipe Display types below.

Recipe Display types

ID Name Data
0 minecraft:crafting_shapeless data
1 minecraft:crafting_shaped data
2 minecraft:furnace data
3 minecraft:stonecutter data
4 minecraft:smithing data
minecraft:crafting_shapeless
Name Type Description
Ingredient Count VarInt Number of elements in the following array.
Ingredients Array of Slot Display
Result Slot Display
Crafting Station Slot Display Crafting station icon to display in the recipe notification.
minecraft:crafting_shaped
Name Type Description
Width VarInt
Height VarInt
Ingredient Count VarInt Number of elements in the following array. Always equal to Width * Height.
Ingredients Array of Slot Display
Result Slot Display
Crafting Station Slot Display Crafting station icon to display in the recipe notification.
minecraft:furnace
Name Type Description
Ingredient Slot Display
Fuel Slot Display
Result Slot Display
Crafting Station Slot Display Crafting station icon to display in the recipe notification.
Cooking Time VarInt Time to smelt in a regular furnace, in ticks.
Experience Float
minecraft:stonecutter
Name Type Description
Ingredient Slot Display
Result Slot Display
Crafting Station Slot Display Crafting station icon to display in the recipe notification.
minecraft:smithing
Name Type Description
Template Slot Display
Base Slot Display
Addition Slot Display
Result Slot Display
Crafting Station Slot Display Crafting station icon to display in the recipe notification.

Slot Display structure

Name Type Description
Slot Display Type VarInt ID in the minecraft:slot_display registry.
Data Varies See #Slot Display types below.

Slot Display types

ID Name Data
0 minecraft:empty no data
1 minecraft:any_fuel no data
2 minecraft:item data
3 minecraft:item_stack data
4 minecraft:tag data
5 minecraft:smithing_trim data
6 minecraft:with_remainder data
7 minecraft:composite data
minecraft:item
Name Type Description
Item Type VarInt ID in the minecraft:item registry.
minecraft:item_stack
Name Type Description
Item Stack Slot
minecraft:tag
Name Type Description
Tag Identifier Tag in the minecraft:item registry. Not prefixed by '#'!.
minecraft:smithing_trim
Name Type Description
Base Slot Display
Material Slot Display
Pattern Slot Display
minecraft:with_remainder
Name Type Description
Ingredient Slot Display
Remainder Slot Display
minecraft:composite
Name Type Description
Option Count VarInt Number of elements in the following array.
Options Array of Slot Display

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 Recipe Display

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 Recipe Display
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).