Pre-release protocol

From wiki.vg
Revision as of 20:37, 29 July 2015 by Niko (talk | contribs) (Held Item Change uses a different packet id.)
Jump to navigation Jump to search

This page documents the changes from the last stable Minecraft release (currently 1.8.8, protocol 47) to the current pre-release (currently 15w31a, protocol 49). 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.

Protocol history

None so far.

New/modified data types

None so far.

Handshaking

Clientbound

No changes so far.

Serverbound

Handshake

This causes the server to switch into the target state.

Packet ID State Bound To Field Name Field Type Notes
0x00 Handshaking Server Protocol Version VarInt See protocol version numbers (currently 47 49)
Server Address String hostname or IP, e.g. localhost or 127.0.0.1
Server Port Unsigned Short default is 25565
Next State VarInt 1 for status, 2 for login

Play

Clientbound

No changes so far.

Serverbound

Player Digging

Sent when the player mines a block. A Notchian server only accepts digging packets with coordinates within a 6-unit radius of the player's position.

Packet ID State Bound To Field Name Field Type Notes
0x07 Play Server Status Byte The action the player is taking against the block (see below)
Location Position Block position
Face Byte The face being hit (see below)

Status can (currently) be one of six values:

Meaning Value
Started digging 0
Cancelled digging 1
Finished digging 2
Drop item stack 3
Drop item 4
Shoot arrow / finish eating 5
Swap item in Hand 6

Notchian clients send a 0 (started digging) when they start digging and a 2 (finished digging) once they think they are finished. If digging is aborted, the client simply send a 1 (cancel digging).

Status code 4 (drop item) is a special case. In-game, when you use the Drop Item command (keypress 'q'), a dig packet with a status of 4, and all other values set to 0, is sent from client to server. Status code 3 is similar, but drops the entire stack.

Status code 5 (shoot arrow / finish eating) is also a special case. The x, y and z fields are all set to 0 like above, with the exception of the face field, which is set to 255.

Status code 6 is another special case. Used to swap or assign an item to the second hand. The rest of the fields (x, y, z and face) are all set to 0.

The face can be one of six values, representing the face being hit:

Value 0 1 2 3 4 5
Offset -Y +Y -Z +Z -X +X


Held Item Change

Sent when the player changes the slot selection

Packet ID State Bound To Field Name Field Type Notes
0x09 0x0A Play Server Slot Short The slot which the player has selected (0–8)

Status

Clientbound

No changes so far.

Serverbound

No changes so far.

Login

Clientbound

No changes so far.

Serverbound

No changes so far.