Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
m (Mentioned the range)
m (Unsigned byte, not int)
Line 126: Line 126:
 
|- class="row2"
 
|- class="row2"
 
| class="col0 centeralign" | '''Unknown'''
 
| class="col0 centeralign" | '''Unknown'''
| class="col1 centeralign" | int
+
| class="col1 centeralign" | unsigned byte
 
| class="col2 centeralign" | <code>0</code>
 
| class="col2 centeralign" | <code>0</code>
 
| class="col3" | Probably related to horses
 
| class="col3" | Probably related to horses

Revision as of 10:18, 18 April 2013

This page documents the changes from the last stable Minecraft release (currently 1.5, protocol 60) to the current pre-release, 13w16a (protocol 62). Note that this page contains bleeding-edge information that may not be completely or correctly documented.

New Packets

-None-

Changed Packets

Update Health (0x08)

Server to Client

http://wiki.vg/Protocol#Update_Health_.280x08.29

Packet ID Field Name Field Type Example Notes
0x08 Health float 20.0 0 or less = dead, 20 = full HP
Food short 20 0 - 20
Food Saturation float 5.0 Seems to vary from 0.0 to 5.0 in integer increments
Total Size: 11 bytes

Entity Action (0x13)

Client to Server

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 Field Name Field Type Example Notes
0x13 EID int 55534 Player ID
Action ID byte 1 The ID of the action, see below.
Unknown int 0 Something to do with horses. Ranged from 0 -> 90
Total Size: 10 bytes

Action ID can be one of the following values:

ID Action
1 Crouch
2 Uncrouch
3 Leave bed
4 Start sprinting
5 Stop sprinting

Attach Entity (0x27)

Server to Client

This packet is sent when a player has been attached to an entity (e.g. Minecart)

Packet ID Field Name Field Type Example Notes
0x27 Entity ID int 1298 The player entity ID being attached
Vehicle ID int 1805 The vehicle entity ID attached to (-1 for unattaching)
Unknown unsigned byte 0 Probably related to horses
Total Size: 13 bytes

Player Abilities (0xCA)

Two-Way

The latter 2 bytes are used to indicate the walking and flying speeds respectively, while the first byte is used to determine the value of 4 booleans.

These booleans are whether damage is disabled (god mode, '8' bit), whether the player can fly ('4' bit), whether the player is flying ('2' bit), and whether the player is in creative mode ('1' bit).

To get the values of these booleans, simply AND (&) the byte with 1,2,4 and 8 respectively, to get the 0 or 1 bitwise value. To set them OR (|) them with their repspective masks. The vanilla client sends this packet when the player starts/stops flying with the second parameter changed accordingly. All other parameters are ignored by the vanilla server.

Packet ID Field Name Field Type Example Notes
0xCA Flags byte 5
Flying speed float 12.0
Walking speed float 25.0
Total Size: 10 bytes

Removed Packets

-None-

Changed Data Types

-None-

Protocol History

-None-