Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
(Changes to the Animation packet.)
(This packets is not longer sent when the client opens the inventory (Action 6).)
Line 184: Line 184:
 
  | Byte
 
  | Byte
 
  | Hand used for the animation.
 
  | Hand used for the animation.
 +
|}
 +
 +
 +
==== Entity Action ====
 +
 +
Sent at least when crouching, leaving a bed, or sprinting. To send action animation to client use 0x28. The client will send this with Action ID = 3 when “Leave Bed” is clicked.
 +
 +
{| class="wikitable"
 +
! Packet ID
 +
! State
 +
! Bound To
 +
! Field Name
 +
! Field Type
 +
! Notes
 +
|-
 +
|rowspan="3"| {{Change|0x0B|0x0C}}
 +
|rowspan="3"| Play
 +
|rowspan="3"| Server
 +
| Entity ID
 +
| VarInt
 +
| Player ID
 +
|-
 +
| Action ID
 +
| VarInt
 +
| The ID of the action, see below
 +
|-
 +
| Jump Boost
 +
| VarInt
 +
| Horse jump boost. Ranged from 0 -> 100.
 +
|}
 +
 +
Action ID can be one of the following values:
 +
 +
{| class="wikitable"
 +
! ID
 +
! Action
 +
|-
 +
| 0
 +
| Crouch
 +
|-
 +
| 1
 +
| Uncrouch
 +
|-
 +
| 2
 +
| Leave bed
 +
|-
 +
| 3
 +
| Start sprinting
 +
|-
 +
| 4
 +
| Stop sprinting
 +
|-
 +
| 5
 +
| Jump with horse
 +
|-
 +
| <Strike>6</Strike>
 +
| <Strike>Open inventory</Strike>
 
  |}
 
  |}
  

Revision as of 21:07, 29 July 2015

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)


Animation

Sent when the player's arm swings

Packet ID State Bound To Field Name Field Type Notes
0x0A 0x0B Play Server Hand Byte Hand used for the animation.


Entity Action

Sent at least when crouching, leaving a bed, or sprinting. To send action animation to client use 0x28. The client will send this with Action ID = 3 when “Leave Bed” is clicked.

Packet ID State Bound To Field Name Field Type Notes
0x0B 0x0C Play Server Entity ID VarInt Player ID
Action ID VarInt The ID of the action, see below
Jump Boost VarInt Horse jump boost. Ranged from 0 -> 100.

Action ID can be one of the following values:

ID Action
0 Crouch
1 Uncrouch
2 Leave bed
3 Start sprinting
4 Stop sprinting
5 Jump with horse
6 Open inventory

Status

Clientbound

No changes so far.

Serverbound

No changes so far.

Login

Clientbound

No changes so far.

Serverbound

No changes so far.