Difference between revisions of "Pre-release protocol"

From wiki.vg
Jump to navigation Jump to search
Line 84: Line 84:
 
| Total Size:
 
| Total Size:
 
| colspan="4" | ? bytes
 
| colspan="4" | ? bytes
 +
|}
 +
 +
Known values:
 +
{| class="wikitable"
 +
|-
 +
| Key
 +
| Default
 +
| Min
 +
| Max
 +
| Label
 +
|-
 +
| generic.maxHealth
 +
| 20.0
 +
| 0.0
 +
| Double.MaxValue
 +
| Max Health
 +
|-
 +
| generic.followRange
 +
| 32.0
 +
| 0.0
 +
| 2048.0
 +
| Follow Range
 +
|-
 +
| generic.knockbackResistance
 +
| 0.0
 +
| 0.0
 +
| 1.0
 +
| Knockback Resistance
 +
|-
 +
| generic.movementSpeed
 +
| 0.699999988079071
 +
| 0.0
 +
| Double.MaxValue
 +
| Movement Speed
 +
|-
 +
| generic.attackDamage
 +
| 2.0
 +
| 0.0
 +
| Double.MaxValue
 +
|
 +
|-
 +
| horse.jumpStrength
 +
| 0.7
 +
| 0.0
 +
| 2.0
 +
| Jump Strength
 +
|-
 +
| zombie.spawnReinforcements
 +
| 0.0
 +
| 0.0
 +
| 1.0
 +
| Spawn Reinforcements Chance
 
|}
 
|}
  

Revision as of 04:57, 9 June 2013

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

He 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 occured to the respective packets there.

Protocol Version

As of 13w22a the protocol version is 67.

New Packets

Steer Vehicle (0x1B)

Client to Server

Sent by client to steer the horse, minecart and boats. Horses listen to all directions, boats and minecarts only listen to the positive forward value in combination with the direction the player is looking in.

Packet ID Field Name Field Type Example Notes
0x1B Sideways float 0.98 Positive to the left of the player
Forward float -0.98 Positive forward
Jump bool true
Unmount bool false True when leaving the vehicle
Total Size: 11 bytes


Entity Properties (0x2C)

Server to Client

Packet ID Field Name Field Type Example Notes
0x2C EntityID int 195 ?
Properties Count int 3 Number of string/data pairs that follow. The remaining fields here are repeated this number of times.
Key string16 "generic.Maxhealth"
Value double 20.0
Total Size: ? bytes

Known values:

Key Default Min Max Label
generic.maxHealth 20.0 0.0 Double.MaxValue Max Health
generic.followRange 32.0 0.0 2048.0 Follow Range
generic.knockbackResistance 0.0 0.0 1.0 Knockback Resistance
generic.movementSpeed 0.699999988079071 0.0 Double.MaxValue Movement Speed
generic.attackDamage 2.0 0.0 Double.MaxValue
horse.jumpStrength 0.7 0.0 2.0 Jump Strength
zombie.spawnReinforcements 0.0 0.0 1.0 Spawn Reinforcements Chance

Changed Packets

Chat Message (0x03)

Client to Server

Unchanged

Server to Client

The chat string must now be a valid JSON object:

   {"translate":"chat.type.announcement","using":["Server","hi"]}
   {"color":"gray","italic":true,"translate":"chat.type.admin","using":["Server",{"translate":"commands.save.success"}]}
   {"text":"§aOld style chat"}

Where translate is one of the following:

   chat.type.admin: [%s: %s]
   chat.type.announcement: [%s] %s
   chat.type.emote: * %s %s
   chat.type.text: <%s> %s


Update Health (0x08)

Server to Client

Sent by the server to update/set the health of the player it is sent to. Added in protocol version 5.

Food saturation acts as a food "overcharge". Food values will not decrease while the saturation is over zero. Players logging in automatically get a saturation of 5.0. Eating food increases the saturation as well as the food bar.

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)
Leash boolean false If set to true, leashes the entity to the vehicle
Total Size: 10 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.

The flags are whether damage is disabled (god mode, 8, bit 3), whether the player can fly (4, bit 2), whether the player is flying (2, bit 1), and whether the player is in creative mode (1, bit 0).

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 0.05 previous integer value divided by 250
Walking speed float 0.1 previous integer value divided by 250
Total Size: 10 bytes

Removed Packets

-None-

Changed Data Types

-None-

Protocol History

-None-