Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
(Player shoulders metadata)
(→‎Entity Metadata: NBT tag is a new type)
Line 26: Line 26:
  
 
=== Entity Metadata ===
 
=== Entity Metadata ===
 +
 +
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 Byte 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
 +
| String
 +
|
 +
|-
 +
| 4
 +
| [[Chat]]
 +
|
 +
|-
 +
| 5
 +
| [[Slot]]
 +
|
 +
|-
 +
| 6
 +
| Boolean
 +
|
 +
|-
 +
| 7
 +
| Rotation
 +
| 3 floats: rotation on x, rotation on y, rotation on z
 +
|-
 +
| 8
 +
| [[Data Types#Position|Position]]
 +
|
 +
|-
 +
| 9
 +
| OptPosition (Boolean + Optional Position)
 +
| Position is present if the Boolean is set to true
 +
|-
 +
| 10
 +
| Direction (VarInt)
 +
| (Down = 0, Up = 1, North = 2, South = 3, West = 4, East = 5)
 +
|-
 +
| 11
 +
| OptUUID (Boolean + Optional UUID)
 +
| UUID is present if the Boolean is set to true
 +
|-
 +
| 12
 +
| OptBlockID (VarInt)
 +
| 0 for absent otherwise, <code><nowiki>id &lt;&lt; 4 | data</nowiki></code>
 +
|-style="background-color: #d9ead3;"
 +
| 13
 +
| [[NBT|NBT Tag]]
 +
|
 +
|}
 +
 +
Entity classes also recursively inherit fields from classes they extend.
  
 
=== Parrot ===
 
=== Parrot ===

Revision as of 15:13, 30 March 2017

This page documents the changes from the last stable Minecraft release (currently 1.11.2, protocol 316) to the current pre-release (currently 17w13a, protocol 318). Note that this page contains bleeding-edge information that may not be completely or correctly documented.

One who wishes to commandeer the merging of this into Protocol when an update is made must be sure to respect any changes that may have occurred to the respective packets there.

Contents

Data types

No changes so far.

Packets

ID Packet name Documentation
Handshaking serverbound
0x00 Handshake Current Pre

New/modified data types

Entity Metadata

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:

Name Type Meaning
Index Unsigned Byte Unique index key determining the meaning of the following value, see the table below. If this is 0xff then the it is the end of the Entity Metadata array and no more is read.
Type Optional Byte Enum Only if Index is not 0xff; the type of the index, see the table below
Value Optional value of Type Only if Index is not 0xff: the value of the metadata field
Value of Type field Type of Value field Notes
0 Byte
1 VarInt
2 Float
3 String
4 Chat
5 Slot
6 Boolean
7 Rotation 3 floats: rotation on x, rotation on y, rotation on z
8 Position
9 OptPosition (Boolean + Optional Position) Position is present if the Boolean is set to true
10 Direction (VarInt) (Down = 0, Up = 1, North = 2, South = 3, West = 4, East = 5)
11 OptUUID (Boolean + Optional UUID) UUID is present if the Boolean is set to true
12 OptBlockID (VarInt) 0 for absent otherwise, id << 4 | data
13 NBT Tag

Entity classes also recursively inherit fields from classes they extend.

Parrot

Extends TameableAnimal.

Index Type Meaning Default
15 VarInt Variant (values ranging from 0 to 3) 0

Player

Extends Living.

Index Type Meaning Default
11 Float Additional Hearts 0.0
12 VarInt Score 0
13 Byte The Displayed Skin Parts bit mask that is sent in Client Settings 0
Bit mask Meaning
0x01 Cape enabled
0x02 Jacket enabled
0x04 Left sleeve enabled
0x08 Right sleeve enabled
0x10 Left pants leg enabled
0x20 Right pants leg enabled
0x40 Hat enabled
0x80 Unused
14 Byte Main hand (0 : Left, 1 : Right) 1
15 NBT Tag Left shoulder entity data
16 NBT Tag Right shoulder entity data

Block Actions

No changes so far.

Plugin Channels

No changes so far.

Handshaking

Clientbound

No changes so far.

Serverbound

No changes so far.

Handshake

This causes the server to switch into the target state.

Packet ID State Bound To Field Name Field Type Notes
0x00 Handshaking Server Protocol Version VarInt See protocol version numbers (currently 316 318)
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, 2 for login

Status

Clientbound

No changes so far.

Serverbound

No changes so far.

Login

Clientbound

No changes so far.

Serverbound

No changes so far.