https://wiki.vg/api.php?action=feedcontributions&user=Sadimusi&feedformat=atomwiki.vg - User contributions [en]2024-03-28T09:45:26ZUser contributionsMediaWiki 1.34.4https://wiki.vg/index.php?title=Protocol&diff=4746Protocol2013-09-06T20:38:02Z<p>Sadimusi: /* Named Sound Effect (0x3E) */ Fixed link</p>
<hr />
<div>This page presents a dissection of the current stable [http://minecraft.net/game/ Minecraft] protocol. The current pre-release protocol is documented [[Pre-release_protocol|elsewhere]]. The protocol for Pocket Minecraft is substantially different, and is documented at [[Pocket Minecraft Protocol]].<br />
<br />
If you're having trouble, check out the [[Protocol_FAQ|FAQ]] or ask for help in the IRC channel ([irc://irc.freenode.net/mcdevs #mcdevs on irc.freenode.net]).<br />
<br />
'''Note:''' While you may use the contents of this page without restriction to create servers, clients, bots, etc… you still need to provide attribution to #mcdevs if you copy any of the contents of this page for publication elsewhere.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Term<br />
! Definition<br />
|-<br />
| Player<br />
| When used in the singular, Player always refers to the client connected to the server<br />
|-<br />
| Entity<br />
| Entity refers to any item, player, mob, minecart or boat in the world. This definition is subject to change as Notch extends the protocol<br />
|-<br />
| EID<br />
| An EID - or Entity ID - is a unique 4-byte integer used to identify a specific entity<br />
|-<br />
| XYZ<br />
| In this document, the axis names are the same as those used by Notch. Y points upwards, X points South, and Z points West.<br />
|-<br />
!colspan="2"|See also: [[Data types]], [[Units of Measurement]]<br />
|}<br />
<br />
== Packets ==<br />
All packets begin with a single "Packet ID" byte. Listed packet size includes this byte. Packets are either "server to client", "client to server", or "Two-Way" (both). Packets are not prefixed with their length. For variable length packets, you must parse it completely to determine its length.<br />
=== Protocol Version ===<br />
1.6.2 - 74<br />
<br />
{{anchor|0x00}}<br />
=== Keep Alive (0x00) ===<br />
''Two-Way''<br />
<br />
The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same packet.<br />
The Beta server will disconnect a client if it doesn't receive at least one packet before 1200 in-game ticks, and the Beta client will time out the connection under the same conditions. The client may send packets with Keep-alive ID=0.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x00<br />
| Keep-alive ID<br />
| int<br />
| <code>957759560</code><br />
| Server-generated random id<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes<br />
|}<br />
<br />
{{anchor|0x01}}<br />
=== Login Request (0x01) ===<br />
''Server to Client'' ''(and Client to Server in some mods, see below)''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x01<br />
| Entity ID<br />
| int<br />
| <code>1298</code><br />
| The Player's Entity ID<br />
|-<br />
| Level type<br />
| string<br />
| default<br />
| <code>default</code>, <code>flat</code>, or <code>largeBiomes</code>. level-type in server.properties<br />
|-<br />
| Game mode<br />
| byte<br />
| <code>0</code><br />
| <code>0</code>: survival, <code>1</code>: creative, <code>2</code>: adventure. Bit 3 (<code>0x8</code>) is the hardcore flag<br />
|-<br />
| Dimension<br />
| byte<br />
| <code>0</code><br />
| <code>-1</code>: nether, <code>0</code>: overworld, <code>1</code>: end<br />
|-<br />
| Difficulty<br />
| byte<br />
| <code>1</code><br />
| <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard<br />
|-<br />
| Not used<br />
| byte<br />
| <code>0</code><br />
| Only 0 observed from vanilla server, was previously world height<br />
|-<br />
| Max players<br />
| byte<br />
| <code>8</code><br />
| Used by the client to draw the player list<br />
|-<br />
| Total Size:<br />
| colspan="4" | 12 bytes + length of strings<br />
|}<br />
<br />
* MinecraftForge sends packet with type 0x01 and 25 bytes(may depend on mods installed with it) following it after completing handshake and enabling encryption. In our tests it sent the following payload:<br />
0x53 0xC8 0xE6 0x1B 0x00 0x07 0x00 0x64 0x00 0x65 0x00 0x66 0x00 0x61 0x00 0x75 0x00 0x6C 0x00 0x74 0xFF 0x02 0x00 0x00 0x00<br />
<br />
It is probably safe for server to ignore them unless you know what to do. More insights are needed on MinecraftForge protocol specifics.<br />
<br />
{{anchor|0x02}}<br />
<br />
=== Handshake (0x02) ===<br />
''Client to server''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x02<br />
| Protocol Version<br />
| byte<br />
| <code>51</code><br />
| As of 1.6.2 the protocol version is 74. See [[Protocol version numbers]] for list.<br />
|-<br />
| Username<br />
| string<br />
| <code>Notch</code><br />
| The username of the player attempting to connect<br />
|-<br />
| Server Host<br />
| string<br />
| <code>localhost</code><br />
|<br />
|-<br />
| Server Port<br />
| int<br />
| <code>25565</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes + length of strings<br />
|}<br />
{{anchor|0x03}}<br />
<br />
=== Chat Message (0x03) ===<br />
<br />
''Client to Server''<br />
<br />
The default server will check the message to see if it begins with a '/'. If it doesn't, the username of the sender is prepended and sent to all other clients (including the original sender). If it does, the server assumes it to be a command and attempts to process it. A message longer than 100 characters will cause the server to kick the client. (As of 1.3.2, the vanilla client appears to limit the text a user can enter to 100 charaters.) This limits the chat message packet length to 203 bytes (as characters are encoded on 2 bytes). Note that this limit does not apply to chat messages sent by the server, which are limited to 32767 characters since 1.2.5. This change was initially done by allowing the client to not slice the message up to 119 (the previous limit), without changes to the server. For this reason, the vanilla server kept the code to cut messages at 119, but this isn't a protocol limitation and can be ignored.<br />
<br />
For more information, see [[Chat]].<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
! Packet ID<br />
! Field Name<br />
! Field Type<br />
! Example<br />
! Notes<br />
|-<br />
| rowspan="1" | 0x03<br />
| JSON string<br />
| String<br />
| See below<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes + string length<br />
|}<br />
<br />
The chat string must now be a valid JSON object:<br />
<br />
{"translate":"chat.type.announcement","using":["Server","hi"]}<br />
{"color":"gray","italic":true,"translate":"chat.type.admin","using":["Server",{"translate":"commands.save.success"}]}<br />
{"text":"§aOld style chat"}<br />
[https://gist.github.com/Dinnerbone/5631634 Original Gist from Dinnerbone]<br />
<br />
Where translate is one of the following:<br />
<br />
chat.type.admin: [%s: %s]<br />
chat.type.announcement: [%s] %s<br />
chat.type.emote: * %s %s<br />
chat.type.text: <%s> %s<br />
<br />
<br />
{{anchor|0x04}}<br />
<br />
=== Time Update (0x04) ===<br />
''Server to Client''<br />
<br />
Time is based on ticks, where 20 ticks happen every second. There are 24000 ticks in a day, making Minecraft days exactly 20 minutes long.<br />
<br />
The time of day is based on the timestamp modulo 24000. 0 is sunrise, 6000 is noon, 12000 is sunset, and 18000 is midnight.<br />
<br />
The default SMP server increments the time by <code>20</code> every second.<br />
<br />
{| class="wikitable"<br />
|-<br />
! | Packet ID<br />
! | Field Name<br />
! | Field Type<br />
! | Example<br />
! | Notes<br />
|-<br />
| rowspan="2" | 0x04<br />
| Age of the world<br />
| long<br />
| 45464654<br />
| In ticks; not changed by server commands<br />
|-<br />
| Time of Day<br />
| long<br />
| 21321<br />
| The world (or region) time, in ticks. '''If negative the sun will stop moving at the Math.abs of the time.'''<br />
|-<br />
! | Total Size:<br />
| colspan="4" | 17 Bytes<br />
|}<br />
<br />
{{anchor|0x05}}<br />
=== Entity Equipment (0x05) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x05<br />
| Entity ID<br />
| int<br />
| 0x00010643<br />
| Named Entity ID<br />
|-<br />
| Slot<br />
| short<br />
| 4<br />
| Equipment slot: 0=held, 1-4=armor slot (1 - boots, 2 - leggings, 3 - chestplate, 4 - helmet)<br />
|-<br />
| Item<br />
| [[Slot_Data|slot]]<br />
|<br />
| Item in slot format<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + slot data<br />
|}<br />
<br />
{{anchor|0x06}}<br />
=== Spawn Position (0x06) ===<br />
''Server to Client''<br />
<br />
Sent by the server after login to specify the coordinates of the spawn point (the point at which players spawn at, and which the compass points to). It can be sent at any time to update the point compasses point at.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x06<br />
| X<br />
| int<br />
| <code>117</code><br />
| Spawn X in block coordinates<br />
|-<br />
| Y<br />
| int<br />
| <code>70</code><br />
| Spawn Y in block coordinates<br />
|-<br />
| Z<br />
| int<br />
| <code>-46</code><br />
| Spawn Z in block coordinates<br />
|-<br />
| Total Size:<br />
| colspan="4" | 13 bytes<br />
|}<br />
<br />
{{anchor|0x07}}<br />
=== Use Entity (0x07) ===<br />
''Client to Server''<br />
<br />
This packet is sent from the client to the server when the client attacks or right-clicks another entity (a player, minecart, etc).<br />
<br />
A Notchian server only accepts this packet if the entity being attacked/used is visible without obstruction and within a 4-unit radius of the player's position.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x07<br />
| User<br />
| int<br />
| <code>1298</code><br />
| The entity of the player (ignored by the server)<br />
|-<br />
| Target<br />
| int<br />
| <code>1805</code><br />
| The entity the player is interacting with<br />
|-<br />
| Mouse button<br />
| boolean<br />
| <code>true</code><br />
| <code>true</code> when the player is left-clicking and <code>false</code> when right-clicking.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x08}}<br />
=== Update Health (0x08) ===<br />
''Server to Client''<br />
<br />
Sent by the server to update/set the health of the player it is sent to. Added in protocol version 5.<br />
<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x08<br />
| Health<br />
| '''float'''<br />
| '''20.0'''<br />
| 0 or less = dead, 20 = full HP<br />
|-<br />
| Food<br />
| short<br />
| 20<br />
| 0 - 20<br />
|-<br />
| Food Saturation<br />
| float<br />
| 5.0<br />
| Seems to vary from 0.0 to 5.0 in integer increments<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes<br />
|}<br />
<br />
{{anchor|0x09}}<br />
=== Respawn (0x09) ===<br />
''Server to Client''<br />
<br />
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x09<br />
| Dimension<br />
| int<br />
| <code>1</code><br />
| <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|-<br />
| Difficulty<br />
| byte<br />
| <code>1</code><br />
| <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard. <code>1</code> is always sent c->s<br />
|-<br />
| Game mode<br />
| byte<br />
| <code>1</code><br />
| <code>0</code>: survival, <code>1</code>: creative, <code>2</code>: adventure. The hardcore flag is not included<br />
|-<br />
| World height<br />
| short<br />
| <code>256</code><br />
| Defaults to <code>256</code><br />
|-<br />
| Level type<br />
| string<br />
| default<br />
| See [[#0x01|0x01 login]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes + length of string<br />
|}<br />
* Please avoid changing player's dimension to same dimension as he was in (i.e. from Nether to Nether, from Overworld to Overworld). While at first glance everything seems to work, weird bugs can occur, i.e. such player will be unable to attack other players in new world (minecraft client just won't send "Use Entity (0x07)" packet on hitting, only "Animation (0x12)" packet), even though he can see them and they can attack him (fixes after his death and respawn though).<br />
If you actually have multiple worlds of same dimension on server and need to teleport player between them, use intermediate world (with different dimension) between them.<br />
<br />
{{anchor|0x0A}}<br />
=== Player (0x0A) ===<br />
''Client to Server''<br />
<br />
This packet is used to indicate whether the player is on ground (walking/swimming), or airborne (jumping/falling).<br />
<br />
When dropping from sufficient height, fall damage is applied when this state goes from False to True. The amount of damage applied is based on the point where it last changed from True to False. Note that there are several movement related packets containing this state.<br />
<br />
This packet was previously referred to as Flying<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x0A<br />
| On Ground<br />
| boolean<br />
| <code>1</code><br />
| <code>True</code> if the client is on the ground, <code>False</code> otherwise<br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 bytes<br />
|}<br />
<br />
{{anchor|0x0B}}<br />
=== Player Position (0x0B) ===<br />
''Client to Server''<br />
<br />
Updates the players XYZ position on the server. <br />
If <code>Stance - Y</code> is less than <code>0.1</code> or greater than <code>1.65</code>, the stance is illegal and the client will be kicked with the message “Illegal Stance”.<br />
If the distance between the last known position of the player on the server and the new position set by this packet is greater than 100 units will result in the client being kicked for "You moved too quickly :( (Hacking?)"<br />
Also if the absolute number of X or Z is set greater than <code>3.2E7D</code> the client will be kicked for "Illegal position" <br />
<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x0B<br />
| X<br />
| double<br />
| <code>102.809</code><br />
| Absolute position<br />
|-<br />
| Y<br />
| double<br />
| <code>70.00</code><br />
| Absolute position<br />
|-<br />
| Stance<br />
| double<br />
| <code>71.62</code><br />
| Used to modify the players bounding box when going up stairs, crouching, etc…<br />
|-<br />
| Z<br />
| double<br />
| <code>68.30</code><br />
| Absolute position<br />
|-<br />
| On Ground<br />
| boolean<br />
| <code>1</code><br />
|<br />
Derived from packet [[#0x0A|0x0A]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 34 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x0C}}<br />
=== Player Look (0x0C) ===<br />
''Client to Server''<br />
<br />
[[File:Minecraft-trig-yaw.png|thumb|The unit circle for yaw]]<br />
<br />
Updates the direction the player is looking in.<br />
<br />
Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the xz-plane starts at (0, 1) and turns backwards towards (-1, 0), or in other words, it turns clockwise instead of counterclockwise. Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.<br />
<br />
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.<br />
<br />
You can get a unit vector from a given yaw/pitch via:<br />
x = -cos(pitch) * sin(yaw)<br />
y = -sin(pitch)<br />
z = cos(pitch) * cos(yaw)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x0C<br />
| Yaw<br />
| float<br />
| <code>0.00</code><br />
| Absolute rotation on the X Axis, in degrees<br />
|-<br />
| Pitch<br />
| float<br />
| <code>0.00</code><br />
| Absolute rotation on the Y Axis, in degrees<br />
|-<br />
| On Ground<br />
| boolean<br />
| <code>1</code><br />
|<br />
Derived from packet [[#0x0A|0x0A]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
{{anchor|0x0D}}<br />
=== Player Position and Look (0x0D) ===<br />
''Two-Way''<br />
<br />
A combination of [[#0x0C|Player Look]] and [[#0x0B|Player position]]. <br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x0D<br />
| X<br />
| double<br />
| <code>6.5</code><br />
| Absolute position<br />
|-<br />
| Y/Stance<br />
| double<br />
| <code>65.620000004768372</code><br />
| Y: Absolute Position (Client to Server); Stance: Used to modify the players bounding box when going up stairs, crouching, etc… (Server to Client)<br />
|-<br />
| Stance/Y<br />
| double<br />
| <code>67.240000009536743</code><br />
| Stance (Client to Server); Y (Server to Client)<br />
|-<br />
| Z<br />
| double<br />
| <code>7.5</code><br />
| Absolute position<br />
|-<br />
| Yaw<br />
| float<br />
| <code>0.0</code><br />
| Absolute rotation on the X Axis<br />
|-<br />
| Pitch<br />
| float<br />
| <code>0.0</code><br />
| Absolute rotation on the Y Axis<br />
|-<br />
| On Ground<br />
| boolean<br />
| <code>0</code><br />
|<br />
Derived from packet [[#0x0A|0x0A]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 42 bytes<br />
|}<br />
<br />
{{anchor|0x0E}}<br />
<br />
=== Player Digging (0x0E) ===<br />
''Client to Server''<br />
<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x0E<br />
| Status<br />
| byte<br />
| <code>1</code><br />
| The action the player is taking against the block (see below)<br />
|-<br />
| X<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Y<br />
| byte<br />
| <code>64</code><br />
| Block position<br />
|-<br />
| Z<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Face<br />
| byte<br />
| <code>3</code><br />
| The face being hit (see below)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 12 bytes<br />
|}<br />
<br />
Status can (currently) be one of six values:<br />
<br />
{| class="wikitable"<br />
|-<br />
| Meaning<br />
| Value<br />
|-<br />
| Started digging<br />
| <code>0</code><br />
|-<br />
| Cancelled digging<br />
| <code>1</code><br />
|-<br />
| Finished digging<br />
| <code>2</code><br />
|-<br />
| Drop item stack<br />
| <code>3</code><br />
|-<br />
| Drop item<br />
| <code>4</code><br />
|-<br />
| Shoot arrow / finish eating<br />
| <code>5</code><br />
|}<br />
<br />
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).<br />
<br />
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.<br />
<br />
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.<br />
<br />
The face can be one of six values, representing the face being hit:<br />
<br />
{| class="wikitable"<br />
|-<br />
| Value<br />
| 0<br />
| 1<br />
| 2<br />
| 3<br />
| 4<br />
| 5<br />
|-<br />
| Offset<br />
| -Y<br />
| +Y<br />
| -Z<br />
| +Z<br />
| -X<br />
| +X<br />
|}<br />
<br />
In 1.7.3, when a player opens a door with left click the server receives Packet 0xE+start digging and opens the door.<br />
<br />
{{anchor|0x0F}}<br />
=== Player Block Placement (0x0F) ===<br />
''Client to Server''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="8" | 0x0F<br />
| X<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Y<br />
| unsigned byte<br />
| <code>64</code><br />
| Block position<br />
|-<br />
| Z<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Direction<br />
| byte<br />
| <code>3</code><br />
| The offset to use for block/item placement (see below)<br />
|-<br />
| Held item<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Cursor position X<br />
| byte<br />
| 0 - 16<br />
| The position of the crosshair on the block<br />
|-<br />
| Cursor position Y<br />
| byte<br />
| 0 - 16<br />
|<br />
|-<br />
| Cursor position Z<br />
| byte<br />
| 0 - 16<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 14 bytes + slot data<br />
|}<br />
In normal operation (ie placing a block), this packet is sent once, with the values set normally.<br />
<br />
This packet has a special case where X, Y, Z, and Direction are all -1. (Note that Y is unsigned so set to 255.) This special packet indicates that the currently held item for the player should have its state updated such as eating food, shooting bows, using buckets, etc.<br />
<br />
In a Notchian Beta client, the block or item ID corresponds to whatever the client is currently holding, and the client sends one of these packets any time a right-click is issued on a surface, so no assumptions can be made about the safety of the ID. However, with the implementation of server-side inventory, a Notchian server seems to ignore the item ID, instead operating on server-side inventory information and holding selection. The client has been observed (1.2.5 and 1.3.2) to send both real item IDs and -1 in a single session.<br />
<br />
Special note on using buckets: When using buckets, the Notchian client might send two packets: first a normal and then a special case. The first normal packet is sent when you're looking at a block (e.g. the water you want to scoop up). This normal packet does not appear to do anything with a Notchian server. The second, special case packet appears to perform the action - based on current position/orientation and with a distance check - it appears that buckets can only be used within a radius of 6 units.<br />
<br />
{{anchor|0x10}}<br />
=== Held Item Change (0x10) ===<br />
''Two-Way''<br />
<br />
Sent when the player changes the slot selection<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x10<br />
| Slot ID<br />
| short<br />
| <code>1</code><br />
| The slot which the player has selected (0-8)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes<br />
|}<br />
<br />
{{anchor|0x11}}<br />
=== Use Bed (0x11) ===<br />
''Server to Client''<br />
<br />
This packet tells that a player goes to bed.<br />
<br />
The client with the matching Entity ID will go into bed mode.<br />
<br />
This Packet is sent to all nearby players including the one sent to bed.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x11<br />
| Entity ID<br />
| int<br />
| 89<br />
| Player ID<br />
|-<br />
| Unknown<br />
| byte<br />
| 0<br />
| Only 0 has been observed<br />
|-<br />
| Bed X<br />
| int<br />
| -247<br />
| Bed headboard X as block coordinate<br />
|-<br />
| Bed Y<br />
| byte<br />
| 78<br />
| Bed headboard Y as block coordinate<br />
|-<br />
| Bed Z<br />
| int<br />
| 128<br />
| Bed headboard Z as block coordinate<br />
|-<br />
| Total Size:<br />
| colspan="4" | 15 bytes<br />
|}<br />
<br />
{{anchor|0x12}}<br />
<br />
=== Animation (0x12) ===<br />
''Two-Way''<br />
<br />
Sent whenever an entity should change animation.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x12<br />
| Entity ID<br />
| int<br />
| <code>55534</code><br />
| Player ID<br />
|-<br />
| Animation<br />
| byte<br />
| <code>1</code><br />
| Animation ID<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
Animation can be one of the following values:<br />
<br />
{| class="wikitable"<br />
|-<br />
! ID<br />
! Animation<br />
|-<br />
| 0<br />
| No animation<br />
|-<br />
| 1<br />
| Swing arm<br />
|-<br />
| 2<br />
| Damage animation<br />
|-<br />
| 3<br />
| Leave bed<br />
|-<br />
| 5<br />
| Eat food<br />
|-<br />
| 6<br />
| Critical effect<br />
|-<br />
| 7<br />
| Magic critical effect<br />
|-<br />
| 102<br />
| (unknown)<br />
|-<br />
| 104<br />
| Crouch<br />
|-<br />
| 105<br />
| Uncrouch<br />
|}<br />
<br />
Only <code>1</code> (swing arm) is sent by notchian clients. Crouching is sent via 0x13. Damage is server-side, and so is not sent by notchian clients. See also [[#0x26|Entity Status]]. As of client 1.5.2, crouching / uncrouching is sent through [[#0x28|Entity Metadata]].<br />
<br />
{{anchor|0x13}}<br />
<br />
=== Entity Action (0x13) ===<br />
''Client to Server''<br />
<br />
Sent at least when crouching, leaving a bed, or sprinting.<br />
To send action animation to client use 0x28.<br />
The client will send this with Action ID = 3 when "Leave Bed" is clicked.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x13<br />
| Entity ID<br />
| int<br />
| <code>55534</code><br />
| Player ID<br />
|-<br />
| Action ID<br />
| byte<br />
| <code>1</code><br />
| The ID of the action, see below.<br />
|-<br />
| '''jumpBoost'''<br />
| int<br />
| <code>0</code><br />
| Horse jump boost. Ranged from 0 -> 100.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
Action ID can be one of the following values:<br />
<br />
{| class="wikitable"<br />
|-<br />
! ID<br />
! Action<br />
|-<br />
| 1<br />
| Crouch<br />
|-<br />
| 2<br />
| Uncrouch<br />
|-<br />
| 3<br />
| Leave bed<br />
|-<br />
| 4<br />
| Start sprinting<br />
|-<br />
| 5<br />
| Stop sprinting<br />
|}<br />
<br />
<br />
{{anchor|0x14}}<br />
<br />
=== Spawn Named Entity (0x14) ===<br />
''Server to Client''<br />
<br />
The only named entities (at the moment) are players (either real or NPC/Bot). This packet is sent by the server when a player comes into visible range, '''not''' when a player joins.<br />
<br />
Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly.<br />
<br />
At one point, the Notchian client was not okay with receiving player entity packets, including 0x14, that refer to its own username or Entity ID; and would teleport to the absolute origin of the map and fall through the Void any time it received them. However, in more recent versions, it appears to handle them correctly, by spawning a new entity as directed (though future packets referring to the entity ID may be handled incorrectly).<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="9" | 0x14<br />
| Entity ID<br />
| int<br />
| <code>94453</code><br />
| Player ID<br />
|-<br />
| Player Name<br />
| string<br />
| <code>Twdtwd</code><br />
| Max length of 16<br />
|-<br />
| X<br />
| int<br />
| <code>784</code><br />
| Player X as Absolute Integer<br />
|-<br />
| Y<br />
| int<br />
| <code>2131</code><br />
| Player Y as Absolute Integer<br />
|-<br />
| Z<br />
| int<br />
| <code>-752</code><br />
| Player Z as Absolute Integer<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>0</code><br />
| Player rotation as a packed byte<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| Player rotation as a packed byte<br />
|-<br />
| Current Item<br />
| short<br />
| <code>0</code><br />
| The item the player is currently holding. Note that this should be 0 for "no item", unlike -1 used in other packets. A negative value crashes clients.<br />
|-<br />
| Metadata<br />
| [[Entities#Entity_Metadata_Format|Metadata]]<br />
| <code></code><br />
| The 1.3 client crashes on packets with no metadata, but the server can send any metadata key of 0, 1 or 8 and the client is fine.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 22 bytes + length of strings + metadata (at least 1)<br />
|}<br />
<br />
{{anchor|0x15}}<br />
=== Collect Item (0x16) ===<br />
''Server to Client''<br />
<br />
Sent by the server when someone picks up an item lying on the ground - its sole purpose appears to be the animation of the item flying towards you. It doesn't destroy the entity in the client memory ([[#0x1D|0x1D]] does that), and it doesn't add it to your inventory ([[#0x67|0x67]] does that). The server only checks for items to be picked up after each [[#0x0B|Player Position]] and [[#0x0D|Player Position & Look]] packet sent by the client.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x16<br />
| Collected Entity ID<br />
| int<br />
| <code>38</code><br />
|<br />
|-<br />
| Collector Entity ID<br />
| int<br />
| <code>20</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0x17}}<br />
=== Spawn Object/Vehicle (0x17) ===<br />
''Server to Client''<br />
<br />
Sent by the server when an Object/Vehicle is created. The throwers entity id is now used for fishing floats too.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="8" | 0x17<br />
| Entity ID<br />
| int<br />
| <code>62</code><br />
| Entity ID of the Object<br />
|-<br />
| Type<br />
| byte<br />
| <code>11</code><br />
| The type of object (see [[Entities#Objects]])<br />
|-<br />
| X<br />
| int<br />
| <code>16080</code><br />
| The Absolute Integer X Position of the object<br />
|-<br />
| Y<br />
| int<br />
| <code>2299</code><br />
| The Absolute Integer Y Position of the object<br />
|-<br />
| Z<br />
| int<br />
| <code>592</code><br />
| The Absolute Integer Z Position of the object<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>67</code><br />
| The pitch in steps of 2p/256<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>0</code><br />
| The yaw in steps of 2p/256<br />
|-<br />
| [[Object Data]]<br />
| [[Object Data]]<br />
|<br />
| <br />
|-<br />
| Total Size:<br />
| colspan="4" | 23 or 29 bytes<br />
|}<br />
<br />
{{anchor|0x18}}<br />
=== Spawn Mob (0x18) ===<br />
''Server to Client''<br />
<br />
Sent by the server when a Mob Entity is Spawned<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="12" | 0x18<br />
| Entity ID<br />
| int<br />
| <code>446</code><br />
| Spawned Entity ID<br />
|-<br />
| Type<br />
| byte<br />
| <code>91</code><br />
| The type of mob. See [[Entities#Mobs]]<br />
|-<br />
| X<br />
| int<br />
| <code>13366</code><br />
| The Absolute Integer X Position of the object<br />
|-<br />
| Y<br />
| int<br />
| <code>2176</code><br />
| The Absolute Integer Y Position of the object<br />
|-<br />
| Z<br />
| int<br />
| <code>1680</code><br />
| The Absolute Integer Z Position of the object<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The pitch in steps of 2p/256<br />
|-<br />
| Head Pitch<br />
| byte<br />
| <code>10</code><br />
| The head pitch in steps of 2p/256<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>-27</code><br />
| Yaw in steps of 2p/256<br />
|-<br />
| Velocity X<br />
| short<br />
| <code>0</code><br />
|<br />
|-<br />
| Velocity Y<br />
| short<br />
| <code>0</code><br />
|<br />
|-<br />
| Velocity Z<br />
| short<br />
| <code>0</code><br />
|<br />
|-<br />
| Metadata<br />
| [[Entities#Entity_Metadata_Format|Metadata]]<br />
| <code>0 0 127</code><br />
| Varies by mob, see [[Entities]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 27 bytes + Metadata (at least 3 as you must send at least 1 item of metadata)<br />
|}<br />
<br />
{{anchor|0x19}}<br />
=== Spawn Painting (0x19) ===<br />
''Server to Client''<br />
<br />
This packet shows location, name, and type of painting.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x19<br />
| Entity ID<br />
| int<br />
| <code>0x00000326</code><br />
| Unique entity ID<br />
|-<br />
| Title<br />
| string<br />
| <code>Creepers</code><br />
| Name of the painting; max length 13 (length of "SkullAndRoses")<br />
|-<br />
| X<br />
| int<br />
| <code>50</code><br />
| Center X coordinate<br />
|-<br />
| Y<br />
| int<br />
| <code>66</code><br />
| Center Y coordinate<br />
|-<br />
| Z<br />
| int<br />
| <code>-50</code><br />
| Center Z coordinate<br />
|-<br />
| Direction<br />
| int<br />
| <code>0</code><br />
| Direction the painting faces (0 -z, 1 -x, 2 +z, 3 +x)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 23 bytes + length of string<br />
|}<br />
<br />
Calculating the center of an image: given a (width x height) grid of cells, with (0, 0) being the top left corner, the center is (max(0, width / 2 - 1), height / 2). E.g.<br />
<br />
2x1 (1, 0)<br />
4x4 (1, 2)<br />
<br />
{{anchor|0x1A}}<br />
=== Spawn Experience Orb (0x1A) ===<br />
''Server to Client''<br />
<br />
Spawns one or more experience orbs. Coordinates are in absolute units.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x1A<br />
| Entity ID<br />
| int<br />
| 105668<br />
|<br />
|-<br />
| x<br />
| int<br />
| -1143<br />
|<br />
|-<br />
| y<br />
| int<br />
| 1952<br />
|<br />
|-<br />
| z<br />
| int<br />
| 1166<br />
|<br />
|-<br />
| count<br />
| short<br />
| 7<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 19 bytes<br />
|}<br />
<br />
{{anchor|0x1B}}<br />
=== Steer Vehicle (0x1B) ===<br />
''Client to Server''<br />
<br />
Sent by client to steer the horse, minecart and boats.<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x1B<br />
| Sideways<br />
| float<br />
| 0.98<br />
| Positive to the left of the player<br />
|-<br />
| Forward<br />
| float<br />
| -0.98<br />
| Positive forward<br />
|-<br />
| Jump<br />
| bool<br />
| true<br />
| <br />
|-<br />
| Unmount<br />
| bool<br />
| false<br />
| True when leaving the vehicle<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes<br />
|}<br />
<br />
{{anchor|0x1C}}<br />
=== Entity Velocity (0x1C) ===<br />
''Server to Client''<br />
<br />
This packet is new to version 4 of the protocol, and is believed to be Entity Velocity/Motion.<br />
<br />
Velocity is believed to be in units of 1/8000 of a block per server tick (50ms);<br />
for example, -1343 would move (-1343 / 8000) = −0.167875 blocks per tick (or −3,3575 blocks per second).<br />
<br />
(This packet data values are not fully verified)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x1C<br />
| Entity ID<br />
| int<br />
| <code>1805</code><br />
| The entity ID<br />
|-<br />
| Velocity X<br />
| short<br />
| <code>-1343</code><br />
| Velocity on the X axis<br />
|-<br />
| Velocity Y<br />
| short<br />
| <code>0</code><br />
| Velocity on the Y axis<br />
|-<br />
| Velocity Z<br />
| short<br />
| <code>0</code><br />
| Velocity on the Z axis<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes<br />
|}<br />
<br />
{{anchor|0x1D}}<br />
<br />
=== Destroy Entity (0x1D) ===<br />
''Server to Client''<br />
<br />
Sent by the server when an list of Entities is to be destroyed on the client.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x1D<br />
| Entity Count<br />
| byte<br />
| <code>3</code><br />
| The amount of entities which should be destroyed<br />
|-<br />
| Entity IDs<br />
| array of int<br />
| <code>452, 546, 123</code><br />
| The list of entity ids which should be destroyed<br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 + (entity count * 4) bytes<br />
|}<br />
<br />
{{anchor|0x1E}}<br />
=== Entity (0x1E) ===<br />
''Server to Client''<br />
<br />
Most entity-related packets are subclasses of this packet. When sent from the server to the client, it may initialize the entry.<br />
<br />
For player entities, either this packet or any move/look packet is sent every game tick.<br />
So the meaning of this packet is basically that the entity did not move/look since the last such packet.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x1E<br />
| Entity ID<br />
| int<br />
| <code>446</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes<br />
|}<br />
<br />
{{anchor|0x1F}}<br />
=== Entity Relative Move (0x1F) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity moves less then 4 blocks; if an entity moves more than 4 blocks [[#0x22|Entity Teleport]] should be sent instead.<br />
<br />
This packet allows at most four blocks movement in any direction, because byte range is from -128 to 127. Movement is an offset of Absolute Int; to convert relative move to block coordinate offset, divide by 32.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x1F<br />
| Entity ID<br />
| int<br />
| <code>459</code><br />
|<br />
|-<br />
| dX<br />
| byte<br />
| <code>1</code><br />
| X axis Relative movement as an Absolute Integer<br />
|-<br />
| dY<br />
| byte<br />
| <code>-7</code><br />
| Y axis Relative movement as an Absolute Integer<br />
|-<br />
| dZ<br />
| byte<br />
| <code>5</code><br />
| Z axis Relative movement as an Absolute Integer<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 bytes<br />
|}<br />
<br />
{{anchor|0x20}}<br />
=== Entity Look (0x20) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity rotates. Example: "Yaw" field 64 means a 90 degree turn.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x20<br />
| Entity ID<br />
| int<br />
| <code>459</code><br />
|<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>126</code><br />
| The X Axis rotation as a fraction of 360<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The Y Axis rotation as a fraction of 360<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes<br />
|}<br />
<br />
{{anchor|0x21}}<br />
=== Entity Look and Relative Move (0x21) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity rotates and moves.<br />
Since a byte range is limited from -128 to 127, and movement is offset of Absolute Int,<br />
this packet allows at most four blocks movement in any direction. (-128/32 == -4)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x21<br />
| Entity ID<br />
| int<br />
| <code>459</code><br />
|<br />
|-<br />
| dX<br />
| byte<br />
| <code>1</code><br />
| X axis Relative movement as an Absolute Integer<br />
|-<br />
| dY<br />
| byte<br />
| <code>-7</code><br />
| Y axis Relative movement as an Absolute Integer<br />
|-<br />
| dZ<br />
| byte<br />
| <code>5</code><br />
| Z axis Relative movement as an Absolute Integer<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>126</code><br />
| The X Axis rotation as a fraction of 360<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The Y Axis rotation as a fraction of 360<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
{{anchor|0x22}}<br />
=== Entity Teleport (0x22) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity moves more than 4 blocks.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x22<br />
| Entity ID<br />
| int<br />
| <code>459</code><br />
|<br />
|-<br />
| X<br />
| int<br />
| <code>14162</code><br />
| X axis position as an Absolute Integer<br />
|-<br />
| Y<br />
| int<br />
| <code>2176</code><br />
| Y axis position as an Absolute Integer<br />
|-<br />
| Z<br />
| int<br />
| <code>1111</code><br />
| Z axis position as an Absolute Integer<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>126</code><br />
| The X Axis rotation as a fraction of 360<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The Y Axis rotation as a fraction of 360<br />
|-<br />
| Total Size:<br />
| colspan="4" | 19 bytes<br />
|}<br />
<br />
{{anchor|0x23}}<br />
=== Entity Head Look (0x23) ===<br />
''Server to Client''<br />
<br />
Changes the direction an entity's head is facing.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x23<br />
| Entity ID<br />
| int<br />
|<br />
|<br />
|-<br />
| Head Yaw<br />
| byte<br />
|<br />
| Head yaw in steps of 2p/256<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
{{anchor|0x26}}<br />
=== Entity Status (0x26) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x26<br />
| Entity ID<br />
| int<br />
| 34353<br />
|<br />
|-<br />
| Entity Status<br />
| byte<br />
| 0x03<br />
| See below<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
{| class="wikitable"<br />
|-<br />
! Entity Status<br />
! Meaning<br />
|-<br />
| 2<br />
| Entity hurt<br />
|-<br />
| 3<br />
| Entity dead<br />
|-<br />
| 6<br />
| Wolf taming<br />
|-<br />
| 7<br />
| Wolf tamed<br />
|-<br />
| 8<br />
| Wolf shaking water off itself<br />
|-<br />
| 9<br />
| (of self) Eating accepted by server<br />
|-<br />
| 10<br />
| Sheep eating grass<br />
|-<br />
| 11<br />
| Iron Golem handing over a rose<br />
|-<br />
| 12<br />
| Spawn "heart" particles near a villager<br />
|-<br />
| 13<br />
| Spawn particles indicating that a villager is angry and seeking revenge<br />
|-<br />
| 14<br />
| Spawn happy particles near a villager<br />
|-<br />
| 15<br />
| Spawn a "magic" particle near the Witch<br />
|-<br />
| 16<br />
| Zombie converting into a villager by shaking violently<br />
|-<br />
| 17<br />
| A firework exploding<br />
|-<br />
|}<br />
<br />
{{anchor|0x27}}<br />
<br />
=== Attach Entity (0x27) ===<br />
''Server to Client''<br />
<br />
This packet is sent when a player has been attached to an entity (e.g. Minecart)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x27<br />
| Entity ID<br />
| int<br />
| <code>1298</code><br />
| The player entity ID being attached<br />
|-<br />
| Vehicle ID<br />
| int<br />
| <code>1805</code><br />
| The vehicle entity ID attached to (-1 for unattaching)<br />
|-<br />
| '''Leash'''<br />
| unsigned byte<br />
| <code>0</code><br />
| If set to 1, leashes the entity to the vehicle<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
{{anchor|0x28}}<br />
<br />
=== Entity Metadata (0x28) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x28<br />
| Entity ID<br />
| int<br />
| <code>0x00000326</code><br />
| Unique entity ID to update.<br />
|-<br />
| Entity Metadata<br />
| [[Entities#Entity_Metadata_Format|Metadata]]<br />
| <code>0x00 0x01 0x7F</code><br />
| Metadata varies by entity. See [[Entities]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes + Metadata<br />
|}<br />
<br />
<br />
{{anchor|0x29}}<br />
=== Entity Effect (0x29) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x29<br />
| Entity ID<br />
| int<br />
| <code>14</code><br />
| Entity ID of a player<br />
|-<br />
| Effect ID<br />
| byte<br />
| <code>17</code><br />
| See [http://www.minecraftwiki.net/wiki/Potion_effect#Parameters here]<br />
|-<br />
| Amplifier<br />
| byte<br />
| <code>0</code><br />
|<br />
|-<br />
| Duration<br />
| short<br />
| <code>64</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0x2A}}<br />
=== Remove Entity Effect (0x2A) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x2a<br />
| Entity ID<br />
| int<br />
|<br />
| Entity ID of a player<br />
|-<br />
| Effect ID<br />
| byte<br />
| <code>17</code><br />
| See [http://www.minecraftwiki.net/wiki/Potion_effect#Parameters here]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x2B}}<br />
=== Set Experience (0x2B) ===<br />
''Server to Client''<br />
<br />
Sent by the server when the client should change experience levels.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x2B<br />
| Experience bar<br />
| float<br />
| <code>0.5960060358047485</code><br />
| Used for drawing the experience bar - value is between 0 and 1.<br />
|-<br />
| Level<br />
| short<br />
| <code>8</code><br />
|<br />
|-<br />
| Total experience<br />
| short<br />
| <code>130</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0x2C}}<br />
=== Entity Properties (0x2C) ===<br />
''Server to Client''<br />
<br />
'''Note''': The server sends this packet to inform the user of its movement speed. Users move far too fast when this packet is not sent.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x2C<br />
| Entity ID<br />
| int<br />
| 195<br />
| ?<br />
|-<br />
| Properties Count<br />
| int<br />
| 3<br />
| Number of string/data (including these lists) pairs that follow. The remaining fields here are repeated this number of times.<br />
|-<br />
| Properties<br />
| array of Property Data<br />
| <br />
| <br />
|-<br />
| Total Size:<br />
| colspan="4" | ? bytes<br />
|}<br />
<br />
<br />
'''Property Data''' structure:<br />
{| class="wikitable"<br />
|-<br />
! Field Name<br />
! Field Type<br />
! Example<br />
! Notes<br />
|-<br />
| Key<br />
| string<br />
| "generic.Maxhealth"<br />
| <br />
|-<br />
| Value<br />
| double<br />
| 20.0<br />
| <br />
|-<br />
| List Length<br />
| short<br />
| 1<br />
| Number of list elements that follow.<br />
|-<br />
| Modifiers<br />
| array of Modifier Data<br />
| <br />
| http://www.minecraftwiki.net/wiki/Attribute#Modifiers<br />
|}<br />
<br />
Known key values:<br />
{| class="wikitable"<br />
|-<br />
! Key <br />
! Default <br />
! Min <br />
! Max<br />
! Label<br />
|-<br />
| generic.maxHealth<br />
| 20.0<br />
| 0.0<br />
| Double.MaxValue<br />
| Max Health<br />
|-<br />
| generic.followRange<br />
| 32.0<br />
| 0.0<br />
| 2048.0<br />
| Follow Range<br />
|-<br />
| generic.knockbackResistance<br />
| 0.0<br />
| 0.0<br />
| 1.0<br />
| Knockback Resistance<br />
|-<br />
| generic.movementSpeed<br />
| 0.699999988079071<br />
| 0.0<br />
| Double.MaxValue<br />
| Movement Speed<br />
|-<br />
| generic.attackDamage<br />
| 2.0<br />
| 0.0<br />
| Double.MaxValue<br />
| <br />
|-<br />
| horse.jumpStrength<br />
| 0.7<br />
| 0.0<br />
| 2.0<br />
| Jump Strength<br />
|-<br />
| zombie.spawnReinforcements<br />
| 0.0<br />
| 0.0<br />
| 1.0<br />
| Spawn Reinforcements Chance<br />
|}<br />
<br />
'''Modifier Data''' structure:<br />
{| class="wikitable"<br />
|-<br />
! Field Name<br />
! Field Type<br />
! Example<br />
! Notes<br />
|-<br />
| UUID<br />
| 128-bit integer<br />
|<br />
|<br />
|-<br />
| Amount<br />
| double<br />
|<br />
|<br />
|-<br />
| Operation<br />
| byte<br />
|<br />
|<br />
|}<br />
<br />
<br />
{{anchor|0x33}}<br />
<br />
=== Chunk Data (0x33) ===<br />
''Server to Client''<br />
<br />
Chunks are not unloaded by the client automatically. To unload chunks, send this packet with ground-up continuous=true and no 16^3 chunks (eg. primary bit mask=0). The server does not send skylight information for nether-chunks, it's up to the client to know if the player is currently in the nether. You can also infer this information from the primary bitmask and the amount of uncompressed bytes sent.<br />
<br />
See also: [[SMP Map Format]]<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x33<br />
| Chunk X<br />
| int<br />
|<br />
| Chunk X Coordinate (*16 to get true X)<br />
|-<br />
| Chunk Z<br />
| int<br />
|<br />
| Chunk Z Coordinate (*16 to get true Z)<br />
|-<br />
| Ground-up continuous<br />
| boolean<br />
|<br />
| This is True if the packet represents all sections in this vertical column, where the primary bit map specifies exactly which sections are included, and which are air.<br />
|-<br />
| Primary bit map<br />
| unsigned short<br />
| 15<br />
| Bitmask with 1 for every 16x16x16 section which data follows in the compressed data.<br />
|-<br />
| Add bit map<br />
| unsigned short<br />
| 0<br />
| Same as above, but this is used exclusively for the 'add' portion of the payload<br />
|-<br />
| Compressed size<br />
| int<br />
|<br />
| Size of compressed chunk data.<br />
|-<br />
| Compressed data<br />
| unsigned byte array<br />
| <code>…</code><br />
| The chunk data is compressed using ZLib Deflate function.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 18 bytes + Compressed chunk size<br />
|}<br />
<br />
{{anchor|0x34}}<br />
<br />
=== Multi Block Change (0x34) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x34<br />
| Chunk X<br />
| int<br />
| <code>-9</code><br />
| Chunk X Coordinate<br />
|-<br />
| Chunk Z<br />
| int<br />
| <code>12</code><br />
| Chunk Z Coordinate<br />
|-<br />
| Record count<br />
| short<br />
|<br />
| The number of blocks affected<br />
|-<br />
| Data size<br />
| int<br />
|<br />
| The total size of the data, in bytes. Should always be 4*record count - please confirm.<br />
|-<br />
| Data<br />
| Special<br />
| <code>…</code><br />
| Coordinates, type, and metadata of blocks to change (see below table).<br />
|-<br />
| Total Size:<br />
| colspan="4" | 15 bytes + Arrays<br />
|}<br />
<br />
Each record is four bytes.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Bit mask<br />
| Width<br />
| Meaning<br />
|-<br />
| 00 00 00 0F<br />
| 4 bits<br />
| Block metadata<br />
|-<br />
| 00 00 FF F0<br />
| 12 bits<br />
| Block ID<br />
|-<br />
| 00 FF 00 00<br />
| 8 bits<br />
| Y co-ordinate<br />
|-<br />
| 0F 00 00 00<br />
| 4 bits<br />
| Z co-ordinate, relative to chunk<br />
|-<br />
| F0 00 00 00<br />
| 4 bits<br />
| X co-ordinate, relative to chunk<br />
|}<br />
<br />
{{anchor|0x35}}<br />
<br />
=== Block Change (0x35) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x35<br />
| X<br />
| int<br />
| <code>502</code><br />
| Block X Coordinate<br />
|-<br />
| Y<br />
| byte<br />
| <code>71</code><br />
| Block Y Coordinate<br />
|-<br />
| Z<br />
| int<br />
| <code>18</code><br />
| Block Z Coordinate<br />
|-<br />
| Block Type<br />
| short<br />
| <code>78</code><br />
| The new block type for the block<br />
|-<br />
| Block Metadata<br />
| byte<br />
| <code>0</code><br />
| The new Metadata for the block<br />
|-<br />
| Total Size:<br />
| colspan="4" | 13 bytes<br />
|}<br />
<br />
{{anchor|0x36}}<br />
=== Block Action (0x36) ===<br />
''Server to Client''<br />
<br />
This packet is used for a number of things:<br />
* <div class="li">Chests opening and closing<br />
* Pistons pushing and pulling<br />
* Note blocks playing<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x36<br />
| X<br />
| int<br />
| <code>502</code><br />
| Block X Coordinate<br />
|-<br />
| Y<br />
| short<br />
| <code>71</code><br />
| Block Y Coordinate<br />
|-<br />
| Z<br />
| int<br />
| <code>18</code><br />
| Block Z Coordinate<br />
|-<br />
| Byte 1<br />
| byte<br />
| <code>3</code><br />
| Varies depending on block - see below<br />
|-<br />
| Byte 2<br />
| byte<br />
| <code>17</code><br />
| Varies depending on block - see below<br />
|-<br />
| Block ID<br />
| short<br />
| <code>29</code><br />
| The block id this action is set for<br />
|-<br />
| Total Size:<br />
| colspan="4" | 15 bytes<br />
|}<br />
See Also: [[Block Actions]] <br />
<br />
{{anchor|0x37}}<br />
=== Block Break Animation (0x37) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x37<br />
| Entity ID?<br />
| int<br />
|<br />
| Entity breaking the block?<br />
|-<br />
| X<br />
| int<br />
|<br />
| rowspan="3" | Block position<br />
|-<br />
| Y<br />
| int<br />
|<br />
|-<br />
| Z<br />
| int<br />
|<br />
|-<br />
| Destroy Stage<br />
| byte<br />
| 1<br />
| How far destroyed this block is. (0-7)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 18 bytes<br />
|}<br />
<br />
{{anchor|0x38}}<br />
<br />
=== Map Chunk Bulk (0x38) ===<br />
''Server to Client''<br />
<br />
See also: [[SMP Map Format]]<br />
<br />
To reduce the number of bytes this packet is used to send chunks together for better compression results.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x38<br />
| Chunk column count<br />
| short<br />
|<br />
| The number of chunks in this packet<br />
|-<br />
| Data length<br />
| int<br />
|<br />
| the size of the data field<br />
|-<br />
| Sky light sent<br />
| boolean<br />
|<br />
| Whether or not the chunk data contains a light nibble array. This is true in the main world, false in the end + nether<br />
|-<br />
| Data<br />
| byte array<br />
|<br />
| Compressed chunk data<br />
|-<br />
| Meta information<br />
| Special<br />
|<br />
| see below<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 + (Chunk data size) + 12 * (Chunk Count) bytes<br />
|}<br />
<br />
====Meta Information Structure====<br />
<br />
This structure is repeated for each chunk column sent<br />
<br />
{| class="wikitable"<br />
|-<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| Chunk X<br />
| int<br />
| 10<br />
| The X coordinate of the specific chunk<br />
|-<br />
| Chunk Z<br />
| int<br />
| 10<br />
| The Z coordinate of the specific chunk<br />
|-<br />
| Primary bitmap<br />
| unsigned short<br />
| 15<br />
| A bitmap which specifies which sections are not empty in this chunk<br />
|-<br />
| Add bitmap<br />
| unsigned short<br />
| 0<br />
| A bitmap which specifies which sections need add information because of very high block ids. not yet used. needs verification<br />
|-<br />
| Total Size:<br />
| colspan="3" | 12 bytes<br />
|}<br />
<br />
<br />
* If you send this packet to update area surrounding player in the middle of the game, entities within the updated area may become unattackable (vanilla client just won't send "Use Entity (0x07)" packet when you try to hit them, only swing animation, also it will dig blocks through them), even though they will be visible and work correctly in other ways. This is a bug in vanilla client (still there in 1.5.2), but you can workaround it by destroying relevant entities prior to sending 0x38 (via 0x1D) and spawning them again after it.<br />
<br />
{{anchor|0x3C}}<br />
<br />
=== Explosion (0x3C) ===<br />
''Server to Client''<br />
<br />
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="9" | 0x3C<br />
| X<br />
| double<br />
|<br />
|<br />
|-<br />
| Y<br />
| double<br />
|<br />
|<br />
|-<br />
| Z<br />
| double<br />
|<br />
|<br />
|-<br />
| Radius<br />
| float<br />
| 3.0<br />
| Currently unused in the client<br />
|-<br />
| Record count<br />
| int<br />
|<br />
| This is the count, not the size. The size is 3 times this value.<br />
|-<br />
| Records<br />
| (byte, byte, byte) × count<br />
|<br />
| Each record is 3 signed bytes long, each bytes are the XYZ (respectively) offsets of affected blocks.<br />
|-<br />
| Player Motion X<br />
| float<br />
|<br />
| X velocity of the player being pushed by the explosion<br />
|-<br />
| Player Motion Y<br />
| float<br />
|<br />
| Y velocity of the player being pushed by the explosion<br />
|-<br />
| Player Motion Z<br />
| float<br />
|<br />
| Z velocity of the player being pushed by the explosion<br />
|-<br />
| Total Size:<br />
| colspan="4" | 45 bytes + 3*(Record count) bytes<br />
|}<br />
<br />
Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x<br />
<br />
{{anchor|0x3D}}<br />
=== Sound Or Particle Effect (0x3D) ===<br />
''Server to Client''<br />
<br />
Sent when a client is to play a sound or particle effect.<br />
<br />
By default, the minecraft client adjusts the volume of sound effects based on distance. The final boolean field is used to disable this, and instead the effect is played from 2 blocks away in the correct direction. Currently this is only used for effect 1013 (mob.wither.spawn), and is ignored for any other value by the client.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x3D<br />
| Effect ID<br />
| int<br />
| 1003<br />
| The ID of the effect, see below.<br />
|-<br />
| X<br />
| int<br />
|<br />
| The X location of the effect.<br />
|-<br />
| Y<br />
| byte<br />
|<br />
| The Y location of the effect.<br />
|-<br />
| Z<br />
| int<br />
|<br />
| The Z location of the effect.<br />
|-<br />
| Data<br />
| int<br />
| 0<br />
| Extra data for certain effects, see below.<br />
|-<br />
| Disable relative volume<br />
| boolean<br />
| false<br />
| See above<br />
|-<br />
| Total Size:<br />
| colspan="4" | 19 bytes<br />
|}<br />
<br />
====Effects====<br />
<br />
'''Sound''':<br />
<br />
*1000: <code>random.click</code><br />
*1001: <code>random.click</code><br />
*1002: <code>random.bow</code><br />
*1003: <code>random.door_open</code> or <code>random.door_close</code> (50/50 chance)<br />
*1004: <code>random.fizz</code><br />
*1005: Play a music disc. '''Data''': [http://www.minecraftwiki.net/wiki/Music_Discs Record ID]<br />
*''(1006 not assigned)''<br />
*1007: <code>mob.ghast.charge</code><br />
*1008: <code>mob.ghast.fireball</code><br />
*1009: <code>mob.ghast.fireball</code>, but with a lower volume.<br />
*1010: <code>mob.zombie.wood</code><br />
*1011: <code>mob.zombie.metal</code><br />
*1012: <code>mob.zombie.woodbreak</code><br />
*1013: <code>mob.wither.spawn</code><br />
*1014: <code>mob.wither.shoot</code><br />
*1015: <code>mob.bat.takeoff</code><br />
*1016: <code>mob.zombie.infect</code><br />
*1017: <code>mob.zombie.unfect</code><br />
*1018: <code>mob.enderdragon.end</code><br />
*1020: <code>random.anvil_break</code><br />
*1021: <code>random.anvil_use</code><br />
*1022: <code>random.anvil_land</code><br />
<br />
'''Particle''':<br />
<br />
*2000: Spawns 10 smoke particles, e.g. from a fire. '''Data''': direction, see below<br />
*2001: Block break. '''Data''': [http://www.minecraftwiki.net/wiki/Data_values Block ID]<br />
*2002: Splash potion. Particle effect + glass break sound. '''Data''': [http://www.lb-stuff.com/Minecraft/PotionDataValues1.9pre3.txt Potion ID]<br />
*2003: Eye of ender. Actual client effect to be determined.<br />
*2004: Mob spawn particle effect: smoke + flames<br />
*2005: Spawn "happy villager" effect (hearts).<br />
<br />
Smoke directions:<br />
<br />
{| class="wikitable"<br />
|-<br />
| ID<br />
| Direction<br />
|-<br />
| 0<br />
| South - East<br />
|-<br />
| 1<br />
| South<br />
|-<br />
| 2<br />
| South - West<br />
|-<br />
| 3<br />
| East<br />
|-<br />
| 4<br />
| (Up or middle ?)<br />
|-<br />
| 5<br />
| West<br />
|-<br />
| 6<br />
| North - East<br />
|-<br />
| 7<br />
| North<br />
|-<br />
| 8<br />
| North - West<br />
|}<br />
<br />
{{anchor|0x3E}}<br />
<br />
=== Named Sound Effect (0x3E) ===<br />
''Server to client''<br />
<br />
Used to play a sound effect on the client.<br />
<br />
All known sound effect names can be seen [https://github.com/SirCmpwn/Craft.Net/blob/master/source/Craft.Net.Common/SoundEffect.cs here].<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x3E<br />
| Sound name<br />
| string<br />
| step.grass<br />
| 250<br />
|-<br />
| Effect position X<br />
| int<br />
| 250<br />
| effect X multiplied by 8<br />
|-<br />
| Effect position Y<br />
| int<br />
| 250<br />
| effect Y multiplied by 8<br />
|-<br />
| Effect position Z<br />
| int<br />
| 250<br />
| effect Z multiplied by 8<br />
|-<br />
| Volume<br />
| float<br />
| 9<br />
| 1 is 100%, can be more<br />
|-<br />
| Pitch<br />
| byte<br />
| 1<br />
| 63 is 100%, can be more<br />
|-<br />
| Total Size:<br />
| colspan="4" | 20 bytes + length of string<br />
|}<br />
<br />
{{anchor|0x3F}}<br />
<br />
=== Particle (0x3F) ===<br />
''Server to Client''<br />
<br />
This displays the named particle<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="9" | 0x3F<br />
| Particle name<br />
| string<br />
| <code>hugeexplosion</code><br />
| The name of the particle to create. A list can be found [https://gist.github.com/thinkofdeath/5110835 here]<br />
|-<br />
| X<br />
| float<br />
| 0<br />
| X position of the particle<br />
|-<br />
| Y<br />
| float<br />
| 0<br />
| Y position of the particle<br />
|-<br />
| Z<br />
| float<br />
| 0<br />
| Z position of the particle<br />
|-<br />
| Offset X<br />
| float<br />
| 0<br />
| This is added to the X position after being multiplied by random.nextGaussian() <br />
|-<br />
| Offset Y<br />
| float<br />
| 0<br />
| This is added to the Y position after being multiplied by random.nextGaussian() <br />
|-<br />
| Offset Z<br />
| float<br />
| 0<br />
| This is added to the Z position after being multiplied by random.nextGaussian() <br />
|-<br />
| Particle speed<br />
| float<br />
| 0<br />
| The speed of each particle<br />
|-<br />
| Number of particles<br />
| int<br />
| 0<br />
| The number of particles to create<br />
|-<br />
| Total Size:<br />
| colspan="4" | 34 bytes + length of string<br />
|}<br />
<br />
{{anchor|0x46}}<br />
=== Change Game State (0x46) ===<br />
''Server to Client''<br />
<br />
This packet appeared with protocol version 10. Currently, it appears when a bed can't be used as a spawn point and when the rain state changes. it could have additional uses in the future.<br />
<br />
The class has an array of strings linked to reason codes 0, 1, 2, and 3 but only the codes for 1 and 2 are null.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x46<br />
| Reason<br />
| byte<br />
| 0<br />
|<br />
|-<br />
| Game mode<br />
| byte<br />
| 0<br />
| Used only when reason = 3. 0 is survival, 1 is creative.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes<br />
|}<br />
<br />
'''Reason codes'''<br />
<br />
{| class="wikitable"<br />
|-<br />
! Code<br />
! Effect<br />
! Text<br />
|-<br />
| 0<br />
| Invalid Bed<br />
| "tile.bed.notValid"<br />
|-<br />
| 1<br />
| Begin raining<br />
| null<br />
|-<br />
| 2<br />
| End raining<br />
| null<br />
|-<br />
| 3<br />
| Change game mode<br />
| gameMode.changed<br />
|-<br />
| 4<br />
| Enter credits<br />
|<br />
|}<br />
<br />
{{anchor|0x47}}<br />
=== Spawn Global Entity (0x47) ===<br />
''Server to Client''<br />
<br />
With this packet, the server notifies the client of thunderbolts striking within a 512 block radius around the player. The coordinates specify where exactly the thunderbolt strikes.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x47<br />
| Entity ID<br />
| int<br />
| 4<br />
| The entity ID of the thunderbolt<br />
|-<br />
| Type<br />
| byte<br />
| 1<br />
| The global entity type, currently always 1 for thunderbolt.<br />
|-<br />
| X<br />
| int<br />
| 133<br />
| Thunderbolt X as Absolute Integer<br />
|-<br />
| Y<br />
| int<br />
| 913<br />
| Thunderbolt Y as Absolute Integer<br />
|-<br />
| Z<br />
| int<br />
| 63552<br />
| Thunderbolt Z as Absolute Integer<br />
|-<br />
| Total Size:<br />
| colspan="4" | 18 bytes<br />
|}<br />
<br />
{{anchor|0x64}}<br />
<br />
=== Open Window (0x64) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should open an inventory, such as a chest, workbench, or furnace. This message is not sent anywhere for clients opening their own inventory.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x64<br />
| Window id<br />
| byte<br />
| 123<br />
| A unique id number for the window to be displayed. Notchian server implementation is a counter, starting at 1.<br />
|-<br />
| Inventory Type<br />
| byte<br />
| 2<br />
| The window type to use for display. Check below<br />
|-<br />
| Window title<br />
| string<br />
| <code>Chest</code><br />
| The title of the window.<br />
|-<br />
| Number of Slots<br />
| byte<br />
| 3<br />
| Number of slots in the window (excluding the number of slots in the player inventory).<br />
|-<br />
| Use provided window title<br />
| boolean<br />
| 1<br />
| If false, the client will look up a string like "window.minecart". If true, the client uses what the server provides.<br />
|-<br />
| entityId<br />
| int<br />
| 0<br />
| EntityHorse's entityId. Only sent when window type is equal to 11 (AnimalChest).<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 bytes + length of string<br />
|}<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information.<br />
<br />
{{anchor|0x65}}<br />
<br />
=== Close Window (0x65) ===<br />
''Two-Way''<br />
<br />
This packet is sent by the client when closing a window. This packet is sent from the server to the client when a window is forcibly closed, such as when a chest is destroyed while it's open.<br />
<br />
Note, notchian clients send a close window message with window id 0 to close their inventory even though there is never an Open Window message for inventory. <br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x65<br />
| Window id<br />
| byte<br />
| 0<br />
| This is the id of the window that was closed. 0 for inventory.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 bytes<br />
|}<br />
<br />
{{anchor|0x66}}<br />
=== Click Window (0x66) ===<br />
''Client to Server''<br />
<br />
This packet is sent by the player when it clicks on a slot in a window.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x66<br />
| Window id<br />
| byte<br />
| <code>0</code><br />
| The id of the window which was clicked. 0 for player inventory.<br />
|-<br />
| Slot<br />
| short<br />
| <code>36</code><br />
| The clicked slot. See below.<br />
|-<br />
| Button<br />
| byte<br />
| <code>1</code><br />
| The button used in the click. See below.<br />
|-<br />
| Action number<br />
| short<br />
| <code>12</code><br />
| A unique number for the action, used for transaction handling (See the Transaction packet).<br />
|-<br />
| Mode<br />
| byte<br />
| <code>1</code><br />
| Inventory operation mode. See below.<br />
|-<br />
| Clicked item<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 bytes + slot data<br />
|}<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.<br />
<br />
When right-clicking on a stack of items, half the stack will be picked up and half left in the slot. If the stack is an odd number, the half left in the slot will be smaller of the amounts.<br />
<br />
The Action number is actually a counter, starting at 1. This number is used by the server as a transaction ID to send back a [[#0x6A|Transaction packet]].<br />
<br />
The distinct type of click performed by the client is determined by the combination of the "Mode" and "Button" fields.<br />
{| class="wikitable"<br />
|-<br />
! Mode<br />
! Button<br />
! Slot<br />
! Trigger<br />
|-<br />
! rowspan="2" | 0<br />
| 0<br />
| N/A<br />
| Left mouse click<br />
|-<br />
| 1<br />
| N/A<br />
| Right mouse click<br />
|-<br />
! rowspan="2" | 1<br />
| 0<br />
| N/A<br />
| Shift + left mouse click<br />
|-<br />
| 1<br />
| N/A<br />
| Shift + right mouse click ''(Identical behavior)''<br />
|-<br />
! rowspan="5" | 2<br />
| 0<br />
| N/A<br />
| Number key 1<br />
|-<br />
| 1<br />
| N/A<br />
| Number key 2<br />
|-<br />
| 2<br />
| N/A<br />
| Number key 3<br />
|-<br />
| ...<br />
| ...<br />
| ...<br />
|-<br />
| 8<br />
| N/A<br />
| Number key 9<br />
|-<br />
! rowspan="1" | 3<br />
| 2<br />
| N/A<br />
| Middle click<br />
|-<br />
! rowspan="4" | 4<br />
| 0<br />
| Not -999<br />
| Drop key (Q)<br />
|-<br />
| 1<br />
| Not -999<br />
| Ctrl + Drop key (Ctrl-Q)<br />
|-<br />
| 0<br />
| -999<br />
| Left click outside inventory holding nothing ''(No-op)''<br />
|-<br />
| 1<br />
| -999<br />
| Right click outside inventory holding nothing ''(No-op)''<br />
|-<br />
! rowspan="6" | 5<br />
| 0<br />
| -999<br />
| Starting left mouse paint ''(Or middle mouse)''<br />
|-<br />
| 4<br />
| -999<br />
| Starting right mouse paint<br />
|-<br />
| 1<br />
| Not -999<br />
| Left mouse painting progress<br />
|-<br />
| 5<br />
| Not -999<br />
| Right mouse painting progress<br />
|-<br />
| 2<br />
| -999<br />
| Ending left mouse paint<br />
|-<br />
| 6<br />
| -999<br />
| Ending right mouse paint<br />
|-<br />
! 6<br />
| 0<br />
| N/A<br />
| Double click<br />
|}<br />
<br />
Starting from version 1.5, "painting mode" is available for use in inventory windows. It is done by picking up stack of something (more than 1 items), then holding mouse button (left, right or middle) and dragging holded stack over empty (or same type in case of right button ) slots. In that case client sends the following to server after mouse button release (omitting first pickup packet which is sent as usual):<br />
<br />
# packet with mode 5, slot -999 , button (0 for left | 4 for right);<br />
# packet for every slot painted on, mode is still 5, button (1 | 5);<br />
# packet with mode 5, slot -999, button (2 | 6);<br />
<br />
If any of the painting packets other than the "progress" ones are sent out of order (for example, a start, some slots, then another start; or a left-click in the middle) the painting status will be reset.<br />
<br />
{{anchor|0x67}}<br />
<br />
=== Set Slot (0x67) ===<br />
''Server to Client''<br />
<br />
Sent by the server when an item in a slot (in a window) is added/removed.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x67<br />
| Window id<br />
| byte<br />
| <code>0</code><br />
| The window which is being updated. 0 for player inventory. Note that all known window types include the player inventory. This packet will only be sent for the currently opened window while the player is performing actions, even if it affects the player inventory. After the window is closed, a number of these packets are sent to update the player's inventory window (0).<br />
|-<br />
| Slot<br />
| short<br />
| <code>36</code><br />
| The slot that should be updated<br />
|-<br />
| Slot data<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 4 bytes + slot data<br />
|}<br />
<br />
Note that if window ID and slot are both -1, it means the item currently attached to the cursor.<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.<br />
<br />
Slots: [http://gyazo.com/9d52e1fd4dc14790ec66eab4a9aee00e.png]<br />
<br />
{{anchor|0x68}}<br />
=== Set Window Items (0x68) ===<br />
''Server to Client''<br />
<br />
[[File:Inventory-slots.png|thumb|The inventory slots]]<br />
<br />
Sent by the server when an item in a slot (in a window) is added/removed. This includes the main inventory, equipped armour and crafting slots. <br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x68<br />
| Window ID<br />
| byte<br />
| <code>1</code><br />
| The id of window which items are being sent for. 0 for player inventory.<br />
|-<br />
| Count<br />
| short<br />
| <code>4</code><br />
| The number of slots (see below)<br />
|-<br />
| Slot data<br />
| array of [[Slot_Data|slot]]s<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 4 bytes + size of slot data array<br />
|}<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.<br />
<br />
{{anchor|0x69}}<br />
<br />
=== Update Window Property (0x69) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x69<br />
| Window id<br />
| byte<br />
| 2<br />
| The id of the window.<br />
|-<br />
| Property<br />
| short<br />
| 1<br />
| Which property should be updated.<br />
|-<br />
| Value<br />
| short<br />
| 650<br />
| The new value for the property.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
'''Furnace'''<br />
<br />
Properties:<br />
<br />
* 0: Progress arrow<br />
* 1: Fire icon (fuel)<br />
<br />
Values:<br />
<br />
* 0-200 for progress arrow<br />
* 0-200 for fuel indicator<br />
<br />
Ranges are presumably in in-game ticks<br />
<br />
'''Enchantment Table'''<br />
<br />
Properties: 0, 1 or 2 depending on the "enchantment slot" being given.<br />
<br />
Values: The enchantment's level.<br />
<br />
{{anchor|0x6A}}<br />
=== Confirm Transaction (0x6A) ===<br />
''Two-Way''<br />
<br />
A packet from the server indicating whether a request from the client was accepted, or whether there was a conflict (due to lag). This packet is also sent from the client to the server in response to a server transaction rejection packet.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x6A<br />
| Window ID<br />
| byte<br />
| 0<br />
| The id of the window that the action occurred in.<br />
|-<br />
| Action number<br />
| short<br />
| 12<br />
| Every action that is to be accepted has a unique number. This field corresponds to that number.<br />
|-<br />
| Accepted?<br />
| boolean<br />
| true<br />
| Whether the action was accepted.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes<br />
|}<br />
<br />
{{anchor|0x6B}}<br />
<br />
=== Creative Inventory Action (0x6B) ===<br />
''Two-Way''<br />
<br />
While the user is in the standard inventory (i.e., not a crafting bench) on a creative-mode server then the server will send this packet:<br />
<br />
* <div class="li"> If an item is dropped into the quick bar</div><br />
* If an item is picked up from the quick bar (item id is -1)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x6B<br />
| Slot<br />
| short<br />
| 36<br />
| Inventory slot<br />
|-<br />
| Clicked item<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes + slot data<br />
|}<br />
<br />
{{anchor|0x6C}}<br />
=== Enchant Item (0x6C) ===<br />
''Client to Server''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x6C<br />
| Window ID<br />
| byte<br />
| 1<br />
| The ID sent by [[#0x64|Open Window]]<br />
|-<br />
| Enchantment<br />
| byte<br />
| 0<br />
| The position of the enchantment on the enchantment table window, starting with 0 as the topmost one.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes<br />
|}<br />
<br />
{{anchor|0x82}}<br />
=== Update Sign (0x82) ===<br />
''Two-Way''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x82<br />
| X<br />
| int<br />
| 128<br />
| Block X Coordinate<br />
|-<br />
| Y<br />
| short<br />
| 0<br />
| Block Y Coordinate<br />
|-<br />
| Z<br />
| int<br />
| -128<br />
| Block Z Coordinate<br />
|-<br />
| Line 1<br />
| string<br />
| <code>First line</code><br />
| First line of text in the sign<br />
|-<br />
| Line 2<br />
| string<br />
| <code>Second line</code><br />
| Second line of text in the sign<br />
|-<br />
| Line 3<br />
| string<br />
| <code>Third line</code><br />
| Third line of text in the sign<br />
|-<br />
| Line 4<br />
| string<br />
| <code>Fourth line</code><br />
| Fourth line of text in the sign<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes + 4 strings<br />
|}<br />
<br />
This message is sent from the server to the client whenever a sign is discovered or created. This message is sent from the client to the server when the "Done" button is pushed after placing a sign. This message is NOT sent when a sign is destroyed or unloaded.<br />
<br />
{{anchor|0x83}}<br />
<br />
=== Item Data (0x83) ===<br />
''Server to Client''<br />
<br />
Sent to specify complex data on an item; currently used only for maps.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x83<br />
| Item Type<br />
| short<br />
| <code>358</code><br />
| Type of item being modified<br />
|-<br />
| Item ID<br />
| short<br />
| <code>0</code><br />
| The ID (damage value) of the item being modified<br />
|-<br />
| Text length<br />
| short<br />
| <code>35</code><br />
| Length of following byte array<br />
|-<br />
| Text<br />
| byte array<br />
| {0,0,0,20,20,20,20,20}<br />
| ASCII text.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + Text length<br />
|}<br />
<br />
'''Maps'''<br />
If the first byte of the text is 0, the next two bytes are X start and Y start and the rest of the bytes are the colors in that column.<br />
<br />
If the first byte of the text is 1, the rest of the bytes are in groups of three: (data, x, y). The lower half of the data is the type (always 0 under vanilla) and the upper half is the direction.<br />
<br />
{{anchor|0x84}}<br />
=== Update Tile Entity (0x84) ===<br />
''Server to Client''<br />
<br />
Essentially a block update on a tile entity.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x84<br />
| X<br />
| int<br />
|<br />
|<br />
|-<br />
| Y<br />
| short<br />
|<br />
|<br />
|-<br />
| Z<br />
| int<br />
|<br />
|<br />
|-<br />
| Action<br />
| byte<br />
|<br />
| The type of update to perform<br />
|-<br />
| Data length<br />
| Short<br />
|<br />
| Varies<br />
|-<br />
| NBT Data<br />
| Byte Array<br />
|<br />
| Present if data length > 0. Compressed with [[wikipedia:Gzip|gzip]]. Varies<br />
|-<br />
| Total Size:<br />
| colspan="4" | 12 + itemstack bytes<br />
|}<br />
<br />
'''Actions'''<br />
<br />
* '''1''': Set mob displayed inside a mob spawner. Custom 1 contains the [[Entities#Mobs|mob type]]<br />
<br />
{{anchor|0x85}}<br />
<br />
=== Tile Editor Open? (0x85) ===<br />
''Server to Client''<br />
<br />
Sent on placement of sign.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x85<br />
| Tile Entity Id<br />
| byte<br />
| <code>0</code><br />
| Always seems to be 0 (TileEntitySign)<br />
|-<br />
| X<br />
| int<br />
| <code>70</code><br />
| X in block coordinates<br />
|-<br />
| Y<br />
| int<br />
| <code>70</code><br />
| Y in block coordinates<br />
|-<br />
| Z<br />
| int<br />
| <code>-46</code><br />
| Z in block coordinates<br />
|-<br />
| Total Size:<br />
| colspan="4" | 14 bytes<br />
|}<br />
<br />
{{anchor|0xC8}}<br />
<br />
=== Increment Statistic (0xC8) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0xC8<br />
| Statistic ID<br />
| int<br />
| 1003<br />
| The ID of the statistic. See [http://www.minecraftwiki.net/wiki/Statistics List of statistics].<br />
|-<br />
| Amount<br />
| '''int'''<br />
| 1<br />
| The amount to increment the statistic.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0xC9}}<br />
<br />
=== Player List Item (0xC9) ===<br />
''Server to Client''<br />
<br />
Sent by the notchian server to update the user list (<tab> in the client). The server sends one packet per user per tick, amounting to 20 packets/s for 1 online user, 40 for 2, and so forth.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xC9<br />
| Player name<br />
| string<br />
| barneygale<br />
| Supports chat colouring, limited to 16 characters.<br />
|-<br />
| Online<br />
| boolean<br />
| true<br />
| If false, the client will remove the user from the list.<br />
|-<br />
| Ping<br />
| short<br />
| 193<br />
| Ping, presumably in ms.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xCA}}<br />
=== Player Abilities (0xCA) ===<br />
''Two-Way''<br />
<br />
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.<br />
<br />
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).<br />
<br />
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.<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xCA<br />
| Flags<br />
| byte<br />
| 5<br />
|<br />
|-<br />
| Flying speed*<br />
| '''float'''<br />
| '''0.05'''<br />
| previous integer value divided by 250<br />
|-<br />
| Walking speed*<br />
| '''float'''<br />
| '''0.1'''<br />
| previous integer value divided by 250<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
The client ignores the walking speed and flying speed fields. Send an 0x2C packet as well.<br />
<br />
{{anchor|0xCB}}<br />
=== Tab-complete (0xCB) ===<br />
''Two-way''<br />
<br />
Sent C->S when the user presses [tab] while writing text. The payload contains all text behind the cursor.<br />
<br />
The server responds with an auto-completion of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported.<br />
<br />
In the event of more than one possible completion, the server responds with the options packed into the single string field, separated by a null character. Note that as strings are UTF-16, this is two bytes wide.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0xCB<br />
| Text<br />
| string<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xCC}}<br />
=== Client Settings (0xCC) ===<br />
''Client to server''<br />
<br />
Sent when the player connects, or when settings are changed.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0xCC<br />
| Locale<br />
| string<br />
| en_GB<br />
|<br />
|-<br />
| View distance<br />
| byte<br />
| 0<br />
| 0-3 for 'far', 'normal', 'short', 'tiny'.<br />
|-<br />
| Chat flags<br />
| byte<br />
| 8<br />
| Chat settings. See notes below.<br />
|-<br />
| Difficulty<br />
| byte<br />
| 0<br />
| Client-side difficulty from options.txt<br />
|-<br />
| Show Cape<br />
| boolean<br />
| true<br />
| Client-side "show cape" option<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + length of string<br />
|}<br />
<br />
Chat flags has several values packed into one byte.<br />
<br />
'''Chat Enabled:''' Bits 0-1. 00: Enabled. 01: Commands only. 10: Hidden.<br />
<br />
'''Colors Enabled:''' Bit 3. 0: Disabled. 1: Enabled.<br />
<br />
{{anchor|0xCD}}<br />
=== Client Statuses (0xCD) ===<br />
''Client to server''<br />
<br />
Sent when the client is ready to complete login and when the client is ready to respawn after death.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="1" | 0xCD<br />
| Payload<br />
| byte<br />
| 0<br />
| Bit field. 0: Initial spawn, 1: Respawn after death<br />
|-<br />
| Total Size:<br />
| colspan="5" | 2 bytes<br />
|}<br />
<br />
{{anchor|0xCE}}<br />
=== Scoreboard Objective (0xCE) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should create a new scoreboard or remove one.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xCE<br />
| Objective name<br />
| string<br />
| <code>deaths</code><br />
| An unique name for the objective<br />
|-<br />
| Objective value<br />
| string<br />
| <code>Deaths</code><br />
| The text to be displayed for the score.<br />
|-<br />
| Create/Remove<br />
| byte<br />
| 0<br />
| 0 to create the scoreboard. 1 to remove the scoreboard. 2 to update the display text. TODO: Check these values<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xCF}}<br />
=== Update Score (0xCF) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should update a scoreboard item.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0xCF<br />
| Item Name<br />
| string<br />
| <code>Bob</code><br />
| An unique name to be displayed in the list.<br />
|-<br />
| Update/Remove<br />
| byte<br />
| 0<br />
| 0 to create/update an item. 1 to remove an item.<br />
|-<br />
| Score Name<br />
| string<br />
| <code>deaths</code><br />
| The unique name for the scoreboard to be updated. Only sent when Update/Remove does not equal 1.<br />
|-<br />
| Value<br />
| int<br />
| 5<br />
| The score to be displayed next to the entry. Only sent when Update/Remove does not equal 1.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes + length of strings<br />
|}<br />
<br />
{{anchor|0xD0}}<br />
<br />
=== Display Scoreboard (0xD0) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should display a scoreboard.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0xD0<br />
| Position<br />
| byte<br />
| 1<br />
| The position of the scoreboard. 0 = list, 1 = sidebar, 2 = belowName.<br />
|-<br />
| Score Name<br />
| string<br />
| <code>deaths</code><br />
| The unique name for the scoreboard to be displayed.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 4 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xD1}}<br />
=== Teams (0xD1) ===<br />
''Server to Client''<br />
<br />
Creates and updates teams.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="8" | 0xD1<br />
| Team Name<br />
| string<br />
| mcdevs<br />
| A unique name for the team. (Shared with scoreboard).<br />
|-<br />
| Mode<br />
| byte<br />
| 0<br />
| If 0 then the team is created. <br />
If 1 then the team is removed. <br />
<br />
If 2 the team team information is updated. <br />
<br />
If 3 then new players are added to the team. <br />
<br />
If 4 then players are removed from the team.<br />
|-<br />
| Team Display Name<br />
| string<br />
| McDevs<br />
| Only if Mode = 0 or 2. <br />
|-<br />
| Team Prefix<br />
| string<br />
|<br />
| Only if Mode = 0 or 2. Displayed before the players' name that are part of this team. <br />
|-<br />
| Team Suffix<br />
| string<br />
|<br />
| Only if Mode = 0 or 2. Displayed after the players' name that are part of this team. <br />
|-<br />
| Friendly fire<br />
| byte<br />
| 0<br />
| Only if Mode = 0 or 2; 0 for off, 1 for on, 3 for seeing friendly invisibles<br />
|-<br />
| Player count<br />
| short<br />
| 0<br />
| Only if Mode = 0 or 3 or 4. Number of players in the array<br />
|-<br />
| Players<br />
| Array of strings<br />
|<br />
| Only if Mode = 0 or 3 or 4. Players to be added/remove from the team.<br />
|-<br />
| Total Size:<br />
| colspan="4" | Variable<br />
|}<br />
<br />
{{anchor|0xFA}}<br />
=== Plugin Message (0xFA) ===<br />
''Two-Way''<br />
<br />
Mods and plugins can use this to send their data. As of 1.3, Minecraft itself uses a number of [[plugin channel]]s. These internal channels are prefixed with <code>MC|</code>.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xFA<br />
| Channel<br />
| string<br />
| MyMod:testchannel<br />
| Name of the "channel" used to send the data.<br />
|-<br />
| length<br />
| short<br />
|<br />
| Length of the following byte array<br />
|-<br />
| data<br />
| byte array<br />
|<br />
| Any data.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes + length of string + length of byte array<br />
|}<br />
<br />
More documentation on this: http://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/<br />
<br />
{{anchor|0xFC}}<br />
=== Encryption Key Response (0xFC) ===<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on this packet. Bypassing the encryption is possible, authentication for the player name is still needed if the server is in online mode, but instead of sending this packet, you send [[#0xCD|Client Statuses]] instead.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0xFC<br />
| Shared secret length<br />
| short<br />
|<br />
|<br />
|-<br />
| Shared secret<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Verify token length<br />
| short<br />
|<br />
|<br />
|-<br />
| Verify token response<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes + length of shared secret + length of token<br />
|}<br />
<br />
{{anchor|0xFD}}<br />
=== Encryption Key Request (0xFD) ===<br />
''Server to client''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0xFD<br />
| Server id<br />
| string<br />
|<br />
|<br />
|-<br />
| Public key length<br />
| short<br />
|<br />
|<br />
|-<br />
| Public key<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Verify token length<br />
| short<br />
|<br />
|<br />
|-<br />
| Verify token<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + length of string + length of key + length of token<br />
|}<br />
<br />
{{anchor|0xFE}}<br />
<br />
=== Server List Ping (0xFE) ===<br />
''Client to Server''<br />
<br />
''Main article: [[Server List Ping]]''<br />
<br />
This packet is used by the multiplayer menu to retrieve MOTD, version, and player counts.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="1" | 0xFE<br />
| Magic<br />
| byte<br />
| <code>1</code><br />
| always <code>1</code><br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 bytes<br />
|}<br />
<br />
{{anchor|0xFF}}<br />
<br />
=== Disconnect/Kick (0xFF) ===<br />
''Two-Way''<br />
<br />
Sent by the server before it disconnects a client, or by the client before it disconnects from the server. The receiver of this packet assumes that the sender has already closed the connection by the time the packet arrives.<br />
<br />
Due to race conditions in the client, a local server may need to pause for a short period after sending this packet before closing the connection. An alternative is simply not to close the connection, and wait for the client to do so on receipt of this packet.<br />
<br />
When vanilla client quits, reason is "Quitting", but any reason is ok.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0xFF<br />
| Reason<br />
| string<br />
| <code>The server is full!</code><br />
| Displayed to the client when the connection terminates<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes + length of strings<br />
|}<br />
<br />
== See Also ==<br />
* [[Protocol History]]<br />
* [[Data Types]]<br />
* [[Units of Measurement]]<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Protocol&diff=4657Protocol2013-08-28T12:41:57Z<p>Sadimusi: /* Set Window Items (0x68) */</p>
<hr />
<div>This page presents a dissection of the current stable [http://minecraft.net/game/ Minecraft] protocol. The current pre-release protocol is documented [[Pre-release_protocol|elsewhere]]. The protocol for Pocket Minecraft is substantially different, and is documented at [[Pocket Minecraft Protocol]].<br />
<br />
If you're having trouble, check out the [[Protocol_FAQ|FAQ]] or ask for help in the IRC channel ([irc://irc.freenode.net/mcdevs #mcdevs on irc.freenode.net]).<br />
<br />
'''Note:''' While you may use the contents of this page without restriction to create servers, clients, bots, etc… you still need to provide attribution to #mcdevs if you copy any of the contents of this page for publication elsewhere.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Term<br />
! Definition<br />
|-<br />
| Player<br />
| When used in the singular, Player always refers to the client connected to the server<br />
|-<br />
| Entity<br />
| Entity refers to any item, player, mob, minecart or boat in the world. This definition is subject to change as Notch extends the protocol<br />
|-<br />
| EID<br />
| An EID - or Entity ID - is a unique 4-byte integer used to identify a specific entity<br />
|-<br />
| XYZ<br />
| In this document, the axis names are the same as those used by Notch. Y points upwards, X points South, and Z points West.<br />
|-<br />
!colspan="2"|See also: [[Data types]], [[Units of Measurement]]<br />
|}<br />
<br />
== Packets ==<br />
All packets begin with a single "Packet ID" byte. Listed packet size includes this byte. Packets are either "server to client", "client to server", or "Two-Way" (both). Packets are not prefixed with their length. For variable length packets, you must parse it completely to determine its length.<br />
=== Protocol Version ===<br />
1.6.2 - 74<br />
<br />
{{anchor|0x00}}<br />
=== Keep Alive (0x00) ===<br />
''Two-Way''<br />
<br />
The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same packet.<br />
The Beta server will disconnect a client if it doesn't receive at least one packet before 1200 in-game ticks, and the Beta client will time out the connection under the same conditions. The client may send packets with Keep-alive ID=0.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x00<br />
| Keep-alive ID<br />
| int<br />
| <code>957759560</code><br />
| Server-generated random id<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes<br />
|}<br />
<br />
{{anchor|0x01}}<br />
=== Login Request (0x01) ===<br />
''Server to Client'' ''(and Client to Server in some mods, see below)''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x01<br />
| Entity ID<br />
| int<br />
| <code>1298</code><br />
| The Player's Entity ID<br />
|-<br />
| Level type<br />
| string<br />
| default<br />
| <code>default</code>, <code>flat</code>, or <code>largeBiomes</code>. level-type in server.properties<br />
|-<br />
| Game mode<br />
| byte<br />
| <code>0</code><br />
| <code>0</code>: survival, <code>1</code>: creative, <code>2</code>: adventure. Bit 3 (<code>0x8</code>) is the hardcore flag<br />
|-<br />
| Dimension<br />
| byte<br />
| <code>0</code><br />
| <code>-1</code>: nether, <code>0</code>: overworld, <code>1</code>: end<br />
|-<br />
| Difficulty<br />
| byte<br />
| <code>1</code><br />
| <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard<br />
|-<br />
| Not used<br />
| byte<br />
| <code>0</code><br />
| Only 0 observed from vanilla server, was previously world height<br />
|-<br />
| Max players<br />
| byte<br />
| <code>8</code><br />
| Used by the client to draw the player list<br />
|-<br />
| Total Size:<br />
| colspan="4" | 12 bytes + length of strings<br />
|}<br />
<br />
* MinecraftForge sends packet with type 0x01 and 25 bytes(may depend on mods installed with it) following it after completing handshake and enabling encryption. In our tests it sent the following payload:<br />
0x53 0xC8 0xE6 0x1B 0x00 0x07 0x00 0x64 0x00 0x65 0x00 0x66 0x00 0x61 0x00 0x75 0x00 0x6C 0x00 0x74 0xFF 0x02 0x00 0x00 0x00<br />
<br />
It is probably safe for server to ignore them unless you know what to do. More insights are needed on MinecraftForge protocol specifics.<br />
<br />
{{anchor|0x02}}<br />
<br />
=== Handshake (0x02) ===<br />
''Client to server''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x02<br />
| Protocol Version<br />
| byte<br />
| <code>51</code><br />
| As of 1.6.2 the protocol version is 74. See [[Protocol version numbers]] for list.<br />
|-<br />
| Username<br />
| string<br />
| <code>Notch</code><br />
| The username of the player attempting to connect<br />
|-<br />
| Server Host<br />
| string<br />
| <code>localhost</code><br />
|<br />
|-<br />
| Server Port<br />
| int<br />
| <code>25565</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes + length of strings<br />
|}<br />
{{anchor|0x03}}<br />
<br />
=== Chat Message (0x03) ===<br />
<br />
''Client to Server''<br />
<br />
The default server will check the message to see if it begins with a '/'. If it doesn't, the username of the sender is prepended and sent to all other clients (including the original sender). If it does, the server assumes it to be a command and attempts to process it. A message longer than 100 characters will cause the server to kick the client. (As of 1.3.2, the vanilla client appears to limit the text a user can enter to 100 charaters.) This limits the chat message packet length to 203 bytes (as characters are encoded on 2 bytes). Note that this limit does not apply to chat messages sent by the server, which are limited to 32767 characters since 1.2.5. This change was initially done by allowing the client to not slice the message up to 119 (the previous limit), without changes to the server. For this reason, the vanilla server kept the code to cut messages at 119, but this isn't a protocol limitation and can be ignored.<br />
<br />
For more information, see [[Chat]].<br />
<br />
''Server to Client''<br />
<br />
The chat string must now be a valid JSON object:<br />
<br />
{"translate":"chat.type.announcement","using":["Server","hi"]}<br />
{"color":"gray","italic":true,"translate":"chat.type.admin","using":["Server",{"translate":"commands.save.success"}]}<br />
{"text":"§aOld style chat"}<br />
[https://gist.github.com/Dinnerbone/5631634 Original Gist from Dinnerbone]<br />
<br />
Where translate is one of the following:<br />
<br />
chat.type.admin: [%s: %s]<br />
chat.type.announcement: [%s] %s<br />
chat.type.emote: * %s %s<br />
chat.type.text: <%s> %s<br />
<br />
<br />
{{anchor|0x04}}<br />
=== Time Update (0x04) ===<br />
''Server to Client''<br />
<br />
Time is based on ticks, where 20 ticks happen every second. There are 24000 ticks in a day, making Minecraft days exactly 20 minutes long.<br />
<br />
The time of day is based on the timestamp modulo 24000. 0 is sunrise, 6000 is noon, 12000 is sunset, and 18000 is midnight.<br />
<br />
The default SMP server increments the time by <code>20</code> every second.<br />
<br />
{| class="wikitable"<br />
|-<br />
! | Packet ID<br />
! | Field Name<br />
! | Field Type<br />
! | Example<br />
! | Notes<br />
|-<br />
| rowspan="2" | 0x04<br />
| Age of the world<br />
| long<br />
| 45464654<br />
| In ticks; not changed by server commands<br />
|-<br />
| Time of Day<br />
| long<br />
| 21321<br />
| The world (or region) time, in ticks. '''If negative the sun will stop moving at the Math.abs of the time.'''<br />
|-<br />
! | Total Size:<br />
| colspan="4" | 17 Bytes<br />
|}<br />
<br />
{{anchor|0x05}}<br />
=== Entity Equipment (0x05) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x05<br />
| Entity ID<br />
| int<br />
| 0x00010643<br />
| Named Entity ID<br />
|-<br />
| Slot<br />
| short<br />
| 4<br />
| Equipment slot: 0=held, 1-4=armor slot (1 - boots, 2 - leggings, 3 - chestplate, 4 - helmet)<br />
|-<br />
| Item<br />
| [[Slot_Data|slot]]<br />
|<br />
| Item in slot format<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + slot data<br />
|}<br />
<br />
{{anchor|0x06}}<br />
=== Spawn Position (0x06) ===<br />
''Server to Client''<br />
<br />
Sent by the server after login to specify the coordinates of the spawn point (the point at which players spawn at, and which the compass points to). It can be sent at any time to update the point compasses point at.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x06<br />
| X<br />
| int<br />
| <code>117</code><br />
| Spawn X in block coordinates<br />
|-<br />
| Y<br />
| int<br />
| <code>70</code><br />
| Spawn Y in block coordinates<br />
|-<br />
| Z<br />
| int<br />
| <code>-46</code><br />
| Spawn Z in block coordinates<br />
|-<br />
| Total Size:<br />
| colspan="4" | 13 bytes<br />
|}<br />
<br />
{{anchor|0x07}}<br />
=== Use Entity (0x07) ===<br />
''Client to Server''<br />
<br />
This packet is sent from the client to the server when the client attacks or right-clicks another entity (a player, minecart, etc).<br />
<br />
A Notchian server only accepts this packet if the entity being attacked/used is visible without obstruction and within a 4-unit radius of the player's position.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x07<br />
| User<br />
| int<br />
| <code>1298</code><br />
| The entity of the player (ignored by the server)<br />
|-<br />
| Target<br />
| int<br />
| <code>1805</code><br />
| The entity the player is interacting with<br />
|-<br />
| Mouse button<br />
| boolean<br />
| <code>true</code><br />
| <code>true</code> when the player is left-clicking and <code>false</code> when right-clicking.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x08}}<br />
=== Update Health (0x08) ===<br />
''Server to Client''<br />
<br />
Sent by the server to update/set the health of the player it is sent to. Added in protocol version 5.<br />
<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x08<br />
| Health<br />
| '''float'''<br />
| '''20.0'''<br />
| 0 or less = dead, 20 = full HP<br />
|-<br />
| Food<br />
| short<br />
| 20<br />
| 0 - 20<br />
|-<br />
| Food Saturation<br />
| float<br />
| 5.0<br />
| Seems to vary from 0.0 to 5.0 in integer increments<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes<br />
|}<br />
<br />
{{anchor|0x09}}<br />
=== Respawn (0x09) ===<br />
''Server to Client''<br />
<br />
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x09<br />
| Dimension<br />
| int<br />
| <code>1</code><br />
| <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|-<br />
| Difficulty<br />
| byte<br />
| <code>1</code><br />
| <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard. <code>1</code> is always sent c->s<br />
|-<br />
| Game mode<br />
| byte<br />
| <code>1</code><br />
| <code>0</code>: survival, <code>1</code>: creative, <code>2</code>: adventure. The hardcore flag is not included<br />
|-<br />
| World height<br />
| short<br />
| <code>256</code><br />
| Defaults to <code>256</code><br />
|-<br />
| Level type<br />
| string<br />
| default<br />
| See [[#0x01|0x01 login]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes + length of string<br />
|}<br />
* Please avoid changing player's dimension to same dimension as he was in (i.e. from Nether to Nether, from Overworld to Overworld). While at first glance everything seems to work, weird bugs can occur, i.e. such player will be unable to attack other players in new world (minecraft client just won't send "Use Entity (0x07)" packet on hitting, only "Animation (0x12)" packet), even though he can see them and they can attack him (fixes after his death and respawn though).<br />
If you actually have multiple worlds of same dimension on server and need to teleport player between them, use intermediate world (with different dimension) between them.<br />
<br />
{{anchor|0x0A}}<br />
=== Player (0x0A) ===<br />
''Client to Server''<br />
<br />
This packet is used to indicate whether the player is on ground (walking/swimming), or airborne (jumping/falling).<br />
<br />
When dropping from sufficient height, fall damage is applied when this state goes from False to True. The amount of damage applied is based on the point where it last changed from True to False. Note that there are several movement related packets containing this state.<br />
<br />
This packet was previously referred to as Flying<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x0A<br />
| On Ground<br />
| boolean<br />
| <code>1</code><br />
| <code>True</code> if the client is on the ground, <code>False</code> otherwise<br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 bytes<br />
|}<br />
<br />
{{anchor|0x0B}}<br />
=== Player Position (0x0B) ===<br />
''Client to Server''<br />
<br />
Updates the players XYZ position on the server. <br />
If <code>Stance - Y</code> is less than <code>0.1</code> or greater than <code>1.65</code>, the stance is illegal and the client will be kicked with the message “Illegal Stance”.<br />
If the distance between the last known position of the player on the server and the new position set by this packet is greater than 100 units will result in the client being kicked for "You moved too quickly :( (Hacking?)"<br />
Also if the absolute number of X or Z is set greater than <code>3.2E7D</code> the client will be kicked for "Illegal position" <br />
<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x0B<br />
| X<br />
| double<br />
| <code>102.809</code><br />
| Absolute position<br />
|-<br />
| Y<br />
| double<br />
| <code>70.00</code><br />
| Absolute position<br />
|-<br />
| Stance<br />
| double<br />
| <code>71.62</code><br />
| Used to modify the players bounding box when going up stairs, crouching, etc…<br />
|-<br />
| Z<br />
| double<br />
| <code>68.30</code><br />
| Absolute position<br />
|-<br />
| On Ground<br />
| boolean<br />
| <code>1</code><br />
|<br />
Derived from packet [[#0x0A|0x0A]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 34 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x0C}}<br />
=== Player Look (0x0C) ===<br />
''Client to Server''<br />
<br />
[[File:Minecraft-trig-yaw.png|thumb|The unit circle for yaw]]<br />
<br />
Updates the direction the player is looking in.<br />
<br />
Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the xz-plane starts at (0, 1) and turns backwards towards (-1, 0), or in other words, it turns clockwise instead of counterclockwise. Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.<br />
<br />
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.<br />
<br />
You can get a unit vector from a given yaw/pitch via:<br />
x = -cos(pitch) * sin(yaw)<br />
y = -sin(pitch)<br />
z = cos(pitch) * cos(yaw)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x0C<br />
| Yaw<br />
| float<br />
| <code>0.00</code><br />
| Absolute rotation on the X Axis, in degrees<br />
|-<br />
| Pitch<br />
| float<br />
| <code>0.00</code><br />
| Absolute rotation on the Y Axis, in degrees<br />
|-<br />
| On Ground<br />
| boolean<br />
| <code>1</code><br />
|<br />
Derived from packet [[#0x0A|0x0A]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
{{anchor|0x0D}}<br />
=== Player Position and Look (0x0D) ===<br />
''Two-Way''<br />
<br />
A combination of [[#0x0C|Player Look]] and [[#0x0B|Player position]]. <br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x0D<br />
| X<br />
| double<br />
| <code>6.5</code><br />
| Absolute position<br />
|-<br />
| Y/Stance<br />
| double<br />
| <code>65.620000004768372</code><br />
| Y: Absolute Position (Client to Server); Stance: Used to modify the players bounding box when going up stairs, crouching, etc… (Server to Client)<br />
|-<br />
| Stance/Y<br />
| double<br />
| <code>67.240000009536743</code><br />
| Stance (Client to Server); Y (Server to Client)<br />
|-<br />
| Z<br />
| double<br />
| <code>7.5</code><br />
| Absolute position<br />
|-<br />
| Yaw<br />
| float<br />
| <code>0.0</code><br />
| Absolute rotation on the X Axis<br />
|-<br />
| Pitch<br />
| float<br />
| <code>0.0</code><br />
| Absolute rotation on the Y Axis<br />
|-<br />
| On Ground<br />
| boolean<br />
| <code>0</code><br />
|<br />
Derived from packet [[#0x0A|0x0A]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 42 bytes<br />
|}<br />
<br />
{{anchor|0x0E}}<br />
<br />
=== Player Digging (0x0E) ===<br />
''Client to Server''<br />
<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x0E<br />
| Status<br />
| byte<br />
| <code>1</code><br />
| The action the player is taking against the block (see below)<br />
|-<br />
| X<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Y<br />
| byte<br />
| <code>64</code><br />
| Block position<br />
|-<br />
| Z<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Face<br />
| byte<br />
| <code>3</code><br />
| The face being hit (see below)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 12 bytes<br />
|}<br />
<br />
Status can (currently) be one of six values:<br />
<br />
{| class="wikitable"<br />
|-<br />
| Meaning<br />
| Value<br />
|-<br />
| Started digging<br />
| <code>0</code><br />
|-<br />
| Cancelled digging<br />
| <code>1</code><br />
|-<br />
| Finished digging<br />
| <code>2</code><br />
|-<br />
| Drop item stack<br />
| <code>3</code><br />
|-<br />
| Drop item<br />
| <code>4</code><br />
|-<br />
| Shoot arrow / finish eating<br />
| <code>5</code><br />
|}<br />
<br />
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).<br />
<br />
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.<br />
<br />
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.<br />
<br />
The face can be one of six values, representing the face being hit:<br />
<br />
{| class="wikitable"<br />
|-<br />
| Value<br />
| 0<br />
| 1<br />
| 2<br />
| 3<br />
| 4<br />
| 5<br />
|-<br />
| Offset<br />
| -Y<br />
| +Y<br />
| -Z<br />
| +Z<br />
| -X<br />
| +X<br />
|}<br />
<br />
In 1.7.3, when a player opens a door with left click the server receives Packet 0xE+start digging and opens the door.<br />
<br />
{{anchor|0x0F}}<br />
=== Player Block Placement (0x0F) ===<br />
''Client to Server''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="8" | 0x0F<br />
| X<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Y<br />
| unsigned byte<br />
| <code>64</code><br />
| Block position<br />
|-<br />
| Z<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Direction<br />
| byte<br />
| <code>3</code><br />
| The offset to use for block/item placement (see below)<br />
|-<br />
| Held item<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Cursor position X<br />
| byte<br />
| 0 - 16<br />
| The position of the crosshair on the block<br />
|-<br />
| Cursor position Y<br />
| byte<br />
| 0 - 16<br />
|<br />
|-<br />
| Cursor position Z<br />
| byte<br />
| 0 - 16<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 14 bytes + slot data<br />
|}<br />
In normal operation (ie placing a block), this packet is sent once, with the values set normally.<br />
<br />
This packet has a special case where X, Y, Z, and Direction are all -1. (Note that Y is unsigned so set to 255.) This special packet indicates that the currently held item for the player should have its state updated such as eating food, shooting bows, using buckets, etc.<br />
<br />
In a Notchian Beta client, the block or item ID corresponds to whatever the client is currently holding, and the client sends one of these packets any time a right-click is issued on a surface, so no assumptions can be made about the safety of the ID. However, with the implementation of server-side inventory, a Notchian server seems to ignore the item ID, instead operating on server-side inventory information and holding selection. The client has been observed (1.2.5 and 1.3.2) to send both real item IDs and -1 in a single session.<br />
<br />
Special note on using buckets: When using buckets, the Notchian client might send two packets: first a normal and then a special case. The first normal packet is sent when you're looking at a block (e.g. the water you want to scoop up). This normal packet does not appear to do anything with a Notchian server. The second, special case packet appears to perform the action - based on current position/orientation and with a distance check - it appears that buckets can only be used within a radius of 6 units.<br />
<br />
{{anchor|0x10}}<br />
=== Held Item Change (0x10) ===<br />
''Two-Way''<br />
<br />
Sent when the player changes the slot selection<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x10<br />
| Slot ID<br />
| short<br />
| <code>1</code><br />
| The slot which the player has selected (0-8)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes<br />
|}<br />
<br />
{{anchor|0x11}}<br />
=== Use Bed (0x11) ===<br />
''Server to Client''<br />
<br />
This packet tells that a player goes to bed.<br />
<br />
The client with the matching Entity ID will go into bed mode.<br />
<br />
This Packet is sent to all nearby players including the one sent to bed.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x11<br />
| Entity ID<br />
| int<br />
| 89<br />
| Player ID<br />
|-<br />
| Unknown<br />
| byte<br />
| 0<br />
| Only 0 has been observed<br />
|-<br />
| Bed X<br />
| int<br />
| -247<br />
| Bed headboard X as block coordinate<br />
|-<br />
| Bed Y<br />
| byte<br />
| 78<br />
| Bed headboard Y as block coordinate<br />
|-<br />
| Bed Z<br />
| int<br />
| 128<br />
| Bed headboard Z as block coordinate<br />
|-<br />
| Total Size:<br />
| colspan="4" | 15 bytes<br />
|}<br />
<br />
{{anchor|0x12}}<br />
<br />
=== Animation (0x12) ===<br />
''Two-Way''<br />
<br />
Sent whenever an entity should change animation.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x12<br />
| EID<br />
| int<br />
| <code>55534</code><br />
| Player ID<br />
|-<br />
| Animation<br />
| byte<br />
| <code>1</code><br />
| Animation ID<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
Animation can be one of the following values:<br />
<br />
{| class="wikitable"<br />
|-<br />
! ID<br />
! Animation<br />
|-<br />
| 0<br />
| No animation<br />
|-<br />
| 1<br />
| Swing arm<br />
|-<br />
| 2<br />
| Damage animation<br />
|-<br />
| 3<br />
| Leave bed<br />
|-<br />
| 5<br />
| Eat food<br />
|-<br />
| 6<br />
| Critical effect<br />
|-<br />
| 7<br />
| Magic critical effect<br />
|-<br />
| 102<br />
| (unknown)<br />
|-<br />
| 104<br />
| Crouch<br />
|-<br />
| 105<br />
| Uncrouch<br />
|}<br />
<br />
Only <code>1</code> (swing arm) is sent by notchian clients. Crouching is sent via 0x13. Damage is server-side, and so is not sent by notchian clients. See also [[#0x26|Entity Status]]. As of client 1.5.2, crouching / uncrouching is sent through [[#0x28|Entity Metadata]].<br />
<br />
{{anchor|0x13}}<br />
<br />
=== Entity Action (0x13) ===<br />
''Client to Server''<br />
<br />
Sent at least when crouching, leaving a bed, or sprinting.<br />
To send action animation to client use 0x28.<br />
The client will send this with Action ID = 3 when "Leave Bed" is clicked.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x13<br />
| EID<br />
| int<br />
| <code>55534</code><br />
| Player ID<br />
|-<br />
| Action ID<br />
| byte<br />
| <code>1</code><br />
| The ID of the action, see below.<br />
|-<br />
| '''jumpBoost'''<br />
| int<br />
| <code>0</code><br />
| Horse jump boost. Ranged from 0 -> 100.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
Action ID can be one of the following values:<br />
<br />
{| class="wikitable"<br />
|-<br />
! ID<br />
! Action<br />
|-<br />
| 1<br />
| Crouch<br />
|-<br />
| 2<br />
| Uncrouch<br />
|-<br />
| 3<br />
| Leave bed<br />
|-<br />
| 4<br />
| Start sprinting<br />
|-<br />
| 5<br />
| Stop sprinting<br />
|}<br />
<br />
<br />
{{anchor|0x14}}<br />
<br />
=== Spawn Named Entity (0x14) ===<br />
''Server to Client''<br />
<br />
The only named entities (at the moment) are players (either real or NPC/Bot). This packet is sent by the server when a player comes into visible range, '''not''' when a player joins.<br />
<br />
Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly.<br />
<br />
At one point, the Notchian client was not okay with receiving player entity packets, including 0x14, that refer to its own username or EID; and would teleport to the absolute origin of the map and fall through the Void any time it received them. However, in more recent versions, it appears to handle them correctly, by spawning a new entity as directed (though future packets referring to the entity ID may be handled incorrectly).<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="9" | 0x14<br />
| EID<br />
| int<br />
| <code>94453</code><br />
| Player ID<br />
|-<br />
| Player Name<br />
| string<br />
| <code>Twdtwd</code><br />
| Max length of 16<br />
|-<br />
| X<br />
| int<br />
| <code>784</code><br />
| Player X as Absolute Integer<br />
|-<br />
| Y<br />
| int<br />
| <code>2131</code><br />
| Player Y as Absolute Integer<br />
|-<br />
| Z<br />
| int<br />
| <code>-752</code><br />
| Player Z as Absolute Integer<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>0</code><br />
| Player rotation as a packed byte<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| Player rotation as a packed byte<br />
|-<br />
| Current Item<br />
| short<br />
| <code>0</code><br />
| The item the player is currently holding. Note that this should be 0 for "no item", unlike -1 used in other packets. A negative value crashes clients.<br />
|-<br />
| Metadata<br />
| [[Entities#Entity_Metadata_Format|Metadata]]<br />
| <code></code><br />
| The 1.3 client crashes on packets with no metadata, but the server can send any metadata key of 0, 1 or 8 and the client is fine.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 22 bytes + length of strings + metadata (at least 1)<br />
|}<br />
<br />
{{anchor|0x15}}<br />
=== Collect Item (0x16) ===<br />
''Server to Client''<br />
<br />
Sent by the server when someone picks up an item lying on the ground - its sole purpose appears to be the animation of the item flying towards you. It doesn't destroy the entity in the client memory ([[#0x1D|0x1D]] does that), and it doesn't add it to your inventory ([[#0x67|0x67]] does that). The server only checks for items to be picked up after each [[#0x0B|Player Position]] and [[#0x0D|Player Position & Look]] packet sent by the client.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x16<br />
| Collected EID<br />
| int<br />
| <code>38</code><br />
|<br />
|-<br />
| Collector EID<br />
| int<br />
| <code>20</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0x17}}<br />
=== Spawn Object/Vehicle (0x17) ===<br />
''Server to Client''<br />
<br />
Sent by the server when an Object/Vehicle is created. The throwers entity id is now used for fishing floats too.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="8" | 0x17<br />
| EID<br />
| int<br />
| <code>62</code><br />
| Entity ID of the Object<br />
|-<br />
| Type<br />
| byte<br />
| <code>11</code><br />
| The type of object (see [[Entities#Objects]])<br />
|-<br />
| X<br />
| int<br />
| <code>16080</code><br />
| The Absolute Integer X Position of the object<br />
|-<br />
| Y<br />
| int<br />
| <code>2299</code><br />
| The Absolute Integer Y Position of the object<br />
|-<br />
| Z<br />
| int<br />
| <code>592</code><br />
| The Absolute Integer Z Position of the object<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>67</code><br />
| The pitch in steps of 2p/256<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>0</code><br />
| The yaw in steps of 2p/256<br />
|-<br />
| [[Object Data]]<br />
| [[Object Data]]<br />
|<br />
| <br />
|-<br />
| Total Size:<br />
| colspan="4" | 23 or 29 bytes<br />
|}<br />
<br />
{{anchor|0x18}}<br />
=== Spawn Mob (0x18) ===<br />
''Server to Client''<br />
<br />
Sent by the server when a Mob Entity is Spawned<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="12" | 0x18<br />
| EID<br />
| int<br />
| <code>446</code><br />
| Entity ID<br />
|-<br />
| Type<br />
| byte<br />
| <code>91</code><br />
| The type of mob. See [[Entities#Mobs]]<br />
|-<br />
| X<br />
| int<br />
| <code>13366</code><br />
| The Absolute Integer X Position of the object<br />
|-<br />
| Y<br />
| int<br />
| <code>2176</code><br />
| The Absolute Integer Y Position of the object<br />
|-<br />
| Z<br />
| int<br />
| <code>1680</code><br />
| The Absolute Integer Z Position of the object<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The pitch in steps of 2p/256<br />
|-<br />
| Head Pitch<br />
| byte<br />
| <code>10</code><br />
| The head pitch in steps of 2p/256<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>-27</code><br />
| Yaw in steps of 2p/256<br />
|-<br />
| Velocity X<br />
| short<br />
| <code>0</code><br />
|<br />
|-<br />
| Velocity Y<br />
| short<br />
| <code>0</code><br />
|<br />
|-<br />
| Velocity Z<br />
| short<br />
| <code>0</code><br />
|<br />
|-<br />
| Metadata<br />
| [[Entities#Entity_Metadata_Format|Metadata]]<br />
| <code>0 0 127</code><br />
| Varies by mob, see [[Entities]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 27 bytes + Metadata (at least 3 as you must send at least 1 item of metadata)<br />
|}<br />
<br />
{{anchor|0x19}}<br />
=== Spawn Painting (0x19) ===<br />
''Server to Client''<br />
<br />
This packet shows location, name, and type of painting.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x19<br />
| Entity ID<br />
| int<br />
| <code>0x00000326</code><br />
| Unique entity ID<br />
|-<br />
| Title<br />
| string<br />
| <code>Creepers</code><br />
| Name of the painting; max length 13 (length of "SkullAndRoses")<br />
|-<br />
| X<br />
| int<br />
| <code>50</code><br />
| Center X coordinate<br />
|-<br />
| Y<br />
| int<br />
| <code>66</code><br />
| Center Y coordinate<br />
|-<br />
| Z<br />
| int<br />
| <code>-50</code><br />
| Center Z coordinate<br />
|-<br />
| Direction<br />
| int<br />
| <code>0</code><br />
| Direction the painting faces (0 -z, 1 -x, 2 +z, 3 +x)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 23 bytes + length of string<br />
|}<br />
<br />
Calculating the center of an image: given a (width x height) grid of cells, with (0, 0) being the top left corner, the center is (max(0, width / 2 - 1), height / 2). E.g.<br />
<br />
2x1 (1, 0)<br />
4x4 (1, 2)<br />
<br />
{{anchor|0x1A}}<br />
=== Spawn Experience Orb (0x1A) ===<br />
''Server to Client''<br />
<br />
Spawns one or more experience orbs. Coordinates are in absolute units.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x1A<br />
| Entity ID<br />
| int<br />
| 105668<br />
|<br />
|-<br />
| x<br />
| int<br />
| -1143<br />
|<br />
|-<br />
| y<br />
| int<br />
| 1952<br />
|<br />
|-<br />
| z<br />
| int<br />
| 1166<br />
|<br />
|-<br />
| count<br />
| short<br />
| 7<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 19 bytes<br />
|}<br />
<br />
{{anchor|0x1B}}<br />
=== Steer Vehicle (0x1B) ===<br />
''Client to Server''<br />
<br />
Sent by client to steer the horse, minecart and boats.<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x1B<br />
| Sideways<br />
| float<br />
| 0.98<br />
| Positive to the left of the player<br />
|-<br />
| Forward<br />
| float<br />
| -0.98<br />
| Positive forward<br />
|-<br />
| Jump<br />
| bool<br />
| true<br />
| <br />
|-<br />
| Unmount<br />
| bool<br />
| false<br />
| True when leaving the vehicle<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes<br />
|}<br />
<br />
{{anchor|0x1C}}<br />
=== Entity Velocity (0x1C) ===<br />
''Server to Client''<br />
<br />
This packet is new to version 4 of the protocol, and is believed to be Entity Velocity/Motion.<br />
<br />
Velocity is believed to be in units of 1/8000 of a block per server tick (50ms);<br />
for example, -1343 would move (-1343 / 8000) = −0.167875 blocks per tick (or −3,3575 blocks per second).<br />
<br />
(This packet data values are not fully verified)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x1C<br />
| Entity ID<br />
| int<br />
| <code>1805</code><br />
| The entity ID<br />
|-<br />
| Velocity X<br />
| short<br />
| <code>-1343</code><br />
| Velocity on the X axis<br />
|-<br />
| Velocity Y<br />
| short<br />
| <code>0</code><br />
| Velocity on the Y axis<br />
|-<br />
| Velocity Z<br />
| short<br />
| <code>0</code><br />
| Velocity on the Z axis<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes<br />
|}<br />
<br />
{{anchor|0x1D}}<br />
<br />
=== Destroy Entity (0x1D) ===<br />
''Server to Client''<br />
<br />
Sent by the server when an list of Entities is to be destroyed on the client.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x1D<br />
| Entity Count<br />
| byte<br />
| <code>3</code><br />
| The amount of entities which should be destroyed<br />
|-<br />
| Entity IDs<br />
| array of int<br />
| <code>452, 546, 123</code><br />
| The list of entity ids which should be destroyed<br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 + (entity count * 4) bytes<br />
|}<br />
<br />
{{anchor|0x1E}}<br />
=== Entity (0x1E) ===<br />
''Server to Client''<br />
<br />
Most entity-related packets are subclasses of this packet. When sent from the server to the client, it may initialize the entry.<br />
<br />
For player entities, either this packet or any move/look packet is sent every game tick.<br />
So the meaning of this packet is basically that the entity did not move/look since the last such packet.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x1E<br />
| EID<br />
| int<br />
| <code>446</code><br />
| Entity ID<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes<br />
|}<br />
<br />
{{anchor|0x1F}}<br />
=== Entity Relative Move (0x1F) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity moves less then 4 blocks; if an entity moves more than 4 blocks [[#0x22|Entity Teleport]] should be sent instead.<br />
<br />
This packet allows at most four blocks movement in any direction, because byte range is from -128 to 127. Movement is an offset of Absolute Int; to convert relative move to block coordinate offset, divide by 32.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x1F<br />
| EID<br />
| int<br />
| <code>459</code><br />
| Entity ID<br />
|-<br />
| dX<br />
| byte<br />
| <code>1</code><br />
| X axis Relative movement as an Absolute Integer<br />
|-<br />
| dY<br />
| byte<br />
| <code>-7</code><br />
| Y axis Relative movement as an Absolute Integer<br />
|-<br />
| dZ<br />
| byte<br />
| <code>5</code><br />
| Z axis Relative movement as an Absolute Integer<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 bytes<br />
|}<br />
<br />
{{anchor|0x20}}<br />
=== Entity Look (0x20) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity rotates. Example: "Yaw" field 64 means a 90 degree turn.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x20<br />
| EID<br />
| int<br />
| <code>459</code><br />
| Entity ID<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>126</code><br />
| The X Axis rotation as a fraction of 360<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The Y Axis rotation as a fraction of 360<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes<br />
|}<br />
<br />
{{anchor|0x21}}<br />
=== Entity Look and Relative Move (0x21) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity rotates and moves.<br />
Since a byte range is limited from -128 to 127, and movement is offset of Absolute Int,<br />
this packet allows at most four blocks movement in any direction. (-128/32 == -4)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x21<br />
| EID<br />
| int<br />
| <code>459</code><br />
| Entity ID<br />
|-<br />
| dX<br />
| byte<br />
| <code>1</code><br />
| X axis Relative movement as an Absolute Integer<br />
|-<br />
| dY<br />
| byte<br />
| <code>-7</code><br />
| Y axis Relative movement as an Absolute Integer<br />
|-<br />
| dZ<br />
| byte<br />
| <code>5</code><br />
| Z axis Relative movement as an Absolute Integer<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>126</code><br />
| The X Axis rotation as a fraction of 360<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The Y Axis rotation as a fraction of 360<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
{{anchor|0x22}}<br />
=== Entity Teleport (0x22) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity moves more than 4 blocks.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x22<br />
| EID<br />
| int<br />
| <code>459</code><br />
| Entity ID<br />
|-<br />
| X<br />
| int<br />
| <code>14162</code><br />
| X axis position as an Absolute Integer<br />
|-<br />
| Y<br />
| int<br />
| <code>2176</code><br />
| Y axis position as an Absolute Integer<br />
|-<br />
| Z<br />
| int<br />
| <code>1111</code><br />
| Z axis position as an Absolute Integer<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>126</code><br />
| The X Axis rotation as a fraction of 360<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The Y Axis rotation as a fraction of 360<br />
|-<br />
| Total Size:<br />
| colspan="4" | 19 bytes<br />
|}<br />
<br />
{{anchor|0x23}}<br />
=== Entity Head Look (0x23) ===<br />
''Server to Client''<br />
<br />
Changes the direction an entity's head is facing.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x23<br />
| Entity ID<br />
| int<br />
|<br />
|<br />
|-<br />
| Head Yaw<br />
| byte<br />
|<br />
| Head yaw in steps of 2p/256<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
{{anchor|0x26}}<br />
=== Entity Status (0x26) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x26<br />
| Entity ID<br />
| int<br />
| 34353<br />
|<br />
|-<br />
| Entity Status<br />
| byte<br />
| 0x03<br />
| See below<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
{| class="wikitable"<br />
|-<br />
! Entity Status<br />
! Meaning<br />
|-<br />
| 2<br />
| Entity hurt<br />
|-<br />
| 3<br />
| Entity dead<br />
|-<br />
| 6<br />
| Wolf taming<br />
|-<br />
| 7<br />
| Wolf tamed<br />
|-<br />
| 8<br />
| Wolf shaking water off itself<br />
|-<br />
| 9<br />
| (of self) Eating accepted by server<br />
|-<br />
| 10<br />
| Sheep eating grass<br />
|-<br />
| 11<br />
| Iron Golem handing over a rose<br />
|-<br />
| 12<br />
| Spawn "heart" particles near a villager<br />
|-<br />
| 13<br />
| Spawn particles indicating that a villager is angry and seeking revenge<br />
|-<br />
| 14<br />
| Spawn happy particles near a villager<br />
|-<br />
| 15<br />
| Spawn a "magic" particle near the Witch<br />
|-<br />
| 16<br />
| Zombie converting into a villager by shaking violently<br />
|-<br />
| 17<br />
| A firework exploding<br />
|-<br />
|}<br />
<br />
{{anchor|0x27}}<br />
<br />
=== Attach Entity (0x27) ===<br />
''Server to Client''<br />
<br />
This packet is sent when a player has been attached to an entity (e.g. Minecart)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x27<br />
| Entity ID<br />
| int<br />
| <code>1298</code><br />
| The player entity ID being attached<br />
|-<br />
| Vehicle ID<br />
| int<br />
| <code>1805</code><br />
| The vehicle entity ID attached to (-1 for unattaching)<br />
|-<br />
| '''Leash'''<br />
| unsigned byte<br />
| <code>0</code><br />
| If set to 1, leashes the entity to the vehicle<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
{{anchor|0x28}}<br />
<br />
=== Entity Metadata (0x28) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x28<br />
| Entity ID<br />
| int<br />
| <code>0x00000326</code><br />
| Unique entity ID to update.<br />
|-<br />
| Entity Metadata<br />
| [[Entities#Entity_Metadata_Format|Metadata]]<br />
| <code>0x00 0x01 0x7F</code><br />
| Metadata varies by entity. See [[Entities]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes + Metadata<br />
|}<br />
<br />
<br />
{{anchor|0x29}}<br />
=== Entity Effect (0x29) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x29<br />
| Entity ID<br />
| int<br />
| <code>14</code><br />
| Entity ID of a player<br />
|-<br />
| Effect ID<br />
| byte<br />
| <code>17</code><br />
| See [http://www.minecraftwiki.net/wiki/Potion_effect#Parameters here]<br />
|-<br />
| Amplifier<br />
| byte<br />
| <code>0</code><br />
|<br />
|-<br />
| Duration<br />
| short<br />
| <code>64</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0x2A}}<br />
=== Remove Entity Effect (0x2A) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x2a<br />
| Entity ID<br />
| int<br />
|<br />
| Entity ID of a player<br />
|-<br />
| Effect ID<br />
| byte<br />
| <code>17</code><br />
| See [http://www.minecraftwiki.net/wiki/Potion_effect#Parameters here]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x2B}}<br />
=== Set Experience (0x2B) ===<br />
''Server to Client''<br />
<br />
Sent by the server when the client should change experience levels.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x2B<br />
| Experience bar<br />
| float<br />
| <code>0.5960060358047485</code><br />
| Used for drawing the experience bar - value is between 0 and 1.<br />
|-<br />
| Level<br />
| short<br />
| <code>8</code><br />
|<br />
|-<br />
| Total experience<br />
| short<br />
| <code>130</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0x2C}}<br />
=== Entity Properties (0x2C) ===<br />
''Server to Client''<br />
<br />
'''Note''': The server sends this packet to inform the user of its movement speed. Users move far too fast when this packet is not sent.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x2C<br />
| EntityID<br />
| int<br />
| 195<br />
| ?<br />
|-<br />
| Properties Count<br />
| int<br />
| 3<br />
| Number of string/data (including these lists) pairs that follow. The remaining fields here are repeated this number of times.<br />
|-<br />
| Key<br />
| string16<br />
| "generic.Maxhealth"<br />
| <br />
|-<br />
| Value<br />
| double<br />
| 20.0<br />
| <br />
|-<br />
| ListLength<br />
| short<br />
| 1<br />
| Number of list elements that follow.<br />
|-<br />
| ListElement<br />
| {long (UUID MSB), long (UUID LSB), double (amount), byte (operation)}<br />
| <br />
| http://www.minecraftwiki.net/wiki/Attribute#Modifiers<br />
|-<br />
| Total Size:<br />
| colspan="4" | ? bytes<br />
|}<br />
<br />
Known values:<br />
{| class="wikitable"<br />
|-<br />
| Key <br />
| Default <br />
| Min <br />
| Max<br />
| Label<br />
|-<br />
| generic.maxHealth<br />
| 20.0<br />
| 0.0<br />
| Double.MaxValue<br />
| Max Health<br />
|-<br />
| generic.followRange<br />
| 32.0<br />
| 0.0<br />
| 2048.0<br />
| Follow Range<br />
|-<br />
| generic.knockbackResistance<br />
| 0.0<br />
| 0.0<br />
| 1.0<br />
| Knockback Resistance<br />
|-<br />
| generic.movementSpeed<br />
| 0.699999988079071<br />
| 0.0<br />
| Double.MaxValue<br />
| Movement Speed<br />
|-<br />
| generic.attackDamage<br />
| 2.0<br />
| 0.0<br />
| Double.MaxValue<br />
| <br />
|-<br />
| horse.jumpStrength<br />
| 0.7<br />
| 0.0<br />
| 2.0<br />
| Jump Strength<br />
|-<br />
| zombie.spawnReinforcements<br />
| 0.0<br />
| 0.0<br />
| 1.0<br />
| Spawn Reinforcements Chance<br />
|}<br />
<br />
{{anchor|0x33}}<br />
<br />
=== Chunk Data (0x33) ===<br />
''Server to Client''<br />
<br />
Chunks are not unloaded by the client automatically. To unload chunks, send this packet with ground-up continuous=true and no 16^3 chunks (eg. primary bit mask=0). The server does not send skylight information for nether-chunks, it's up to the client to know if the player is currently in the nether. You can also infer this information from the primary bitmask and the amount of uncompressed bytes sent.<br />
<br />
See also: [[SMP Map Format]]<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x33<br />
| X<br />
| int<br />
|<br />
| Chunk X Coordinate (*16 to get true X)<br />
|-<br />
| Z<br />
| int<br />
|<br />
| Chunk Z Coordinate (*16 to get true Z)<br />
|-<br />
| Ground-up continuous<br />
| boolean<br />
|<br />
| This is True if the packet represents all sections in this vertical column, where the primary bit map specifies exactly which sections are included, and which are air.<br />
|-<br />
| Primary bit map<br />
| unsigned short<br />
| 15<br />
| Bitmask with 1 for every 16x16x16 section which data follows in the compressed data.<br />
|-<br />
| Add bit map<br />
| unsigned short<br />
| 0<br />
| Same as above, but this is used exclusively for the 'add' portion of the payload<br />
|-<br />
| Compressed size<br />
| int<br />
|<br />
| Size of compressed chunk data.<br />
|-<br />
| Compressed data<br />
| unsigned byte array<br />
| <code>…</code><br />
| The chunk data is compressed using ZLib Deflate function.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 18 bytes + Compressed chunk size<br />
|}<br />
<br />
{{anchor|0x34}}<br />
<br />
=== Multi Block Change (0x34) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x34<br />
| Chunk X<br />
| int<br />
| <code>-9</code><br />
| Chunk X Coordinate<br />
|-<br />
| Chunk Z<br />
| int<br />
| <code>12</code><br />
| Chunk Z Coordinate<br />
|-<br />
| Record count<br />
| short<br />
|<br />
| The number of blocks affected<br />
|-<br />
| Data size<br />
| int<br />
|<br />
| The total size of the data, in bytes. Should always be 4*record count - please confirm.<br />
|-<br />
| Data<br />
| Special<br />
| <code>…</code><br />
| Coordinates, type, and metadata of blocks to change (see below table).<br />
|-<br />
| Total Size:<br />
| colspan="4" | 15 bytes + Arrays<br />
|}<br />
<br />
Each record is four bytes.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Bit mask<br />
| Width<br />
| Meaning<br />
|-<br />
| 00 00 00 0F<br />
| 4 bits<br />
| Block metadata<br />
|-<br />
| 00 00 FF F0<br />
| 12 bits<br />
| Block ID<br />
|-<br />
| 00 FF 00 00<br />
| 8 bits<br />
| Y co-ordinate<br />
|-<br />
| 0F 00 00 00<br />
| 4 bits<br />
| Z co-ordinate, relative to chunk<br />
|-<br />
| F0 00 00 00<br />
| 4 bits<br />
| X co-ordinate, relative to chunk<br />
|}<br />
<br />
{{anchor|0x35}}<br />
<br />
=== Block Change (0x35) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x35<br />
| X<br />
| int<br />
| <code>502</code><br />
| Block X Coordinate<br />
|-<br />
| Y<br />
| byte<br />
| <code>71</code><br />
| Block Y Coordinate<br />
|-<br />
| Z<br />
| int<br />
| <code>18</code><br />
| Block Z Coordinate<br />
|-<br />
| Block Type<br />
| short<br />
| <code>78</code><br />
| The new block type for the block<br />
|-<br />
| Block Metadata<br />
| byte<br />
| <code>0</code><br />
| The new Metadata for the block<br />
|-<br />
| Total Size:<br />
| colspan="4" | 13 bytes<br />
|}<br />
<br />
{{anchor|0x36}}<br />
=== Block Action (0x36) ===<br />
''Server to Client''<br />
<br />
This packet is used for a number of things:<br />
* <div class="li">Chests opening and closing<br />
* Pistons pushing and pulling<br />
* Note blocks playing<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x36<br />
| X<br />
| int<br />
| <code>502</code><br />
| Block X Coordinate<br />
|-<br />
| Y<br />
| short<br />
| <code>71</code><br />
| Block Y Coordinate<br />
|-<br />
| Z<br />
| int<br />
| <code>18</code><br />
| Block Z Coordinate<br />
|-<br />
| Byte 1<br />
| byte<br />
| <code>3</code><br />
| Varies depending on block - see below<br />
|-<br />
| Byte 2<br />
| byte<br />
| <code>17</code><br />
| Varies depending on block - see below<br />
|-<br />
| Block ID<br />
| short<br />
| <code>29</code><br />
| The block id this action is set for<br />
|-<br />
| Total Size:<br />
| colspan="4" | 15 bytes<br />
|}<br />
See Also: [[Block Actions]] <br />
<br />
{{anchor|0x37}}<br />
=== Block Break Animation (0x37) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x37<br />
| EID?<br />
| int<br />
|<br />
| Entity breaking the block?<br />
|-<br />
| X<br />
| int<br />
|<br />
| rowspan="3" | Block position<br />
|-<br />
| Y<br />
| int<br />
|<br />
|-<br />
| Z<br />
| int<br />
|<br />
|-<br />
| Destroy Stage<br />
| byte<br />
| 1<br />
| How far destroyed this block is. (0-7)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 18 bytes<br />
|}<br />
<br />
{{anchor|0x38}}<br />
<br />
=== Map Chunk Bulk (0x38) ===<br />
''Server to Client''<br />
<br />
See also: [[SMP Map Format]]<br />
<br />
To reduce the number of bytes this packet is used to send chunks together for better compression results.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x38<br />
| Chunk column count<br />
| short<br />
|<br />
| The number of chunks in this packet<br />
|-<br />
| Data length<br />
| int<br />
|<br />
| the size of the data field<br />
|-<br />
| Sky light sent<br />
| boolean<br />
|<br />
| Whether or not the chunk data contains a light nibble array. This is true in the main world, false in the end + nether<br />
|-<br />
| Data<br />
| byte array<br />
|<br />
| Compressed chunk data<br />
|-<br />
| Meta information<br />
| Special<br />
|<br />
| see below<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 + (Chunk data size) + 12 * (Chunk Count) bytes<br />
|}<br />
<br />
====Meta Information Structure====<br />
<br />
This structure is repeated for each chunk column sent<br />
<br />
{| class="wikitable"<br />
|-<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| Chunk X<br />
| int<br />
| 10<br />
| The X coordinate of the specific chunk<br />
|-<br />
| Chunk Z<br />
| int<br />
| 10<br />
| The Z coordinate of the specific chunk<br />
|-<br />
| Primary bitmap<br />
| unsigned short<br />
| 15<br />
| A bitmap which specifies which sections are not empty in this chunk<br />
|-<br />
| Add bitmap<br />
| unsigned short<br />
| 0<br />
| A bitmap which specifies which sections need add information because of very high block ids. not yet used. needs verification<br />
|-<br />
| Total Size:<br />
| colspan="3" | 12 bytes<br />
|}<br />
<br />
<br />
* If you send this packet to update area surrounding player in the middle of the game, entities within the updated area may become unattackable (vanilla client just won't send "Use Entity (0x07)" packet when you try to hit them, only swing animation, also it will dig blocks through them), even though they will be visible and work correctly in other ways. This is a bug in vanilla client (still there in 1.5.2), but you can workaround it by destroying relevant entities prior to sending 0x38 (via 0x1D) and spawning them again after it.<br />
<br />
{{anchor|0x3C}}<br />
<br />
=== Explosion (0x3C) ===<br />
''Server to Client''<br />
<br />
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="9" | 0x3C<br />
| X<br />
| double<br />
|<br />
|<br />
|-<br />
| Y<br />
| double<br />
|<br />
|<br />
|-<br />
| Z<br />
| double<br />
|<br />
|<br />
|-<br />
| Radius<br />
| float<br />
| 3.0<br />
| Currently unused in the client<br />
|-<br />
| Record count<br />
| int<br />
|<br />
| This is the count, not the size. The size is 3 times this value.<br />
|-<br />
| Records<br />
| (byte, byte, byte) × count<br />
|<br />
| Each record is 3 signed bytes long, each bytes are the XYZ (respectively) offsets of affected blocks.<br />
|-<br />
| Player Motion X<br />
| float<br />
|<br />
| X velocity of the player being pushed by the explosion<br />
|-<br />
| Player Motion Y<br />
| float<br />
|<br />
| Y velocity of the player being pushed by the explosion<br />
|-<br />
| Player Motion Z<br />
| float<br />
|<br />
| Z velocity of the player being pushed by the explosion<br />
|-<br />
| Total Size:<br />
| colspan="4" | 45 bytes + 3*(Record count) bytes<br />
|}<br />
<br />
Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x<br />
<br />
{{anchor|0x3D}}<br />
=== Sound Or Particle Effect (0x3D) ===<br />
''Server to Client''<br />
<br />
Sent when a client is to play a sound or particle effect.<br />
<br />
By default, the minecraft client adjusts the volume of sound effects based on distance. The final boolean field is used to disable this, and instead the effect is played from 2 blocks away in the correct direction. Currently this is only used for effect 1013 (mob.wither.spawn), and is ignored for any other value by the client.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x3D<br />
| Effect ID<br />
| int<br />
| 1003<br />
| The ID of the effect, see below.<br />
|-<br />
| X<br />
| int<br />
|<br />
| The X location of the effect.<br />
|-<br />
| Y<br />
| byte<br />
|<br />
| The Y location of the effect.<br />
|-<br />
| Z<br />
| int<br />
|<br />
| The Z location of the effect.<br />
|-<br />
| Data<br />
| int<br />
| 0<br />
| Extra data for certain effects, see below.<br />
|-<br />
| Disable relative volume<br />
| boolean<br />
| false<br />
| See above<br />
|-<br />
| Total Size:<br />
| colspan="4" | 19 bytes<br />
|}<br />
<br />
====Effects====<br />
<br />
'''Sound''':<br />
<br />
*1000: <code>random.click</code><br />
*1001: <code>random.click</code><br />
*1002: <code>random.bow</code><br />
*1003: <code>random.door_open</code> or <code>random.door_close</code> (50/50 chance)<br />
*1004: <code>random.fizz</code><br />
*1005: Play a music disc. '''Data''': [http://www.minecraftwiki.net/wiki/Music_Discs Record ID]<br />
*''(1006 not assigned)''<br />
*1007: <code>mob.ghast.charge</code><br />
*1008: <code>mob.ghast.fireball</code><br />
*1009: <code>mob.ghast.fireball</code>, but with a lower volume.<br />
*1010: <code>mob.zombie.wood</code><br />
*1011: <code>mob.zombie.metal</code><br />
*1012: <code>mob.zombie.woodbreak</code><br />
*1013: <code>mob.wither.spawn</code><br />
*1014: <code>mob.wither.shoot</code><br />
*1015: <code>mob.bat.takeoff</code><br />
*1016: <code>mob.zombie.infect</code><br />
*1017: <code>mob.zombie.unfect</code><br />
*1018: <code>mob.enderdragon.end</code><br />
*1020: <code>random.anvil_break</code><br />
*1021: <code>random.anvil_use</code><br />
*1022: <code>random.anvil_land</code><br />
<br />
'''Particle''':<br />
<br />
*2000: Spawns 10 smoke particles, e.g. from a fire. '''Data''': direction, see below<br />
*2001: Block break. '''Data''': [http://www.minecraftwiki.net/wiki/Data_values Block ID]<br />
*2002: Splash potion. Particle effect + glass break sound. '''Data''': [http://www.lb-stuff.com/Minecraft/PotionDataValues1.9pre3.txt Potion ID]<br />
*2003: Eye of ender. Actual client effect to be determined.<br />
*2004: Mob spawn particle effect: smoke + flames<br />
*2005: Spawn "happy villager" effect (hearts).<br />
<br />
Smoke directions:<br />
<br />
{| class="wikitable"<br />
|-<br />
| ID<br />
| Direction<br />
|-<br />
| 0<br />
| South - East<br />
|-<br />
| 1<br />
| South<br />
|-<br />
| 2<br />
| South - West<br />
|-<br />
| 3<br />
| East<br />
|-<br />
| 4<br />
| (Up or middle ?)<br />
|-<br />
| 5<br />
| West<br />
|-<br />
| 6<br />
| North - East<br />
|-<br />
| 7<br />
| North<br />
|-<br />
| 8<br />
| North - West<br />
|}<br />
<br />
{{anchor|0x3E}}<br />
<br />
=== Named Sound Effect (0x3E) ===<br />
''Server to client''<br />
<br />
Used to play a sound effect on the client.<br />
<br />
All known sound effect names can be seen [https://github.com/SirCmpwn/Craft.Net/blob/master/Craft.Net.Data/SoundEffect.cs here].<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x3E<br />
| Sound name<br />
| string<br />
| step.grass<br />
| 250<br />
|-<br />
| Effect position X<br />
| int<br />
| 250<br />
| effect X multiplied by 8<br />
|-<br />
| Effect position Y<br />
| int<br />
| 250<br />
| effect Y multiplied by 8<br />
|-<br />
| Effect position Z<br />
| int<br />
| 250<br />
| effect Z multiplied by 8<br />
|-<br />
| Volume<br />
| float<br />
| 9<br />
| 1 is 100%, can be more<br />
|-<br />
| Pitch<br />
| byte<br />
| 1<br />
| 63 is 100%, can be more<br />
|-<br />
| Total Size:<br />
| colspan="4" | 20 bytes + length of string<br />
|}<br />
<br />
{{anchor|0x3F}}<br />
=== Particle (0x3F) ===<br />
''Server to Client''<br />
<br />
This displays the named particle<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="9" | 0x3F<br />
| Particle name<br />
| string<br />
| <code>hugeexplosion</code><br />
| The name of the particle to create. A list can be found [https://gist.github.com/thinkofdeath/5110835 here]<br />
|-<br />
| X<br />
| float<br />
| 0<br />
| X position of the particle<br />
|-<br />
| Y<br />
| float<br />
| 0<br />
| Y position of the particle<br />
|-<br />
| Z<br />
| float<br />
| 0<br />
| Z position of the particle<br />
|-<br />
| Offset X<br />
| float<br />
| 0<br />
| This is added to the X position after being multiplied by random.nextGaussian() <br />
|-<br />
| Offset Y<br />
| float<br />
| 0<br />
| This is added to the Y position after being multiplied by random.nextGaussian() <br />
|-<br />
| Offset Z<br />
| float<br />
| 0<br />
| This is added to the Z position after being multiplied by random.nextGaussian() <br />
|-<br />
| Particle speed<br />
| float<br />
| 0<br />
| The speed of each particle<br />
|-<br />
| Number of particles<br />
| int<br />
| 0<br />
| The number of particles to create<br />
|-<br />
| Total Size:<br />
| colspan="4" | 34 bytes + length of string<br />
|}<br />
<br />
{{anchor|0x46}}<br />
=== Change Game State (0x46) ===<br />
''Server to Client''<br />
<br />
This packet appeared with protocol version 10. Currently, it appears when a bed can't be used as a spawn point and when the rain state changes. it could have additional uses in the future.<br />
<br />
The class has an array of strings linked to reason codes 0, 1, 2, and 3 but only the codes for 1 and 2 are null.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x46<br />
| Reason<br />
| byte<br />
| 0<br />
|<br />
|-<br />
| Game mode<br />
| byte<br />
| 0<br />
| Used only when reason = 3. 0 is survival, 1 is creative.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes<br />
|}<br />
<br />
'''Reason codes'''<br />
<br />
{| class="wikitable"<br />
|-<br />
! Code<br />
! Effect<br />
! Text<br />
|-<br />
| 0<br />
| Invalid Bed<br />
| "tile.bed.notValid"<br />
|-<br />
| 1<br />
| Begin raining<br />
| null<br />
|-<br />
| 2<br />
| End raining<br />
| null<br />
|-<br />
| 3<br />
| Change game mode<br />
| gameMode.changed<br />
|-<br />
| 4<br />
| Enter credits<br />
|<br />
|}<br />
<br />
{{anchor|0x47}}<br />
=== Spawn Global Entity (0x47) ===<br />
''Server to Client''<br />
<br />
With this packet, the server notifies the client of thunderbolts striking within a 512 block radius around the player. The coordinates specify where exactly the thunderbolt strikes.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x47<br />
| Entity ID<br />
| int<br />
| 4<br />
| The entity ID of the thunderbolt<br />
|-<br />
| Type<br />
| byte<br />
| 1<br />
| The global entity type, currently always 1 for thunderbolt.<br />
|-<br />
| X<br />
| int<br />
| 133<br />
| Thunderbolt X as Absolute Integer<br />
|-<br />
| Y<br />
| int<br />
| 913<br />
| Thunderbolt Y as Absolute Integer<br />
|-<br />
| Z<br />
| int<br />
| 63552<br />
| Thunderbolt Z as Absolute Integer<br />
|-<br />
| Total Size:<br />
| colspan="4" | 18 bytes<br />
|}<br />
<br />
{{anchor|0x64}}<br />
<br />
=== Open Window (0x64) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should open an inventory, such as a chest, workbench, or furnace. This message is not sent anywhere for clients opening their own inventory.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x64<br />
| Window id<br />
| byte<br />
| 123<br />
| A unique id number for the window to be displayed. Notchian server implementation is a counter, starting at 1.<br />
|-<br />
| Inventory Type<br />
| byte<br />
| 2<br />
| The window type to use for display. Check below<br />
|-<br />
| Window title<br />
| string<br />
| <code>Chest</code><br />
| The title of the window.<br />
|-<br />
| Number of Slots<br />
| byte<br />
| 3<br />
| Number of slots in the window (excluding the number of slots in the player inventory).<br />
|-<br />
| Use provided window title<br />
| boolean<br />
| 1<br />
| If false, the client will look up a string like "window.minecart". If true, the client uses what the server provides.<br />
|-<br />
| entityId<br />
| int<br />
| 0<br />
| EntityHorse's entityId. Only sent when window type is equal to 11 (AnimalChest).<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 bytes + length of string<br />
|}<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information.<br />
<br />
{{anchor|0x65}}<br />
<br />
=== Close Window (0x65) ===<br />
''Two-Way''<br />
<br />
This packet is sent by the client when closing a window. This packet is sent from the server to the client when a window is forcibly closed, such as when a chest is destroyed while it's open.<br />
<br />
Note, notchian clients send a close window message with window id 0 to close their inventory even though there is never an Open Window message for inventory. <br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x65<br />
| Window id<br />
| byte<br />
| 0<br />
| This is the id of the window that was closed. 0 for inventory.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 bytes<br />
|}<br />
<br />
{{anchor|0x66}}<br />
=== Click Window (0x66) ===<br />
''Client to Server''<br />
<br />
This packet is sent by the player when it clicks on a slot in a window.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x66<br />
| Window id<br />
| byte<br />
| <code>0</code><br />
| The id of the window which was clicked. 0 for player inventory.<br />
|-<br />
| Slot<br />
| short<br />
| <code>36</code><br />
| The clicked slot. See below.<br />
|-<br />
| Button<br />
| byte<br />
| <code>1</code><br />
| The button used in the click. See below.<br />
|-<br />
| Action number<br />
| short<br />
| <code>12</code><br />
| A unique number for the action, used for transaction handling (See the Transaction packet).<br />
|-<br />
| Mode<br />
| byte<br />
| <code>1</code><br />
| Inventory operation mode. See below.<br />
|-<br />
| Clicked item<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 bytes + slot data<br />
|}<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.<br />
<br />
When right-clicking on a stack of items, half the stack will be picked up and half left in the slot. If the stack is an odd number, the half left in the slot will be smaller of the amounts.<br />
<br />
The Action number is actually a counter, starting at 1. This number is used by the server as a transaction ID to send back a [[#0x6A|Transaction packet]].<br />
<br />
The distinct type of click performed by the client is determined by the combination of the "Mode" and "Button" fields.<br />
{| class="wikitable"<br />
|-<br />
! Mode<br />
! Button<br />
! Slot<br />
! Trigger<br />
|-<br />
! rowspan="2" | 0<br />
| 0<br />
| N/A<br />
| Left mouse click<br />
|-<br />
| 1<br />
| N/A<br />
| Right mouse click<br />
|-<br />
! rowspan="2" | 1<br />
| 0<br />
| N/A<br />
| Shift + left mouse click<br />
|-<br />
| 1<br />
| N/A<br />
| Shift + right mouse click ''(Identical behavior)''<br />
|-<br />
! rowspan="5" | 2<br />
| 0<br />
| N/A<br />
| Number key 1<br />
|-<br />
| 1<br />
| N/A<br />
| Number key 2<br />
|-<br />
| 2<br />
| N/A<br />
| Number key 3<br />
|-<br />
| ...<br />
| ...<br />
| ...<br />
|-<br />
| 8<br />
| N/A<br />
| Number key 9<br />
|-<br />
! rowspan="1" | 3<br />
| 2<br />
| N/A<br />
| Middle click<br />
|-<br />
! rowspan="4" | 4<br />
| 0<br />
| Not -999<br />
| Drop key (Q)<br />
|-<br />
| 1<br />
| Not -999<br />
| Ctrl + Drop key (Ctrl-Q)<br />
|-<br />
| 0<br />
| -999<br />
| Left click outside inventory holding nothing ''(No-op)''<br />
|-<br />
| 1<br />
| -999<br />
| Right click outside inventory holding nothing ''(No-op)''<br />
|-<br />
! rowspan="6" | 5<br />
| 0<br />
| -999<br />
| Starting left mouse paint ''(Or middle mouse)''<br />
|-<br />
| 4<br />
| -999<br />
| Starting right mouse paint<br />
|-<br />
| 1<br />
| Not -999<br />
| Left mouse painting progress<br />
|-<br />
| 5<br />
| Not -999<br />
| Right mouse painting progress<br />
|-<br />
| 2<br />
| -999<br />
| Ending left mouse paint<br />
|-<br />
| 6<br />
| -999<br />
| Ending right mouse paint<br />
|-<br />
! 6<br />
| 0<br />
| N/A<br />
| Double click<br />
|}<br />
<br />
Starting from version 1.5, "painting mode" is available for use in inventory windows. It is done by picking up stack of something (more than 1 items), then holding mouse button (left, right or middle) and dragging holded stack over empty (or same type in case of right button ) slots. In that case client sends the following to server after mouse button release (omitting first pickup packet which is sent as usual):<br />
<br />
# packet with mode 5, slot -999 , button (0 for left | 4 for right);<br />
# packet for every slot painted on, mode is still 5, button (1 | 5);<br />
# packet with mode 5, slot -999, button (2 | 6);<br />
<br />
If any of the painting packets other than the "progress" ones are sent out of order (for example, a start, some slots, then another start; or a left-click in the middle) the painting status will be reset.<br />
<br />
{{anchor|0x67}}<br />
<br />
=== Set Slot (0x67) ===<br />
''Server to Client''<br />
<br />
Sent by the server when an item in a slot (in a window) is added/removed.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x67<br />
| Window id<br />
| byte<br />
| <code>0</code><br />
| The window which is being updated. 0 for player inventory. Note that all known window types include the player inventory. This packet will only be sent for the currently opened window while the player is performing actions, even if it affects the player inventory. After the window is closed, a number of these packets are sent to update the player's inventory window (0).<br />
|-<br />
| Slot<br />
| short<br />
| <code>36</code><br />
| The slot that should be updated<br />
|-<br />
| Slot data<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 4 bytes + slot data<br />
|}<br />
<br />
Note that if window ID and slot are both -1, it means the item currently attached to the cursor.<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.<br />
<br />
Slots: [http://gyazo.com/9d52e1fd4dc14790ec66eab4a9aee00e.png]<br />
<br />
{{anchor|0x68}}<br />
=== Set Window Items (0x68) ===<br />
''Server to Client''<br />
<br />
[[File:Inventory-slots.png|thumb|The inventory slots]]<br />
<br />
Sent by the server when an item in a slot (in a window) is added/removed. This includes the main inventory, equipped armour and crafting slots. <br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x68<br />
| Window ID<br />
| byte<br />
| <code>1</code><br />
| The id of window which items are being sent for. 0 for player inventory.<br />
|-<br />
| Count<br />
| short<br />
| <code>4</code><br />
| The number of slots (see below)<br />
|-<br />
| Slot data<br />
| array of [[Slot_Data|slot]]s<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 4 bytes + size of slot data array<br />
|}<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.<br />
<br />
{{anchor|0x69}}<br />
<br />
=== Update Window Property (0x69) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x69<br />
| Window id<br />
| byte<br />
| 2<br />
| The id of the window.<br />
|-<br />
| Property<br />
| short<br />
| 1<br />
| Which property should be updated.<br />
|-<br />
| Value<br />
| short<br />
| 650<br />
| The new value for the property.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
'''Furnace'''<br />
<br />
Properties:<br />
<br />
* 0: Progress arrow<br />
* 1: Fire icon (fuel)<br />
<br />
Values:<br />
<br />
* 0-200 for progress arrow<br />
* 0-200 for fuel indicator<br />
<br />
Ranges are presumably in in-game ticks<br />
<br />
'''Enchantment Table'''<br />
<br />
Properties: 0, 1 or 2 depending on the "enchantment slot" being given.<br />
<br />
Values: The enchantment's level.<br />
<br />
{{anchor|0x6A}}<br />
=== Confirm Transaction (0x6A) ===<br />
''Two-Way''<br />
<br />
A packet from the server indicating whether a request from the client was accepted, or whether there was a conflict (due to lag). This packet is also sent from the client to the server in response to a server transaction rejection packet.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x6A<br />
| Window ID<br />
| byte<br />
| 0<br />
| The id of the window that the action occurred in.<br />
|-<br />
| Action number<br />
| short<br />
| 12<br />
| Every action that is to be accepted has a unique number. This field corresponds to that number.<br />
|-<br />
| Accepted?<br />
| boolean<br />
| true<br />
| Whether the action was accepted.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes<br />
|}<br />
<br />
{{anchor|0x6B}}<br />
<br />
=== Creative Inventory Action (0x6B) ===<br />
''Two-Way''<br />
<br />
While the user is in the standard inventory (i.e., not a crafting bench) on a creative-mode server then the server will send this packet:<br />
<br />
* <div class="li"> If an item is dropped into the quick bar</div><br />
* If an item is picked up from the quick bar (item id is -1)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x6B<br />
| Slot<br />
| short<br />
| 36<br />
| Inventory slot<br />
|-<br />
| Clicked item<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes + slot data<br />
|}<br />
<br />
{{anchor|0x6C}}<br />
=== Enchant Item (0x6C) ===<br />
''Client to Server''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x6C<br />
| Window ID<br />
| byte<br />
| 1<br />
| The ID sent by [[#0x64|Open Window]]<br />
|-<br />
| Enchantment<br />
| byte<br />
| 0<br />
| The position of the enchantment on the enchantment table window, starting with 0 as the topmost one.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes<br />
|}<br />
<br />
{{anchor|0x82}}<br />
=== Update Sign (0x82) ===<br />
''Two-Way''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x82<br />
| X<br />
| int<br />
| 128<br />
| Block X Coordinate<br />
|-<br />
| Y<br />
| short<br />
| 0<br />
| Block Y Coordinate<br />
|-<br />
| Z<br />
| int<br />
| -128<br />
| Block Z Coordinate<br />
|-<br />
| Line 1<br />
| string<br />
| <code>First line</code><br />
| First line of text in the sign<br />
|-<br />
| Line 2<br />
| string<br />
| <code>Second line</code><br />
| Second line of text in the sign<br />
|-<br />
| Line 3<br />
| string<br />
| <code>Third line</code><br />
| Third line of text in the sign<br />
|-<br />
| Line 4<br />
| string<br />
| <code>Fourth line</code><br />
| Fourth line of text in the sign<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes + 4 strings<br />
|}<br />
<br />
This message is sent from the server to the client whenever a sign is discovered or created. This message is sent from the client to the server when the "Done" button is pushed after placing a sign. This message is NOT sent when a sign is destroyed or unloaded.<br />
<br />
{{anchor|0x83}}<br />
<br />
=== Item Data (0x83) ===<br />
''Server to Client''<br />
<br />
Sent to specify complex data on an item; currently used only for maps.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x83<br />
| Item Type<br />
| short<br />
| <code>358</code><br />
| Type of item being modified<br />
|-<br />
| Item ID<br />
| short<br />
| <code>0</code><br />
| The ID (damage value) of the item being modified<br />
|-<br />
| Text length<br />
| short<br />
| <code>35</code><br />
| Length of following byte array<br />
|-<br />
| Text<br />
| byte array<br />
| {0,0,0,20,20,20,20,20}<br />
| ASCII text.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + Text length<br />
|}<br />
<br />
'''Maps'''<br />
If the first byte of the text is 0, the next two bytes are X start and Y start and the rest of the bytes are the colors in that column.<br />
<br />
If the first byte of the text is 1, the rest of the bytes are in groups of three: (data, x, y). The lower half of the data is the type (always 0 under vanilla) and the upper half is the direction.<br />
<br />
{{anchor|0x84}}<br />
=== Update Tile Entity (0x84) ===<br />
''Server to Client''<br />
<br />
Essentially a block update on a tile entity.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x84<br />
| X<br />
| int<br />
|<br />
|<br />
|-<br />
| Y<br />
| short<br />
|<br />
|<br />
|-<br />
| Z<br />
| int<br />
|<br />
|<br />
|-<br />
| Action<br />
| byte<br />
|<br />
| The type of update to perform<br />
|-<br />
| Data length<br />
| Short<br />
|<br />
| Varies<br />
|-<br />
| NBT Data<br />
| Byte Array<br />
|<br />
| Present if data length > 0. Compressed with [[wikipedia:Gzip|gzip]]. Varies<br />
|-<br />
| Total Size:<br />
| colspan="4" | 12 + itemstack bytes<br />
|}<br />
<br />
'''Actions'''<br />
<br />
* '''1''': Set mob displayed inside a mob spawner. Custom 1 contains the [[Entities#Mobs|mob type]]<br />
<br />
{{anchor|0x85}}<br />
<br />
=== Tile Editor Open? (0x85) ===<br />
''Server to Client''<br />
<br />
Sent on placement of sign.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x85<br />
| Tile Entity Id<br />
| byte<br />
| <code>0</code><br />
| Always seems to be 0 (TileEntitySign)<br />
|-<br />
| X<br />
| int<br />
| <code>70</code><br />
| X in block coordinates<br />
|-<br />
| Y<br />
| int<br />
| <code>70</code><br />
| Y in block coordinates<br />
|-<br />
| Z<br />
| int<br />
| <code>-46</code><br />
| Z in block coordinates<br />
|-<br />
| Total Size:<br />
| colspan="4" | 14 bytes<br />
|}<br />
<br />
{{anchor|0xC8}}<br />
<br />
=== Increment Statistic (0xC8) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0xC8<br />
| Statistic ID<br />
| int<br />
| 1003<br />
| The ID of the statistic. See [http://www.minecraftwiki.net/wiki/Statistics List of statistics].<br />
|-<br />
| Amount<br />
| '''int'''<br />
| 1<br />
| The amount to increment the statistic.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0xC9}}<br />
<br />
=== Player List Item (0xC9) ===<br />
''Server to Client''<br />
<br />
Sent by the notchian server to update the user list (<tab> in the client). The server sends one packet per user per tick, amounting to 20 packets/s for 1 online user, 40 for 2, and so forth.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xC9<br />
| Player name<br />
| string<br />
| barneygale<br />
| Supports chat colouring, limited to 16 characters.<br />
|-<br />
| Online<br />
| boolean<br />
| true<br />
| If false, the client will remove the user from the list.<br />
|-<br />
| Ping<br />
| short<br />
| 193<br />
| Ping, presumably in ms.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xCA}}<br />
=== Player Abilities (0xCA) ===<br />
''Two-Way''<br />
<br />
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.<br />
<br />
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).<br />
<br />
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.<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xCA<br />
| Flags<br />
| byte<br />
| 5<br />
|<br />
|-<br />
| Flying speed*<br />
| '''float'''<br />
| '''0.05'''<br />
| previous integer value divided by 250<br />
|-<br />
| Walking speed*<br />
| '''float'''<br />
| '''0.1'''<br />
| previous integer value divided by 250<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
The client ignores the walking speed and flying speed fields. Send an 0x2C packet as well.<br />
<br />
{{anchor|0xCB}}<br />
=== Tab-complete (0xCB) ===<br />
''Two-way''<br />
<br />
Sent C->S when the user presses [tab] while writing text. The payload contains all text behind the cursor.<br />
<br />
The server responds with an auto-completion of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported.<br />
<br />
In the event of more than one possible completion, the server responds with the options packed into the single string field, separated by a null character. Note that as strings are UTF-16, this is two bytes wide.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0xCB<br />
| Text<br />
| string<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xCC}}<br />
=== Client Settings (0xCC) ===<br />
''Client to server''<br />
<br />
Sent when the player connects, or when settings are changed.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0xCC<br />
| Locale<br />
| string<br />
| en_GB<br />
|<br />
|-<br />
| View distance<br />
| byte<br />
| 0<br />
| 0-3 for 'far', 'normal', 'short', 'tiny'.<br />
|-<br />
| Chat flags<br />
| byte<br />
| 8<br />
| Chat settings. See notes below.<br />
|-<br />
| Difficulty<br />
| byte<br />
| 0<br />
| Client-side difficulty from options.txt<br />
|-<br />
| Show Cape<br />
| boolean<br />
| true<br />
| Client-side "show cape" option<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + length of string<br />
|}<br />
<br />
Chat flags has several values packed into one byte.<br />
<br />
'''Chat Enabled:''' Bits 0-1. 00: Enabled. 01: Commands only. 10: Hidden.<br />
<br />
'''Colors Enabled:''' Bit 3. 0: Disabled. 1: Enabled.<br />
<br />
{{anchor|0xCD}}<br />
=== Client Statuses (0xCD) ===<br />
''Client to server''<br />
<br />
Sent when the client is ready to complete login and when the client is ready to respawn after death.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="1" | 0xCD<br />
| Payload<br />
| byte<br />
| 0<br />
| Bit field. 0: Initial spawn, 1: Respawn after death<br />
|-<br />
| Total Size:<br />
| colspan="5" | 2 bytes<br />
|}<br />
<br />
{{anchor|0xCE}}<br />
=== Scoreboard Objective (0xCE) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should create a new scoreboard or remove one.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xCE<br />
| Objective name<br />
| string<br />
| <code>deaths</code><br />
| An unique name for the objective<br />
|-<br />
| Objective value<br />
| string<br />
| <code>Deaths</code><br />
| The text to be displayed for the score.<br />
|-<br />
| Create/Remove<br />
| byte<br />
| 0<br />
| 0 to create the scoreboard. 1 to remove the scoreboard. 2 to update the display text. TODO: Check these values<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xCF}}<br />
=== Update Score (0xCF) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should update a scoreboard item.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0xCF<br />
| Item Name<br />
| string<br />
| <code>Bob</code><br />
| An unique name to be displayed in the list.<br />
|-<br />
| Update/Remove<br />
| byte<br />
| 0<br />
| 0 to create/update an item. 1 to remove an item.<br />
|-<br />
| Score Name<br />
| string<br />
| <code>deaths</code><br />
| The unique name for the scoreboard to be updated. Only sent when Update/Remove does not equal 1.<br />
|-<br />
| Value<br />
| int<br />
| 5<br />
| The score to be displayed next to the entry. Only sent when Update/Remove does not equal 1.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes + length of strings<br />
|}<br />
<br />
{{anchor|0xD0}}<br />
<br />
=== Display Scoreboard (0xD0) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should display a scoreboard.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0xD0<br />
| Position<br />
| byte<br />
| 1<br />
| The position of the scoreboard. 0 = list, 1 = sidebar, 2 = belowName.<br />
|-<br />
| Score Name<br />
| string<br />
| <code>deaths</code><br />
| The unique name for the scoreboard to be displayed.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 4 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xD1}}<br />
=== Teams (0xD1) ===<br />
''Server to Client''<br />
<br />
Creates and updates teams.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="8" | 0xD1<br />
| Team Name<br />
| string<br />
| mcdevs<br />
| A unique name for the team. (Shared with scoreboard).<br />
|-<br />
| Mode<br />
| byte<br />
| 0<br />
| If 0 then the team is created. <br />
If 1 then the team is removed. <br />
<br />
If 2 the team team information is updated. <br />
<br />
If 3 then new players are added to the team. <br />
<br />
If 4 then players are removed from the team.<br />
|-<br />
| Team Display Name<br />
| string<br />
| McDevs<br />
| Only if Mode = 0 or 2. <br />
|-<br />
| Team Prefix<br />
| string<br />
|<br />
| Only if Mode = 0 or 2. Displayed before the players' name that are part of this team. <br />
|-<br />
| Team Suffix<br />
| string<br />
|<br />
| Only if Mode = 0 or 2. Displayed after the players' name that are part of this team. <br />
|-<br />
| Friendly fire<br />
| byte<br />
| 0<br />
| Only if Mode = 0 or 2; 0 for off, 1 for on, 3 for seeing friendly invisibles<br />
|-<br />
| Player count<br />
| short<br />
| 0<br />
| Only if Mode = 0 or 3 or 4. Number of players in the array<br />
|-<br />
| Players<br />
| Array of strings<br />
|<br />
| Only if Mode = 0 or 3 or 4. Players to be added/remove from the team.<br />
|-<br />
| Total Size:<br />
| colspan="4" | Variable<br />
|}<br />
<br />
{{anchor|0xFA}}<br />
=== Plugin Message (0xFA) ===<br />
''Two-Way''<br />
<br />
Mods and plugins can use this to send their data. As of 1.3, Minecraft itself uses a number of [[plugin channel]]s. These internal channels are prefixed with <code>MC|</code>.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xFA<br />
| Channel<br />
| string<br />
| MyMod:testchannel<br />
| Name of the "channel" used to send the data.<br />
|-<br />
| length<br />
| short<br />
|<br />
| Length of the following byte array<br />
|-<br />
| data<br />
| byte array<br />
|<br />
| Any data.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes + length of string + length of byte array<br />
|}<br />
<br />
More documentation on this: http://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/<br />
<br />
{{anchor|0xFC}}<br />
=== Encryption Key Response (0xFC) ===<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on this packet. Bypassing the encryption is possible, authentication for the player name is still needed if the server is in online mode, but instead of sending this packet, you send [[#0xCD|Client Statuses]] instead.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0xFC<br />
| Shared secret length<br />
| short<br />
|<br />
|<br />
|-<br />
| Shared secret<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Verify token length<br />
| short<br />
|<br />
|<br />
|-<br />
| Verify token response<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes + length of shared secret + length of token<br />
|}<br />
<br />
{{anchor|0xFD}}<br />
=== Encryption Key Request (0xFD) ===<br />
''Server to client''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0xFD<br />
| Server id<br />
| string<br />
|<br />
|<br />
|-<br />
| Public key length<br />
| short<br />
|<br />
|<br />
|-<br />
| Public key<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Verify token length<br />
| short<br />
|<br />
|<br />
|-<br />
| Verify token<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + length of string + length of key + length of token<br />
|}<br />
<br />
{{anchor|0xFE}}<br />
<br />
=== Server List Ping (0xFE) ===<br />
''Client to Server''<br />
<br />
''Main article: [[Server List Ping]]''<br />
<br />
This packet is used by the multiplayer menu to retrieve MOTD, version, and player counts.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="1" | 0xFE<br />
| Magic<br />
| byte<br />
| <code>1</code><br />
| always <code>1</code><br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 bytes<br />
|}<br />
<br />
{{anchor|0xFF}}<br />
<br />
=== Disconnect/Kick (0xFF) ===<br />
''Two-Way''<br />
<br />
Sent by the server before it disconnects a client, or by the client before it disconnects from the server. The receiver of this packet assumes that the sender has already closed the connection by the time the packet arrives.<br />
<br />
Due to race conditions in the client, a local server may need to pause for a short period after sending this packet before closing the connection. An alternative is simply not to close the connection, and wait for the client to do so on receipt of this packet.<br />
<br />
When vanilla client quits, reason is "Quitting", but any reason is ok.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0xFF<br />
| Reason<br />
| string<br />
| <code>The server is full!</code><br />
| Displayed to the client when the connection terminates<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes + length of strings<br />
|}<br />
<br />
== See Also ==<br />
* [[Protocol History]]<br />
* [[Data Types]]<br />
* [[Units of Measurement]]<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Protocol&diff=4656Protocol2013-08-28T12:40:59Z<p>Sadimusi: /* Update Sign (0x82) */</p>
<hr />
<div>This page presents a dissection of the current stable [http://minecraft.net/game/ Minecraft] protocol. The current pre-release protocol is documented [[Pre-release_protocol|elsewhere]]. The protocol for Pocket Minecraft is substantially different, and is documented at [[Pocket Minecraft Protocol]].<br />
<br />
If you're having trouble, check out the [[Protocol_FAQ|FAQ]] or ask for help in the IRC channel ([irc://irc.freenode.net/mcdevs #mcdevs on irc.freenode.net]).<br />
<br />
'''Note:''' While you may use the contents of this page without restriction to create servers, clients, bots, etc… you still need to provide attribution to #mcdevs if you copy any of the contents of this page for publication elsewhere.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Term<br />
! Definition<br />
|-<br />
| Player<br />
| When used in the singular, Player always refers to the client connected to the server<br />
|-<br />
| Entity<br />
| Entity refers to any item, player, mob, minecart or boat in the world. This definition is subject to change as Notch extends the protocol<br />
|-<br />
| EID<br />
| An EID - or Entity ID - is a unique 4-byte integer used to identify a specific entity<br />
|-<br />
| XYZ<br />
| In this document, the axis names are the same as those used by Notch. Y points upwards, X points South, and Z points West.<br />
|-<br />
!colspan="2"|See also: [[Data types]], [[Units of Measurement]]<br />
|}<br />
<br />
== Packets ==<br />
All packets begin with a single "Packet ID" byte. Listed packet size includes this byte. Packets are either "server to client", "client to server", or "Two-Way" (both). Packets are not prefixed with their length. For variable length packets, you must parse it completely to determine its length.<br />
=== Protocol Version ===<br />
1.6.2 - 74<br />
<br />
{{anchor|0x00}}<br />
=== Keep Alive (0x00) ===<br />
''Two-Way''<br />
<br />
The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same packet.<br />
The Beta server will disconnect a client if it doesn't receive at least one packet before 1200 in-game ticks, and the Beta client will time out the connection under the same conditions. The client may send packets with Keep-alive ID=0.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x00<br />
| Keep-alive ID<br />
| int<br />
| <code>957759560</code><br />
| Server-generated random id<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes<br />
|}<br />
<br />
{{anchor|0x01}}<br />
=== Login Request (0x01) ===<br />
''Server to Client'' ''(and Client to Server in some mods, see below)''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x01<br />
| Entity ID<br />
| int<br />
| <code>1298</code><br />
| The Player's Entity ID<br />
|-<br />
| Level type<br />
| string<br />
| default<br />
| <code>default</code>, <code>flat</code>, or <code>largeBiomes</code>. level-type in server.properties<br />
|-<br />
| Game mode<br />
| byte<br />
| <code>0</code><br />
| <code>0</code>: survival, <code>1</code>: creative, <code>2</code>: adventure. Bit 3 (<code>0x8</code>) is the hardcore flag<br />
|-<br />
| Dimension<br />
| byte<br />
| <code>0</code><br />
| <code>-1</code>: nether, <code>0</code>: overworld, <code>1</code>: end<br />
|-<br />
| Difficulty<br />
| byte<br />
| <code>1</code><br />
| <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard<br />
|-<br />
| Not used<br />
| byte<br />
| <code>0</code><br />
| Only 0 observed from vanilla server, was previously world height<br />
|-<br />
| Max players<br />
| byte<br />
| <code>8</code><br />
| Used by the client to draw the player list<br />
|-<br />
| Total Size:<br />
| colspan="4" | 12 bytes + length of strings<br />
|}<br />
<br />
* MinecraftForge sends packet with type 0x01 and 25 bytes(may depend on mods installed with it) following it after completing handshake and enabling encryption. In our tests it sent the following payload:<br />
0x53 0xC8 0xE6 0x1B 0x00 0x07 0x00 0x64 0x00 0x65 0x00 0x66 0x00 0x61 0x00 0x75 0x00 0x6C 0x00 0x74 0xFF 0x02 0x00 0x00 0x00<br />
<br />
It is probably safe for server to ignore them unless you know what to do. More insights are needed on MinecraftForge protocol specifics.<br />
<br />
{{anchor|0x02}}<br />
<br />
=== Handshake (0x02) ===<br />
''Client to server''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x02<br />
| Protocol Version<br />
| byte<br />
| <code>51</code><br />
| As of 1.6.2 the protocol version is 74. See [[Protocol version numbers]] for list.<br />
|-<br />
| Username<br />
| string<br />
| <code>Notch</code><br />
| The username of the player attempting to connect<br />
|-<br />
| Server Host<br />
| string<br />
| <code>localhost</code><br />
|<br />
|-<br />
| Server Port<br />
| int<br />
| <code>25565</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes + length of strings<br />
|}<br />
{{anchor|0x03}}<br />
<br />
=== Chat Message (0x03) ===<br />
<br />
''Client to Server''<br />
<br />
The default server will check the message to see if it begins with a '/'. If it doesn't, the username of the sender is prepended and sent to all other clients (including the original sender). If it does, the server assumes it to be a command and attempts to process it. A message longer than 100 characters will cause the server to kick the client. (As of 1.3.2, the vanilla client appears to limit the text a user can enter to 100 charaters.) This limits the chat message packet length to 203 bytes (as characters are encoded on 2 bytes). Note that this limit does not apply to chat messages sent by the server, which are limited to 32767 characters since 1.2.5. This change was initially done by allowing the client to not slice the message up to 119 (the previous limit), without changes to the server. For this reason, the vanilla server kept the code to cut messages at 119, but this isn't a protocol limitation and can be ignored.<br />
<br />
For more information, see [[Chat]].<br />
<br />
''Server to Client''<br />
<br />
The chat string must now be a valid JSON object:<br />
<br />
{"translate":"chat.type.announcement","using":["Server","hi"]}<br />
{"color":"gray","italic":true,"translate":"chat.type.admin","using":["Server",{"translate":"commands.save.success"}]}<br />
{"text":"§aOld style chat"}<br />
[https://gist.github.com/Dinnerbone/5631634 Original Gist from Dinnerbone]<br />
<br />
Where translate is one of the following:<br />
<br />
chat.type.admin: [%s: %s]<br />
chat.type.announcement: [%s] %s<br />
chat.type.emote: * %s %s<br />
chat.type.text: <%s> %s<br />
<br />
<br />
{{anchor|0x04}}<br />
=== Time Update (0x04) ===<br />
''Server to Client''<br />
<br />
Time is based on ticks, where 20 ticks happen every second. There are 24000 ticks in a day, making Minecraft days exactly 20 minutes long.<br />
<br />
The time of day is based on the timestamp modulo 24000. 0 is sunrise, 6000 is noon, 12000 is sunset, and 18000 is midnight.<br />
<br />
The default SMP server increments the time by <code>20</code> every second.<br />
<br />
{| class="wikitable"<br />
|-<br />
! | Packet ID<br />
! | Field Name<br />
! | Field Type<br />
! | Example<br />
! | Notes<br />
|-<br />
| rowspan="2" | 0x04<br />
| Age of the world<br />
| long<br />
| 45464654<br />
| In ticks; not changed by server commands<br />
|-<br />
| Time of Day<br />
| long<br />
| 21321<br />
| The world (or region) time, in ticks. '''If negative the sun will stop moving at the Math.abs of the time.'''<br />
|-<br />
! | Total Size:<br />
| colspan="4" | 17 Bytes<br />
|}<br />
<br />
{{anchor|0x05}}<br />
=== Entity Equipment (0x05) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x05<br />
| Entity ID<br />
| int<br />
| 0x00010643<br />
| Named Entity ID<br />
|-<br />
| Slot<br />
| short<br />
| 4<br />
| Equipment slot: 0=held, 1-4=armor slot (1 - boots, 2 - leggings, 3 - chestplate, 4 - helmet)<br />
|-<br />
| Item<br />
| [[Slot_Data|slot]]<br />
|<br />
| Item in slot format<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + slot data<br />
|}<br />
<br />
{{anchor|0x06}}<br />
=== Spawn Position (0x06) ===<br />
''Server to Client''<br />
<br />
Sent by the server after login to specify the coordinates of the spawn point (the point at which players spawn at, and which the compass points to). It can be sent at any time to update the point compasses point at.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x06<br />
| X<br />
| int<br />
| <code>117</code><br />
| Spawn X in block coordinates<br />
|-<br />
| Y<br />
| int<br />
| <code>70</code><br />
| Spawn Y in block coordinates<br />
|-<br />
| Z<br />
| int<br />
| <code>-46</code><br />
| Spawn Z in block coordinates<br />
|-<br />
| Total Size:<br />
| colspan="4" | 13 bytes<br />
|}<br />
<br />
{{anchor|0x07}}<br />
=== Use Entity (0x07) ===<br />
''Client to Server''<br />
<br />
This packet is sent from the client to the server when the client attacks or right-clicks another entity (a player, minecart, etc).<br />
<br />
A Notchian server only accepts this packet if the entity being attacked/used is visible without obstruction and within a 4-unit radius of the player's position.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x07<br />
| User<br />
| int<br />
| <code>1298</code><br />
| The entity of the player (ignored by the server)<br />
|-<br />
| Target<br />
| int<br />
| <code>1805</code><br />
| The entity the player is interacting with<br />
|-<br />
| Mouse button<br />
| boolean<br />
| <code>true</code><br />
| <code>true</code> when the player is left-clicking and <code>false</code> when right-clicking.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x08}}<br />
=== Update Health (0x08) ===<br />
''Server to Client''<br />
<br />
Sent by the server to update/set the health of the player it is sent to. Added in protocol version 5.<br />
<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x08<br />
| Health<br />
| '''float'''<br />
| '''20.0'''<br />
| 0 or less = dead, 20 = full HP<br />
|-<br />
| Food<br />
| short<br />
| 20<br />
| 0 - 20<br />
|-<br />
| Food Saturation<br />
| float<br />
| 5.0<br />
| Seems to vary from 0.0 to 5.0 in integer increments<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes<br />
|}<br />
<br />
{{anchor|0x09}}<br />
=== Respawn (0x09) ===<br />
''Server to Client''<br />
<br />
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x09<br />
| Dimension<br />
| int<br />
| <code>1</code><br />
| <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|-<br />
| Difficulty<br />
| byte<br />
| <code>1</code><br />
| <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard. <code>1</code> is always sent c->s<br />
|-<br />
| Game mode<br />
| byte<br />
| <code>1</code><br />
| <code>0</code>: survival, <code>1</code>: creative, <code>2</code>: adventure. The hardcore flag is not included<br />
|-<br />
| World height<br />
| short<br />
| <code>256</code><br />
| Defaults to <code>256</code><br />
|-<br />
| Level type<br />
| string<br />
| default<br />
| See [[#0x01|0x01 login]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes + length of string<br />
|}<br />
* Please avoid changing player's dimension to same dimension as he was in (i.e. from Nether to Nether, from Overworld to Overworld). While at first glance everything seems to work, weird bugs can occur, i.e. such player will be unable to attack other players in new world (minecraft client just won't send "Use Entity (0x07)" packet on hitting, only "Animation (0x12)" packet), even though he can see them and they can attack him (fixes after his death and respawn though).<br />
If you actually have multiple worlds of same dimension on server and need to teleport player between them, use intermediate world (with different dimension) between them.<br />
<br />
{{anchor|0x0A}}<br />
=== Player (0x0A) ===<br />
''Client to Server''<br />
<br />
This packet is used to indicate whether the player is on ground (walking/swimming), or airborne (jumping/falling).<br />
<br />
When dropping from sufficient height, fall damage is applied when this state goes from False to True. The amount of damage applied is based on the point where it last changed from True to False. Note that there are several movement related packets containing this state.<br />
<br />
This packet was previously referred to as Flying<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x0A<br />
| On Ground<br />
| boolean<br />
| <code>1</code><br />
| <code>True</code> if the client is on the ground, <code>False</code> otherwise<br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 bytes<br />
|}<br />
<br />
{{anchor|0x0B}}<br />
=== Player Position (0x0B) ===<br />
''Client to Server''<br />
<br />
Updates the players XYZ position on the server. <br />
If <code>Stance - Y</code> is less than <code>0.1</code> or greater than <code>1.65</code>, the stance is illegal and the client will be kicked with the message “Illegal Stance”.<br />
If the distance between the last known position of the player on the server and the new position set by this packet is greater than 100 units will result in the client being kicked for "You moved too quickly :( (Hacking?)"<br />
Also if the absolute number of X or Z is set greater than <code>3.2E7D</code> the client will be kicked for "Illegal position" <br />
<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x0B<br />
| X<br />
| double<br />
| <code>102.809</code><br />
| Absolute position<br />
|-<br />
| Y<br />
| double<br />
| <code>70.00</code><br />
| Absolute position<br />
|-<br />
| Stance<br />
| double<br />
| <code>71.62</code><br />
| Used to modify the players bounding box when going up stairs, crouching, etc…<br />
|-<br />
| Z<br />
| double<br />
| <code>68.30</code><br />
| Absolute position<br />
|-<br />
| On Ground<br />
| boolean<br />
| <code>1</code><br />
|<br />
Derived from packet [[#0x0A|0x0A]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 34 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x0C}}<br />
=== Player Look (0x0C) ===<br />
''Client to Server''<br />
<br />
[[File:Minecraft-trig-yaw.png|thumb|The unit circle for yaw]]<br />
<br />
Updates the direction the player is looking in.<br />
<br />
Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the xz-plane starts at (0, 1) and turns backwards towards (-1, 0), or in other words, it turns clockwise instead of counterclockwise. Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.<br />
<br />
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.<br />
<br />
You can get a unit vector from a given yaw/pitch via:<br />
x = -cos(pitch) * sin(yaw)<br />
y = -sin(pitch)<br />
z = cos(pitch) * cos(yaw)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x0C<br />
| Yaw<br />
| float<br />
| <code>0.00</code><br />
| Absolute rotation on the X Axis, in degrees<br />
|-<br />
| Pitch<br />
| float<br />
| <code>0.00</code><br />
| Absolute rotation on the Y Axis, in degrees<br />
|-<br />
| On Ground<br />
| boolean<br />
| <code>1</code><br />
|<br />
Derived from packet [[#0x0A|0x0A]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
{{anchor|0x0D}}<br />
=== Player Position and Look (0x0D) ===<br />
''Two-Way''<br />
<br />
A combination of [[#0x0C|Player Look]] and [[#0x0B|Player position]]. <br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x0D<br />
| X<br />
| double<br />
| <code>6.5</code><br />
| Absolute position<br />
|-<br />
| Y/Stance<br />
| double<br />
| <code>65.620000004768372</code><br />
| Y: Absolute Position (Client to Server); Stance: Used to modify the players bounding box when going up stairs, crouching, etc… (Server to Client)<br />
|-<br />
| Stance/Y<br />
| double<br />
| <code>67.240000009536743</code><br />
| Stance (Client to Server); Y (Server to Client)<br />
|-<br />
| Z<br />
| double<br />
| <code>7.5</code><br />
| Absolute position<br />
|-<br />
| Yaw<br />
| float<br />
| <code>0.0</code><br />
| Absolute rotation on the X Axis<br />
|-<br />
| Pitch<br />
| float<br />
| <code>0.0</code><br />
| Absolute rotation on the Y Axis<br />
|-<br />
| On Ground<br />
| boolean<br />
| <code>0</code><br />
|<br />
Derived from packet [[#0x0A|0x0A]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 42 bytes<br />
|}<br />
<br />
{{anchor|0x0E}}<br />
<br />
=== Player Digging (0x0E) ===<br />
''Client to Server''<br />
<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x0E<br />
| Status<br />
| byte<br />
| <code>1</code><br />
| The action the player is taking against the block (see below)<br />
|-<br />
| X<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Y<br />
| byte<br />
| <code>64</code><br />
| Block position<br />
|-<br />
| Z<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Face<br />
| byte<br />
| <code>3</code><br />
| The face being hit (see below)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 12 bytes<br />
|}<br />
<br />
Status can (currently) be one of six values:<br />
<br />
{| class="wikitable"<br />
|-<br />
| Meaning<br />
| Value<br />
|-<br />
| Started digging<br />
| <code>0</code><br />
|-<br />
| Cancelled digging<br />
| <code>1</code><br />
|-<br />
| Finished digging<br />
| <code>2</code><br />
|-<br />
| Drop item stack<br />
| <code>3</code><br />
|-<br />
| Drop item<br />
| <code>4</code><br />
|-<br />
| Shoot arrow / finish eating<br />
| <code>5</code><br />
|}<br />
<br />
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).<br />
<br />
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.<br />
<br />
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.<br />
<br />
The face can be one of six values, representing the face being hit:<br />
<br />
{| class="wikitable"<br />
|-<br />
| Value<br />
| 0<br />
| 1<br />
| 2<br />
| 3<br />
| 4<br />
| 5<br />
|-<br />
| Offset<br />
| -Y<br />
| +Y<br />
| -Z<br />
| +Z<br />
| -X<br />
| +X<br />
|}<br />
<br />
In 1.7.3, when a player opens a door with left click the server receives Packet 0xE+start digging and opens the door.<br />
<br />
{{anchor|0x0F}}<br />
=== Player Block Placement (0x0F) ===<br />
''Client to Server''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="8" | 0x0F<br />
| X<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Y<br />
| unsigned byte<br />
| <code>64</code><br />
| Block position<br />
|-<br />
| Z<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Direction<br />
| byte<br />
| <code>3</code><br />
| The offset to use for block/item placement (see below)<br />
|-<br />
| Held item<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Cursor position X<br />
| byte<br />
| 0 - 16<br />
| The position of the crosshair on the block<br />
|-<br />
| Cursor position Y<br />
| byte<br />
| 0 - 16<br />
|<br />
|-<br />
| Cursor position Z<br />
| byte<br />
| 0 - 16<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 14 bytes + slot data<br />
|}<br />
In normal operation (ie placing a block), this packet is sent once, with the values set normally.<br />
<br />
This packet has a special case where X, Y, Z, and Direction are all -1. (Note that Y is unsigned so set to 255.) This special packet indicates that the currently held item for the player should have its state updated such as eating food, shooting bows, using buckets, etc.<br />
<br />
In a Notchian Beta client, the block or item ID corresponds to whatever the client is currently holding, and the client sends one of these packets any time a right-click is issued on a surface, so no assumptions can be made about the safety of the ID. However, with the implementation of server-side inventory, a Notchian server seems to ignore the item ID, instead operating on server-side inventory information and holding selection. The client has been observed (1.2.5 and 1.3.2) to send both real item IDs and -1 in a single session.<br />
<br />
Special note on using buckets: When using buckets, the Notchian client might send two packets: first a normal and then a special case. The first normal packet is sent when you're looking at a block (e.g. the water you want to scoop up). This normal packet does not appear to do anything with a Notchian server. The second, special case packet appears to perform the action - based on current position/orientation and with a distance check - it appears that buckets can only be used within a radius of 6 units.<br />
<br />
{{anchor|0x10}}<br />
=== Held Item Change (0x10) ===<br />
''Two-Way''<br />
<br />
Sent when the player changes the slot selection<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x10<br />
| Slot ID<br />
| short<br />
| <code>1</code><br />
| The slot which the player has selected (0-8)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes<br />
|}<br />
<br />
{{anchor|0x11}}<br />
=== Use Bed (0x11) ===<br />
''Server to Client''<br />
<br />
This packet tells that a player goes to bed.<br />
<br />
The client with the matching Entity ID will go into bed mode.<br />
<br />
This Packet is sent to all nearby players including the one sent to bed.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x11<br />
| Entity ID<br />
| int<br />
| 89<br />
| Player ID<br />
|-<br />
| Unknown<br />
| byte<br />
| 0<br />
| Only 0 has been observed<br />
|-<br />
| Bed X<br />
| int<br />
| -247<br />
| Bed headboard X as block coordinate<br />
|-<br />
| Bed Y<br />
| byte<br />
| 78<br />
| Bed headboard Y as block coordinate<br />
|-<br />
| Bed Z<br />
| int<br />
| 128<br />
| Bed headboard Z as block coordinate<br />
|-<br />
| Total Size:<br />
| colspan="4" | 15 bytes<br />
|}<br />
<br />
{{anchor|0x12}}<br />
<br />
=== Animation (0x12) ===<br />
''Two-Way''<br />
<br />
Sent whenever an entity should change animation.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x12<br />
| EID<br />
| int<br />
| <code>55534</code><br />
| Player ID<br />
|-<br />
| Animation<br />
| byte<br />
| <code>1</code><br />
| Animation ID<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
Animation can be one of the following values:<br />
<br />
{| class="wikitable"<br />
|-<br />
! ID<br />
! Animation<br />
|-<br />
| 0<br />
| No animation<br />
|-<br />
| 1<br />
| Swing arm<br />
|-<br />
| 2<br />
| Damage animation<br />
|-<br />
| 3<br />
| Leave bed<br />
|-<br />
| 5<br />
| Eat food<br />
|-<br />
| 6<br />
| Critical effect<br />
|-<br />
| 7<br />
| Magic critical effect<br />
|-<br />
| 102<br />
| (unknown)<br />
|-<br />
| 104<br />
| Crouch<br />
|-<br />
| 105<br />
| Uncrouch<br />
|}<br />
<br />
Only <code>1</code> (swing arm) is sent by notchian clients. Crouching is sent via 0x13. Damage is server-side, and so is not sent by notchian clients. See also [[#0x26|Entity Status]]. As of client 1.5.2, crouching / uncrouching is sent through [[#0x28|Entity Metadata]].<br />
<br />
{{anchor|0x13}}<br />
<br />
=== Entity Action (0x13) ===<br />
''Client to Server''<br />
<br />
Sent at least when crouching, leaving a bed, or sprinting.<br />
To send action animation to client use 0x28.<br />
The client will send this with Action ID = 3 when "Leave Bed" is clicked.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x13<br />
| EID<br />
| int<br />
| <code>55534</code><br />
| Player ID<br />
|-<br />
| Action ID<br />
| byte<br />
| <code>1</code><br />
| The ID of the action, see below.<br />
|-<br />
| '''jumpBoost'''<br />
| int<br />
| <code>0</code><br />
| Horse jump boost. Ranged from 0 -> 100.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
Action ID can be one of the following values:<br />
<br />
{| class="wikitable"<br />
|-<br />
! ID<br />
! Action<br />
|-<br />
| 1<br />
| Crouch<br />
|-<br />
| 2<br />
| Uncrouch<br />
|-<br />
| 3<br />
| Leave bed<br />
|-<br />
| 4<br />
| Start sprinting<br />
|-<br />
| 5<br />
| Stop sprinting<br />
|}<br />
<br />
<br />
{{anchor|0x14}}<br />
<br />
=== Spawn Named Entity (0x14) ===<br />
''Server to Client''<br />
<br />
The only named entities (at the moment) are players (either real or NPC/Bot). This packet is sent by the server when a player comes into visible range, '''not''' when a player joins.<br />
<br />
Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly.<br />
<br />
At one point, the Notchian client was not okay with receiving player entity packets, including 0x14, that refer to its own username or EID; and would teleport to the absolute origin of the map and fall through the Void any time it received them. However, in more recent versions, it appears to handle them correctly, by spawning a new entity as directed (though future packets referring to the entity ID may be handled incorrectly).<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="9" | 0x14<br />
| EID<br />
| int<br />
| <code>94453</code><br />
| Player ID<br />
|-<br />
| Player Name<br />
| string<br />
| <code>Twdtwd</code><br />
| Max length of 16<br />
|-<br />
| X<br />
| int<br />
| <code>784</code><br />
| Player X as Absolute Integer<br />
|-<br />
| Y<br />
| int<br />
| <code>2131</code><br />
| Player Y as Absolute Integer<br />
|-<br />
| Z<br />
| int<br />
| <code>-752</code><br />
| Player Z as Absolute Integer<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>0</code><br />
| Player rotation as a packed byte<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| Player rotation as a packed byte<br />
|-<br />
| Current Item<br />
| short<br />
| <code>0</code><br />
| The item the player is currently holding. Note that this should be 0 for "no item", unlike -1 used in other packets. A negative value crashes clients.<br />
|-<br />
| Metadata<br />
| [[Entities#Entity_Metadata_Format|Metadata]]<br />
| <code></code><br />
| The 1.3 client crashes on packets with no metadata, but the server can send any metadata key of 0, 1 or 8 and the client is fine.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 22 bytes + length of strings + metadata (at least 1)<br />
|}<br />
<br />
{{anchor|0x15}}<br />
=== Collect Item (0x16) ===<br />
''Server to Client''<br />
<br />
Sent by the server when someone picks up an item lying on the ground - its sole purpose appears to be the animation of the item flying towards you. It doesn't destroy the entity in the client memory ([[#0x1D|0x1D]] does that), and it doesn't add it to your inventory ([[#0x67|0x67]] does that). The server only checks for items to be picked up after each [[#0x0B|Player Position]] and [[#0x0D|Player Position & Look]] packet sent by the client.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x16<br />
| Collected EID<br />
| int<br />
| <code>38</code><br />
|<br />
|-<br />
| Collector EID<br />
| int<br />
| <code>20</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0x17}}<br />
=== Spawn Object/Vehicle (0x17) ===<br />
''Server to Client''<br />
<br />
Sent by the server when an Object/Vehicle is created. The throwers entity id is now used for fishing floats too.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="8" | 0x17<br />
| EID<br />
| int<br />
| <code>62</code><br />
| Entity ID of the Object<br />
|-<br />
| Type<br />
| byte<br />
| <code>11</code><br />
| The type of object (see [[Entities#Objects]])<br />
|-<br />
| X<br />
| int<br />
| <code>16080</code><br />
| The Absolute Integer X Position of the object<br />
|-<br />
| Y<br />
| int<br />
| <code>2299</code><br />
| The Absolute Integer Y Position of the object<br />
|-<br />
| Z<br />
| int<br />
| <code>592</code><br />
| The Absolute Integer Z Position of the object<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>67</code><br />
| The pitch in steps of 2p/256<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>0</code><br />
| The yaw in steps of 2p/256<br />
|-<br />
| [[Object Data]]<br />
| [[Object Data]]<br />
|<br />
| <br />
|-<br />
| Total Size:<br />
| colspan="4" | 23 or 29 bytes<br />
|}<br />
<br />
{{anchor|0x18}}<br />
=== Spawn Mob (0x18) ===<br />
''Server to Client''<br />
<br />
Sent by the server when a Mob Entity is Spawned<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="12" | 0x18<br />
| EID<br />
| int<br />
| <code>446</code><br />
| Entity ID<br />
|-<br />
| Type<br />
| byte<br />
| <code>91</code><br />
| The type of mob. See [[Entities#Mobs]]<br />
|-<br />
| X<br />
| int<br />
| <code>13366</code><br />
| The Absolute Integer X Position of the object<br />
|-<br />
| Y<br />
| int<br />
| <code>2176</code><br />
| The Absolute Integer Y Position of the object<br />
|-<br />
| Z<br />
| int<br />
| <code>1680</code><br />
| The Absolute Integer Z Position of the object<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The pitch in steps of 2p/256<br />
|-<br />
| Head Pitch<br />
| byte<br />
| <code>10</code><br />
| The head pitch in steps of 2p/256<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>-27</code><br />
| Yaw in steps of 2p/256<br />
|-<br />
| Velocity X<br />
| short<br />
| <code>0</code><br />
|<br />
|-<br />
| Velocity Y<br />
| short<br />
| <code>0</code><br />
|<br />
|-<br />
| Velocity Z<br />
| short<br />
| <code>0</code><br />
|<br />
|-<br />
| Metadata<br />
| [[Entities#Entity_Metadata_Format|Metadata]]<br />
| <code>0 0 127</code><br />
| Varies by mob, see [[Entities]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 27 bytes + Metadata (at least 3 as you must send at least 1 item of metadata)<br />
|}<br />
<br />
{{anchor|0x19}}<br />
=== Spawn Painting (0x19) ===<br />
''Server to Client''<br />
<br />
This packet shows location, name, and type of painting.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x19<br />
| Entity ID<br />
| int<br />
| <code>0x00000326</code><br />
| Unique entity ID<br />
|-<br />
| Title<br />
| string<br />
| <code>Creepers</code><br />
| Name of the painting; max length 13 (length of "SkullAndRoses")<br />
|-<br />
| X<br />
| int<br />
| <code>50</code><br />
| Center X coordinate<br />
|-<br />
| Y<br />
| int<br />
| <code>66</code><br />
| Center Y coordinate<br />
|-<br />
| Z<br />
| int<br />
| <code>-50</code><br />
| Center Z coordinate<br />
|-<br />
| Direction<br />
| int<br />
| <code>0</code><br />
| Direction the painting faces (0 -z, 1 -x, 2 +z, 3 +x)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 23 bytes + length of string<br />
|}<br />
<br />
Calculating the center of an image: given a (width x height) grid of cells, with (0, 0) being the top left corner, the center is (max(0, width / 2 - 1), height / 2). E.g.<br />
<br />
2x1 (1, 0)<br />
4x4 (1, 2)<br />
<br />
{{anchor|0x1A}}<br />
=== Spawn Experience Orb (0x1A) ===<br />
''Server to Client''<br />
<br />
Spawns one or more experience orbs. Coordinates are in absolute units.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x1A<br />
| Entity ID<br />
| int<br />
| 105668<br />
|<br />
|-<br />
| x<br />
| int<br />
| -1143<br />
|<br />
|-<br />
| y<br />
| int<br />
| 1952<br />
|<br />
|-<br />
| z<br />
| int<br />
| 1166<br />
|<br />
|-<br />
| count<br />
| short<br />
| 7<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 19 bytes<br />
|}<br />
<br />
{{anchor|0x1B}}<br />
=== Steer Vehicle (0x1B) ===<br />
''Client to Server''<br />
<br />
Sent by client to steer the horse, minecart and boats.<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x1B<br />
| Sideways<br />
| float<br />
| 0.98<br />
| Positive to the left of the player<br />
|-<br />
| Forward<br />
| float<br />
| -0.98<br />
| Positive forward<br />
|-<br />
| Jump<br />
| bool<br />
| true<br />
| <br />
|-<br />
| Unmount<br />
| bool<br />
| false<br />
| True when leaving the vehicle<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes<br />
|}<br />
<br />
{{anchor|0x1C}}<br />
=== Entity Velocity (0x1C) ===<br />
''Server to Client''<br />
<br />
This packet is new to version 4 of the protocol, and is believed to be Entity Velocity/Motion.<br />
<br />
Velocity is believed to be in units of 1/8000 of a block per server tick (50ms);<br />
for example, -1343 would move (-1343 / 8000) = −0.167875 blocks per tick (or −3,3575 blocks per second).<br />
<br />
(This packet data values are not fully verified)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x1C<br />
| Entity ID<br />
| int<br />
| <code>1805</code><br />
| The entity ID<br />
|-<br />
| Velocity X<br />
| short<br />
| <code>-1343</code><br />
| Velocity on the X axis<br />
|-<br />
| Velocity Y<br />
| short<br />
| <code>0</code><br />
| Velocity on the Y axis<br />
|-<br />
| Velocity Z<br />
| short<br />
| <code>0</code><br />
| Velocity on the Z axis<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes<br />
|}<br />
<br />
{{anchor|0x1D}}<br />
<br />
=== Destroy Entity (0x1D) ===<br />
''Server to Client''<br />
<br />
Sent by the server when an list of Entities is to be destroyed on the client.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x1D<br />
| Entity Count<br />
| byte<br />
| <code>3</code><br />
| The amount of entities which should be destroyed<br />
|-<br />
| Entity IDs<br />
| array of int<br />
| <code>452, 546, 123</code><br />
| The list of entity ids which should be destroyed<br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 + (entity count * 4) bytes<br />
|}<br />
<br />
{{anchor|0x1E}}<br />
=== Entity (0x1E) ===<br />
''Server to Client''<br />
<br />
Most entity-related packets are subclasses of this packet. When sent from the server to the client, it may initialize the entry.<br />
<br />
For player entities, either this packet or any move/look packet is sent every game tick.<br />
So the meaning of this packet is basically that the entity did not move/look since the last such packet.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x1E<br />
| EID<br />
| int<br />
| <code>446</code><br />
| Entity ID<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes<br />
|}<br />
<br />
{{anchor|0x1F}}<br />
=== Entity Relative Move (0x1F) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity moves less then 4 blocks; if an entity moves more than 4 blocks [[#0x22|Entity Teleport]] should be sent instead.<br />
<br />
This packet allows at most four blocks movement in any direction, because byte range is from -128 to 127. Movement is an offset of Absolute Int; to convert relative move to block coordinate offset, divide by 32.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x1F<br />
| EID<br />
| int<br />
| <code>459</code><br />
| Entity ID<br />
|-<br />
| dX<br />
| byte<br />
| <code>1</code><br />
| X axis Relative movement as an Absolute Integer<br />
|-<br />
| dY<br />
| byte<br />
| <code>-7</code><br />
| Y axis Relative movement as an Absolute Integer<br />
|-<br />
| dZ<br />
| byte<br />
| <code>5</code><br />
| Z axis Relative movement as an Absolute Integer<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 bytes<br />
|}<br />
<br />
{{anchor|0x20}}<br />
=== Entity Look (0x20) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity rotates. Example: "Yaw" field 64 means a 90 degree turn.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x20<br />
| EID<br />
| int<br />
| <code>459</code><br />
| Entity ID<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>126</code><br />
| The X Axis rotation as a fraction of 360<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The Y Axis rotation as a fraction of 360<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes<br />
|}<br />
<br />
{{anchor|0x21}}<br />
=== Entity Look and Relative Move (0x21) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity rotates and moves.<br />
Since a byte range is limited from -128 to 127, and movement is offset of Absolute Int,<br />
this packet allows at most four blocks movement in any direction. (-128/32 == -4)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x21<br />
| EID<br />
| int<br />
| <code>459</code><br />
| Entity ID<br />
|-<br />
| dX<br />
| byte<br />
| <code>1</code><br />
| X axis Relative movement as an Absolute Integer<br />
|-<br />
| dY<br />
| byte<br />
| <code>-7</code><br />
| Y axis Relative movement as an Absolute Integer<br />
|-<br />
| dZ<br />
| byte<br />
| <code>5</code><br />
| Z axis Relative movement as an Absolute Integer<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>126</code><br />
| The X Axis rotation as a fraction of 360<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The Y Axis rotation as a fraction of 360<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
{{anchor|0x22}}<br />
=== Entity Teleport (0x22) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity moves more than 4 blocks.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x22<br />
| EID<br />
| int<br />
| <code>459</code><br />
| Entity ID<br />
|-<br />
| X<br />
| int<br />
| <code>14162</code><br />
| X axis position as an Absolute Integer<br />
|-<br />
| Y<br />
| int<br />
| <code>2176</code><br />
| Y axis position as an Absolute Integer<br />
|-<br />
| Z<br />
| int<br />
| <code>1111</code><br />
| Z axis position as an Absolute Integer<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>126</code><br />
| The X Axis rotation as a fraction of 360<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The Y Axis rotation as a fraction of 360<br />
|-<br />
| Total Size:<br />
| colspan="4" | 19 bytes<br />
|}<br />
<br />
{{anchor|0x23}}<br />
=== Entity Head Look (0x23) ===<br />
''Server to Client''<br />
<br />
Changes the direction an entity's head is facing.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x23<br />
| Entity ID<br />
| int<br />
|<br />
|<br />
|-<br />
| Head Yaw<br />
| byte<br />
|<br />
| Head yaw in steps of 2p/256<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
{{anchor|0x26}}<br />
=== Entity Status (0x26) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x26<br />
| Entity ID<br />
| int<br />
| 34353<br />
|<br />
|-<br />
| Entity Status<br />
| byte<br />
| 0x03<br />
| See below<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
{| class="wikitable"<br />
|-<br />
! Entity Status<br />
! Meaning<br />
|-<br />
| 2<br />
| Entity hurt<br />
|-<br />
| 3<br />
| Entity dead<br />
|-<br />
| 6<br />
| Wolf taming<br />
|-<br />
| 7<br />
| Wolf tamed<br />
|-<br />
| 8<br />
| Wolf shaking water off itself<br />
|-<br />
| 9<br />
| (of self) Eating accepted by server<br />
|-<br />
| 10<br />
| Sheep eating grass<br />
|-<br />
| 11<br />
| Iron Golem handing over a rose<br />
|-<br />
| 12<br />
| Spawn "heart" particles near a villager<br />
|-<br />
| 13<br />
| Spawn particles indicating that a villager is angry and seeking revenge<br />
|-<br />
| 14<br />
| Spawn happy particles near a villager<br />
|-<br />
| 15<br />
| Spawn a "magic" particle near the Witch<br />
|-<br />
| 16<br />
| Zombie converting into a villager by shaking violently<br />
|-<br />
| 17<br />
| A firework exploding<br />
|-<br />
|}<br />
<br />
{{anchor|0x27}}<br />
<br />
=== Attach Entity (0x27) ===<br />
''Server to Client''<br />
<br />
This packet is sent when a player has been attached to an entity (e.g. Minecart)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x27<br />
| Entity ID<br />
| int<br />
| <code>1298</code><br />
| The player entity ID being attached<br />
|-<br />
| Vehicle ID<br />
| int<br />
| <code>1805</code><br />
| The vehicle entity ID attached to (-1 for unattaching)<br />
|-<br />
| '''Leash'''<br />
| unsigned byte<br />
| <code>0</code><br />
| If set to 1, leashes the entity to the vehicle<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
{{anchor|0x28}}<br />
<br />
=== Entity Metadata (0x28) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x28<br />
| Entity ID<br />
| int<br />
| <code>0x00000326</code><br />
| Unique entity ID to update.<br />
|-<br />
| Entity Metadata<br />
| [[Entities#Entity_Metadata_Format|Metadata]]<br />
| <code>0x00 0x01 0x7F</code><br />
| Metadata varies by entity. See [[Entities]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes + Metadata<br />
|}<br />
<br />
<br />
{{anchor|0x29}}<br />
=== Entity Effect (0x29) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x29<br />
| Entity ID<br />
| int<br />
| <code>14</code><br />
| Entity ID of a player<br />
|-<br />
| Effect ID<br />
| byte<br />
| <code>17</code><br />
| See [http://www.minecraftwiki.net/wiki/Potion_effect#Parameters here]<br />
|-<br />
| Amplifier<br />
| byte<br />
| <code>0</code><br />
|<br />
|-<br />
| Duration<br />
| short<br />
| <code>64</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0x2A}}<br />
=== Remove Entity Effect (0x2A) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x2a<br />
| Entity ID<br />
| int<br />
|<br />
| Entity ID of a player<br />
|-<br />
| Effect ID<br />
| byte<br />
| <code>17</code><br />
| See [http://www.minecraftwiki.net/wiki/Potion_effect#Parameters here]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x2B}}<br />
=== Set Experience (0x2B) ===<br />
''Server to Client''<br />
<br />
Sent by the server when the client should change experience levels.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x2B<br />
| Experience bar<br />
| float<br />
| <code>0.5960060358047485</code><br />
| Used for drawing the experience bar - value is between 0 and 1.<br />
|-<br />
| Level<br />
| short<br />
| <code>8</code><br />
|<br />
|-<br />
| Total experience<br />
| short<br />
| <code>130</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0x2C}}<br />
=== Entity Properties (0x2C) ===<br />
''Server to Client''<br />
<br />
'''Note''': The server sends this packet to inform the user of its movement speed. Users move far too fast when this packet is not sent.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x2C<br />
| EntityID<br />
| int<br />
| 195<br />
| ?<br />
|-<br />
| Properties Count<br />
| int<br />
| 3<br />
| Number of string/data (including these lists) pairs that follow. The remaining fields here are repeated this number of times.<br />
|-<br />
| Key<br />
| string16<br />
| "generic.Maxhealth"<br />
| <br />
|-<br />
| Value<br />
| double<br />
| 20.0<br />
| <br />
|-<br />
| ListLength<br />
| short<br />
| 1<br />
| Number of list elements that follow.<br />
|-<br />
| ListElement<br />
| {long (UUID MSB), long (UUID LSB), double (amount), byte (operation)}<br />
| <br />
| http://www.minecraftwiki.net/wiki/Attribute#Modifiers<br />
|-<br />
| Total Size:<br />
| colspan="4" | ? bytes<br />
|}<br />
<br />
Known values:<br />
{| class="wikitable"<br />
|-<br />
| Key <br />
| Default <br />
| Min <br />
| Max<br />
| Label<br />
|-<br />
| generic.maxHealth<br />
| 20.0<br />
| 0.0<br />
| Double.MaxValue<br />
| Max Health<br />
|-<br />
| generic.followRange<br />
| 32.0<br />
| 0.0<br />
| 2048.0<br />
| Follow Range<br />
|-<br />
| generic.knockbackResistance<br />
| 0.0<br />
| 0.0<br />
| 1.0<br />
| Knockback Resistance<br />
|-<br />
| generic.movementSpeed<br />
| 0.699999988079071<br />
| 0.0<br />
| Double.MaxValue<br />
| Movement Speed<br />
|-<br />
| generic.attackDamage<br />
| 2.0<br />
| 0.0<br />
| Double.MaxValue<br />
| <br />
|-<br />
| horse.jumpStrength<br />
| 0.7<br />
| 0.0<br />
| 2.0<br />
| Jump Strength<br />
|-<br />
| zombie.spawnReinforcements<br />
| 0.0<br />
| 0.0<br />
| 1.0<br />
| Spawn Reinforcements Chance<br />
|}<br />
<br />
{{anchor|0x33}}<br />
<br />
=== Chunk Data (0x33) ===<br />
''Server to Client''<br />
<br />
Chunks are not unloaded by the client automatically. To unload chunks, send this packet with ground-up continuous=true and no 16^3 chunks (eg. primary bit mask=0). The server does not send skylight information for nether-chunks, it's up to the client to know if the player is currently in the nether. You can also infer this information from the primary bitmask and the amount of uncompressed bytes sent.<br />
<br />
See also: [[SMP Map Format]]<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x33<br />
| X<br />
| int<br />
|<br />
| Chunk X Coordinate (*16 to get true X)<br />
|-<br />
| Z<br />
| int<br />
|<br />
| Chunk Z Coordinate (*16 to get true Z)<br />
|-<br />
| Ground-up continuous<br />
| boolean<br />
|<br />
| This is True if the packet represents all sections in this vertical column, where the primary bit map specifies exactly which sections are included, and which are air.<br />
|-<br />
| Primary bit map<br />
| unsigned short<br />
| 15<br />
| Bitmask with 1 for every 16x16x16 section which data follows in the compressed data.<br />
|-<br />
| Add bit map<br />
| unsigned short<br />
| 0<br />
| Same as above, but this is used exclusively for the 'add' portion of the payload<br />
|-<br />
| Compressed size<br />
| int<br />
|<br />
| Size of compressed chunk data.<br />
|-<br />
| Compressed data<br />
| unsigned byte array<br />
| <code>…</code><br />
| The chunk data is compressed using ZLib Deflate function.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 18 bytes + Compressed chunk size<br />
|}<br />
<br />
{{anchor|0x34}}<br />
<br />
=== Multi Block Change (0x34) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x34<br />
| Chunk X<br />
| int<br />
| <code>-9</code><br />
| Chunk X Coordinate<br />
|-<br />
| Chunk Z<br />
| int<br />
| <code>12</code><br />
| Chunk Z Coordinate<br />
|-<br />
| Record count<br />
| short<br />
|<br />
| The number of blocks affected<br />
|-<br />
| Data size<br />
| int<br />
|<br />
| The total size of the data, in bytes. Should always be 4*record count - please confirm.<br />
|-<br />
| Data<br />
| Special<br />
| <code>…</code><br />
| Coordinates, type, and metadata of blocks to change (see below table).<br />
|-<br />
| Total Size:<br />
| colspan="4" | 15 bytes + Arrays<br />
|}<br />
<br />
Each record is four bytes.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Bit mask<br />
| Width<br />
| Meaning<br />
|-<br />
| 00 00 00 0F<br />
| 4 bits<br />
| Block metadata<br />
|-<br />
| 00 00 FF F0<br />
| 12 bits<br />
| Block ID<br />
|-<br />
| 00 FF 00 00<br />
| 8 bits<br />
| Y co-ordinate<br />
|-<br />
| 0F 00 00 00<br />
| 4 bits<br />
| Z co-ordinate, relative to chunk<br />
|-<br />
| F0 00 00 00<br />
| 4 bits<br />
| X co-ordinate, relative to chunk<br />
|}<br />
<br />
{{anchor|0x35}}<br />
<br />
=== Block Change (0x35) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x35<br />
| X<br />
| int<br />
| <code>502</code><br />
| Block X Coordinate<br />
|-<br />
| Y<br />
| byte<br />
| <code>71</code><br />
| Block Y Coordinate<br />
|-<br />
| Z<br />
| int<br />
| <code>18</code><br />
| Block Z Coordinate<br />
|-<br />
| Block Type<br />
| short<br />
| <code>78</code><br />
| The new block type for the block<br />
|-<br />
| Block Metadata<br />
| byte<br />
| <code>0</code><br />
| The new Metadata for the block<br />
|-<br />
| Total Size:<br />
| colspan="4" | 13 bytes<br />
|}<br />
<br />
{{anchor|0x36}}<br />
=== Block Action (0x36) ===<br />
''Server to Client''<br />
<br />
This packet is used for a number of things:<br />
* <div class="li">Chests opening and closing<br />
* Pistons pushing and pulling<br />
* Note blocks playing<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x36<br />
| X<br />
| int<br />
| <code>502</code><br />
| Block X Coordinate<br />
|-<br />
| Y<br />
| short<br />
| <code>71</code><br />
| Block Y Coordinate<br />
|-<br />
| Z<br />
| int<br />
| <code>18</code><br />
| Block Z Coordinate<br />
|-<br />
| Byte 1<br />
| byte<br />
| <code>3</code><br />
| Varies depending on block - see below<br />
|-<br />
| Byte 2<br />
| byte<br />
| <code>17</code><br />
| Varies depending on block - see below<br />
|-<br />
| Block ID<br />
| short<br />
| <code>29</code><br />
| The block id this action is set for<br />
|-<br />
| Total Size:<br />
| colspan="4" | 15 bytes<br />
|}<br />
See Also: [[Block Actions]] <br />
<br />
{{anchor|0x37}}<br />
=== Block Break Animation (0x37) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x37<br />
| EID?<br />
| int<br />
|<br />
| Entity breaking the block?<br />
|-<br />
| X<br />
| int<br />
|<br />
| rowspan="3" | Block position<br />
|-<br />
| Y<br />
| int<br />
|<br />
|-<br />
| Z<br />
| int<br />
|<br />
|-<br />
| Destroy Stage<br />
| byte<br />
| 1<br />
| How far destroyed this block is. (0-7)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 18 bytes<br />
|}<br />
<br />
{{anchor|0x38}}<br />
<br />
=== Map Chunk Bulk (0x38) ===<br />
''Server to Client''<br />
<br />
See also: [[SMP Map Format]]<br />
<br />
To reduce the number of bytes this packet is used to send chunks together for better compression results.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x38<br />
| Chunk column count<br />
| short<br />
|<br />
| The number of chunks in this packet<br />
|-<br />
| Data length<br />
| int<br />
|<br />
| the size of the data field<br />
|-<br />
| Sky light sent<br />
| boolean<br />
|<br />
| Whether or not the chunk data contains a light nibble array. This is true in the main world, false in the end + nether<br />
|-<br />
| Data<br />
| byte array<br />
|<br />
| Compressed chunk data<br />
|-<br />
| Meta information<br />
| Special<br />
|<br />
| see below<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 + (Chunk data size) + 12 * (Chunk Count) bytes<br />
|}<br />
<br />
====Meta Information Structure====<br />
<br />
This structure is repeated for each chunk column sent<br />
<br />
{| class="wikitable"<br />
|-<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| Chunk X<br />
| int<br />
| 10<br />
| The X coordinate of the specific chunk<br />
|-<br />
| Chunk Z<br />
| int<br />
| 10<br />
| The Z coordinate of the specific chunk<br />
|-<br />
| Primary bitmap<br />
| unsigned short<br />
| 15<br />
| A bitmap which specifies which sections are not empty in this chunk<br />
|-<br />
| Add bitmap<br />
| unsigned short<br />
| 0<br />
| A bitmap which specifies which sections need add information because of very high block ids. not yet used. needs verification<br />
|-<br />
| Total Size:<br />
| colspan="3" | 12 bytes<br />
|}<br />
<br />
<br />
* If you send this packet to update area surrounding player in the middle of the game, entities within the updated area may become unattackable (vanilla client just won't send "Use Entity (0x07)" packet when you try to hit them, only swing animation, also it will dig blocks through them), even though they will be visible and work correctly in other ways. This is a bug in vanilla client (still there in 1.5.2), but you can workaround it by destroying relevant entities prior to sending 0x38 (via 0x1D) and spawning them again after it.<br />
<br />
{{anchor|0x3C}}<br />
<br />
=== Explosion (0x3C) ===<br />
''Server to Client''<br />
<br />
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="9" | 0x3C<br />
| X<br />
| double<br />
|<br />
|<br />
|-<br />
| Y<br />
| double<br />
|<br />
|<br />
|-<br />
| Z<br />
| double<br />
|<br />
|<br />
|-<br />
| Radius<br />
| float<br />
| 3.0<br />
| Currently unused in the client<br />
|-<br />
| Record count<br />
| int<br />
|<br />
| This is the count, not the size. The size is 3 times this value.<br />
|-<br />
| Records<br />
| (byte, byte, byte) × count<br />
|<br />
| Each record is 3 signed bytes long, each bytes are the XYZ (respectively) offsets of affected blocks.<br />
|-<br />
| Player Motion X<br />
| float<br />
|<br />
| X velocity of the player being pushed by the explosion<br />
|-<br />
| Player Motion Y<br />
| float<br />
|<br />
| Y velocity of the player being pushed by the explosion<br />
|-<br />
| Player Motion Z<br />
| float<br />
|<br />
| Z velocity of the player being pushed by the explosion<br />
|-<br />
| Total Size:<br />
| colspan="4" | 45 bytes + 3*(Record count) bytes<br />
|}<br />
<br />
Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x<br />
<br />
{{anchor|0x3D}}<br />
=== Sound Or Particle Effect (0x3D) ===<br />
''Server to Client''<br />
<br />
Sent when a client is to play a sound or particle effect.<br />
<br />
By default, the minecraft client adjusts the volume of sound effects based on distance. The final boolean field is used to disable this, and instead the effect is played from 2 blocks away in the correct direction. Currently this is only used for effect 1013 (mob.wither.spawn), and is ignored for any other value by the client.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x3D<br />
| Effect ID<br />
| int<br />
| 1003<br />
| The ID of the effect, see below.<br />
|-<br />
| X<br />
| int<br />
|<br />
| The X location of the effect.<br />
|-<br />
| Y<br />
| byte<br />
|<br />
| The Y location of the effect.<br />
|-<br />
| Z<br />
| int<br />
|<br />
| The Z location of the effect.<br />
|-<br />
| Data<br />
| int<br />
| 0<br />
| Extra data for certain effects, see below.<br />
|-<br />
| Disable relative volume<br />
| boolean<br />
| false<br />
| See above<br />
|-<br />
| Total Size:<br />
| colspan="4" | 19 bytes<br />
|}<br />
<br />
====Effects====<br />
<br />
'''Sound''':<br />
<br />
*1000: <code>random.click</code><br />
*1001: <code>random.click</code><br />
*1002: <code>random.bow</code><br />
*1003: <code>random.door_open</code> or <code>random.door_close</code> (50/50 chance)<br />
*1004: <code>random.fizz</code><br />
*1005: Play a music disc. '''Data''': [http://www.minecraftwiki.net/wiki/Music_Discs Record ID]<br />
*''(1006 not assigned)''<br />
*1007: <code>mob.ghast.charge</code><br />
*1008: <code>mob.ghast.fireball</code><br />
*1009: <code>mob.ghast.fireball</code>, but with a lower volume.<br />
*1010: <code>mob.zombie.wood</code><br />
*1011: <code>mob.zombie.metal</code><br />
*1012: <code>mob.zombie.woodbreak</code><br />
*1013: <code>mob.wither.spawn</code><br />
*1014: <code>mob.wither.shoot</code><br />
*1015: <code>mob.bat.takeoff</code><br />
*1016: <code>mob.zombie.infect</code><br />
*1017: <code>mob.zombie.unfect</code><br />
*1018: <code>mob.enderdragon.end</code><br />
*1020: <code>random.anvil_break</code><br />
*1021: <code>random.anvil_use</code><br />
*1022: <code>random.anvil_land</code><br />
<br />
'''Particle''':<br />
<br />
*2000: Spawns 10 smoke particles, e.g. from a fire. '''Data''': direction, see below<br />
*2001: Block break. '''Data''': [http://www.minecraftwiki.net/wiki/Data_values Block ID]<br />
*2002: Splash potion. Particle effect + glass break sound. '''Data''': [http://www.lb-stuff.com/Minecraft/PotionDataValues1.9pre3.txt Potion ID]<br />
*2003: Eye of ender. Actual client effect to be determined.<br />
*2004: Mob spawn particle effect: smoke + flames<br />
*2005: Spawn "happy villager" effect (hearts).<br />
<br />
Smoke directions:<br />
<br />
{| class="wikitable"<br />
|-<br />
| ID<br />
| Direction<br />
|-<br />
| 0<br />
| South - East<br />
|-<br />
| 1<br />
| South<br />
|-<br />
| 2<br />
| South - West<br />
|-<br />
| 3<br />
| East<br />
|-<br />
| 4<br />
| (Up or middle ?)<br />
|-<br />
| 5<br />
| West<br />
|-<br />
| 6<br />
| North - East<br />
|-<br />
| 7<br />
| North<br />
|-<br />
| 8<br />
| North - West<br />
|}<br />
<br />
{{anchor|0x3E}}<br />
<br />
=== Named Sound Effect (0x3E) ===<br />
''Server to client''<br />
<br />
Used to play a sound effect on the client.<br />
<br />
All known sound effect names can be seen [https://github.com/SirCmpwn/Craft.Net/blob/master/Craft.Net.Data/SoundEffect.cs here].<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x3E<br />
| Sound name<br />
| string<br />
| step.grass<br />
| 250<br />
|-<br />
| Effect position X<br />
| int<br />
| 250<br />
| effect X multiplied by 8<br />
|-<br />
| Effect position Y<br />
| int<br />
| 250<br />
| effect Y multiplied by 8<br />
|-<br />
| Effect position Z<br />
| int<br />
| 250<br />
| effect Z multiplied by 8<br />
|-<br />
| Volume<br />
| float<br />
| 9<br />
| 1 is 100%, can be more<br />
|-<br />
| Pitch<br />
| byte<br />
| 1<br />
| 63 is 100%, can be more<br />
|-<br />
| Total Size:<br />
| colspan="4" | 20 bytes + length of string<br />
|}<br />
<br />
{{anchor|0x3F}}<br />
=== Particle (0x3F) ===<br />
''Server to Client''<br />
<br />
This displays the named particle<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="9" | 0x3F<br />
| Particle name<br />
| string<br />
| <code>hugeexplosion</code><br />
| The name of the particle to create. A list can be found [https://gist.github.com/thinkofdeath/5110835 here]<br />
|-<br />
| X<br />
| float<br />
| 0<br />
| X position of the particle<br />
|-<br />
| Y<br />
| float<br />
| 0<br />
| Y position of the particle<br />
|-<br />
| Z<br />
| float<br />
| 0<br />
| Z position of the particle<br />
|-<br />
| Offset X<br />
| float<br />
| 0<br />
| This is added to the X position after being multiplied by random.nextGaussian() <br />
|-<br />
| Offset Y<br />
| float<br />
| 0<br />
| This is added to the Y position after being multiplied by random.nextGaussian() <br />
|-<br />
| Offset Z<br />
| float<br />
| 0<br />
| This is added to the Z position after being multiplied by random.nextGaussian() <br />
|-<br />
| Particle speed<br />
| float<br />
| 0<br />
| The speed of each particle<br />
|-<br />
| Number of particles<br />
| int<br />
| 0<br />
| The number of particles to create<br />
|-<br />
| Total Size:<br />
| colspan="4" | 34 bytes + length of string<br />
|}<br />
<br />
{{anchor|0x46}}<br />
=== Change Game State (0x46) ===<br />
''Server to Client''<br />
<br />
This packet appeared with protocol version 10. Currently, it appears when a bed can't be used as a spawn point and when the rain state changes. it could have additional uses in the future.<br />
<br />
The class has an array of strings linked to reason codes 0, 1, 2, and 3 but only the codes for 1 and 2 are null.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x46<br />
| Reason<br />
| byte<br />
| 0<br />
|<br />
|-<br />
| Game mode<br />
| byte<br />
| 0<br />
| Used only when reason = 3. 0 is survival, 1 is creative.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes<br />
|}<br />
<br />
'''Reason codes'''<br />
<br />
{| class="wikitable"<br />
|-<br />
! Code<br />
! Effect<br />
! Text<br />
|-<br />
| 0<br />
| Invalid Bed<br />
| "tile.bed.notValid"<br />
|-<br />
| 1<br />
| Begin raining<br />
| null<br />
|-<br />
| 2<br />
| End raining<br />
| null<br />
|-<br />
| 3<br />
| Change game mode<br />
| gameMode.changed<br />
|-<br />
| 4<br />
| Enter credits<br />
|<br />
|}<br />
<br />
{{anchor|0x47}}<br />
=== Spawn Global Entity (0x47) ===<br />
''Server to Client''<br />
<br />
With this packet, the server notifies the client of thunderbolts striking within a 512 block radius around the player. The coordinates specify where exactly the thunderbolt strikes.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x47<br />
| Entity ID<br />
| int<br />
| 4<br />
| The entity ID of the thunderbolt<br />
|-<br />
| Type<br />
| byte<br />
| 1<br />
| The global entity type, currently always 1 for thunderbolt.<br />
|-<br />
| X<br />
| int<br />
| 133<br />
| Thunderbolt X as Absolute Integer<br />
|-<br />
| Y<br />
| int<br />
| 913<br />
| Thunderbolt Y as Absolute Integer<br />
|-<br />
| Z<br />
| int<br />
| 63552<br />
| Thunderbolt Z as Absolute Integer<br />
|-<br />
| Total Size:<br />
| colspan="4" | 18 bytes<br />
|}<br />
<br />
{{anchor|0x64}}<br />
<br />
=== Open Window (0x64) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should open an inventory, such as a chest, workbench, or furnace. This message is not sent anywhere for clients opening their own inventory.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x64<br />
| Window id<br />
| byte<br />
| 123<br />
| A unique id number for the window to be displayed. Notchian server implementation is a counter, starting at 1.<br />
|-<br />
| Inventory Type<br />
| byte<br />
| 2<br />
| The window type to use for display. Check below<br />
|-<br />
| Window title<br />
| string<br />
| <code>Chest</code><br />
| The title of the window.<br />
|-<br />
| Number of Slots<br />
| byte<br />
| 3<br />
| Number of slots in the window (excluding the number of slots in the player inventory).<br />
|-<br />
| Use provided window title<br />
| boolean<br />
| 1<br />
| If false, the client will look up a string like "window.minecart". If true, the client uses what the server provides.<br />
|-<br />
| entityId<br />
| int<br />
| 0<br />
| EntityHorse's entityId. Only sent when window type is equal to 11 (AnimalChest).<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 bytes + length of string<br />
|}<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information.<br />
<br />
{{anchor|0x65}}<br />
<br />
=== Close Window (0x65) ===<br />
''Two-Way''<br />
<br />
This packet is sent by the client when closing a window. This packet is sent from the server to the client when a window is forcibly closed, such as when a chest is destroyed while it's open.<br />
<br />
Note, notchian clients send a close window message with window id 0 to close their inventory even though there is never an Open Window message for inventory. <br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x65<br />
| Window id<br />
| byte<br />
| 0<br />
| This is the id of the window that was closed. 0 for inventory.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 bytes<br />
|}<br />
<br />
{{anchor|0x66}}<br />
=== Click Window (0x66) ===<br />
''Client to Server''<br />
<br />
This packet is sent by the player when it clicks on a slot in a window.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x66<br />
| Window id<br />
| byte<br />
| <code>0</code><br />
| The id of the window which was clicked. 0 for player inventory.<br />
|-<br />
| Slot<br />
| short<br />
| <code>36</code><br />
| The clicked slot. See below.<br />
|-<br />
| Button<br />
| byte<br />
| <code>1</code><br />
| The button used in the click. See below.<br />
|-<br />
| Action number<br />
| short<br />
| <code>12</code><br />
| A unique number for the action, used for transaction handling (See the Transaction packet).<br />
|-<br />
| Mode<br />
| byte<br />
| <code>1</code><br />
| Inventory operation mode. See below.<br />
|-<br />
| Clicked item<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 bytes + slot data<br />
|}<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.<br />
<br />
When right-clicking on a stack of items, half the stack will be picked up and half left in the slot. If the stack is an odd number, the half left in the slot will be smaller of the amounts.<br />
<br />
The Action number is actually a counter, starting at 1. This number is used by the server as a transaction ID to send back a [[#0x6A|Transaction packet]].<br />
<br />
The distinct type of click performed by the client is determined by the combination of the "Mode" and "Button" fields.<br />
{| class="wikitable"<br />
|-<br />
! Mode<br />
! Button<br />
! Slot<br />
! Trigger<br />
|-<br />
! rowspan="2" | 0<br />
| 0<br />
| N/A<br />
| Left mouse click<br />
|-<br />
| 1<br />
| N/A<br />
| Right mouse click<br />
|-<br />
! rowspan="2" | 1<br />
| 0<br />
| N/A<br />
| Shift + left mouse click<br />
|-<br />
| 1<br />
| N/A<br />
| Shift + right mouse click ''(Identical behavior)''<br />
|-<br />
! rowspan="5" | 2<br />
| 0<br />
| N/A<br />
| Number key 1<br />
|-<br />
| 1<br />
| N/A<br />
| Number key 2<br />
|-<br />
| 2<br />
| N/A<br />
| Number key 3<br />
|-<br />
| ...<br />
| ...<br />
| ...<br />
|-<br />
| 8<br />
| N/A<br />
| Number key 9<br />
|-<br />
! rowspan="1" | 3<br />
| 2<br />
| N/A<br />
| Middle click<br />
|-<br />
! rowspan="4" | 4<br />
| 0<br />
| Not -999<br />
| Drop key (Q)<br />
|-<br />
| 1<br />
| Not -999<br />
| Ctrl + Drop key (Ctrl-Q)<br />
|-<br />
| 0<br />
| -999<br />
| Left click outside inventory holding nothing ''(No-op)''<br />
|-<br />
| 1<br />
| -999<br />
| Right click outside inventory holding nothing ''(No-op)''<br />
|-<br />
! rowspan="6" | 5<br />
| 0<br />
| -999<br />
| Starting left mouse paint ''(Or middle mouse)''<br />
|-<br />
| 4<br />
| -999<br />
| Starting right mouse paint<br />
|-<br />
| 1<br />
| Not -999<br />
| Left mouse painting progress<br />
|-<br />
| 5<br />
| Not -999<br />
| Right mouse painting progress<br />
|-<br />
| 2<br />
| -999<br />
| Ending left mouse paint<br />
|-<br />
| 6<br />
| -999<br />
| Ending right mouse paint<br />
|-<br />
! 6<br />
| 0<br />
| N/A<br />
| Double click<br />
|}<br />
<br />
Starting from version 1.5, "painting mode" is available for use in inventory windows. It is done by picking up stack of something (more than 1 items), then holding mouse button (left, right or middle) and dragging holded stack over empty (or same type in case of right button ) slots. In that case client sends the following to server after mouse button release (omitting first pickup packet which is sent as usual):<br />
<br />
# packet with mode 5, slot -999 , button (0 for left | 4 for right);<br />
# packet for every slot painted on, mode is still 5, button (1 | 5);<br />
# packet with mode 5, slot -999, button (2 | 6);<br />
<br />
If any of the painting packets other than the "progress" ones are sent out of order (for example, a start, some slots, then another start; or a left-click in the middle) the painting status will be reset.<br />
<br />
{{anchor|0x67}}<br />
<br />
=== Set Slot (0x67) ===<br />
''Server to Client''<br />
<br />
Sent by the server when an item in a slot (in a window) is added/removed.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x67<br />
| Window id<br />
| byte<br />
| <code>0</code><br />
| The window which is being updated. 0 for player inventory. Note that all known window types include the player inventory. This packet will only be sent for the currently opened window while the player is performing actions, even if it affects the player inventory. After the window is closed, a number of these packets are sent to update the player's inventory window (0).<br />
|-<br />
| Slot<br />
| short<br />
| <code>36</code><br />
| The slot that should be updated<br />
|-<br />
| Slot data<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 4 bytes + slot data<br />
|}<br />
<br />
Note that if window ID and slot are both -1, it means the item currently attached to the cursor.<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.<br />
<br />
Slots: [http://gyazo.com/9d52e1fd4dc14790ec66eab4a9aee00e.png]<br />
<br />
{{anchor|0x68}}<br />
=== Set Window Items (0x68) ===<br />
''Server to Client''<br />
<br />
[[File:Inventory-slots.png|thumb|The inventory slots]]<br />
<br />
Sent by the server when an item in a slot (in a window) is added/removed. This includes the main inventory, equipped armour and crafting slots. <br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x68<br />
| Window id<br />
| byte<br />
| <code>1</code><br />
| The id of window which items are being sent for. 0 for player inventory.<br />
|-<br />
| Count<br />
| short<br />
| <code>4</code><br />
| The number of slots (see below)<br />
|-<br />
| Slot data<br />
| array of [[Slot_Data|slot]]s<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 4 bytes + size of slot data array<br />
|}<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.<br />
<br />
{{anchor|0x69}}<br />
=== Update Window Property (0x69) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x69<br />
| Window id<br />
| byte<br />
| 2<br />
| The id of the window.<br />
|-<br />
| Property<br />
| short<br />
| 1<br />
| Which property should be updated.<br />
|-<br />
| Value<br />
| short<br />
| 650<br />
| The new value for the property.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
'''Furnace'''<br />
<br />
Properties:<br />
<br />
* 0: Progress arrow<br />
* 1: Fire icon (fuel)<br />
<br />
Values:<br />
<br />
* 0-200 for progress arrow<br />
* 0-200 for fuel indicator<br />
<br />
Ranges are presumably in in-game ticks<br />
<br />
'''Enchantment Table'''<br />
<br />
Properties: 0, 1 or 2 depending on the "enchantment slot" being given.<br />
<br />
Values: The enchantment's level.<br />
<br />
{{anchor|0x6A}}<br />
=== Confirm Transaction (0x6A) ===<br />
''Two-Way''<br />
<br />
A packet from the server indicating whether a request from the client was accepted, or whether there was a conflict (due to lag). This packet is also sent from the client to the server in response to a server transaction rejection packet.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x6A<br />
| Window ID<br />
| byte<br />
| 0<br />
| The id of the window that the action occurred in.<br />
|-<br />
| Action number<br />
| short<br />
| 12<br />
| Every action that is to be accepted has a unique number. This field corresponds to that number.<br />
|-<br />
| Accepted?<br />
| boolean<br />
| true<br />
| Whether the action was accepted.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes<br />
|}<br />
<br />
{{anchor|0x6B}}<br />
<br />
=== Creative Inventory Action (0x6B) ===<br />
''Two-Way''<br />
<br />
While the user is in the standard inventory (i.e., not a crafting bench) on a creative-mode server then the server will send this packet:<br />
<br />
* <div class="li"> If an item is dropped into the quick bar</div><br />
* If an item is picked up from the quick bar (item id is -1)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x6B<br />
| Slot<br />
| short<br />
| 36<br />
| Inventory slot<br />
|-<br />
| Clicked item<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes + slot data<br />
|}<br />
<br />
{{anchor|0x6C}}<br />
=== Enchant Item (0x6C) ===<br />
''Client to Server''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x6C<br />
| Window ID<br />
| byte<br />
| 1<br />
| The ID sent by [[#0x64|Open Window]]<br />
|-<br />
| Enchantment<br />
| byte<br />
| 0<br />
| The position of the enchantment on the enchantment table window, starting with 0 as the topmost one.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes<br />
|}<br />
<br />
{{anchor|0x82}}<br />
=== Update Sign (0x82) ===<br />
''Two-Way''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x82<br />
| X<br />
| int<br />
| 128<br />
| Block X Coordinate<br />
|-<br />
| Y<br />
| short<br />
| 0<br />
| Block Y Coordinate<br />
|-<br />
| Z<br />
| int<br />
| -128<br />
| Block Z Coordinate<br />
|-<br />
| Line 1<br />
| string<br />
| <code>First line</code><br />
| First line of text in the sign<br />
|-<br />
| Line 2<br />
| string<br />
| <code>Second line</code><br />
| Second line of text in the sign<br />
|-<br />
| Line 3<br />
| string<br />
| <code>Third line</code><br />
| Third line of text in the sign<br />
|-<br />
| Line 4<br />
| string<br />
| <code>Fourth line</code><br />
| Fourth line of text in the sign<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes + 4 strings<br />
|}<br />
<br />
This message is sent from the server to the client whenever a sign is discovered or created. This message is sent from the client to the server when the "Done" button is pushed after placing a sign. This message is NOT sent when a sign is destroyed or unloaded.<br />
<br />
{{anchor|0x83}}<br />
<br />
=== Item Data (0x83) ===<br />
''Server to Client''<br />
<br />
Sent to specify complex data on an item; currently used only for maps.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x83<br />
| Item Type<br />
| short<br />
| <code>358</code><br />
| Type of item being modified<br />
|-<br />
| Item ID<br />
| short<br />
| <code>0</code><br />
| The ID (damage value) of the item being modified<br />
|-<br />
| Text length<br />
| short<br />
| <code>35</code><br />
| Length of following byte array<br />
|-<br />
| Text<br />
| byte array<br />
| {0,0,0,20,20,20,20,20}<br />
| ASCII text.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + Text length<br />
|}<br />
<br />
'''Maps'''<br />
If the first byte of the text is 0, the next two bytes are X start and Y start and the rest of the bytes are the colors in that column.<br />
<br />
If the first byte of the text is 1, the rest of the bytes are in groups of three: (data, x, y). The lower half of the data is the type (always 0 under vanilla) and the upper half is the direction.<br />
<br />
{{anchor|0x84}}<br />
=== Update Tile Entity (0x84) ===<br />
''Server to Client''<br />
<br />
Essentially a block update on a tile entity.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x84<br />
| X<br />
| int<br />
|<br />
|<br />
|-<br />
| Y<br />
| short<br />
|<br />
|<br />
|-<br />
| Z<br />
| int<br />
|<br />
|<br />
|-<br />
| Action<br />
| byte<br />
|<br />
| The type of update to perform<br />
|-<br />
| Data length<br />
| Short<br />
|<br />
| Varies<br />
|-<br />
| NBT Data<br />
| Byte Array<br />
|<br />
| Present if data length > 0. Compressed with [[wikipedia:Gzip|gzip]]. Varies<br />
|-<br />
| Total Size:<br />
| colspan="4" | 12 + itemstack bytes<br />
|}<br />
<br />
'''Actions'''<br />
<br />
* '''1''': Set mob displayed inside a mob spawner. Custom 1 contains the [[Entities#Mobs|mob type]]<br />
<br />
{{anchor|0x85}}<br />
<br />
=== Tile Editor Open? (0x85) ===<br />
''Server to Client''<br />
<br />
Sent on placement of sign.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x85<br />
| Tile Entity Id<br />
| byte<br />
| <code>0</code><br />
| Always seems to be 0 (TileEntitySign)<br />
|-<br />
| X<br />
| int<br />
| <code>70</code><br />
| X in block coordinates<br />
|-<br />
| Y<br />
| int<br />
| <code>70</code><br />
| Y in block coordinates<br />
|-<br />
| Z<br />
| int<br />
| <code>-46</code><br />
| Z in block coordinates<br />
|-<br />
| Total Size:<br />
| colspan="4" | 14 bytes<br />
|}<br />
<br />
{{anchor|0xC8}}<br />
<br />
=== Increment Statistic (0xC8) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0xC8<br />
| Statistic ID<br />
| int<br />
| 1003<br />
| The ID of the statistic. See [http://www.minecraftwiki.net/wiki/Statistics List of statistics].<br />
|-<br />
| Amount<br />
| '''int'''<br />
| 1<br />
| The amount to increment the statistic.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0xC9}}<br />
<br />
=== Player List Item (0xC9) ===<br />
''Server to Client''<br />
<br />
Sent by the notchian server to update the user list (<tab> in the client). The server sends one packet per user per tick, amounting to 20 packets/s for 1 online user, 40 for 2, and so forth.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xC9<br />
| Player name<br />
| string<br />
| barneygale<br />
| Supports chat colouring, limited to 16 characters.<br />
|-<br />
| Online<br />
| boolean<br />
| true<br />
| If false, the client will remove the user from the list.<br />
|-<br />
| Ping<br />
| short<br />
| 193<br />
| Ping, presumably in ms.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xCA}}<br />
=== Player Abilities (0xCA) ===<br />
''Two-Way''<br />
<br />
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.<br />
<br />
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).<br />
<br />
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.<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xCA<br />
| Flags<br />
| byte<br />
| 5<br />
|<br />
|-<br />
| Flying speed*<br />
| '''float'''<br />
| '''0.05'''<br />
| previous integer value divided by 250<br />
|-<br />
| Walking speed*<br />
| '''float'''<br />
| '''0.1'''<br />
| previous integer value divided by 250<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
The client ignores the walking speed and flying speed fields. Send an 0x2C packet as well.<br />
<br />
{{anchor|0xCB}}<br />
=== Tab-complete (0xCB) ===<br />
''Two-way''<br />
<br />
Sent C->S when the user presses [tab] while writing text. The payload contains all text behind the cursor.<br />
<br />
The server responds with an auto-completion of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported.<br />
<br />
In the event of more than one possible completion, the server responds with the options packed into the single string field, separated by a null character. Note that as strings are UTF-16, this is two bytes wide.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0xCB<br />
| Text<br />
| string<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xCC}}<br />
=== Client Settings (0xCC) ===<br />
''Client to server''<br />
<br />
Sent when the player connects, or when settings are changed.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0xCC<br />
| Locale<br />
| string<br />
| en_GB<br />
|<br />
|-<br />
| View distance<br />
| byte<br />
| 0<br />
| 0-3 for 'far', 'normal', 'short', 'tiny'.<br />
|-<br />
| Chat flags<br />
| byte<br />
| 8<br />
| Chat settings. See notes below.<br />
|-<br />
| Difficulty<br />
| byte<br />
| 0<br />
| Client-side difficulty from options.txt<br />
|-<br />
| Show Cape<br />
| boolean<br />
| true<br />
| Client-side "show cape" option<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + length of string<br />
|}<br />
<br />
Chat flags has several values packed into one byte.<br />
<br />
'''Chat Enabled:''' Bits 0-1. 00: Enabled. 01: Commands only. 10: Hidden.<br />
<br />
'''Colors Enabled:''' Bit 3. 0: Disabled. 1: Enabled.<br />
<br />
{{anchor|0xCD}}<br />
=== Client Statuses (0xCD) ===<br />
''Client to server''<br />
<br />
Sent when the client is ready to complete login and when the client is ready to respawn after death.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="1" | 0xCD<br />
| Payload<br />
| byte<br />
| 0<br />
| Bit field. 0: Initial spawn, 1: Respawn after death<br />
|-<br />
| Total Size:<br />
| colspan="5" | 2 bytes<br />
|}<br />
<br />
{{anchor|0xCE}}<br />
=== Scoreboard Objective (0xCE) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should create a new scoreboard or remove one.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xCE<br />
| Objective name<br />
| string<br />
| <code>deaths</code><br />
| An unique name for the objective<br />
|-<br />
| Objective value<br />
| string<br />
| <code>Deaths</code><br />
| The text to be displayed for the score.<br />
|-<br />
| Create/Remove<br />
| byte<br />
| 0<br />
| 0 to create the scoreboard. 1 to remove the scoreboard. 2 to update the display text. TODO: Check these values<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xCF}}<br />
=== Update Score (0xCF) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should update a scoreboard item.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0xCF<br />
| Item Name<br />
| string<br />
| <code>Bob</code><br />
| An unique name to be displayed in the list.<br />
|-<br />
| Update/Remove<br />
| byte<br />
| 0<br />
| 0 to create/update an item. 1 to remove an item.<br />
|-<br />
| Score Name<br />
| string<br />
| <code>deaths</code><br />
| The unique name for the scoreboard to be updated. Only sent when Update/Remove does not equal 1.<br />
|-<br />
| Value<br />
| int<br />
| 5<br />
| The score to be displayed next to the entry. Only sent when Update/Remove does not equal 1.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes + length of strings<br />
|}<br />
<br />
{{anchor|0xD0}}<br />
<br />
=== Display Scoreboard (0xD0) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should display a scoreboard.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0xD0<br />
| Position<br />
| byte<br />
| 1<br />
| The position of the scoreboard. 0 = list, 1 = sidebar, 2 = belowName.<br />
|-<br />
| Score Name<br />
| string<br />
| <code>deaths</code><br />
| The unique name for the scoreboard to be displayed.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 4 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xD1}}<br />
=== Teams (0xD1) ===<br />
''Server to Client''<br />
<br />
Creates and updates teams.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="8" | 0xD1<br />
| Team Name<br />
| string<br />
| mcdevs<br />
| A unique name for the team. (Shared with scoreboard).<br />
|-<br />
| Mode<br />
| byte<br />
| 0<br />
| If 0 then the team is created. <br />
If 1 then the team is removed. <br />
<br />
If 2 the team team information is updated. <br />
<br />
If 3 then new players are added to the team. <br />
<br />
If 4 then players are removed from the team.<br />
|-<br />
| Team Display Name<br />
| string<br />
| McDevs<br />
| Only if Mode = 0 or 2. <br />
|-<br />
| Team Prefix<br />
| string<br />
|<br />
| Only if Mode = 0 or 2. Displayed before the players' name that are part of this team. <br />
|-<br />
| Team Suffix<br />
| string<br />
|<br />
| Only if Mode = 0 or 2. Displayed after the players' name that are part of this team. <br />
|-<br />
| Friendly fire<br />
| byte<br />
| 0<br />
| Only if Mode = 0 or 2; 0 for off, 1 for on, 3 for seeing friendly invisibles<br />
|-<br />
| Player count<br />
| short<br />
| 0<br />
| Only if Mode = 0 or 3 or 4. Number of players in the array<br />
|-<br />
| Players<br />
| Array of strings<br />
|<br />
| Only if Mode = 0 or 3 or 4. Players to be added/remove from the team.<br />
|-<br />
| Total Size:<br />
| colspan="4" | Variable<br />
|}<br />
<br />
{{anchor|0xFA}}<br />
=== Plugin Message (0xFA) ===<br />
''Two-Way''<br />
<br />
Mods and plugins can use this to send their data. As of 1.3, Minecraft itself uses a number of [[plugin channel]]s. These internal channels are prefixed with <code>MC|</code>.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xFA<br />
| Channel<br />
| string<br />
| MyMod:testchannel<br />
| Name of the "channel" used to send the data.<br />
|-<br />
| length<br />
| short<br />
|<br />
| Length of the following byte array<br />
|-<br />
| data<br />
| byte array<br />
|<br />
| Any data.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes + length of string + length of byte array<br />
|}<br />
<br />
More documentation on this: http://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/<br />
<br />
{{anchor|0xFC}}<br />
=== Encryption Key Response (0xFC) ===<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on this packet. Bypassing the encryption is possible, authentication for the player name is still needed if the server is in online mode, but instead of sending this packet, you send [[#0xCD|Client Statuses]] instead.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0xFC<br />
| Shared secret length<br />
| short<br />
|<br />
|<br />
|-<br />
| Shared secret<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Verify token length<br />
| short<br />
|<br />
|<br />
|-<br />
| Verify token response<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes + length of shared secret + length of token<br />
|}<br />
<br />
{{anchor|0xFD}}<br />
=== Encryption Key Request (0xFD) ===<br />
''Server to client''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0xFD<br />
| Server id<br />
| string<br />
|<br />
|<br />
|-<br />
| Public key length<br />
| short<br />
|<br />
|<br />
|-<br />
| Public key<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Verify token length<br />
| short<br />
|<br />
|<br />
|-<br />
| Verify token<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + length of string + length of key + length of token<br />
|}<br />
<br />
{{anchor|0xFE}}<br />
<br />
=== Server List Ping (0xFE) ===<br />
''Client to Server''<br />
<br />
''Main article: [[Server List Ping]]''<br />
<br />
This packet is used by the multiplayer menu to retrieve MOTD, version, and player counts.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="1" | 0xFE<br />
| Magic<br />
| byte<br />
| <code>1</code><br />
| always <code>1</code><br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 bytes<br />
|}<br />
<br />
{{anchor|0xFF}}<br />
<br />
=== Disconnect/Kick (0xFF) ===<br />
''Two-Way''<br />
<br />
Sent by the server before it disconnects a client, or by the client before it disconnects from the server. The receiver of this packet assumes that the sender has already closed the connection by the time the packet arrives.<br />
<br />
Due to race conditions in the client, a local server may need to pause for a short period after sending this packet before closing the connection. An alternative is simply not to close the connection, and wait for the client to do so on receipt of this packet.<br />
<br />
When vanilla client quits, reason is "Quitting", but any reason is ok.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0xFF<br />
| Reason<br />
| string<br />
| <code>The server is full!</code><br />
| Displayed to the client when the connection terminates<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes + length of strings<br />
|}<br />
<br />
== See Also ==<br />
* [[Protocol History]]<br />
* [[Data Types]]<br />
* [[Units of Measurement]]<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Protocol&diff=4655Protocol2013-08-28T12:40:28Z<p>Sadimusi: /* Confirm Transaction (0x6A) */</p>
<hr />
<div>This page presents a dissection of the current stable [http://minecraft.net/game/ Minecraft] protocol. The current pre-release protocol is documented [[Pre-release_protocol|elsewhere]]. The protocol for Pocket Minecraft is substantially different, and is documented at [[Pocket Minecraft Protocol]].<br />
<br />
If you're having trouble, check out the [[Protocol_FAQ|FAQ]] or ask for help in the IRC channel ([irc://irc.freenode.net/mcdevs #mcdevs on irc.freenode.net]).<br />
<br />
'''Note:''' While you may use the contents of this page without restriction to create servers, clients, bots, etc… you still need to provide attribution to #mcdevs if you copy any of the contents of this page for publication elsewhere.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Term<br />
! Definition<br />
|-<br />
| Player<br />
| When used in the singular, Player always refers to the client connected to the server<br />
|-<br />
| Entity<br />
| Entity refers to any item, player, mob, minecart or boat in the world. This definition is subject to change as Notch extends the protocol<br />
|-<br />
| EID<br />
| An EID - or Entity ID - is a unique 4-byte integer used to identify a specific entity<br />
|-<br />
| XYZ<br />
| In this document, the axis names are the same as those used by Notch. Y points upwards, X points South, and Z points West.<br />
|-<br />
!colspan="2"|See also: [[Data types]], [[Units of Measurement]]<br />
|}<br />
<br />
== Packets ==<br />
All packets begin with a single "Packet ID" byte. Listed packet size includes this byte. Packets are either "server to client", "client to server", or "Two-Way" (both). Packets are not prefixed with their length. For variable length packets, you must parse it completely to determine its length.<br />
=== Protocol Version ===<br />
1.6.2 - 74<br />
<br />
{{anchor|0x00}}<br />
=== Keep Alive (0x00) ===<br />
''Two-Way''<br />
<br />
The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same packet.<br />
The Beta server will disconnect a client if it doesn't receive at least one packet before 1200 in-game ticks, and the Beta client will time out the connection under the same conditions. The client may send packets with Keep-alive ID=0.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x00<br />
| Keep-alive ID<br />
| int<br />
| <code>957759560</code><br />
| Server-generated random id<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes<br />
|}<br />
<br />
{{anchor|0x01}}<br />
=== Login Request (0x01) ===<br />
''Server to Client'' ''(and Client to Server in some mods, see below)''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x01<br />
| Entity ID<br />
| int<br />
| <code>1298</code><br />
| The Player's Entity ID<br />
|-<br />
| Level type<br />
| string<br />
| default<br />
| <code>default</code>, <code>flat</code>, or <code>largeBiomes</code>. level-type in server.properties<br />
|-<br />
| Game mode<br />
| byte<br />
| <code>0</code><br />
| <code>0</code>: survival, <code>1</code>: creative, <code>2</code>: adventure. Bit 3 (<code>0x8</code>) is the hardcore flag<br />
|-<br />
| Dimension<br />
| byte<br />
| <code>0</code><br />
| <code>-1</code>: nether, <code>0</code>: overworld, <code>1</code>: end<br />
|-<br />
| Difficulty<br />
| byte<br />
| <code>1</code><br />
| <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard<br />
|-<br />
| Not used<br />
| byte<br />
| <code>0</code><br />
| Only 0 observed from vanilla server, was previously world height<br />
|-<br />
| Max players<br />
| byte<br />
| <code>8</code><br />
| Used by the client to draw the player list<br />
|-<br />
| Total Size:<br />
| colspan="4" | 12 bytes + length of strings<br />
|}<br />
<br />
* MinecraftForge sends packet with type 0x01 and 25 bytes(may depend on mods installed with it) following it after completing handshake and enabling encryption. In our tests it sent the following payload:<br />
0x53 0xC8 0xE6 0x1B 0x00 0x07 0x00 0x64 0x00 0x65 0x00 0x66 0x00 0x61 0x00 0x75 0x00 0x6C 0x00 0x74 0xFF 0x02 0x00 0x00 0x00<br />
<br />
It is probably safe for server to ignore them unless you know what to do. More insights are needed on MinecraftForge protocol specifics.<br />
<br />
{{anchor|0x02}}<br />
<br />
=== Handshake (0x02) ===<br />
''Client to server''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x02<br />
| Protocol Version<br />
| byte<br />
| <code>51</code><br />
| As of 1.6.2 the protocol version is 74. See [[Protocol version numbers]] for list.<br />
|-<br />
| Username<br />
| string<br />
| <code>Notch</code><br />
| The username of the player attempting to connect<br />
|-<br />
| Server Host<br />
| string<br />
| <code>localhost</code><br />
|<br />
|-<br />
| Server Port<br />
| int<br />
| <code>25565</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes + length of strings<br />
|}<br />
{{anchor|0x03}}<br />
<br />
=== Chat Message (0x03) ===<br />
<br />
''Client to Server''<br />
<br />
The default server will check the message to see if it begins with a '/'. If it doesn't, the username of the sender is prepended and sent to all other clients (including the original sender). If it does, the server assumes it to be a command and attempts to process it. A message longer than 100 characters will cause the server to kick the client. (As of 1.3.2, the vanilla client appears to limit the text a user can enter to 100 charaters.) This limits the chat message packet length to 203 bytes (as characters are encoded on 2 bytes). Note that this limit does not apply to chat messages sent by the server, which are limited to 32767 characters since 1.2.5. This change was initially done by allowing the client to not slice the message up to 119 (the previous limit), without changes to the server. For this reason, the vanilla server kept the code to cut messages at 119, but this isn't a protocol limitation and can be ignored.<br />
<br />
For more information, see [[Chat]].<br />
<br />
''Server to Client''<br />
<br />
The chat string must now be a valid JSON object:<br />
<br />
{"translate":"chat.type.announcement","using":["Server","hi"]}<br />
{"color":"gray","italic":true,"translate":"chat.type.admin","using":["Server",{"translate":"commands.save.success"}]}<br />
{"text":"§aOld style chat"}<br />
[https://gist.github.com/Dinnerbone/5631634 Original Gist from Dinnerbone]<br />
<br />
Where translate is one of the following:<br />
<br />
chat.type.admin: [%s: %s]<br />
chat.type.announcement: [%s] %s<br />
chat.type.emote: * %s %s<br />
chat.type.text: <%s> %s<br />
<br />
<br />
{{anchor|0x04}}<br />
=== Time Update (0x04) ===<br />
''Server to Client''<br />
<br />
Time is based on ticks, where 20 ticks happen every second. There are 24000 ticks in a day, making Minecraft days exactly 20 minutes long.<br />
<br />
The time of day is based on the timestamp modulo 24000. 0 is sunrise, 6000 is noon, 12000 is sunset, and 18000 is midnight.<br />
<br />
The default SMP server increments the time by <code>20</code> every second.<br />
<br />
{| class="wikitable"<br />
|-<br />
! | Packet ID<br />
! | Field Name<br />
! | Field Type<br />
! | Example<br />
! | Notes<br />
|-<br />
| rowspan="2" | 0x04<br />
| Age of the world<br />
| long<br />
| 45464654<br />
| In ticks; not changed by server commands<br />
|-<br />
| Time of Day<br />
| long<br />
| 21321<br />
| The world (or region) time, in ticks. '''If negative the sun will stop moving at the Math.abs of the time.'''<br />
|-<br />
! | Total Size:<br />
| colspan="4" | 17 Bytes<br />
|}<br />
<br />
{{anchor|0x05}}<br />
=== Entity Equipment (0x05) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x05<br />
| Entity ID<br />
| int<br />
| 0x00010643<br />
| Named Entity ID<br />
|-<br />
| Slot<br />
| short<br />
| 4<br />
| Equipment slot: 0=held, 1-4=armor slot (1 - boots, 2 - leggings, 3 - chestplate, 4 - helmet)<br />
|-<br />
| Item<br />
| [[Slot_Data|slot]]<br />
|<br />
| Item in slot format<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + slot data<br />
|}<br />
<br />
{{anchor|0x06}}<br />
=== Spawn Position (0x06) ===<br />
''Server to Client''<br />
<br />
Sent by the server after login to specify the coordinates of the spawn point (the point at which players spawn at, and which the compass points to). It can be sent at any time to update the point compasses point at.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x06<br />
| X<br />
| int<br />
| <code>117</code><br />
| Spawn X in block coordinates<br />
|-<br />
| Y<br />
| int<br />
| <code>70</code><br />
| Spawn Y in block coordinates<br />
|-<br />
| Z<br />
| int<br />
| <code>-46</code><br />
| Spawn Z in block coordinates<br />
|-<br />
| Total Size:<br />
| colspan="4" | 13 bytes<br />
|}<br />
<br />
{{anchor|0x07}}<br />
=== Use Entity (0x07) ===<br />
''Client to Server''<br />
<br />
This packet is sent from the client to the server when the client attacks or right-clicks another entity (a player, minecart, etc).<br />
<br />
A Notchian server only accepts this packet if the entity being attacked/used is visible without obstruction and within a 4-unit radius of the player's position.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x07<br />
| User<br />
| int<br />
| <code>1298</code><br />
| The entity of the player (ignored by the server)<br />
|-<br />
| Target<br />
| int<br />
| <code>1805</code><br />
| The entity the player is interacting with<br />
|-<br />
| Mouse button<br />
| boolean<br />
| <code>true</code><br />
| <code>true</code> when the player is left-clicking and <code>false</code> when right-clicking.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x08}}<br />
=== Update Health (0x08) ===<br />
''Server to Client''<br />
<br />
Sent by the server to update/set the health of the player it is sent to. Added in protocol version 5.<br />
<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x08<br />
| Health<br />
| '''float'''<br />
| '''20.0'''<br />
| 0 or less = dead, 20 = full HP<br />
|-<br />
| Food<br />
| short<br />
| 20<br />
| 0 - 20<br />
|-<br />
| Food Saturation<br />
| float<br />
| 5.0<br />
| Seems to vary from 0.0 to 5.0 in integer increments<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes<br />
|}<br />
<br />
{{anchor|0x09}}<br />
=== Respawn (0x09) ===<br />
''Server to Client''<br />
<br />
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x09<br />
| Dimension<br />
| int<br />
| <code>1</code><br />
| <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|-<br />
| Difficulty<br />
| byte<br />
| <code>1</code><br />
| <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard. <code>1</code> is always sent c->s<br />
|-<br />
| Game mode<br />
| byte<br />
| <code>1</code><br />
| <code>0</code>: survival, <code>1</code>: creative, <code>2</code>: adventure. The hardcore flag is not included<br />
|-<br />
| World height<br />
| short<br />
| <code>256</code><br />
| Defaults to <code>256</code><br />
|-<br />
| Level type<br />
| string<br />
| default<br />
| See [[#0x01|0x01 login]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes + length of string<br />
|}<br />
* Please avoid changing player's dimension to same dimension as he was in (i.e. from Nether to Nether, from Overworld to Overworld). While at first glance everything seems to work, weird bugs can occur, i.e. such player will be unable to attack other players in new world (minecraft client just won't send "Use Entity (0x07)" packet on hitting, only "Animation (0x12)" packet), even though he can see them and they can attack him (fixes after his death and respawn though).<br />
If you actually have multiple worlds of same dimension on server and need to teleport player between them, use intermediate world (with different dimension) between them.<br />
<br />
{{anchor|0x0A}}<br />
=== Player (0x0A) ===<br />
''Client to Server''<br />
<br />
This packet is used to indicate whether the player is on ground (walking/swimming), or airborne (jumping/falling).<br />
<br />
When dropping from sufficient height, fall damage is applied when this state goes from False to True. The amount of damage applied is based on the point where it last changed from True to False. Note that there are several movement related packets containing this state.<br />
<br />
This packet was previously referred to as Flying<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x0A<br />
| On Ground<br />
| boolean<br />
| <code>1</code><br />
| <code>True</code> if the client is on the ground, <code>False</code> otherwise<br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 bytes<br />
|}<br />
<br />
{{anchor|0x0B}}<br />
=== Player Position (0x0B) ===<br />
''Client to Server''<br />
<br />
Updates the players XYZ position on the server. <br />
If <code>Stance - Y</code> is less than <code>0.1</code> or greater than <code>1.65</code>, the stance is illegal and the client will be kicked with the message “Illegal Stance”.<br />
If the distance between the last known position of the player on the server and the new position set by this packet is greater than 100 units will result in the client being kicked for "You moved too quickly :( (Hacking?)"<br />
Also if the absolute number of X or Z is set greater than <code>3.2E7D</code> the client will be kicked for "Illegal position" <br />
<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x0B<br />
| X<br />
| double<br />
| <code>102.809</code><br />
| Absolute position<br />
|-<br />
| Y<br />
| double<br />
| <code>70.00</code><br />
| Absolute position<br />
|-<br />
| Stance<br />
| double<br />
| <code>71.62</code><br />
| Used to modify the players bounding box when going up stairs, crouching, etc…<br />
|-<br />
| Z<br />
| double<br />
| <code>68.30</code><br />
| Absolute position<br />
|-<br />
| On Ground<br />
| boolean<br />
| <code>1</code><br />
|<br />
Derived from packet [[#0x0A|0x0A]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 34 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x0C}}<br />
=== Player Look (0x0C) ===<br />
''Client to Server''<br />
<br />
[[File:Minecraft-trig-yaw.png|thumb|The unit circle for yaw]]<br />
<br />
Updates the direction the player is looking in.<br />
<br />
Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the xz-plane starts at (0, 1) and turns backwards towards (-1, 0), or in other words, it turns clockwise instead of counterclockwise. Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.<br />
<br />
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.<br />
<br />
You can get a unit vector from a given yaw/pitch via:<br />
x = -cos(pitch) * sin(yaw)<br />
y = -sin(pitch)<br />
z = cos(pitch) * cos(yaw)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x0C<br />
| Yaw<br />
| float<br />
| <code>0.00</code><br />
| Absolute rotation on the X Axis, in degrees<br />
|-<br />
| Pitch<br />
| float<br />
| <code>0.00</code><br />
| Absolute rotation on the Y Axis, in degrees<br />
|-<br />
| On Ground<br />
| boolean<br />
| <code>1</code><br />
|<br />
Derived from packet [[#0x0A|0x0A]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
{{anchor|0x0D}}<br />
=== Player Position and Look (0x0D) ===<br />
''Two-Way''<br />
<br />
A combination of [[#0x0C|Player Look]] and [[#0x0B|Player position]]. <br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x0D<br />
| X<br />
| double<br />
| <code>6.5</code><br />
| Absolute position<br />
|-<br />
| Y/Stance<br />
| double<br />
| <code>65.620000004768372</code><br />
| Y: Absolute Position (Client to Server); Stance: Used to modify the players bounding box when going up stairs, crouching, etc… (Server to Client)<br />
|-<br />
| Stance/Y<br />
| double<br />
| <code>67.240000009536743</code><br />
| Stance (Client to Server); Y (Server to Client)<br />
|-<br />
| Z<br />
| double<br />
| <code>7.5</code><br />
| Absolute position<br />
|-<br />
| Yaw<br />
| float<br />
| <code>0.0</code><br />
| Absolute rotation on the X Axis<br />
|-<br />
| Pitch<br />
| float<br />
| <code>0.0</code><br />
| Absolute rotation on the Y Axis<br />
|-<br />
| On Ground<br />
| boolean<br />
| <code>0</code><br />
|<br />
Derived from packet [[#0x0A|0x0A]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 42 bytes<br />
|}<br />
<br />
{{anchor|0x0E}}<br />
<br />
=== Player Digging (0x0E) ===<br />
''Client to Server''<br />
<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x0E<br />
| Status<br />
| byte<br />
| <code>1</code><br />
| The action the player is taking against the block (see below)<br />
|-<br />
| X<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Y<br />
| byte<br />
| <code>64</code><br />
| Block position<br />
|-<br />
| Z<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Face<br />
| byte<br />
| <code>3</code><br />
| The face being hit (see below)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 12 bytes<br />
|}<br />
<br />
Status can (currently) be one of six values:<br />
<br />
{| class="wikitable"<br />
|-<br />
| Meaning<br />
| Value<br />
|-<br />
| Started digging<br />
| <code>0</code><br />
|-<br />
| Cancelled digging<br />
| <code>1</code><br />
|-<br />
| Finished digging<br />
| <code>2</code><br />
|-<br />
| Drop item stack<br />
| <code>3</code><br />
|-<br />
| Drop item<br />
| <code>4</code><br />
|-<br />
| Shoot arrow / finish eating<br />
| <code>5</code><br />
|}<br />
<br />
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).<br />
<br />
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.<br />
<br />
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.<br />
<br />
The face can be one of six values, representing the face being hit:<br />
<br />
{| class="wikitable"<br />
|-<br />
| Value<br />
| 0<br />
| 1<br />
| 2<br />
| 3<br />
| 4<br />
| 5<br />
|-<br />
| Offset<br />
| -Y<br />
| +Y<br />
| -Z<br />
| +Z<br />
| -X<br />
| +X<br />
|}<br />
<br />
In 1.7.3, when a player opens a door with left click the server receives Packet 0xE+start digging and opens the door.<br />
<br />
{{anchor|0x0F}}<br />
=== Player Block Placement (0x0F) ===<br />
''Client to Server''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="8" | 0x0F<br />
| X<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Y<br />
| unsigned byte<br />
| <code>64</code><br />
| Block position<br />
|-<br />
| Z<br />
| int<br />
| <code>32</code><br />
| Block position<br />
|-<br />
| Direction<br />
| byte<br />
| <code>3</code><br />
| The offset to use for block/item placement (see below)<br />
|-<br />
| Held item<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Cursor position X<br />
| byte<br />
| 0 - 16<br />
| The position of the crosshair on the block<br />
|-<br />
| Cursor position Y<br />
| byte<br />
| 0 - 16<br />
|<br />
|-<br />
| Cursor position Z<br />
| byte<br />
| 0 - 16<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 14 bytes + slot data<br />
|}<br />
In normal operation (ie placing a block), this packet is sent once, with the values set normally.<br />
<br />
This packet has a special case where X, Y, Z, and Direction are all -1. (Note that Y is unsigned so set to 255.) This special packet indicates that the currently held item for the player should have its state updated such as eating food, shooting bows, using buckets, etc.<br />
<br />
In a Notchian Beta client, the block or item ID corresponds to whatever the client is currently holding, and the client sends one of these packets any time a right-click is issued on a surface, so no assumptions can be made about the safety of the ID. However, with the implementation of server-side inventory, a Notchian server seems to ignore the item ID, instead operating on server-side inventory information and holding selection. The client has been observed (1.2.5 and 1.3.2) to send both real item IDs and -1 in a single session.<br />
<br />
Special note on using buckets: When using buckets, the Notchian client might send two packets: first a normal and then a special case. The first normal packet is sent when you're looking at a block (e.g. the water you want to scoop up). This normal packet does not appear to do anything with a Notchian server. The second, special case packet appears to perform the action - based on current position/orientation and with a distance check - it appears that buckets can only be used within a radius of 6 units.<br />
<br />
{{anchor|0x10}}<br />
=== Held Item Change (0x10) ===<br />
''Two-Way''<br />
<br />
Sent when the player changes the slot selection<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x10<br />
| Slot ID<br />
| short<br />
| <code>1</code><br />
| The slot which the player has selected (0-8)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes<br />
|}<br />
<br />
{{anchor|0x11}}<br />
=== Use Bed (0x11) ===<br />
''Server to Client''<br />
<br />
This packet tells that a player goes to bed.<br />
<br />
The client with the matching Entity ID will go into bed mode.<br />
<br />
This Packet is sent to all nearby players including the one sent to bed.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x11<br />
| Entity ID<br />
| int<br />
| 89<br />
| Player ID<br />
|-<br />
| Unknown<br />
| byte<br />
| 0<br />
| Only 0 has been observed<br />
|-<br />
| Bed X<br />
| int<br />
| -247<br />
| Bed headboard X as block coordinate<br />
|-<br />
| Bed Y<br />
| byte<br />
| 78<br />
| Bed headboard Y as block coordinate<br />
|-<br />
| Bed Z<br />
| int<br />
| 128<br />
| Bed headboard Z as block coordinate<br />
|-<br />
| Total Size:<br />
| colspan="4" | 15 bytes<br />
|}<br />
<br />
{{anchor|0x12}}<br />
<br />
=== Animation (0x12) ===<br />
''Two-Way''<br />
<br />
Sent whenever an entity should change animation.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x12<br />
| EID<br />
| int<br />
| <code>55534</code><br />
| Player ID<br />
|-<br />
| Animation<br />
| byte<br />
| <code>1</code><br />
| Animation ID<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
Animation can be one of the following values:<br />
<br />
{| class="wikitable"<br />
|-<br />
! ID<br />
! Animation<br />
|-<br />
| 0<br />
| No animation<br />
|-<br />
| 1<br />
| Swing arm<br />
|-<br />
| 2<br />
| Damage animation<br />
|-<br />
| 3<br />
| Leave bed<br />
|-<br />
| 5<br />
| Eat food<br />
|-<br />
| 6<br />
| Critical effect<br />
|-<br />
| 7<br />
| Magic critical effect<br />
|-<br />
| 102<br />
| (unknown)<br />
|-<br />
| 104<br />
| Crouch<br />
|-<br />
| 105<br />
| Uncrouch<br />
|}<br />
<br />
Only <code>1</code> (swing arm) is sent by notchian clients. Crouching is sent via 0x13. Damage is server-side, and so is not sent by notchian clients. See also [[#0x26|Entity Status]]. As of client 1.5.2, crouching / uncrouching is sent through [[#0x28|Entity Metadata]].<br />
<br />
{{anchor|0x13}}<br />
<br />
=== Entity Action (0x13) ===<br />
''Client to Server''<br />
<br />
Sent at least when crouching, leaving a bed, or sprinting.<br />
To send action animation to client use 0x28.<br />
The client will send this with Action ID = 3 when "Leave Bed" is clicked.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x13<br />
| EID<br />
| int<br />
| <code>55534</code><br />
| Player ID<br />
|-<br />
| Action ID<br />
| byte<br />
| <code>1</code><br />
| The ID of the action, see below.<br />
|-<br />
| '''jumpBoost'''<br />
| int<br />
| <code>0</code><br />
| Horse jump boost. Ranged from 0 -> 100.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
Action ID can be one of the following values:<br />
<br />
{| class="wikitable"<br />
|-<br />
! ID<br />
! Action<br />
|-<br />
| 1<br />
| Crouch<br />
|-<br />
| 2<br />
| Uncrouch<br />
|-<br />
| 3<br />
| Leave bed<br />
|-<br />
| 4<br />
| Start sprinting<br />
|-<br />
| 5<br />
| Stop sprinting<br />
|}<br />
<br />
<br />
{{anchor|0x14}}<br />
<br />
=== Spawn Named Entity (0x14) ===<br />
''Server to Client''<br />
<br />
The only named entities (at the moment) are players (either real or NPC/Bot). This packet is sent by the server when a player comes into visible range, '''not''' when a player joins.<br />
<br />
Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly.<br />
<br />
At one point, the Notchian client was not okay with receiving player entity packets, including 0x14, that refer to its own username or EID; and would teleport to the absolute origin of the map and fall through the Void any time it received them. However, in more recent versions, it appears to handle them correctly, by spawning a new entity as directed (though future packets referring to the entity ID may be handled incorrectly).<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="9" | 0x14<br />
| EID<br />
| int<br />
| <code>94453</code><br />
| Player ID<br />
|-<br />
| Player Name<br />
| string<br />
| <code>Twdtwd</code><br />
| Max length of 16<br />
|-<br />
| X<br />
| int<br />
| <code>784</code><br />
| Player X as Absolute Integer<br />
|-<br />
| Y<br />
| int<br />
| <code>2131</code><br />
| Player Y as Absolute Integer<br />
|-<br />
| Z<br />
| int<br />
| <code>-752</code><br />
| Player Z as Absolute Integer<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>0</code><br />
| Player rotation as a packed byte<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| Player rotation as a packed byte<br />
|-<br />
| Current Item<br />
| short<br />
| <code>0</code><br />
| The item the player is currently holding. Note that this should be 0 for "no item", unlike -1 used in other packets. A negative value crashes clients.<br />
|-<br />
| Metadata<br />
| [[Entities#Entity_Metadata_Format|Metadata]]<br />
| <code></code><br />
| The 1.3 client crashes on packets with no metadata, but the server can send any metadata key of 0, 1 or 8 and the client is fine.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 22 bytes + length of strings + metadata (at least 1)<br />
|}<br />
<br />
{{anchor|0x15}}<br />
=== Collect Item (0x16) ===<br />
''Server to Client''<br />
<br />
Sent by the server when someone picks up an item lying on the ground - its sole purpose appears to be the animation of the item flying towards you. It doesn't destroy the entity in the client memory ([[#0x1D|0x1D]] does that), and it doesn't add it to your inventory ([[#0x67|0x67]] does that). The server only checks for items to be picked up after each [[#0x0B|Player Position]] and [[#0x0D|Player Position & Look]] packet sent by the client.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x16<br />
| Collected EID<br />
| int<br />
| <code>38</code><br />
|<br />
|-<br />
| Collector EID<br />
| int<br />
| <code>20</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0x17}}<br />
=== Spawn Object/Vehicle (0x17) ===<br />
''Server to Client''<br />
<br />
Sent by the server when an Object/Vehicle is created. The throwers entity id is now used for fishing floats too.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="8" | 0x17<br />
| EID<br />
| int<br />
| <code>62</code><br />
| Entity ID of the Object<br />
|-<br />
| Type<br />
| byte<br />
| <code>11</code><br />
| The type of object (see [[Entities#Objects]])<br />
|-<br />
| X<br />
| int<br />
| <code>16080</code><br />
| The Absolute Integer X Position of the object<br />
|-<br />
| Y<br />
| int<br />
| <code>2299</code><br />
| The Absolute Integer Y Position of the object<br />
|-<br />
| Z<br />
| int<br />
| <code>592</code><br />
| The Absolute Integer Z Position of the object<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>67</code><br />
| The pitch in steps of 2p/256<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>0</code><br />
| The yaw in steps of 2p/256<br />
|-<br />
| [[Object Data]]<br />
| [[Object Data]]<br />
|<br />
| <br />
|-<br />
| Total Size:<br />
| colspan="4" | 23 or 29 bytes<br />
|}<br />
<br />
{{anchor|0x18}}<br />
=== Spawn Mob (0x18) ===<br />
''Server to Client''<br />
<br />
Sent by the server when a Mob Entity is Spawned<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="12" | 0x18<br />
| EID<br />
| int<br />
| <code>446</code><br />
| Entity ID<br />
|-<br />
| Type<br />
| byte<br />
| <code>91</code><br />
| The type of mob. See [[Entities#Mobs]]<br />
|-<br />
| X<br />
| int<br />
| <code>13366</code><br />
| The Absolute Integer X Position of the object<br />
|-<br />
| Y<br />
| int<br />
| <code>2176</code><br />
| The Absolute Integer Y Position of the object<br />
|-<br />
| Z<br />
| int<br />
| <code>1680</code><br />
| The Absolute Integer Z Position of the object<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The pitch in steps of 2p/256<br />
|-<br />
| Head Pitch<br />
| byte<br />
| <code>10</code><br />
| The head pitch in steps of 2p/256<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>-27</code><br />
| Yaw in steps of 2p/256<br />
|-<br />
| Velocity X<br />
| short<br />
| <code>0</code><br />
|<br />
|-<br />
| Velocity Y<br />
| short<br />
| <code>0</code><br />
|<br />
|-<br />
| Velocity Z<br />
| short<br />
| <code>0</code><br />
|<br />
|-<br />
| Metadata<br />
| [[Entities#Entity_Metadata_Format|Metadata]]<br />
| <code>0 0 127</code><br />
| Varies by mob, see [[Entities]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 27 bytes + Metadata (at least 3 as you must send at least 1 item of metadata)<br />
|}<br />
<br />
{{anchor|0x19}}<br />
=== Spawn Painting (0x19) ===<br />
''Server to Client''<br />
<br />
This packet shows location, name, and type of painting.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x19<br />
| Entity ID<br />
| int<br />
| <code>0x00000326</code><br />
| Unique entity ID<br />
|-<br />
| Title<br />
| string<br />
| <code>Creepers</code><br />
| Name of the painting; max length 13 (length of "SkullAndRoses")<br />
|-<br />
| X<br />
| int<br />
| <code>50</code><br />
| Center X coordinate<br />
|-<br />
| Y<br />
| int<br />
| <code>66</code><br />
| Center Y coordinate<br />
|-<br />
| Z<br />
| int<br />
| <code>-50</code><br />
| Center Z coordinate<br />
|-<br />
| Direction<br />
| int<br />
| <code>0</code><br />
| Direction the painting faces (0 -z, 1 -x, 2 +z, 3 +x)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 23 bytes + length of string<br />
|}<br />
<br />
Calculating the center of an image: given a (width x height) grid of cells, with (0, 0) being the top left corner, the center is (max(0, width / 2 - 1), height / 2). E.g.<br />
<br />
2x1 (1, 0)<br />
4x4 (1, 2)<br />
<br />
{{anchor|0x1A}}<br />
=== Spawn Experience Orb (0x1A) ===<br />
''Server to Client''<br />
<br />
Spawns one or more experience orbs. Coordinates are in absolute units.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x1A<br />
| Entity ID<br />
| int<br />
| 105668<br />
|<br />
|-<br />
| x<br />
| int<br />
| -1143<br />
|<br />
|-<br />
| y<br />
| int<br />
| 1952<br />
|<br />
|-<br />
| z<br />
| int<br />
| 1166<br />
|<br />
|-<br />
| count<br />
| short<br />
| 7<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 19 bytes<br />
|}<br />
<br />
{{anchor|0x1B}}<br />
=== Steer Vehicle (0x1B) ===<br />
''Client to Server''<br />
<br />
Sent by client to steer the horse, minecart and boats.<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x1B<br />
| Sideways<br />
| float<br />
| 0.98<br />
| Positive to the left of the player<br />
|-<br />
| Forward<br />
| float<br />
| -0.98<br />
| Positive forward<br />
|-<br />
| Jump<br />
| bool<br />
| true<br />
| <br />
|-<br />
| Unmount<br />
| bool<br />
| false<br />
| True when leaving the vehicle<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes<br />
|}<br />
<br />
{{anchor|0x1C}}<br />
=== Entity Velocity (0x1C) ===<br />
''Server to Client''<br />
<br />
This packet is new to version 4 of the protocol, and is believed to be Entity Velocity/Motion.<br />
<br />
Velocity is believed to be in units of 1/8000 of a block per server tick (50ms);<br />
for example, -1343 would move (-1343 / 8000) = −0.167875 blocks per tick (or −3,3575 blocks per second).<br />
<br />
(This packet data values are not fully verified)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x1C<br />
| Entity ID<br />
| int<br />
| <code>1805</code><br />
| The entity ID<br />
|-<br />
| Velocity X<br />
| short<br />
| <code>-1343</code><br />
| Velocity on the X axis<br />
|-<br />
| Velocity Y<br />
| short<br />
| <code>0</code><br />
| Velocity on the Y axis<br />
|-<br />
| Velocity Z<br />
| short<br />
| <code>0</code><br />
| Velocity on the Z axis<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes<br />
|}<br />
<br />
{{anchor|0x1D}}<br />
<br />
=== Destroy Entity (0x1D) ===<br />
''Server to Client''<br />
<br />
Sent by the server when an list of Entities is to be destroyed on the client.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x1D<br />
| Entity Count<br />
| byte<br />
| <code>3</code><br />
| The amount of entities which should be destroyed<br />
|-<br />
| Entity IDs<br />
| array of int<br />
| <code>452, 546, 123</code><br />
| The list of entity ids which should be destroyed<br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 + (entity count * 4) bytes<br />
|}<br />
<br />
{{anchor|0x1E}}<br />
=== Entity (0x1E) ===<br />
''Server to Client''<br />
<br />
Most entity-related packets are subclasses of this packet. When sent from the server to the client, it may initialize the entry.<br />
<br />
For player entities, either this packet or any move/look packet is sent every game tick.<br />
So the meaning of this packet is basically that the entity did not move/look since the last such packet.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x1E<br />
| EID<br />
| int<br />
| <code>446</code><br />
| Entity ID<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes<br />
|}<br />
<br />
{{anchor|0x1F}}<br />
=== Entity Relative Move (0x1F) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity moves less then 4 blocks; if an entity moves more than 4 blocks [[#0x22|Entity Teleport]] should be sent instead.<br />
<br />
This packet allows at most four blocks movement in any direction, because byte range is from -128 to 127. Movement is an offset of Absolute Int; to convert relative move to block coordinate offset, divide by 32.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x1F<br />
| EID<br />
| int<br />
| <code>459</code><br />
| Entity ID<br />
|-<br />
| dX<br />
| byte<br />
| <code>1</code><br />
| X axis Relative movement as an Absolute Integer<br />
|-<br />
| dY<br />
| byte<br />
| <code>-7</code><br />
| Y axis Relative movement as an Absolute Integer<br />
|-<br />
| dZ<br />
| byte<br />
| <code>5</code><br />
| Z axis Relative movement as an Absolute Integer<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 bytes<br />
|}<br />
<br />
{{anchor|0x20}}<br />
=== Entity Look (0x20) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity rotates. Example: "Yaw" field 64 means a 90 degree turn.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x20<br />
| EID<br />
| int<br />
| <code>459</code><br />
| Entity ID<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>126</code><br />
| The X Axis rotation as a fraction of 360<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The Y Axis rotation as a fraction of 360<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes<br />
|}<br />
<br />
{{anchor|0x21}}<br />
=== Entity Look and Relative Move (0x21) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity rotates and moves.<br />
Since a byte range is limited from -128 to 127, and movement is offset of Absolute Int,<br />
this packet allows at most four blocks movement in any direction. (-128/32 == -4)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x21<br />
| EID<br />
| int<br />
| <code>459</code><br />
| Entity ID<br />
|-<br />
| dX<br />
| byte<br />
| <code>1</code><br />
| X axis Relative movement as an Absolute Integer<br />
|-<br />
| dY<br />
| byte<br />
| <code>-7</code><br />
| Y axis Relative movement as an Absolute Integer<br />
|-<br />
| dZ<br />
| byte<br />
| <code>5</code><br />
| Z axis Relative movement as an Absolute Integer<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>126</code><br />
| The X Axis rotation as a fraction of 360<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The Y Axis rotation as a fraction of 360<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
{{anchor|0x22}}<br />
=== Entity Teleport (0x22) ===<br />
''Server to Client''<br />
<br />
This packet is sent by the server when an entity moves more than 4 blocks.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x22<br />
| EID<br />
| int<br />
| <code>459</code><br />
| Entity ID<br />
|-<br />
| X<br />
| int<br />
| <code>14162</code><br />
| X axis position as an Absolute Integer<br />
|-<br />
| Y<br />
| int<br />
| <code>2176</code><br />
| Y axis position as an Absolute Integer<br />
|-<br />
| Z<br />
| int<br />
| <code>1111</code><br />
| Z axis position as an Absolute Integer<br />
|-<br />
| Yaw<br />
| byte<br />
| <code>126</code><br />
| The X Axis rotation as a fraction of 360<br />
|-<br />
| Pitch<br />
| byte<br />
| <code>0</code><br />
| The Y Axis rotation as a fraction of 360<br />
|-<br />
| Total Size:<br />
| colspan="4" | 19 bytes<br />
|}<br />
<br />
{{anchor|0x23}}<br />
=== Entity Head Look (0x23) ===<br />
''Server to Client''<br />
<br />
Changes the direction an entity's head is facing.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x23<br />
| Entity ID<br />
| int<br />
|<br />
|<br />
|-<br />
| Head Yaw<br />
| byte<br />
|<br />
| Head yaw in steps of 2p/256<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
{{anchor|0x26}}<br />
=== Entity Status (0x26) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x26<br />
| Entity ID<br />
| int<br />
| 34353<br />
|<br />
|-<br />
| Entity Status<br />
| byte<br />
| 0x03<br />
| See below<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
{| class="wikitable"<br />
|-<br />
! Entity Status<br />
! Meaning<br />
|-<br />
| 2<br />
| Entity hurt<br />
|-<br />
| 3<br />
| Entity dead<br />
|-<br />
| 6<br />
| Wolf taming<br />
|-<br />
| 7<br />
| Wolf tamed<br />
|-<br />
| 8<br />
| Wolf shaking water off itself<br />
|-<br />
| 9<br />
| (of self) Eating accepted by server<br />
|-<br />
| 10<br />
| Sheep eating grass<br />
|-<br />
| 11<br />
| Iron Golem handing over a rose<br />
|-<br />
| 12<br />
| Spawn "heart" particles near a villager<br />
|-<br />
| 13<br />
| Spawn particles indicating that a villager is angry and seeking revenge<br />
|-<br />
| 14<br />
| Spawn happy particles near a villager<br />
|-<br />
| 15<br />
| Spawn a "magic" particle near the Witch<br />
|-<br />
| 16<br />
| Zombie converting into a villager by shaking violently<br />
|-<br />
| 17<br />
| A firework exploding<br />
|-<br />
|}<br />
<br />
{{anchor|0x27}}<br />
<br />
=== Attach Entity (0x27) ===<br />
''Server to Client''<br />
<br />
This packet is sent when a player has been attached to an entity (e.g. Minecart)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x27<br />
| Entity ID<br />
| int<br />
| <code>1298</code><br />
| The player entity ID being attached<br />
|-<br />
| Vehicle ID<br />
| int<br />
| <code>1805</code><br />
| The vehicle entity ID attached to (-1 for unattaching)<br />
|-<br />
| '''Leash'''<br />
| unsigned byte<br />
| <code>0</code><br />
| If set to 1, leashes the entity to the vehicle<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
{{anchor|0x28}}<br />
<br />
=== Entity Metadata (0x28) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x28<br />
| Entity ID<br />
| int<br />
| <code>0x00000326</code><br />
| Unique entity ID to update.<br />
|-<br />
| Entity Metadata<br />
| [[Entities#Entity_Metadata_Format|Metadata]]<br />
| <code>0x00 0x01 0x7F</code><br />
| Metadata varies by entity. See [[Entities]]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes + Metadata<br />
|}<br />
<br />
<br />
{{anchor|0x29}}<br />
=== Entity Effect (0x29) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x29<br />
| Entity ID<br />
| int<br />
| <code>14</code><br />
| Entity ID of a player<br />
|-<br />
| Effect ID<br />
| byte<br />
| <code>17</code><br />
| See [http://www.minecraftwiki.net/wiki/Potion_effect#Parameters here]<br />
|-<br />
| Amplifier<br />
| byte<br />
| <code>0</code><br />
|<br />
|-<br />
| Duration<br />
| short<br />
| <code>64</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0x2A}}<br />
=== Remove Entity Effect (0x2A) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x2a<br />
| Entity ID<br />
| int<br />
|<br />
| Entity ID of a player<br />
|-<br />
| Effect ID<br />
| byte<br />
| <code>17</code><br />
| See [http://www.minecraftwiki.net/wiki/Potion_effect#Parameters here]<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x2B}}<br />
=== Set Experience (0x2B) ===<br />
''Server to Client''<br />
<br />
Sent by the server when the client should change experience levels.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x2B<br />
| Experience bar<br />
| float<br />
| <code>0.5960060358047485</code><br />
| Used for drawing the experience bar - value is between 0 and 1.<br />
|-<br />
| Level<br />
| short<br />
| <code>8</code><br />
|<br />
|-<br />
| Total experience<br />
| short<br />
| <code>130</code><br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0x2C}}<br />
=== Entity Properties (0x2C) ===<br />
''Server to Client''<br />
<br />
'''Note''': The server sends this packet to inform the user of its movement speed. Users move far too fast when this packet is not sent.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x2C<br />
| EntityID<br />
| int<br />
| 195<br />
| ?<br />
|-<br />
| Properties Count<br />
| int<br />
| 3<br />
| Number of string/data (including these lists) pairs that follow. The remaining fields here are repeated this number of times.<br />
|-<br />
| Key<br />
| string16<br />
| "generic.Maxhealth"<br />
| <br />
|-<br />
| Value<br />
| double<br />
| 20.0<br />
| <br />
|-<br />
| ListLength<br />
| short<br />
| 1<br />
| Number of list elements that follow.<br />
|-<br />
| ListElement<br />
| {long (UUID MSB), long (UUID LSB), double (amount), byte (operation)}<br />
| <br />
| http://www.minecraftwiki.net/wiki/Attribute#Modifiers<br />
|-<br />
| Total Size:<br />
| colspan="4" | ? bytes<br />
|}<br />
<br />
Known values:<br />
{| class="wikitable"<br />
|-<br />
| Key <br />
| Default <br />
| Min <br />
| Max<br />
| Label<br />
|-<br />
| generic.maxHealth<br />
| 20.0<br />
| 0.0<br />
| Double.MaxValue<br />
| Max Health<br />
|-<br />
| generic.followRange<br />
| 32.0<br />
| 0.0<br />
| 2048.0<br />
| Follow Range<br />
|-<br />
| generic.knockbackResistance<br />
| 0.0<br />
| 0.0<br />
| 1.0<br />
| Knockback Resistance<br />
|-<br />
| generic.movementSpeed<br />
| 0.699999988079071<br />
| 0.0<br />
| Double.MaxValue<br />
| Movement Speed<br />
|-<br />
| generic.attackDamage<br />
| 2.0<br />
| 0.0<br />
| Double.MaxValue<br />
| <br />
|-<br />
| horse.jumpStrength<br />
| 0.7<br />
| 0.0<br />
| 2.0<br />
| Jump Strength<br />
|-<br />
| zombie.spawnReinforcements<br />
| 0.0<br />
| 0.0<br />
| 1.0<br />
| Spawn Reinforcements Chance<br />
|}<br />
<br />
{{anchor|0x33}}<br />
<br />
=== Chunk Data (0x33) ===<br />
''Server to Client''<br />
<br />
Chunks are not unloaded by the client automatically. To unload chunks, send this packet with ground-up continuous=true and no 16^3 chunks (eg. primary bit mask=0). The server does not send skylight information for nether-chunks, it's up to the client to know if the player is currently in the nether. You can also infer this information from the primary bitmask and the amount of uncompressed bytes sent.<br />
<br />
See also: [[SMP Map Format]]<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x33<br />
| X<br />
| int<br />
|<br />
| Chunk X Coordinate (*16 to get true X)<br />
|-<br />
| Z<br />
| int<br />
|<br />
| Chunk Z Coordinate (*16 to get true Z)<br />
|-<br />
| Ground-up continuous<br />
| boolean<br />
|<br />
| This is True if the packet represents all sections in this vertical column, where the primary bit map specifies exactly which sections are included, and which are air.<br />
|-<br />
| Primary bit map<br />
| unsigned short<br />
| 15<br />
| Bitmask with 1 for every 16x16x16 section which data follows in the compressed data.<br />
|-<br />
| Add bit map<br />
| unsigned short<br />
| 0<br />
| Same as above, but this is used exclusively for the 'add' portion of the payload<br />
|-<br />
| Compressed size<br />
| int<br />
|<br />
| Size of compressed chunk data.<br />
|-<br />
| Compressed data<br />
| unsigned byte array<br />
| <code>…</code><br />
| The chunk data is compressed using ZLib Deflate function.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 18 bytes + Compressed chunk size<br />
|}<br />
<br />
{{anchor|0x34}}<br />
<br />
=== Multi Block Change (0x34) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x34<br />
| Chunk X<br />
| int<br />
| <code>-9</code><br />
| Chunk X Coordinate<br />
|-<br />
| Chunk Z<br />
| int<br />
| <code>12</code><br />
| Chunk Z Coordinate<br />
|-<br />
| Record count<br />
| short<br />
|<br />
| The number of blocks affected<br />
|-<br />
| Data size<br />
| int<br />
|<br />
| The total size of the data, in bytes. Should always be 4*record count - please confirm.<br />
|-<br />
| Data<br />
| Special<br />
| <code>…</code><br />
| Coordinates, type, and metadata of blocks to change (see below table).<br />
|-<br />
| Total Size:<br />
| colspan="4" | 15 bytes + Arrays<br />
|}<br />
<br />
Each record is four bytes.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Bit mask<br />
| Width<br />
| Meaning<br />
|-<br />
| 00 00 00 0F<br />
| 4 bits<br />
| Block metadata<br />
|-<br />
| 00 00 FF F0<br />
| 12 bits<br />
| Block ID<br />
|-<br />
| 00 FF 00 00<br />
| 8 bits<br />
| Y co-ordinate<br />
|-<br />
| 0F 00 00 00<br />
| 4 bits<br />
| Z co-ordinate, relative to chunk<br />
|-<br />
| F0 00 00 00<br />
| 4 bits<br />
| X co-ordinate, relative to chunk<br />
|}<br />
<br />
{{anchor|0x35}}<br />
<br />
=== Block Change (0x35) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x35<br />
| X<br />
| int<br />
| <code>502</code><br />
| Block X Coordinate<br />
|-<br />
| Y<br />
| byte<br />
| <code>71</code><br />
| Block Y Coordinate<br />
|-<br />
| Z<br />
| int<br />
| <code>18</code><br />
| Block Z Coordinate<br />
|-<br />
| Block Type<br />
| short<br />
| <code>78</code><br />
| The new block type for the block<br />
|-<br />
| Block Metadata<br />
| byte<br />
| <code>0</code><br />
| The new Metadata for the block<br />
|-<br />
| Total Size:<br />
| colspan="4" | 13 bytes<br />
|}<br />
<br />
{{anchor|0x36}}<br />
=== Block Action (0x36) ===<br />
''Server to Client''<br />
<br />
This packet is used for a number of things:<br />
* <div class="li">Chests opening and closing<br />
* Pistons pushing and pulling<br />
* Note blocks playing<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x36<br />
| X<br />
| int<br />
| <code>502</code><br />
| Block X Coordinate<br />
|-<br />
| Y<br />
| short<br />
| <code>71</code><br />
| Block Y Coordinate<br />
|-<br />
| Z<br />
| int<br />
| <code>18</code><br />
| Block Z Coordinate<br />
|-<br />
| Byte 1<br />
| byte<br />
| <code>3</code><br />
| Varies depending on block - see below<br />
|-<br />
| Byte 2<br />
| byte<br />
| <code>17</code><br />
| Varies depending on block - see below<br />
|-<br />
| Block ID<br />
| short<br />
| <code>29</code><br />
| The block id this action is set for<br />
|-<br />
| Total Size:<br />
| colspan="4" | 15 bytes<br />
|}<br />
See Also: [[Block Actions]] <br />
<br />
{{anchor|0x37}}<br />
=== Block Break Animation (0x37) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x37<br />
| EID?<br />
| int<br />
|<br />
| Entity breaking the block?<br />
|-<br />
| X<br />
| int<br />
|<br />
| rowspan="3" | Block position<br />
|-<br />
| Y<br />
| int<br />
|<br />
|-<br />
| Z<br />
| int<br />
|<br />
|-<br />
| Destroy Stage<br />
| byte<br />
| 1<br />
| How far destroyed this block is. (0-7)<br />
|-<br />
| Total Size:<br />
| colspan="4" | 18 bytes<br />
|}<br />
<br />
{{anchor|0x38}}<br />
<br />
=== Map Chunk Bulk (0x38) ===<br />
''Server to Client''<br />
<br />
See also: [[SMP Map Format]]<br />
<br />
To reduce the number of bytes this packet is used to send chunks together for better compression results.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x38<br />
| Chunk column count<br />
| short<br />
|<br />
| The number of chunks in this packet<br />
|-<br />
| Data length<br />
| int<br />
|<br />
| the size of the data field<br />
|-<br />
| Sky light sent<br />
| boolean<br />
|<br />
| Whether or not the chunk data contains a light nibble array. This is true in the main world, false in the end + nether<br />
|-<br />
| Data<br />
| byte array<br />
|<br />
| Compressed chunk data<br />
|-<br />
| Meta information<br />
| Special<br />
|<br />
| see below<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 + (Chunk data size) + 12 * (Chunk Count) bytes<br />
|}<br />
<br />
====Meta Information Structure====<br />
<br />
This structure is repeated for each chunk column sent<br />
<br />
{| class="wikitable"<br />
|-<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| Chunk X<br />
| int<br />
| 10<br />
| The X coordinate of the specific chunk<br />
|-<br />
| Chunk Z<br />
| int<br />
| 10<br />
| The Z coordinate of the specific chunk<br />
|-<br />
| Primary bitmap<br />
| unsigned short<br />
| 15<br />
| A bitmap which specifies which sections are not empty in this chunk<br />
|-<br />
| Add bitmap<br />
| unsigned short<br />
| 0<br />
| A bitmap which specifies which sections need add information because of very high block ids. not yet used. needs verification<br />
|-<br />
| Total Size:<br />
| colspan="3" | 12 bytes<br />
|}<br />
<br />
<br />
* If you send this packet to update area surrounding player in the middle of the game, entities within the updated area may become unattackable (vanilla client just won't send "Use Entity (0x07)" packet when you try to hit them, only swing animation, also it will dig blocks through them), even though they will be visible and work correctly in other ways. This is a bug in vanilla client (still there in 1.5.2), but you can workaround it by destroying relevant entities prior to sending 0x38 (via 0x1D) and spawning them again after it.<br />
<br />
{{anchor|0x3C}}<br />
<br />
=== Explosion (0x3C) ===<br />
''Server to Client''<br />
<br />
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="9" | 0x3C<br />
| X<br />
| double<br />
|<br />
|<br />
|-<br />
| Y<br />
| double<br />
|<br />
|<br />
|-<br />
| Z<br />
| double<br />
|<br />
|<br />
|-<br />
| Radius<br />
| float<br />
| 3.0<br />
| Currently unused in the client<br />
|-<br />
| Record count<br />
| int<br />
|<br />
| This is the count, not the size. The size is 3 times this value.<br />
|-<br />
| Records<br />
| (byte, byte, byte) × count<br />
|<br />
| Each record is 3 signed bytes long, each bytes are the XYZ (respectively) offsets of affected blocks.<br />
|-<br />
| Player Motion X<br />
| float<br />
|<br />
| X velocity of the player being pushed by the explosion<br />
|-<br />
| Player Motion Y<br />
| float<br />
|<br />
| Y velocity of the player being pushed by the explosion<br />
|-<br />
| Player Motion Z<br />
| float<br />
|<br />
| Z velocity of the player being pushed by the explosion<br />
|-<br />
| Total Size:<br />
| colspan="4" | 45 bytes + 3*(Record count) bytes<br />
|}<br />
<br />
Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x<br />
<br />
{{anchor|0x3D}}<br />
=== Sound Or Particle Effect (0x3D) ===<br />
''Server to Client''<br />
<br />
Sent when a client is to play a sound or particle effect.<br />
<br />
By default, the minecraft client adjusts the volume of sound effects based on distance. The final boolean field is used to disable this, and instead the effect is played from 2 blocks away in the correct direction. Currently this is only used for effect 1013 (mob.wither.spawn), and is ignored for any other value by the client.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x3D<br />
| Effect ID<br />
| int<br />
| 1003<br />
| The ID of the effect, see below.<br />
|-<br />
| X<br />
| int<br />
|<br />
| The X location of the effect.<br />
|-<br />
| Y<br />
| byte<br />
|<br />
| The Y location of the effect.<br />
|-<br />
| Z<br />
| int<br />
|<br />
| The Z location of the effect.<br />
|-<br />
| Data<br />
| int<br />
| 0<br />
| Extra data for certain effects, see below.<br />
|-<br />
| Disable relative volume<br />
| boolean<br />
| false<br />
| See above<br />
|-<br />
| Total Size:<br />
| colspan="4" | 19 bytes<br />
|}<br />
<br />
====Effects====<br />
<br />
'''Sound''':<br />
<br />
*1000: <code>random.click</code><br />
*1001: <code>random.click</code><br />
*1002: <code>random.bow</code><br />
*1003: <code>random.door_open</code> or <code>random.door_close</code> (50/50 chance)<br />
*1004: <code>random.fizz</code><br />
*1005: Play a music disc. '''Data''': [http://www.minecraftwiki.net/wiki/Music_Discs Record ID]<br />
*''(1006 not assigned)''<br />
*1007: <code>mob.ghast.charge</code><br />
*1008: <code>mob.ghast.fireball</code><br />
*1009: <code>mob.ghast.fireball</code>, but with a lower volume.<br />
*1010: <code>mob.zombie.wood</code><br />
*1011: <code>mob.zombie.metal</code><br />
*1012: <code>mob.zombie.woodbreak</code><br />
*1013: <code>mob.wither.spawn</code><br />
*1014: <code>mob.wither.shoot</code><br />
*1015: <code>mob.bat.takeoff</code><br />
*1016: <code>mob.zombie.infect</code><br />
*1017: <code>mob.zombie.unfect</code><br />
*1018: <code>mob.enderdragon.end</code><br />
*1020: <code>random.anvil_break</code><br />
*1021: <code>random.anvil_use</code><br />
*1022: <code>random.anvil_land</code><br />
<br />
'''Particle''':<br />
<br />
*2000: Spawns 10 smoke particles, e.g. from a fire. '''Data''': direction, see below<br />
*2001: Block break. '''Data''': [http://www.minecraftwiki.net/wiki/Data_values Block ID]<br />
*2002: Splash potion. Particle effect + glass break sound. '''Data''': [http://www.lb-stuff.com/Minecraft/PotionDataValues1.9pre3.txt Potion ID]<br />
*2003: Eye of ender. Actual client effect to be determined.<br />
*2004: Mob spawn particle effect: smoke + flames<br />
*2005: Spawn "happy villager" effect (hearts).<br />
<br />
Smoke directions:<br />
<br />
{| class="wikitable"<br />
|-<br />
| ID<br />
| Direction<br />
|-<br />
| 0<br />
| South - East<br />
|-<br />
| 1<br />
| South<br />
|-<br />
| 2<br />
| South - West<br />
|-<br />
| 3<br />
| East<br />
|-<br />
| 4<br />
| (Up or middle ?)<br />
|-<br />
| 5<br />
| West<br />
|-<br />
| 6<br />
| North - East<br />
|-<br />
| 7<br />
| North<br />
|-<br />
| 8<br />
| North - West<br />
|}<br />
<br />
{{anchor|0x3E}}<br />
<br />
=== Named Sound Effect (0x3E) ===<br />
''Server to client''<br />
<br />
Used to play a sound effect on the client.<br />
<br />
All known sound effect names can be seen [https://github.com/SirCmpwn/Craft.Net/blob/master/Craft.Net.Data/SoundEffect.cs here].<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x3E<br />
| Sound name<br />
| string<br />
| step.grass<br />
| 250<br />
|-<br />
| Effect position X<br />
| int<br />
| 250<br />
| effect X multiplied by 8<br />
|-<br />
| Effect position Y<br />
| int<br />
| 250<br />
| effect Y multiplied by 8<br />
|-<br />
| Effect position Z<br />
| int<br />
| 250<br />
| effect Z multiplied by 8<br />
|-<br />
| Volume<br />
| float<br />
| 9<br />
| 1 is 100%, can be more<br />
|-<br />
| Pitch<br />
| byte<br />
| 1<br />
| 63 is 100%, can be more<br />
|-<br />
| Total Size:<br />
| colspan="4" | 20 bytes + length of string<br />
|}<br />
<br />
{{anchor|0x3F}}<br />
=== Particle (0x3F) ===<br />
''Server to Client''<br />
<br />
This displays the named particle<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="9" | 0x3F<br />
| Particle name<br />
| string<br />
| <code>hugeexplosion</code><br />
| The name of the particle to create. A list can be found [https://gist.github.com/thinkofdeath/5110835 here]<br />
|-<br />
| X<br />
| float<br />
| 0<br />
| X position of the particle<br />
|-<br />
| Y<br />
| float<br />
| 0<br />
| Y position of the particle<br />
|-<br />
| Z<br />
| float<br />
| 0<br />
| Z position of the particle<br />
|-<br />
| Offset X<br />
| float<br />
| 0<br />
| This is added to the X position after being multiplied by random.nextGaussian() <br />
|-<br />
| Offset Y<br />
| float<br />
| 0<br />
| This is added to the Y position after being multiplied by random.nextGaussian() <br />
|-<br />
| Offset Z<br />
| float<br />
| 0<br />
| This is added to the Z position after being multiplied by random.nextGaussian() <br />
|-<br />
| Particle speed<br />
| float<br />
| 0<br />
| The speed of each particle<br />
|-<br />
| Number of particles<br />
| int<br />
| 0<br />
| The number of particles to create<br />
|-<br />
| Total Size:<br />
| colspan="4" | 34 bytes + length of string<br />
|}<br />
<br />
{{anchor|0x46}}<br />
=== Change Game State (0x46) ===<br />
''Server to Client''<br />
<br />
This packet appeared with protocol version 10. Currently, it appears when a bed can't be used as a spawn point and when the rain state changes. it could have additional uses in the future.<br />
<br />
The class has an array of strings linked to reason codes 0, 1, 2, and 3 but only the codes for 1 and 2 are null.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x46<br />
| Reason<br />
| byte<br />
| 0<br />
|<br />
|-<br />
| Game mode<br />
| byte<br />
| 0<br />
| Used only when reason = 3. 0 is survival, 1 is creative.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes<br />
|}<br />
<br />
'''Reason codes'''<br />
<br />
{| class="wikitable"<br />
|-<br />
! Code<br />
! Effect<br />
! Text<br />
|-<br />
| 0<br />
| Invalid Bed<br />
| "tile.bed.notValid"<br />
|-<br />
| 1<br />
| Begin raining<br />
| null<br />
|-<br />
| 2<br />
| End raining<br />
| null<br />
|-<br />
| 3<br />
| Change game mode<br />
| gameMode.changed<br />
|-<br />
| 4<br />
| Enter credits<br />
|<br />
|}<br />
<br />
{{anchor|0x47}}<br />
=== Spawn Global Entity (0x47) ===<br />
''Server to Client''<br />
<br />
With this packet, the server notifies the client of thunderbolts striking within a 512 block radius around the player. The coordinates specify where exactly the thunderbolt strikes.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0x47<br />
| Entity ID<br />
| int<br />
| 4<br />
| The entity ID of the thunderbolt<br />
|-<br />
| Type<br />
| byte<br />
| 1<br />
| The global entity type, currently always 1 for thunderbolt.<br />
|-<br />
| X<br />
| int<br />
| 133<br />
| Thunderbolt X as Absolute Integer<br />
|-<br />
| Y<br />
| int<br />
| 913<br />
| Thunderbolt Y as Absolute Integer<br />
|-<br />
| Z<br />
| int<br />
| 63552<br />
| Thunderbolt Z as Absolute Integer<br />
|-<br />
| Total Size:<br />
| colspan="4" | 18 bytes<br />
|}<br />
<br />
{{anchor|0x64}}<br />
<br />
=== Open Window (0x64) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should open an inventory, such as a chest, workbench, or furnace. This message is not sent anywhere for clients opening their own inventory.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x64<br />
| Window id<br />
| byte<br />
| 123<br />
| A unique id number for the window to be displayed. Notchian server implementation is a counter, starting at 1.<br />
|-<br />
| Inventory Type<br />
| byte<br />
| 2<br />
| The window type to use for display. Check below<br />
|-<br />
| Window title<br />
| string<br />
| <code>Chest</code><br />
| The title of the window.<br />
|-<br />
| Number of Slots<br />
| byte<br />
| 3<br />
| Number of slots in the window (excluding the number of slots in the player inventory).<br />
|-<br />
| Use provided window title<br />
| boolean<br />
| 1<br />
| If false, the client will look up a string like "window.minecart". If true, the client uses what the server provides.<br />
|-<br />
| entityId<br />
| int<br />
| 0<br />
| EntityHorse's entityId. Only sent when window type is equal to 11 (AnimalChest).<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 bytes + length of string<br />
|}<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information.<br />
<br />
{{anchor|0x65}}<br />
<br />
=== Close Window (0x65) ===<br />
''Two-Way''<br />
<br />
This packet is sent by the client when closing a window. This packet is sent from the server to the client when a window is forcibly closed, such as when a chest is destroyed while it's open.<br />
<br />
Note, notchian clients send a close window message with window id 0 to close their inventory even though there is never an Open Window message for inventory. <br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0x65<br />
| Window id<br />
| byte<br />
| 0<br />
| This is the id of the window that was closed. 0 for inventory.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 bytes<br />
|}<br />
<br />
{{anchor|0x66}}<br />
=== Click Window (0x66) ===<br />
''Client to Server''<br />
<br />
This packet is sent by the player when it clicks on a slot in a window.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x66<br />
| Window id<br />
| byte<br />
| <code>0</code><br />
| The id of the window which was clicked. 0 for player inventory.<br />
|-<br />
| Slot<br />
| short<br />
| <code>36</code><br />
| The clicked slot. See below.<br />
|-<br />
| Button<br />
| byte<br />
| <code>1</code><br />
| The button used in the click. See below.<br />
|-<br />
| Action number<br />
| short<br />
| <code>12</code><br />
| A unique number for the action, used for transaction handling (See the Transaction packet).<br />
|-<br />
| Mode<br />
| byte<br />
| <code>1</code><br />
| Inventory operation mode. See below.<br />
|-<br />
| Clicked item<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 8 bytes + slot data<br />
|}<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.<br />
<br />
When right-clicking on a stack of items, half the stack will be picked up and half left in the slot. If the stack is an odd number, the half left in the slot will be smaller of the amounts.<br />
<br />
The Action number is actually a counter, starting at 1. This number is used by the server as a transaction ID to send back a [[#0x6A|Transaction packet]].<br />
<br />
The distinct type of click performed by the client is determined by the combination of the "Mode" and "Button" fields.<br />
{| class="wikitable"<br />
|-<br />
! Mode<br />
! Button<br />
! Slot<br />
! Trigger<br />
|-<br />
! rowspan="2" | 0<br />
| 0<br />
| N/A<br />
| Left mouse click<br />
|-<br />
| 1<br />
| N/A<br />
| Right mouse click<br />
|-<br />
! rowspan="2" | 1<br />
| 0<br />
| N/A<br />
| Shift + left mouse click<br />
|-<br />
| 1<br />
| N/A<br />
| Shift + right mouse click ''(Identical behavior)''<br />
|-<br />
! rowspan="5" | 2<br />
| 0<br />
| N/A<br />
| Number key 1<br />
|-<br />
| 1<br />
| N/A<br />
| Number key 2<br />
|-<br />
| 2<br />
| N/A<br />
| Number key 3<br />
|-<br />
| ...<br />
| ...<br />
| ...<br />
|-<br />
| 8<br />
| N/A<br />
| Number key 9<br />
|-<br />
! rowspan="1" | 3<br />
| 2<br />
| N/A<br />
| Middle click<br />
|-<br />
! rowspan="4" | 4<br />
| 0<br />
| Not -999<br />
| Drop key (Q)<br />
|-<br />
| 1<br />
| Not -999<br />
| Ctrl + Drop key (Ctrl-Q)<br />
|-<br />
| 0<br />
| -999<br />
| Left click outside inventory holding nothing ''(No-op)''<br />
|-<br />
| 1<br />
| -999<br />
| Right click outside inventory holding nothing ''(No-op)''<br />
|-<br />
! rowspan="6" | 5<br />
| 0<br />
| -999<br />
| Starting left mouse paint ''(Or middle mouse)''<br />
|-<br />
| 4<br />
| -999<br />
| Starting right mouse paint<br />
|-<br />
| 1<br />
| Not -999<br />
| Left mouse painting progress<br />
|-<br />
| 5<br />
| Not -999<br />
| Right mouse painting progress<br />
|-<br />
| 2<br />
| -999<br />
| Ending left mouse paint<br />
|-<br />
| 6<br />
| -999<br />
| Ending right mouse paint<br />
|-<br />
! 6<br />
| 0<br />
| N/A<br />
| Double click<br />
|}<br />
<br />
Starting from version 1.5, "painting mode" is available for use in inventory windows. It is done by picking up stack of something (more than 1 items), then holding mouse button (left, right or middle) and dragging holded stack over empty (or same type in case of right button ) slots. In that case client sends the following to server after mouse button release (omitting first pickup packet which is sent as usual):<br />
<br />
# packet with mode 5, slot -999 , button (0 for left | 4 for right);<br />
# packet for every slot painted on, mode is still 5, button (1 | 5);<br />
# packet with mode 5, slot -999, button (2 | 6);<br />
<br />
If any of the painting packets other than the "progress" ones are sent out of order (for example, a start, some slots, then another start; or a left-click in the middle) the painting status will be reset.<br />
<br />
{{anchor|0x67}}<br />
<br />
=== Set Slot (0x67) ===<br />
''Server to Client''<br />
<br />
Sent by the server when an item in a slot (in a window) is added/removed.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x67<br />
| Window id<br />
| byte<br />
| <code>0</code><br />
| The window which is being updated. 0 for player inventory. Note that all known window types include the player inventory. This packet will only be sent for the currently opened window while the player is performing actions, even if it affects the player inventory. After the window is closed, a number of these packets are sent to update the player's inventory window (0).<br />
|-<br />
| Slot<br />
| short<br />
| <code>36</code><br />
| The slot that should be updated<br />
|-<br />
| Slot data<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 4 bytes + slot data<br />
|}<br />
<br />
Note that if window ID and slot are both -1, it means the item currently attached to the cursor.<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.<br />
<br />
Slots: [http://gyazo.com/9d52e1fd4dc14790ec66eab4a9aee00e.png]<br />
<br />
{{anchor|0x68}}<br />
=== Set Window Items (0x68) ===<br />
''Server to Client''<br />
<br />
[[File:Inventory-slots.png|thumb|The inventory slots]]<br />
<br />
Sent by the server when an item in a slot (in a window) is added/removed. This includes the main inventory, equipped armour and crafting slots. <br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x68<br />
| Window id<br />
| byte<br />
| <code>1</code><br />
| The id of window which items are being sent for. 0 for player inventory.<br />
|-<br />
| Count<br />
| short<br />
| <code>4</code><br />
| The number of slots (see below)<br />
|-<br />
| Slot data<br />
| array of [[Slot_Data|slot]]s<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 4 bytes + size of slot data array<br />
|}<br />
<br />
See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed.<br />
<br />
{{anchor|0x69}}<br />
=== Update Window Property (0x69) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x69<br />
| Window id<br />
| byte<br />
| 2<br />
| The id of the window.<br />
|-<br />
| Property<br />
| short<br />
| 1<br />
| Which property should be updated.<br />
|-<br />
| Value<br />
| short<br />
| 650<br />
| The new value for the property.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes<br />
|}<br />
<br />
'''Furnace'''<br />
<br />
Properties:<br />
<br />
* 0: Progress arrow<br />
* 1: Fire icon (fuel)<br />
<br />
Values:<br />
<br />
* 0-200 for progress arrow<br />
* 0-200 for fuel indicator<br />
<br />
Ranges are presumably in in-game ticks<br />
<br />
'''Enchantment Table'''<br />
<br />
Properties: 0, 1 or 2 depending on the "enchantment slot" being given.<br />
<br />
Values: The enchantment's level.<br />
<br />
{{anchor|0x6A}}<br />
=== Confirm Transaction (0x6A) ===<br />
''Two-Way''<br />
<br />
A packet from the server indicating whether a request from the client was accepted, or whether there was a conflict (due to lag). This packet is also sent from the client to the server in response to a server transaction rejection packet.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0x6A<br />
| Window ID<br />
| byte<br />
| 0<br />
| The id of the window that the action occurred in.<br />
|-<br />
| Action number<br />
| short<br />
| 12<br />
| Every action that is to be accepted has a unique number. This field corresponds to that number.<br />
|-<br />
| Accepted?<br />
| boolean<br />
| true<br />
| Whether the action was accepted.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes<br />
|}<br />
<br />
{{anchor|0x6B}}<br />
<br />
=== Creative Inventory Action (0x6B) ===<br />
''Two-Way''<br />
<br />
While the user is in the standard inventory (i.e., not a crafting bench) on a creative-mode server then the server will send this packet:<br />
<br />
* <div class="li"> If an item is dropped into the quick bar</div><br />
* If an item is picked up from the quick bar (item id is -1)<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x6B<br />
| Slot<br />
| short<br />
| 36<br />
| Inventory slot<br />
|-<br />
| Clicked item<br />
| [[Slot_Data|slot]]<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes + slot data<br />
|}<br />
<br />
{{anchor|0x6C}}<br />
=== Enchant Item (0x6C) ===<br />
''Client to Server''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0x6C<br />
| Window ID<br />
| byte<br />
| 1<br />
| The ID sent by [[#0x64|Open Window]]<br />
|-<br />
| Enchantment<br />
| byte<br />
| 0<br />
| The position of the enchantment on the enchantment table window, starting with 0 as the topmost one.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes<br />
|}<br />
<br />
{{anchor|0x82}}<br />
=== Update Sign (0x82) ===<br />
''Two-Way''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="7" | 0x82<br />
| X<br />
| int<br />
| 128<br />
| Block X Coordinate<br />
|-<br />
| Y<br />
| short<br />
| 0<br />
| Block Y Coordinate<br />
|-<br />
| Z<br />
| int<br />
| -128<br />
| Block Z Coordinate<br />
|-<br />
| Text1<br />
| string<br />
| <code>First line</code><br />
| First line of text in the sign<br />
|-<br />
| Text2<br />
| string<br />
| <code>Second line</code><br />
| Second line of text in the sign<br />
|-<br />
| Text3<br />
| string<br />
| <code>Third line</code><br />
| Third line of text in the sign<br />
|-<br />
| Text4<br />
| string<br />
| <code>Fourth line</code><br />
| Fourth line of text in the sign<br />
|-<br />
| Total Size:<br />
| colspan="4" | 11 bytes + 4 strings<br />
|}<br />
<br />
This message is sent from the server to the client whenever a sign is discovered or created. This message is sent from the client to the server when the "Done" button is pushed after placing a sign. This message is NOT sent when a sign is destroyed or unloaded.<br />
<br />
{{anchor|0x83}}<br />
=== Item Data (0x83) ===<br />
''Server to Client''<br />
<br />
Sent to specify complex data on an item; currently used only for maps.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x83<br />
| Item Type<br />
| short<br />
| <code>358</code><br />
| Type of item being modified<br />
|-<br />
| Item ID<br />
| short<br />
| <code>0</code><br />
| The ID (damage value) of the item being modified<br />
|-<br />
| Text length<br />
| short<br />
| <code>35</code><br />
| Length of following byte array<br />
|-<br />
| Text<br />
| byte array<br />
| {0,0,0,20,20,20,20,20}<br />
| ASCII text.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + Text length<br />
|}<br />
<br />
'''Maps'''<br />
If the first byte of the text is 0, the next two bytes are X start and Y start and the rest of the bytes are the colors in that column.<br />
<br />
If the first byte of the text is 1, the rest of the bytes are in groups of three: (data, x, y). The lower half of the data is the type (always 0 under vanilla) and the upper half is the direction.<br />
<br />
{{anchor|0x84}}<br />
=== Update Tile Entity (0x84) ===<br />
''Server to Client''<br />
<br />
Essentially a block update on a tile entity.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="6" | 0x84<br />
| X<br />
| int<br />
|<br />
|<br />
|-<br />
| Y<br />
| short<br />
|<br />
|<br />
|-<br />
| Z<br />
| int<br />
|<br />
|<br />
|-<br />
| Action<br />
| byte<br />
|<br />
| The type of update to perform<br />
|-<br />
| Data length<br />
| Short<br />
|<br />
| Varies<br />
|-<br />
| NBT Data<br />
| Byte Array<br />
|<br />
| Present if data length > 0. Compressed with [[wikipedia:Gzip|gzip]]. Varies<br />
|-<br />
| Total Size:<br />
| colspan="4" | 12 + itemstack bytes<br />
|}<br />
<br />
'''Actions'''<br />
<br />
* '''1''': Set mob displayed inside a mob spawner. Custom 1 contains the [[Entities#Mobs|mob type]]<br />
<br />
{{anchor|0x85}}<br />
<br />
=== Tile Editor Open? (0x85) ===<br />
''Server to Client''<br />
<br />
Sent on placement of sign.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0x85<br />
| Tile Entity Id<br />
| byte<br />
| <code>0</code><br />
| Always seems to be 0 (TileEntitySign)<br />
|-<br />
| X<br />
| int<br />
| <code>70</code><br />
| X in block coordinates<br />
|-<br />
| Y<br />
| int<br />
| <code>70</code><br />
| Y in block coordinates<br />
|-<br />
| Z<br />
| int<br />
| <code>-46</code><br />
| Z in block coordinates<br />
|-<br />
| Total Size:<br />
| colspan="4" | 14 bytes<br />
|}<br />
<br />
{{anchor|0xC8}}<br />
<br />
=== Increment Statistic (0xC8) ===<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0xC8<br />
| Statistic ID<br />
| int<br />
| 1003<br />
| The ID of the statistic. See [http://www.minecraftwiki.net/wiki/Statistics List of statistics].<br />
|-<br />
| Amount<br />
| '''int'''<br />
| 1<br />
| The amount to increment the statistic.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes<br />
|}<br />
<br />
{{anchor|0xC9}}<br />
<br />
=== Player List Item (0xC9) ===<br />
''Server to Client''<br />
<br />
Sent by the notchian server to update the user list (<tab> in the client). The server sends one packet per user per tick, amounting to 20 packets/s for 1 online user, 40 for 2, and so forth.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xC9<br />
| Player name<br />
| string<br />
| barneygale<br />
| Supports chat colouring, limited to 16 characters.<br />
|-<br />
| Online<br />
| boolean<br />
| true<br />
| If false, the client will remove the user from the list.<br />
|-<br />
| Ping<br />
| short<br />
| 193<br />
| Ping, presumably in ms.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xCA}}<br />
=== Player Abilities (0xCA) ===<br />
''Two-Way''<br />
<br />
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.<br />
<br />
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).<br />
<br />
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.<br />
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.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xCA<br />
| Flags<br />
| byte<br />
| 5<br />
|<br />
|-<br />
| Flying speed*<br />
| '''float'''<br />
| '''0.05'''<br />
| previous integer value divided by 250<br />
|-<br />
| Walking speed*<br />
| '''float'''<br />
| '''0.1'''<br />
| previous integer value divided by 250<br />
|-<br />
| Total Size:<br />
| colspan="4" | 10 bytes<br />
|}<br />
<br />
The client ignores the walking speed and flying speed fields. Send an 0x2C packet as well.<br />
<br />
{{anchor|0xCB}}<br />
=== Tab-complete (0xCB) ===<br />
''Two-way''<br />
<br />
Sent C->S when the user presses [tab] while writing text. The payload contains all text behind the cursor.<br />
<br />
The server responds with an auto-completion of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported.<br />
<br />
In the event of more than one possible completion, the server responds with the options packed into the single string field, separated by a null character. Note that as strings are UTF-16, this is two bytes wide.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0xCB<br />
| Text<br />
| string<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xCC}}<br />
=== Client Settings (0xCC) ===<br />
''Client to server''<br />
<br />
Sent when the player connects, or when settings are changed.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0xCC<br />
| Locale<br />
| string<br />
| en_GB<br />
|<br />
|-<br />
| View distance<br />
| byte<br />
| 0<br />
| 0-3 for 'far', 'normal', 'short', 'tiny'.<br />
|-<br />
| Chat flags<br />
| byte<br />
| 8<br />
| Chat settings. See notes below.<br />
|-<br />
| Difficulty<br />
| byte<br />
| 0<br />
| Client-side difficulty from options.txt<br />
|-<br />
| Show Cape<br />
| boolean<br />
| true<br />
| Client-side "show cape" option<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + length of string<br />
|}<br />
<br />
Chat flags has several values packed into one byte.<br />
<br />
'''Chat Enabled:''' Bits 0-1. 00: Enabled. 01: Commands only. 10: Hidden.<br />
<br />
'''Colors Enabled:''' Bit 3. 0: Disabled. 1: Enabled.<br />
<br />
{{anchor|0xCD}}<br />
=== Client Statuses (0xCD) ===<br />
''Client to server''<br />
<br />
Sent when the client is ready to complete login and when the client is ready to respawn after death.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="1" | 0xCD<br />
| Payload<br />
| byte<br />
| 0<br />
| Bit field. 0: Initial spawn, 1: Respawn after death<br />
|-<br />
| Total Size:<br />
| colspan="5" | 2 bytes<br />
|}<br />
<br />
{{anchor|0xCE}}<br />
=== Scoreboard Objective (0xCE) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should create a new scoreboard or remove one.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xCE<br />
| Objective name<br />
| string<br />
| <code>deaths</code><br />
| An unique name for the objective<br />
|-<br />
| Objective value<br />
| string<br />
| <code>Deaths</code><br />
| The text to be displayed for the score.<br />
|-<br />
| Create/Remove<br />
| byte<br />
| 0<br />
| 0 to create the scoreboard. 1 to remove the scoreboard. 2 to update the display text. TODO: Check these values<br />
|-<br />
| Total Size:<br />
| colspan="4" | 6 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xCF}}<br />
=== Update Score (0xCF) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should update a scoreboard item.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0xCF<br />
| Item Name<br />
| string<br />
| <code>Bob</code><br />
| An unique name to be displayed in the list.<br />
|-<br />
| Update/Remove<br />
| byte<br />
| 0<br />
| 0 to create/update an item. 1 to remove an item.<br />
|-<br />
| Score Name<br />
| string<br />
| <code>deaths</code><br />
| The unique name for the scoreboard to be updated. Only sent when Update/Remove does not equal 1.<br />
|-<br />
| Value<br />
| int<br />
| 5<br />
| The score to be displayed next to the entry. Only sent when Update/Remove does not equal 1.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 9 bytes + length of strings<br />
|}<br />
<br />
{{anchor|0xD0}}<br />
<br />
=== Display Scoreboard (0xD0) ===<br />
''Server to Client''<br />
<br />
This is sent to the client when it should display a scoreboard.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="2" | 0xD0<br />
| Position<br />
| byte<br />
| 1<br />
| The position of the scoreboard. 0 = list, 1 = sidebar, 2 = belowName.<br />
|-<br />
| Score Name<br />
| string<br />
| <code>deaths</code><br />
| The unique name for the scoreboard to be displayed.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 4 bytes + length of string<br />
|}<br />
<br />
{{anchor|0xD1}}<br />
=== Teams (0xD1) ===<br />
''Server to Client''<br />
<br />
Creates and updates teams.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="8" | 0xD1<br />
| Team Name<br />
| string<br />
| mcdevs<br />
| A unique name for the team. (Shared with scoreboard).<br />
|-<br />
| Mode<br />
| byte<br />
| 0<br />
| If 0 then the team is created. <br />
If 1 then the team is removed. <br />
<br />
If 2 the team team information is updated. <br />
<br />
If 3 then new players are added to the team. <br />
<br />
If 4 then players are removed from the team.<br />
|-<br />
| Team Display Name<br />
| string<br />
| McDevs<br />
| Only if Mode = 0 or 2. <br />
|-<br />
| Team Prefix<br />
| string<br />
|<br />
| Only if Mode = 0 or 2. Displayed before the players' name that are part of this team. <br />
|-<br />
| Team Suffix<br />
| string<br />
|<br />
| Only if Mode = 0 or 2. Displayed after the players' name that are part of this team. <br />
|-<br />
| Friendly fire<br />
| byte<br />
| 0<br />
| Only if Mode = 0 or 2; 0 for off, 1 for on, 3 for seeing friendly invisibles<br />
|-<br />
| Player count<br />
| short<br />
| 0<br />
| Only if Mode = 0 or 3 or 4. Number of players in the array<br />
|-<br />
| Players<br />
| Array of strings<br />
|<br />
| Only if Mode = 0 or 3 or 4. Players to be added/remove from the team.<br />
|-<br />
| Total Size:<br />
| colspan="4" | Variable<br />
|}<br />
<br />
{{anchor|0xFA}}<br />
=== Plugin Message (0xFA) ===<br />
''Two-Way''<br />
<br />
Mods and plugins can use this to send their data. As of 1.3, Minecraft itself uses a number of [[plugin channel]]s. These internal channels are prefixed with <code>MC|</code>.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="3" | 0xFA<br />
| Channel<br />
| string<br />
| MyMod:testchannel<br />
| Name of the "channel" used to send the data.<br />
|-<br />
| length<br />
| short<br />
|<br />
| Length of the following byte array<br />
|-<br />
| data<br />
| byte array<br />
|<br />
| Any data.<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes + length of string + length of byte array<br />
|}<br />
<br />
More documentation on this: http://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/<br />
<br />
{{anchor|0xFC}}<br />
=== Encryption Key Response (0xFC) ===<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on this packet. Bypassing the encryption is possible, authentication for the player name is still needed if the server is in online mode, but instead of sending this packet, you send [[#0xCD|Client Statuses]] instead.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="4" | 0xFC<br />
| Shared secret length<br />
| short<br />
|<br />
|<br />
|-<br />
| Shared secret<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Verify token length<br />
| short<br />
|<br />
|<br />
|-<br />
| Verify token response<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 5 bytes + length of shared secret + length of token<br />
|}<br />
<br />
{{anchor|0xFD}}<br />
=== Encryption Key Request (0xFD) ===<br />
''Server to client''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="5" | 0xFD<br />
| Server id<br />
| string<br />
|<br />
|<br />
|-<br />
| Public key length<br />
| short<br />
|<br />
|<br />
|-<br />
| Public key<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Verify token length<br />
| short<br />
|<br />
|<br />
|-<br />
| Verify token<br />
| byte array<br />
|<br />
|<br />
|-<br />
| Total Size:<br />
| colspan="4" | 7 bytes + length of string + length of key + length of token<br />
|}<br />
<br />
{{anchor|0xFE}}<br />
<br />
=== Server List Ping (0xFE) ===<br />
''Client to Server''<br />
<br />
''Main article: [[Server List Ping]]''<br />
<br />
This packet is used by the multiplayer menu to retrieve MOTD, version, and player counts.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| rowspan="1" | 0xFE<br />
| Magic<br />
| byte<br />
| <code>1</code><br />
| always <code>1</code><br />
|-<br />
| Total Size:<br />
| colspan="4" | 2 bytes<br />
|}<br />
<br />
{{anchor|0xFF}}<br />
<br />
=== Disconnect/Kick (0xFF) ===<br />
''Two-Way''<br />
<br />
Sent by the server before it disconnects a client, or by the client before it disconnects from the server. The receiver of this packet assumes that the sender has already closed the connection by the time the packet arrives.<br />
<br />
Due to race conditions in the client, a local server may need to pause for a short period after sending this packet before closing the connection. An alternative is simply not to close the connection, and wait for the client to do so on receipt of this packet.<br />
<br />
When vanilla client quits, reason is "Quitting", but any reason is ok.<br />
<br />
{| class="wikitable"<br />
|-<br />
| Packet ID<br />
| Field Name<br />
| Field Type<br />
| Example<br />
| Notes<br />
|-<br />
| 0xFF<br />
| Reason<br />
| string<br />
| <code>The server is full!</code><br />
| Displayed to the client when the connection terminates<br />
|-<br />
| Total Size:<br />
| colspan="4" | 3 bytes + length of strings<br />
|}<br />
<br />
== See Also ==<br />
* [[Protocol History]]<br />
* [[Data Types]]<br />
* [[Units of Measurement]]<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Game_files&diff=4212Game files2013-07-22T05:16:36Z<p>Sadimusi: </p>
<hr />
<div>== Game ==<br />
All available version of the game itself are listed on<br />
http://s3.amazonaws.com/Minecraft.Download/versions/versions.json<br />
<br />
The jar file for a specific version is located at<br />
http://s3.amazonaws.com/Minecraft.Download/versions/<version>/<version>.jar<br />
<br />
Some information on how to properly run said jar is available at<br />
http://s3.amazonaws.com/Minecraft.Download/versions/<version>/<version>.json<br />
<br />
== Libraries ==<br />
The libraries which can be used for all minecraft versions and are downloaded by the launcher are located at<br />
http://s3.amazonaws.com/MinecraftDownload/<br />
<br />
The json file downloaded above is used in order to determine which libraries to download. Inside the file is a key, <code>libraries</code> which contains information about each library required.<br />
Example:<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1-nightly-20130708-debug3",<br />
"natives": {<br />
"linux": "natives-linux",<br />
"windows": "natives-windows",<br />
"osx": "natives-osx"<br />
},<br />
"extract": {<br />
"exclude": [<br />
"META-INF/"<br />
]<br />
},<br />
"rules": [<br />
{<br />
"action": "allow",<br />
"os": {<br />
"name": "osx",<br />
"version": "^10\\.5\\.\\d$"<br />
}<br />
}<br />
]<br />
}<br />
</syntaxhighlight><br />
<br />
The <code>name</code> key is used to determine the url from which to download the library from. The format of this string is<br />
<package>:<name>:<version><br />
The corresponding URL would look like this:<br />
<package>/<name>/<version>/<name>-<version>.jar<br />
where <code>path</code> is the result of replacing all the periods in <code>package</code> with slashes.<br />
<br />
<br />
The <code>natives</code> key provides a string for each specific platform to be inserted between the .jar and the <version> of the filename, resulting in a filename with the format:<br />
<name>-<version>-<native-string>.jar</code><br />
This is applied to any file with the <code>natives</code> key.<br />
<br />
<br />
The <code>extract</code> key provides rules for the extraction of the file.<br />
<br />
<br />
The <code>rules</code> key is used to determine which platforms to download the file to. When the <code>action</code> is <code>allow</code>, the file will be downloaded to the platform stated in <code>os</code>. When the <code>action</code> is <code>disallow</code>, the file will not be downloaded to the platform stated in <code>os</code>. If there is no <code>os</code> key, the rule is default for non-specified platforms.<br />
<br />
<br />
In the example above, on an OS X platform, the full download path would be<br />
https://s3.amazonaws.com/Minecraft.Download/libraries/org/lwjgl/lwjgl/lwjgl-platform/2.9.1-nightly-20130708-debug3/lwjgl-platform-2.9.1-nightly-20130708-debug3-natives-osx.jar</code><br />
The file would be extracted but the <code>META-INF</code> file would not be. Additionally, the file would only be downloaded if the computer was running OS X 10.5.<br />
<br />
== Assets == <br />
The game itself downloads further resources from<br />
http://s3.amazonaws.com/MinecraftResources/<br />
<br />
A list of all available resources is available as an XML file at the address above. These files do not have to be downloaded in order for the game to function properly.<br />
<br />
<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Game_files&diff=4211Game files2013-07-22T04:05:41Z<p>Sadimusi: Proxy edit by stephenmac7</p>
<hr />
<div>== Game ==<br />
All available version of the game itself are listed on<br />
http://s3.amazonaws.com/Minecraft.Download/versions/versions.json<br />
<br />
The jar file for a specific version is located at<br />
http://s3.amazonaws.com/Minecraft.Download/versions/<version>/<version>.jar<br />
<br />
Some information on how to properly run said jar is available at<br />
http://s3.amazonaws.com/Minecraft.Download/versions/<version>/<version>.json<br />
<br />
== Libraries ==<br />
The libraries which can be used for all minecraft versions and are downloaded by the launcher are located at<br />
http://s3.amazonaws.com/MinecraftDownload/<br />
<br />
The json file downloaded above is used in order to determine which libraries to download. Inside the file is a key, <code>libraries</code> which contains information about each library required.<br />
Example:<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1-nightly-20130708-debug3",<br />
"natives": {<br />
"linux": "natives-linux",<br />
"windows": "natives-windows",<br />
"osx": "natives-osx"<br />
},<br />
"extract": {<br />
"exclude": [<br />
"META-INF/"<br />
]<br />
},<br />
"rules": [<br />
{<br />
"action": "allow",<br />
"os": {<br />
"name": "osx",<br />
"version": "^10\\.5\\.\\d$"<br />
}<br />
}<br />
]<br />
}<br />
</syntaxhighlight><br />
<br />
The <code>name</code> key is used to determine the url from which to download the library from. The format of this string is <code><package>:<name>:<version></code> and can be turned into a path by replacing the periods in the package name with forward slashes and formatting a string with the template: <code><package>/<name>/<version>/<name>-<version>.jar</code>.<br />
<br />
The <code>natives</code> key provides a string for each specific platform to be inserted between the .jar and the <version> of the filename, resulting in a filename with the format: <code><name>-<version>-<native-string>.jar</code>. This is applied to any file with the <code>natives</code> key.<br />
<br />
The <code>extract</code> key provides rules for the extraction of the file.<br />
<br />
The <code>rules</code> key is used to determine which platforms to download the file to. When the <code>action</code> is <code>allow</code>, the file will be downloaded to the platform stated in <code>os</code>. When the <code>action</code> is <code>disallow</code>, the file will not be downloaded to the platform stated in <code>os</code>. If there is no <code>os</code> key, the rule is default for non-specified platforms.<br />
<br />
In the example above, on an OSX platform, the full download path would be <code>https://s3.amazonaws.com/Minecraft.Download/libraries/org/lwjgl/lwjgl/lwjgl-platform/2.9.1-nightly-20130708-debug3/lwjgl-platform-2.9.1-nightly-20130708-debug3-natives-osx.jar</code>, the file would be extracted but the <code>META-INF</code> file would not be. Additionally, the file would only be downloaded if the computer was running OSX 10.5.<br />
<br />
<br />
== Assets == <br />
The game itself downloads further resources from<br />
http://s3.amazonaws.com/MinecraftResources/<br />
<br />
A list of all available resources is available as an XML file at the address above. These files do not have to be downloaded in order for the game to function properly.<br />
<br />
<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Game_files&diff=4203Game files2013-07-17T21:53:41Z<p>Sadimusi: /* Game */ typo</p>
<hr />
<div>== Game ==<br />
All available version of the game itself are listed on<br />
http://s3.amazonaws.com/Minecraft.Download/versions/versions.json<br />
<br />
The jar file for a specific version is located at<br />
http://s3.amazonaws.com/Minecraft.Download/versions/<version>/<version>.jar<br />
<br />
Some information on how to properly run said jar is available at<br />
http://s3.amazonaws.com/Minecraft.Download/versions/<version>/<version>.json<br />
<br />
== Libraries ==<br />
The libraries which can be used for all minecraft versions and are downloaded by the launcher are located at<br />
http://s3.amazonaws.com/MinecraftDownload/<br />
<br />
The following files are downloaded from this location:<br />
<br />
* <code>lwjgl.jar</code><br />
* <code>jinput.jar</code><br />
* <code>lwjgl_util.jar</code><br />
* <code>minecraft.jar</code><br />
* <code><operating system>_natives.jar.lzma</code><br />
<br />
The latter is available for the following operating systems:<br />
* <code>windows</code><br />
* <code>linux</code><br />
* <code>macosx</code><br />
* <code>solaris</code><br />
<br />
== Resources == <br />
The game itself downloads further resources from<br />
http://s3.amazonaws.com/MinecraftResources/<br />
<br />
A list of all available resources is available as an XML file at the address above.<br />
<br />
<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Legacy_Mojang_Authentication&diff=4202Legacy Mojang Authentication2013-07-16T14:27:04Z<p>Sadimusi: Removed another redundant section</p>
<hr />
<div>Minecraft 1.6 introduced a new authentication scheme called Yggdrasil which completely replaces the [[Legacy_Authentication|previous authentication system]].<br />
<br />
== Request format ==<br />
<br />
All requests to Yggdrasil are made to the following server:<br />
<br />
https://authserver.mojang.com<br />
<br />
Further, they are expected to fulfill the following rules:<br />
<br />
* Are <code>POST</code> requests<br />
* Have the <code>Content-Type</code> header set to <code>application/json</code><br />
* Contain a [http://json.org JSON]-encoded dictionary as payload<br />
<br />
If a request was successful the server will respond with:<br />
<br />
* Status code <code>200</code><br />
* A [http://json.org JSON]-encoded dictionary according to the specifications below<br />
<br />
If however a request fails, the server will respond with:<br />
<br />
* An appropriate, non-200 [http://en.wikipedia.org/wiki/List_of_HTTP_status_codes HTTP status code]<br />
* A [http://json.org JSON]-encoded dictionary following this format:<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"error": "Short description of the error",<br />
"errorMessage": "Longer description which can be shown to the user",<br />
"cause": "Cause of the error" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
== Errors ==<br />
These are some of the errors that can be encountered:<br />
{| class="wikitable"<br />
|-<br />
! Error<br />
! Cause<br />
! Error message<br />
! Notes<br />
|-<br />
| <code>Method Not Allowed</code><br />
|<br />
| The method specified in the request is not allowed for the resource identified by the request URI<br />
| Something other than a POST request was received.<br />
|-<br />
| <code>Not Found</code><br />
|<br />
| The server has not found anything matching the request URI<br />
| Non-existing endpoint was called.<br />
|-<br />
| <code>ForbiddenOperationException</code><br />
| <code>UserMigratedException</code><br />
| Invalid credentials. Account migrated, use e-mail as username.<br />
| <br />
|-<br />
| <code>ForbiddenOperationException</code><br />
| <br />
| Invalid credentials. Invalid username or password.<br />
| <br />
|-<br />
| <code>ForbiddenOperationException</code><br />
| <br />
| Invalid token.<br />
| <code>accessToken</code> was invalid.<br />
|-<br />
| <code>IllegalArgumentException</code><br />
| <br />
| Access token already has a profile assigned.<br />
| Selecting profiles isn't implemented yet.<br />
|}<br />
<br />
== Session ID ==<br />
<br />
Whenever a Mojang service requires a session ID, you can simply combine a valid <code>accessToken</code> with the corresponding profile identifier as follows:<br />
<br />
token:<accessToken>:<profile ID><br />
<br />
== Authenticate ==<br />
<br />
Authenticates a user using his password.<br />
<br />
=== Endpoint ===<br />
/authenticate<br />
<br />
=== Payload ===<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"agent": { // optional<br />
"name": "Minecraft", // So far this is the only encountered value<br />
"version": 1 // This number might be increased<br />
// by the vanilla client in the future<br />
},<br />
"username": "mojang account name", // Can be an email address or player name for<br />
// unmigrated accounts<br />
"password": "mojang account password",<br />
"clientToken": "client identifier" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
The <code>clientToken</code> should be a randomly generated identifier and must be identical for each request.<br />
In case it is omitted the server will generate a random token based on Java's [http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html#toString() UUID.toString()] which should then be stored by the client. This will however also invalidate all previously acquired <code>accessToken</code>s for this user across all clients.<br />
<br />
=== Response ===<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "random access token", // hexadecimal<br />
"clientToken": "client identifier", // identical to the one received<br />
"availableProfiles": [ // only present if the agent field was received<br />
{<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
],<br />
"selectedProfile": { // only present if the agent field was received<br />
"id": "profile identifier",<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
'''Note:''' If a user wishes to stay logged in on his computer you are strongly advised to store the received <code>accessToken</code> instead of the password itself.<br />
<br />
Currently each account will only have one single profile, multiple profiles per account are however planned in the future.<br />
<br />
== Refresh ==<br />
<br />
Refreshes a valid <code>accessToken</code>. It can be uses to keep a user logged in between gaming sessions and is preferred over storing the user's password in a file (see [[lastlogin]]). <br />
<br />
=== Endpoint ===<br />
/refresh<br />
<br />
=== Payload ===<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "valid accessToken",<br />
"clientToken": "client identifier" // This needs to be identical to the one used<br />
// to obtain the accessToken in the first place<br />
"selectedProfile": { // optional; sending it will result in an error<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
Note: The provided <code>accessToken</code> gets invalidated.<br />
<br />
=== Response ===<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "random access token", // hexadecimal<br />
"clientToken": "client identifier", // identical to the one received<br />
"selectedProfile": {<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
== Validate ==<br />
<br />
Checks if an <code>accessToken</code> is valid.<br />
<br />
=== Endpoint ===<br />
/validate<br />
<br />
=== Payload ===<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "valid accessToken",<br />
}<br />
</syntaxhighlight><br />
<br />
=== Response ===<br />
Unlike most other methods this one will return an empty payload if successful.<br />
<br />
== Joining a Server ==<br />
<br />
See [[Protocol Encryption#Authentication|Protocol Encryption]]<br />
<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Protocol_Encryption&diff=4201Protocol Encryption2013-07-16T14:22:43Z<p>Sadimusi: /* Client */</p>
<hr />
<div>As of 12w17a, minecraft implements SSL-like encryption.<br />
<br />
== Overview ==<br />
<br />
#Client connects to server<br />
#'''C->S''' 0x02 handshake<br />
#'''S->C''' 0xFD encryption request - server sends its server id string, public key, and 4 random bytes<br />
#Client generates symmetric key (shared secret)<br />
#Client authenticates via [[Session|session.minecraft.net]].<br />
#Client encrypts these 4 bytes with the servers public key.<br />
#'''C->S''' 0xFC encryption response - client encrypts shared secret with server's public key and sends along with encrypted 4 bytes<br />
#Server checks that the encrypted bytes match<br />
#Server decrypts shared secret with its private key<br />
#Server checks player authenticity via session.minecraft.net<br />
#'''S->C''' 0xFC encryption response - empty payload meaning two zero length byte arrays and two zero shorts<br />
#Server enables AES/CFB8 stream encryption<br />
#Client enables AES/CFB8 stream encryption<br />
#'''C->S''' 0xCD - Payload of 0 (byte)<br />
#'''S->C''' 0x01 login<br />
#see [[Protocol FAQ]] to get information about what happens next.<br />
<br />
==Server ID String==<br />
<br />
The server ID string is a randomly-generated string of characters with a maximum length of 20 code points (the client disconnects with an exception if the length is longer than 20).<br />
<br />
The client appears to arrive at incorrect hashes if the server ID string contains certain unprintable characters, so for consistent results only characters with code points in the range U+0021-U+007E (inclusive) should be sent. This range corresponds to all of ASCII with the exception of the space character (U+0020) and all control characters (U+0000-U+001F, U+007F).<br />
<br />
The client appears to arrive at incorrect hashes if the server ID string is too short. 15 to 20 (inclusive) length strings have been observed from the Notchian server and confirmed to work as of 1.5.2.<br />
<br />
== Key Exchange ==<br />
<br />
The server generates a 1024-bit RSA keypair on startup. The key, when packed into a 0xFD packet, is in ASN.1 format as defined by x.509.<br />
The ASN.1 structure looks as follows<br />
<br />
SubjectPublicKeyInfo ::= SEQUENCE {<br />
algorithm SEQUENCE {<br />
algorithm OBJECT IDENTIFIER<br />
parameters ANY OPTIONAL<br />
}<br />
subjectPublicKey BITSTRING<br />
}<br />
<br />
SubjectPublicKey ::= SEQUENCE {<br />
modulus INTEGER<br />
publicExponent INTEGER<br />
}<br />
<br />
If you're struggling to import this using a crypto library, you can convert it to common PEM by base64-encoding and wrapping in '-----BEGIN PUBLIC KEY-----' and '-----END PUBLIC KEY-----'.<br />
<br />
== Symmetric Encryption ==<br />
<br />
On receipt of a 0xFD from the server, the client will generate a 16-byte shared secret, to be used with the AES/CFB8 stream cipher. It then encrypts it with the server's public key (PKCS#1 v1.5 padded), and also encrypts the token received in the 0xFD packet in the same way, then sends both to the server in a 0xFC packet.<br />
<br />
The server decrypts the shared secret and token using its private key, and checks if the token is the same. It then sends a 0xFC to the client with an empty payload, and enables AES/CFB8 encryption. For the Initial Vector (IV) and AES setup, both sides use the secret key. Similarly, the client will also enable encryption upon receipt of the empty 0xFC. From this point forward, everything is encrypted.<br />
<br />
== Authentication ==<br />
<br />
Both server and client need to make a request to session.minecraft.net if the server is in online-mode.<br />
<br />
=== Client ===<br />
<br />
After generating the shared secret, the client generates the following hash:<br />
<br />
sha1 := Sha1()<br />
sha1.update(ASCII encoding of the server id string from 0xFD) <br />
sha1.update(shared secret) <br />
sha1.update(server's encoded public key from 0xFD) <br />
hash := sha1.hexdigest() # String of hex characters<br />
<br />
[[File:Icon_exclaim.gif|:!:]] Note that the Sha1.hexdigest() method used by minecraft removes leading zeros and uses the two's-complement of negative numbers prefixed with a minus sign:<br />
<br />
sha1(Notch) : 4ed1f46bbe04bc756bcb17c0c7ce3e4632f06a48<br />
sha1(jeb_) : -7c9d5b0044c130109a5d7b5fb5c317c02b4e28c1<br />
sha1(simon) : 88e16a1019277b15d58faf0541e11910eb756f6<br />
<br />
The resulting hash is then sent via an HTTP GET request to<br />
<nowiki>http://session.minecraft.net/game/joinserver.jsp?user=</nowiki>''username''&sessionId=''[[Authentication#Session_ID|user_session]]''&serverId=''hash''<br />
If it returns '''OK''' then continue, otherwise stop<br />
<br />
=== Server ===<br />
<br />
After decrypting the shared secret in the second 0xFC, the server generates the login hash as above and sends it to<br />
<nowiki>http://session.minecraft.net/game/checkserver.jsp?user=</nowiki>''username''&serverId=''hash''<br />
<br />
If the response is '''YES''' then the client is authenticated and allowed to join. Otherwise the client will/should be [[Protocol#Disconnect.2FKick_.280xFF.29|kicked]] (unencrypted) with "Failed to verify username!"<br />
<br />
=== Sample Code ===<br />
<br />
Examples of generating Java-style hex digests:<br />
<br />
* C#: https://gist.github.com/404223052379e82f91e6<br />
* node.js: https://gist.github.com/4425843<br />
* Go: https://gist.github.com/toqueteos/5372776<br />
<br />
== Example ==<br />
<br />
A parsed transcript of a successful protocol encryption handshake follows:<br />
<br />
127.0.0.1:43733 connected, there is now 1 client connected<br />
====PROTOCOL ANALYSIS====<br />
127.0.0.1:43733 ==> Server - Packet of type 0x02<br />
====50 BYTES====<br />
0x02 0x3D 0x00 0x0B 0x00 0x44 0x00 0x72<br />
0x00 0x61 0x00 0x69 0x00 0x6E 0x00 0x65<br />
0x00 0x64 0x00 0x73 0x00 0x6F 0x00 0x75<br />
0x00 0x6C 0x00 0x09 0x00 0x6C 0x00 0x6F<br />
0x00 0x63 0x00 0x61 0x00 0x6C 0x00 0x68<br />
0x00 0x6F 0x00 0x73 0x00 0x74 0x00 0x00<br />
0x2D 0x85<br />
====PAYLOAD====<br />
#1 - Signed Byte: 61<br />
#2 - Unicode String (11 graphemes, 11 code points): "Drainedsoul"<br />
#3 - Unicode String (9 graphemes, 9 code points): "localhost"<br />
#4 - 32-bit Signed Integer: 11653<br />
====PROTOCOL ANALYSIS====<br />
Server ==> 127.0.0.1:43733 - Packet of type 0xFD<br />
====205 BYTES====<br />
0xFD 0x00 0x10 0x00 0x4E 0x00 0x77 0x00<br />
0x5D 0x00 0x31 0x00 0x51 0x00 0x61 0x00<br />
0x43 0x00 0x3C 0x00 0x6F 0x00 0x3A 0x00<br />
0x6C 0x00 0x2E 0x00 0x5C 0x00 0x65 0x00<br />
0x53 0x00 0x39 0x00 0xA2 0x30 0x81 0x9F<br />
0x30 0x0D 0x06 0x09 0x2A 0x86 0x48 0x86<br />
0xF7 0x0D 0x01 0x01 0x01 0x05 0x00 0x03<br />
0x81 0x8D 0x00 0x30 0x81 0x89 0x02 0x81<br />
0x81 0x00 0x9D 0x09 0x76 0x71 0x45 0x24<br />
0x18 0x53 0x5F 0x32 0x5A 0xD5 0xBB 0x26<br />
0x43 0x2C 0x97 0xBB 0xB3 0xF4 0x03 0x96<br />
0xEA 0xF1 0xAD 0xA6 0xC9 0x41 0x7B 0x01<br />
0x8F 0x66 0xED 0x92 0x4B 0xB7 0x17 0x2C<br />
0x65 0x5C 0xD2 0x42 0x35 0x0C 0x8A 0x8C<br />
0xC3 0xE1 0x5C 0x76 0x0E 0x43 0x97 0x17<br />
0xEE 0x9E 0xEF 0x4F 0x4E 0x2D 0xFC 0x2D<br />
0xE6 0x92 0x0B 0x7E 0xA0 0x56 0xB5 0xB7<br />
0x18 0x59 0x57 0x74 0x28 0x5C 0xA1 0x88<br />
0xC4 0xE6 0x60 0xDF 0x64 0x3A 0x2C 0x0E<br />
0x5C 0x7D 0xB9 0x7C 0xF9 0xFB 0xA2 0x21<br />
0xC5 0x0B 0x36 0x7D 0xDE 0x8A 0xC9 0xC5<br />
0x09 0xA0 0x2F 0xA0 0x25 0x8A 0x26 0xDB<br />
0x0B 0x82 0xC8 0x60 0xCB 0x58 0x02 0xEC<br />
0xBB 0xFE 0xBC 0x35 0x3F 0x40 0x9C 0x96<br />
0xF4 0x5F 0x02 0x03 0x01 0x00 0x01 0x00<br />
0x04 0xED 0x85 0x14 0xD6<br />
====PAYLOAD====<br />
#1 - Unicode String (16 graphemes, 16 code points): "Nw]1QaC<o:l.\eS9"<br />
#2 - Array of bytes (162 bytes):<br />
0x30 0x81 0x9F 0x30 0x0D 0x06 0x09 0x2A<br />
0x86 0x48 0x86 0xF7 0x0D 0x01 0x01 0x01<br />
0x05 0x00 0x03 0x81 0x8D 0x00 0x30 0x81<br />
0x89 0x02 0x81 0x81 0x00 0x9D 0x09 0x76<br />
0x71 0x45 0x24 0x18 0x53 0x5F 0x32 0x5A<br />
0xD5 0xBB 0x26 0x43 0x2C 0x97 0xBB 0xB3<br />
0xF4 0x03 0x96 0xEA 0xF1 0xAD 0xA6 0xC9<br />
0x41 0x7B 0x01 0x8F 0x66 0xED 0x92 0x4B<br />
0xB7 0x17 0x2C 0x65 0x5C 0xD2 0x42 0x35<br />
0x0C 0x8A 0x8C 0xC3 0xE1 0x5C 0x76 0x0E<br />
0x43 0x97 0x17 0xEE 0x9E 0xEF 0x4F 0x4E<br />
0x2D 0xFC 0x2D 0xE6 0x92 0x0B 0x7E 0xA0<br />
0x56 0xB5 0xB7 0x18 0x59 0x57 0x74 0x28<br />
0x5C 0xA1 0x88 0xC4 0xE6 0x60 0xDF 0x64<br />
0x3A 0x2C 0x0E 0x5C 0x7D 0xB9 0x7C 0xF9<br />
0xFB 0xA2 0x21 0xC5 0x0B 0x36 0x7D 0xDE<br />
0x8A 0xC9 0xC5 0x09 0xA0 0x2F 0xA0 0x25<br />
0x8A 0x26 0xDB 0x0B 0x82 0xC8 0x60 0xCB<br />
0x58 0x02 0xEC 0xBB 0xFE 0xBC 0x35 0x3F<br />
0x40 0x9C 0x96 0xF4 0x5F 0x02 0x03 0x01<br />
0x00 0x01<br />
#3 - Array of bytes (4 bytes):<br />
0xED 0x85 0x14 0xD6<br />
====PROTOCOL ANALYSIS====<br />
127.0.0.1:43733 ==> Server - Packet of type 0xFC<br />
====261 BYTES====<br />
0xFC 0x00 0x80 0x9B 0xD1 0xD7 0xA8 0xDB<br />
0x54 0x49 0x8F 0x41 0xD5 0xA3 0x74 0x18<br />
0xBD 0x8D 0x09 0xEA 0x45 0xFC 0x0F 0x3F<br />
0x9B 0xE4 0xF9 0xAC 0xC5 0x7B 0xF6 0x16<br />
0xBB 0xFA 0x36 0x51 0xF9 0x19 0xAB 0x72<br />
0x2B 0xBA 0x46 0x6C 0x8D 0xB0 0x2D 0x53<br />
0x5F 0xA5 0xD4 0x17 0x46 0x0E 0xD7 0xC1<br />
0xAA 0x5D 0xC7 0x73 0x51 0xDA 0x3F 0xD7<br />
0x5E 0xF6 0x96 0xF9 0x10 0xB2 0x1C 0x0D<br />
0xAA 0x1E 0x61 0x37 0xFB 0x3C 0x66 0x77<br />
0x20 0xCB 0xF7 0x3C 0x55 0xE5 0x9E 0xC1<br />
0x28 0x63 0xD1 0xD7 0xF6 0xEE 0x1E 0x2C<br />
0x20 0x72 0x98 0x7E 0xF2 0x7D 0xDF 0xFE<br />
0x5A 0x25 0x3C 0x22 0xC0 0xCF 0x86 0xB3<br />
0x02 0x97 0xB1 0x80 0x97 0xA1 0x92 0xDA<br />
0xD2 0x44 0xB1 0xDA 0x0F 0x1C 0x30 0x96<br />
0x98 0x0B 0xB7 0x00 0x80 0x78 0x85 0x42<br />
0xF7 0xF8 0x2F 0x00 0xDB 0xBF 0x2E 0x22<br />
0x33 0x10 0x6C 0x19 0xE3 0x16 0x8F 0x36<br />
0x16 0xE3 0xD9 0x86 0x67 0x52 0x04 0x57<br />
0xB6 0x4F 0x57 0x8C 0xB4 0x02 0x18 0x6D<br />
0x16 0xC6 0xB5 0x95 0xBC 0xE6 0xEA 0x76<br />
0x10 0x7A 0xB9 0xE3 0xBD 0x3C 0x50 0xEA<br />
0x42 0xDF 0x47 0x05 0x3F 0xCF 0xD5 0x70<br />
0xF4 0xAB 0xB5 0x07 0x90 0xA2 0x84 0x12<br />
0x79 0x65 0x03 0x2A 0xB6 0x6B 0x0A 0xA8<br />
0x90 0x8B 0xFE 0xCC 0x4E 0x04 0x35 0xA2<br />
0xDD 0x08 0xBF 0xDD 0x29 0xAF 0x50 0xFD<br />
0x2B 0x73 0xE1 0x6A 0xED 0xE8 0xE2 0x27<br />
0x8F 0x0B 0xD5 0x0D 0xBC 0x9B 0x47 0x16<br />
0x92 0x7B 0xD2 0xE6 0xD7 0xF1 0x3A 0xAE<br />
0x3D 0x14 0xA9 0xC3 0xF2 0x96 0x8A 0x54<br />
0x24 0x29 0xA3 0x53 0x55<br />
====PAYLOAD====<br />
#1 - Array of bytes (128 bytes):<br />
0x9B 0xD1 0xD7 0xA8 0xDB 0x54 0x49 0x8F<br />
0x41 0xD5 0xA3 0x74 0x18 0xBD 0x8D 0x09<br />
0xEA 0x45 0xFC 0x0F 0x3F 0x9B 0xE4 0xF9<br />
0xAC 0xC5 0x7B 0xF6 0x16 0xBB 0xFA 0x36<br />
0x51 0xF9 0x19 0xAB 0x72 0x2B 0xBA 0x46<br />
0x6C 0x8D 0xB0 0x2D 0x53 0x5F 0xA5 0xD4<br />
0x17 0x46 0x0E 0xD7 0xC1 0xAA 0x5D 0xC7<br />
0x73 0x51 0xDA 0x3F 0xD7 0x5E 0xF6 0x96<br />
0xF9 0x10 0xB2 0x1C 0x0D 0xAA 0x1E 0x61<br />
0x37 0xFB 0x3C 0x66 0x77 0x20 0xCB 0xF7<br />
0x3C 0x55 0xE5 0x9E 0xC1 0x28 0x63 0xD1<br />
0xD7 0xF6 0xEE 0x1E 0x2C 0x20 0x72 0x98<br />
0x7E 0xF2 0x7D 0xDF 0xFE 0x5A 0x25 0x3C<br />
0x22 0xC0 0xCF 0x86 0xB3 0x02 0x97 0xB1<br />
0x80 0x97 0xA1 0x92 0xDA 0xD2 0x44 0xB1<br />
0xDA 0x0F 0x1C 0x30 0x96 0x98 0x0B 0xB7<br />
#2 - Array of bytes (128 bytes):<br />
0x78 0x85 0x42 0xF7 0xF8 0x2F 0x00 0xDB<br />
0xBF 0x2E 0x22 0x33 0x10 0x6C 0x19 0xE3<br />
0x16 0x8F 0x36 0x16 0xE3 0xD9 0x86 0x67<br />
0x52 0x04 0x57 0xB6 0x4F 0x57 0x8C 0xB4<br />
0x02 0x18 0x6D 0x16 0xC6 0xB5 0x95 0xBC<br />
0xE6 0xEA 0x76 0x10 0x7A 0xB9 0xE3 0xBD<br />
0x3C 0x50 0xEA 0x42 0xDF 0x47 0x05 0x3F<br />
0xCF 0xD5 0x70 0xF4 0xAB 0xB5 0x07 0x90<br />
0xA2 0x84 0x12 0x79 0x65 0x03 0x2A 0xB6<br />
0x6B 0x0A 0xA8 0x90 0x8B 0xFE 0xCC 0x4E<br />
0x04 0x35 0xA2 0xDD 0x08 0xBF 0xDD 0x29<br />
0xAF 0x50 0xFD 0x2B 0x73 0xE1 0x6A 0xED<br />
0xE8 0xE2 0x27 0x8F 0x0B 0xD5 0x0D 0xBC<br />
0x9B 0x47 0x16 0x92 0x7B 0xD2 0xE6 0xD7<br />
0xF1 0x3A 0xAE 0x3D 0x14 0xA9 0xC3 0xF2<br />
0x96 0x8A 0x54 0x24 0x29 0xA3 0x53 0x55<br />
====PROTOCOL ANALYSIS====<br />
HTTP request ==> <nowiki>http://session.minecraft.net/game/checkserver.jsp?user=Draineds</nowiki><br />
oul&serverId=-219245c9f4bce438ee84e84b28514ced1cd2846b<br />
====PROTOCOL ANALYSIS====<br />
HTTP response <== <nowiki>http://session.minecraft.net/game/checkserver.jsp?user=Drained</nowiki><br />
soul&serverId=-219245c9f4bce438ee84e84b28514ced1cd2846b - Status: 200 - Time ela<br />
psed: 279902765ns - Response body (3 graphemes, 3 code points):<br />
YES<br />
====PROTOCOL ANALYSIS====<br />
Server ==> 127.0.0.1:43733 - Packet of type 0xFC<br />
====5 BYTES====<br />
0xFC 0x00 0x00 0x00 0x00<br />
====PAYLOAD====<br />
#1 - Array of bytes (0 bytes):<br />
<br />
#2 - Array of bytes (0 bytes):<br />
<br />
====ENCRYPTION ENABLED====<br />
Encryption enabled with key:<br />
0x6C 0xBC 0x2E 0x17 0x45 0xBD 0x65 0xDF<br />
0xA0 0x12 0x85 0x8F 0x00 0x87 0xAA 0x74<br />
Encryption enabled with IV:<br />
0x6C 0xBC 0x2E 0x17 0x45 0xBD 0x65 0xDF<br />
0xA0 0x12 0x85 0x8F 0x00 0x87 0xAA 0x74<br />
127.0.0.1 : 43733 logged in as Drainedsoul<br />
====PROTOCOL ANALYSIS====<br />
127.0.0.1:43733 ==> Server - Packet of type 0xCD<br />
====2 BYTES====<br />
0xCD 0x00<br />
<br />
== Additional Links ==<br />
[https://gist.github.com/3900517 Encrypt shared secret using OpenSSL]<br />
<br />
[http://pastebin.com/8eYyKZn6 Generate RSA-Keys and building the ASN.1v8 structure of the x.509 certificate using Crypto++]<br />
<br />
[http://pastebin.com/7Jvaama1 Decrypt shared secret using Crypto++]<br />
<br />
[http://pastebin.com/MjvR0T98 De/Encrypt data via AES using Crypto++]<br />
<br />
[https://github.com/SirCmpwn/Craft.Net/blob/master/Craft.Net/AesStream.cs C# AES/CFB support with bouncy castle on Mono]<br />
<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Legacy_Mojang_Authentication&diff=4200Legacy Mojang Authentication2013-07-16T14:12:24Z<p>Sadimusi: Added some common errors</p>
<hr />
<div>The minecraft client and server communicate with Mojang to validate player sessions. This page describes some of the operations.<br />
<br />
== Authentication ==<br />
<br />
Minecraft 1.6 introduced a new authentication scheme called Yggdrasil which completely replaces the [[Legacy_Authentication|previous authentication system]].<br />
<br />
=== Request format ===<br />
<br />
All requests to Yggdrasil are made to the following server:<br />
<br />
https://authserver.mojang.com<br />
<br />
Further, they are expected to fulfill the following rules:<br />
<br />
* Are <code>POST</code> requests<br />
* Have the <code>Content-Type</code> header set to <code>application/json</code><br />
* Contain a [http://json.org JSON]-encoded dictionary as payload<br />
<br />
If a request was successful the server will respond with:<br />
<br />
* Status code <code>200</code><br />
* A [http://json.org JSON]-encoded dictionary according to the specifications below<br />
<br />
If however a request fails, the server will respond with:<br />
<br />
* An appropriate, non-200 [http://en.wikipedia.org/wiki/List_of_HTTP_status_codes HTTP status code]<br />
* A [http://json.org JSON]-encoded dictionary following this format:<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"error": "Short description of the error",<br />
"errorMessage": "Longer description which can be shown to the user",<br />
"cause": "Cause of the error" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
=== Errors ===<br />
These are some of the errors that can be encountered:<br />
{| class="wikitable"<br />
|-<br />
! Error<br />
! Cause<br />
! Error message<br />
! Notes<br />
|-<br />
| <code>Method Not Allowed</code><br />
|<br />
| The method specified in the request is not allowed for the resource identified by the request URI<br />
| Something other than a POST request was received.<br />
|-<br />
| <code>Not Found</code><br />
|<br />
| The server has not found anything matching the request URI<br />
| Non-existing endpoint was called.<br />
|-<br />
| <code>ForbiddenOperationException</code><br />
| <code>UserMigratedException</code><br />
| Invalid credentials. Account migrated, use e-mail as username.<br />
| <br />
|-<br />
| <code>ForbiddenOperationException</code><br />
| <br />
| Invalid credentials. Invalid username or password.<br />
| <br />
|-<br />
| <code>ForbiddenOperationException</code><br />
| <br />
| Invalid token.<br />
| <code>accessToken</code> was invalid.<br />
|-<br />
| <code>IllegalArgumentException</code><br />
| <br />
| Access token already has a profile assigned.<br />
| Selecting profiles isn't implemented yet.<br />
|}<br />
<br />
<br />
=== Session ID ===<br />
<br />
Whenever a Mojang service requires a session ID, you can simply combine a valid <code>accessToken</code> with a profile identifier as follows:<br />
<br />
token:<accessToken>:<profile ID><br />
<br />
<br />
=== Authenticate ===<br />
<br />
Authenticates a user using his password.<br />
<br />
==== Endpoint ====<br />
/authenticate<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"agent": { // optional<br />
"name": "Minecraft", // So far this is the only encountered value<br />
"version": 1 // This number might be increased<br />
// by the vanilla client in the future<br />
},<br />
"username": "mojang account name", // Can be an email address or player name for<br />
// unmigrated accounts<br />
"password": "mojang account password",<br />
"clientToken": "client identifier" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
The <code>clientToken</code> should be a randomly generated identifier and must be identical for each request.<br />
In case it is omitted the server will generate a random token based on Java's [http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html#toString() UUID.toString()] which should then be stored by the client. This will however also invalidate all previously acquired <code>accessToken</code>s for this user across all clients.<br />
<br />
==== Response ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "random access token", // hexadecimal<br />
"clientToken": "client identifier", // identical to the one received<br />
"availableProfiles": [ // only present if the agent field was received<br />
{<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
],<br />
"selectedProfile": { // only present if the agent field was received<br />
"id": "profile identifier",<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
'''Note:''' If a user wishes to stay logged in on his computer you are strongly advised to store the received <code>accessToken</code> instead of the password itself.<br />
<br />
Currently each account will only have one single profile, multiple profiles per account are however planned in the future.<br />
<br />
<br />
=== Refresh ===<br />
<br />
Refreshes a valid <code>accessToken</code>. It can be uses to keep a user logged in between gaming sessions and is preferred over storing the user's password in a file (see [[lastlogin]]). <br />
<br />
==== Endpoint ====<br />
/refresh<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "valid accessToken",<br />
"clientToken": "client identifier" // This needs to be identical to the one used<br />
// to obtain the accessToken in the first place<br />
"selectedProfile": { // optional; sending it will result in an error<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
Note: The provided <code>accessToken</code> gets invalidated.<br />
<br />
==== Response ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "random access token", // hexadecimal<br />
"clientToken": "client identifier", // identical to the one received<br />
"selectedProfile": {<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
=== Validate ===<br />
<br />
Checks if an <code>accessToken</code> is valid.<br />
<br />
==== Endpoint ====<br />
/validate<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "valid accessToken",<br />
}<br />
</syntaxhighlight><br />
<br />
==== Response ====<br />
Unlike most other methods this one will return an empty payload if successful.<br />
<br />
== Joining a Server ==<br />
<br />
See [[Protocol Encryption]] for details on encrypting connections.<br />
<br />
=== Client operation ===<br />
<br />
# Client connects to server<br />
# Client sends a [[Protocol#0x02|0x02 handshake]] containing the current player name<br />
# Client receives an [[Protocol#0xFD|0xFD encryption request]] with the server's public key and four verification bytes.<br />
# Client generates a symmetric key.<br />
# Client sends a HTTP request to <br />
#:<pre>http://session.minecraft.net/game/joinserver.jsp?user=<player name>&sessionId=<session id>&serverId=<server hash></pre><br />
#:Note: See the [[#Session ID|Session ID]] section on how the <code>&lt;session id&gt;</code> is generated.<br />
#:If the response is '''OK''' then continue, otherwise stop<br />
# Client sends [[Protocol#0xFC|0xFC encryption response]] - client encrypts shared secret and verification token with the server's public key<br />
# Server checks validity and sends [[Protocol#0xFC|0xFC encryption response]] with two empty arrays<br />
# Both sides enable AES/CFB2 encryption using the shared secret generated by the client<br />
# Client sends [[Protocol#0xCD|0xCD client status]] with a payload of 0 (ready to spawn)<br />
# Server sends [[Protocol#0x01|0x01 login]]<br />
# ... receive map chunks, etc...<br />
<br />
=== Server operation ===<br />
<br />
# Server generates a 1024-bit RSA keypair.<br />
# ...<br />
# Server answers TCP connection request and receives a [[Protocol#0x02|0x02 handshake]] from the client.<br />
# Server sends [[Protocol#0xFD|0xFD encryption request]] with its public key and a verification token.<br />
# Server receives [[Protocol#0xFC|0xFC encryption response]] from client and decrypts the shared secret.<br />
# Server verifies the validity of the verification token. If this isn't verified, it kicks the client.<br />
# Server sends a HTTP request to<br />
#:<pre>http://session.minecraft.net/game/checkserver.jsp?user=<username>&serverId=<server hash></pre><br />
#:If it returns '''YES''' then the client is authenticated and allowed to join. Otherwise the client will/should be [[Protocol#0xFF|kicked]] with “Failed to verify username!”<br />
# Server sends a [[Protocol#0xFC|0xFC encryption response]] packet with two empty arrays.<br />
# Both sides enable AES/CFB2 encryption.<br />
# Server receives [[Protocol#0xCD|0xCD client status]] with a payload of , indicating "ready to spawn"<br />
# Server sends [[Protocol#0x01|0x01 login]]<br />
# ... send map chunks, etc...<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Legacy_Minecraft_Authentication&diff=4199Legacy Minecraft Authentication2013-07-16T13:31:17Z<p>Sadimusi: </p>
<hr />
<div>{{deprecated}}<br />
<br />
For the currently used authentication system see [[Authentication]].<br />
<br />
== Login ==<br />
<br />
To log the player in, the official launcher sends an HTTPS POST (GET appears to suffice as well) request to:<br />
<pre>https://login.minecraft.net</pre><br />
with the postdata:<br />
?user=<username>&password=<password>&version=<launcher version><br />
and a "application/x-www-form-urlencoded" Content-Type header.<br />
<br />
After migrating to Mojang accounts, email address is used instead of username, but the procedure stays the same.<br />
<br />
The current launcher version is "13" (for new launcher it's "14"), sending a value lower than 12 will cause the server to return "Old version", however you can send any large number and it will return as expected. If the login succeeded, it will return 5 ':' delimited values.<br />
1343825972000:deprecated:SirCmpwn:7ae9007b9909de05ea58e94199a33b30c310c69c:dba0c48e1c584963b9e93a038a66bb98<br />
#'''current version''' of the game files (not the launcher itself). This is a unix timestamp which the launcher compares to the ~/.minecraft/bin/version file.<br />
#Previously contained a '''download ticket''' for requesting new versions of minecraft.jar from the server. Now contains only "deprecated".<br />
#'''case-correct username'''. For mojang accounts, the user's actual username is returned here instead of the email used to log in.<br />
#'''sessionId''' - a unique ID for your current session.<br />
#'''UID''' - currently unused, introduced near August 8th, 2012. Grum says this is the unique ID for the user, potentially for changing Minecraft names in future.<br />
<br />
If the request is missing a parameter, the server will return "Bad response". If the login information is incorrect, the server will return "Bad login". If the login information is correct but the account isn't premium, the server will return "User not premium". If your minecraft.net account has been migrated to a Mojang account but you're logging in with your minecraft.net username the server will return "Acount migrated, use e-mail".<br />
<br />
== Keep-alive ==<br />
<br />
Every 6000 ticks, the client sends an HTTPS request to<br />
<pre>https://login.minecraft.net/session?name=<username>&session=<session id></pre><br />
The client discards the server's response.<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Template:Deprecated&diff=4198Template:Deprecated2013-07-16T13:30:49Z<p>Sadimusi: Typo</p>
<hr />
<div>{{note|'''Attention:''' The mechanics described in this article are no longer used by the latest version of {{{1|Minecraft}}}.}}</div>Sadimusihttps://wiki.vg/index.php?title=Template:Deprecated&diff=4197Template:Deprecated2013-07-16T13:30:30Z<p>Sadimusi: Created page with "{{note|'''Attention:''' This mechanics described in this article are no longer used by the latest version of {{{1|Minecraft}}}.}}"</p>
<hr />
<div>{{note|'''Attention:''' This mechanics described in this article are no longer used by the latest version of {{{1|Minecraft}}}.}}</div>Sadimusihttps://wiki.vg/index.php?title=Legacy_Mojang_Authentication&diff=4196Legacy Mojang Authentication2013-07-16T13:15:24Z<p>Sadimusi: </p>
<hr />
<div>The minecraft client and server communicate with Mojang to validate player sessions. This page describes some of the operations.<br />
<br />
== Authentication ==<br />
<br />
Minecraft 1.6 introduced a new authentication scheme called Yggdrasil which completely replaces the [[Legacy_Authentication|previous authentication system]].<br />
<br />
=== Request format ===<br />
<br />
All requests to Yggdrasil are made to the following server:<br />
<br />
https://authserver.mojang.com<br />
<br />
Further, they are expected to fulfill the following rules:<br />
<br />
* Are <code>POST</code> requests<br />
* Have the <code>Content-Type</code> header set to <code>application/json</code><br />
* Contain a [http://json.org JSON]-encoded dictionary as payload<br />
<br />
If a request was successful the server will respond with:<br />
<br />
* Status code <code>200</code><br />
* A [http://json.org JSON]-encoded dictionary according to the specifications below<br />
<br />
If however a request fails, the server will respond with:<br />
<br />
* An appropriate, non-200 [http://en.wikipedia.org/wiki/List_of_HTTP_status_codes HTTP status code]<br />
* A [http://json.org JSON]-encoded dictionary following this format:<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"error": "Short description of the error",<br />
"errorMessage": "Longer description which can be shown to the user",<br />
"cause": "Cause of the error" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
=== Session ID ===<br />
<br />
Whenever a Mojang service requires a session ID, you can simply combine a valid <code>accessToken</code> with a profile identifier as follows:<br />
<br />
token:<accessToken>:<profile ID><br />
<br />
=== Authenticate ===<br />
<br />
Authenticates a user using his password.<br />
<br />
==== Endpoint ====<br />
/authenticate<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"agent": { // optional<br />
"name": "Minecraft", // So far this is the only encountered value<br />
"version": 1 // This number might be increased<br />
// by the vanilla client in the future<br />
},<br />
"username": "mojang account name", // Can be an email address or player name for<br />
// unmigrated accounts<br />
"password": "mojang account password",<br />
"clientToken": "client identifier" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
The <code>clientToken</code> should be a randomly generated identifier and must be identical for each request.<br />
In case it is omitted the server will generate a random token based on Java's [http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html#toString() UUID.toString()] which should then be stored by the client. This will however also invalidate all previously acquired <code>accessToken</code>s for this user across all clients.<br />
<br />
<br />
==== Response ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "random access token", // hexadecimal<br />
"clientToken": "client identifier", // identical to the one received<br />
"availableProfiles": [ // only present if the agent field was received<br />
{<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
],<br />
"selectedProfile": { // only present if the agent field was received<br />
"id": "profile identifier",<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
'''Note:''' If a user wishes to stay logged in on his computer you are strongly advised to store the received <code>accessToken</code> instead of the password itself.<br />
<br />
Currently each account will only have one single profile, multiple profiles per account are however planned in the future.<br />
<br />
=== Refresh ===<br />
<br />
Refreshes a valid <code>accessToken</code>. It can be uses to keep a user logged in between gaming sessions and is preferred over storing the user's password in a file (see [[lastlogin]]). <br />
<br />
==== Endpoint ====<br />
/refresh<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "valid accessToken",<br />
"clientToken": "client identifier" // This needs to be identical to the one used<br />
// to obtain the accessToken in the first place<br />
}<br />
</syntaxhighlight><br />
<br />
Note: The provided <code>accessToken</code> gets invalidated.<br />
<br />
==== Response ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "random access token", // hexadecimal<br />
"clientToken": "client identifier", // identical to the one received<br />
"selectedProfile": {<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
=== Validate ===<br />
<br />
Checks if an <code>accessToken</code> is valid.<br />
<br />
==== Endpoint ====<br />
/validate<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "valid accessToken",<br />
}<br />
</syntaxhighlight><br />
<br />
==== Response ====<br />
Unlike most other methods this one will return an empty payload if successful.<br />
<br />
== Joining a Server ==<br />
<br />
See [[Protocol Encryption]] for details on encrypting connections.<br />
<br />
=== Client operation ===<br />
<br />
# Client connects to server<br />
# Client sends a [[Protocol#0x02|0x02 handshake]] containing the current player name<br />
# Client receives an [[Protocol#0xFD|0xFD encryption request]] with the server's public key and four verification bytes.<br />
# Client generates a symmetric key.<br />
# Client sends a HTTP request to <br />
#:<pre>http://session.minecraft.net/game/joinserver.jsp?user=<player name>&sessionId=<session id>&serverId=<server hash></pre><br />
#:Note: See the [[#Session ID|Session ID]] section on how the <code>&lt;session id&gt;</code> is generated.<br />
#:If the response is '''OK''' then continue, otherwise stop<br />
# Client sends [[Protocol#0xFC|0xFC encryption response]] - client encrypts shared secret and verification token with the server's public key<br />
# Server checks validity and sends [[Protocol#0xFC|0xFC encryption response]] with two empty arrays<br />
# Both sides enable AES/CFB2 encryption using the shared secret generated by the client<br />
# Client sends [[Protocol#0xCD|0xCD client status]] with a payload of 0 (ready to spawn)<br />
# Server sends [[Protocol#0x01|0x01 login]]<br />
# ... receive map chunks, etc...<br />
<br />
=== Server operation ===<br />
<br />
# Server generates a 1024-bit RSA keypair.<br />
# ...<br />
# Server answers TCP connection request and receives a [[Protocol#0x02|0x02 handshake]] from the client.<br />
# Server sends [[Protocol#0xFD|0xFD encryption request]] with its public key and a verification token.<br />
# Server receives [[Protocol#0xFC|0xFC encryption response]] from client and decrypts the shared secret.<br />
# Server verifies the validity of the verification token. If this isn't verified, it kicks the client.<br />
# Server sends a HTTP request to<br />
#:<pre>http://session.minecraft.net/game/checkserver.jsp?user=<username>&serverId=<server hash></pre><br />
#:If it returns '''YES''' then the client is authenticated and allowed to join. Otherwise the client will/should be [[Protocol#0xFF|kicked]] with “Failed to verify username!”<br />
# Server sends a [[Protocol#0xFC|0xFC encryption response]] packet with two empty arrays.<br />
# Both sides enable AES/CFB2 encryption.<br />
# Server receives [[Protocol#0xCD|0xCD client status]] with a payload of , indicating "ready to spawn"<br />
# Server sends [[Protocol#0x01|0x01 login]]<br />
# ... send map chunks, etc...<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Legacy_Mojang_Authentication&diff=4181Legacy Mojang Authentication2013-07-15T16:38:09Z<p>Sadimusi: Added validate method</p>
<hr />
<div>The minecraft client and server communicate with Mojang to validate player sessions. This page describes some of the operations.<br />
<br />
== Authentication ==<br />
<br />
Minecraft 1.6 introduced a new authentication scheme called Yggdrasil which completely replaces the [[Legacy_Authentication|previous authentication system]].<br />
<br />
=== Request format ===<br />
<br />
All requests to Yggdrasil are made to the following server:<br />
<br />
https://authserver.mojang.com<br />
<br />
Further, they are expected to fulfill the following rules:<br />
<br />
* Are <code>POST</code> requests<br />
* Have the <code>Content-Type</code> header set to <code>application/json</code><br />
* Contain a [http://json.org JSON]-encoded dictionary as payload<br />
<br />
If a request was successful the server will respond with:<br />
<br />
* Status code <code>200</code><br />
* A [http://json.org JSON]-encoded dictionary according to the specifications below<br />
<br />
If however a request fails, the server will respond with:<br />
<br />
* An appropriate, non-200 [http://en.wikipedia.org/wiki/List_of_HTTP_status_codes HTTP status code]<br />
* A [http://json.org JSON]-encoded dictionary following this format:<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"error": "Short description of the error",<br />
"errorMessage": "Longer description which can be shown to the user",<br />
"cause": "Cause of the error" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
=== Session ID ===<br />
<br />
Whenever a Mojang service requires a session ID, you can simply combine a valid <code>accessToken</code> with a profile identifier as follows:<br />
<br />
token:<accessToken>:<profile ID><br />
<br />
=== Authenticate ===<br />
<br />
Authenticates a user using his password.<br />
<br />
==== Endpoint ====<br />
/authenticate<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"agent": { // optional<br />
"name": "Minecraft", // So far this is the only encountered value<br />
"version": 1 // This number might be increased<br />
// by the vanilla client in the future<br />
},<br />
"username": "mojang account name", // Can be an email address or player name for<br />
// unmigrated accounts<br />
"password": "mojang account password",<br />
"clientToken": "client identifier" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
The <code>clientToken</code> should be a randomly generated identifier and must be identical for each request.<br />
In case it is omitted the server will generate a random token based on Java's [http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html#toString() UUID.toString()] which should then be stored by the client. This will however also invalidate all previously acquired <code>accessToken</code>s for this user across all clients.<br />
<br />
<br />
==== Response ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "random access token", // hexadecimal<br />
"clientToken": "client identifier", // identical to the one received<br />
"availableProfiles": [ // only present if the agent field was received<br />
{<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
],<br />
"selectedProfile": { // only present if the agent field was received<br />
"id": "profile identifier",<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
'''Note:''' If a user wishes to stay logged in on his computer you are strongly advised to store the received <code>accessToken</code> instead of the password itself.<br />
<br />
Currently each account will only have one single profile, multiple profiles per account are however planned in the future.<br />
<br />
=== Refresh ===<br />
<br />
Refreshes an expired but valid <code>accessToken</code>. It can be uses to keep a user logged in between gaming sessions and is preferred over storing the user's password in a file (see [[lastlogin]]). <br />
<br />
==== Endpoint ====<br />
/refresh<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "valid accessToken",<br />
"clientToken": "client identifier" // This needs to be identical to the one used<br />
// to obtain the accessToken in the first place<br />
}<br />
</syntaxhighlight><br />
<br />
Note: The provided <code>accessToken</code> gets invalidated.<br />
<br />
==== Response ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "random access token", // hexadecimal<br />
"clientToken": "client identifier", // identical to the one received<br />
"selectedProfile": {<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
=== Validate ===<br />
<br />
Checks if an <code>accessToken</code> is valid.<br />
<br />
==== Endpoint ====<br />
/validate<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "valid accessToken",<br />
}<br />
</syntaxhighlight><br />
<br />
==== Response ====<br />
Unlike most other methods this one will return an empty payload if successful.<br />
<br />
== Joining a Server ==<br />
<br />
See [[Protocol Encryption]] for details on encrypting connections.<br />
<br />
=== Client operation ===<br />
<br />
# Client connects to server<br />
# Client sends a [[Protocol#0x02|0x02 handshake]] containing the current player name<br />
# Client receives an [[Protocol#0xFD|0xFD encryption request]] with the server's public key and four verification bytes.<br />
# Client generates a symmetric key.<br />
# Client sends a HTTP request to <br />
#:<pre>http://session.minecraft.net/game/joinserver.jsp?user=<player name>&sessionId=<session id>&serverId=<server hash></pre><br />
#:Note: See the [[#Session ID|Session ID]] section on how the <code>&lt;session id&gt;</code> is generated.<br />
#:If the response is '''OK''' then continue, otherwise stop<br />
# Client sends [[Protocol#0xFC|0xFC encryption response]] - client encrypts shared secret and verification token with the server's public key<br />
# Server checks validity and sends [[Protocol#0xFC|0xFC encryption response]] with two empty arrays<br />
# Both sides enable AES/CFB2 encryption using the shared secret generated by the client<br />
# Client sends [[Protocol#0xCD|0xCD client status]] with a payload of 0 (ready to spawn)<br />
# Server sends [[Protocol#0x01|0x01 login]]<br />
# ... receive map chunks, etc...<br />
<br />
=== Server operation ===<br />
<br />
# Server generates a 1024-bit RSA keypair.<br />
# ...<br />
# Server answers TCP connection request and receives a [[Protocol#0x02|0x02 handshake]] from the client.<br />
# Server sends [[Protocol#0xFD|0xFD encryption request]] with its public key and a verification token.<br />
# Server receives [[Protocol#0xFC|0xFC encryption response]] from client and decrypts the shared secret.<br />
# Server verifies the validity of the verification token. If this isn't verified, it kicks the client.<br />
# Server sends a HTTP request to<br />
#:<pre>http://session.minecraft.net/game/checkserver.jsp?user=<username>&serverId=<server hash></pre><br />
#:If it returns '''YES''' then the client is authenticated and allowed to join. Otherwise the client will/should be [[Protocol#0xFF|kicked]] with “Failed to verify username!”<br />
# Server sends a [[Protocol#0xFC|0xFC encryption response]] packet with two empty arrays.<br />
# Both sides enable AES/CFB2 encryption.<br />
# Server receives [[Protocol#0xCD|0xCD client status]] with a payload of , indicating "ready to spawn"<br />
# Server sends [[Protocol#0x01|0x01 login]]<br />
# ... send map chunks, etc...<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Legacy_Minecraft_Authentication&diff=4180Legacy Minecraft Authentication2013-07-15T16:29:59Z<p>Sadimusi: Added link to Authentication article</p>
<hr />
<div>'''This system was used by Minecraft versions prior to 1.6 and might be discontinued at any moment without warning.'''<br />
<br />
For the currently used authentication system see [[Authentication]].<br />
<br />
== Login ==<br />
<br />
To log the player in, the official launcher sends an HTTPS POST (GET appears to suffice as well) request to:<br />
<pre>https://login.minecraft.net</pre><br />
with the postdata:<br />
?user=<username>&password=<password>&version=<launcher version><br />
and a "application/x-www-form-urlencoded" Content-Type header.<br />
<br />
After migrating to Mojang accounts, email address is used instead of username, but the procedure stays the same.<br />
<br />
The current launcher version is "13" (for new launcher it's "14"), sending a value lower than 12 will cause the server to return "Old version", however you can send any large number and it will return as expected. If the login succeeded, it will return 5 ':' delimited values.<br />
1343825972000:deprecated:SirCmpwn:7ae9007b9909de05ea58e94199a33b30c310c69c:dba0c48e1c584963b9e93a038a66bb98<br />
#'''current version''' of the game files (not the launcher itself). This is a unix timestamp which the launcher compares to the ~/.minecraft/bin/version file.<br />
#Previously contained a '''download ticket''' for requesting new versions of minecraft.jar from the server. Now contains only "deprecated".<br />
#'''case-correct username'''. For mojang accounts, the user's actual username is returned here instead of the email used to log in.<br />
#'''sessionId''' - a unique ID for your current session.<br />
#'''UID''' - currently unused, introduced near August 8th, 2012. Grum says this is the unique ID for the user, potentially for changing Minecraft names in future.<br />
<br />
If the request is missing a parameter, the server will return "Bad response". If the login information is incorrect, the server will return "Bad login". If the login information is correct but the account isn't premium, the server will return "User not premium". If your minecraft.net account has been migrated to a Mojang account but you're logging in with your minecraft.net username the server will return "Acount migrated, use e-mail".<br />
<br />
== Keep-alive ==<br />
<br />
Every 6000 ticks, the client sends an HTTPS request to<br />
<pre>https://login.minecraft.net/session?name=<username>&session=<session id></pre><br />
The client discards the server's response.<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Snoop&diff=4179Snoop2013-07-15T16:28:26Z<p>Sadimusi: Added category</p>
<hr />
<div>Every 15 minutes, minecraft sends a HTTP POST request giving stats. This can be disabled in server.properties<br />
<br />
* '''client''': http://snoop.minecraft.net/client?version=1<br />
* '''server''': http://snoop.minecraft.net/server?version=1<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! Field<br />
!style="width: 72px" | Client<br />
!style="width: 72px" | Server<br />
! Example<br />
! Notes<br />
|-<br />
| applet<br />
| {{yes}}<br />
| {{no}}<br />
| <code>true</code><br />
| <br />
|-<br />
| avg_rec_packet_count<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| avg_rec_packet_size<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| avg_sent_packet_count<br />
| {{no}}<br />
| {{yes}}<br />
| <code>6</code><br />
| <br />
|-<br />
| avg_sent_packet_size<br />
| {{no}}<br />
| {{yes}}<br />
| <code>44</code><br />
| <br />
|-<br />
| avg_tick_ms<br />
| {{no}}<br />
| {{yes}}<br />
| <code>3</code><br />
| <br />
|-<br />
| client_brand<br />
| {{yes}}<br />
| {{no}}<br />
| <code>vanilla</code><br />
| via <code>ClientBrandRetriever.getClientModName()</code><br />
|-<br />
| cpu_cores<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2</code><br />
| via <code>Runtime.getRuntime().availableProcessors()</code><br />
|-<br />
| dedicated<br />
| {{no}}<br />
| {{yes}}<br />
| <code>true</code><br />
| <br />
|-<br />
| display_frequency<br />
| {{yes}}<br />
| {{no}}<br />
| <code>60</code><br />
| via <code>org.lwjgl.opengl.Display.getDisplayMode().getFrequency()</code><br />
|-<br />
| display_type<br />
| {{yes}}<br />
| {{no}}<br />
| <code>windowed</code><br />
| <code>windowed</code> or <code>fullscreen</code><br />
|-<br />
| fps<br />
| {{yes}}<br />
| {{no}}<br />
| <code>60</code><br />
| <br />
|-<br />
| gl_caps[''key'']<br />
| {{yes}}<br />
| {{no}}<br />
| ''varies by key''<br />
| via <code>org.lwjgl.opengl.GLContext.getCapabilities().GL_ARB_''key''</code><br />
|-<br />
| gl_max_texture_size<br />
| {{yes}}<br />
| {{no}}<br />
| <code>8192</code><br />
| <br />
|-<br />
| gui_state<br />
| {{no}}<br />
| {{yes}}<br />
| <code>disabled</code><br />
| <code>enabled</code> or <code>disabled</code><br />
|-<br />
| gui_supported<br />
| {{no}}<br />
| {{yes}}<br />
| <code>headless</code><br />
| via <code>java.awt.GraphicsEnvironment.isHeadless()</code> (<code>headless</code> or <code>supported</code>)<br />
|-<br />
| java_version<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>1.6.0_24</code><br />
| via <code>System.getProperty("java.version")</code><br />
|-<br />
| jvm_arg[''n'']<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>-Xms2800M</code><br />
| via <code>java.lang.management.ManagementFactory.getRuntimeMXBean().getInputArguments()</code> (-X args only)<br />
|-<br />
| jvm_args<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2</code><br />
| see above<br />
|-<br />
| memory_free<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2429082024</code><br />
| via <code>Runtime.getRuntime().freeMemory()</code><br />
|-<br />
| memory_max<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2813722624</code><br />
| via <code>Runtime.getRuntime().maxMemory()</code><br />
|-<br />
| memory_total<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2813722624</code><br />
| via <code>Runtime.getRuntime().totalMemory()</code><br />
|-<br />
| opengl_vendor<br />
| {{yes}}<br />
| {{no}}<br />
| <code>NVIDIA Corporation</code><br />
| via <code>GL11.glGetString(GL_VENDOR)</code><br />
|-<br />
| opengl_version<br />
| {{yes}}<br />
| {{no}}<br />
| <code>3.3.0 NVIDIA 302.17</code><br />
| via <code>GL11.glGetString(GL_VERSION)</code><br />
|-<br />
| os_architecture<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>amd64</code><br />
| via <code>System.getProperty("os.arch")</code><br />
|-<br />
| os_name<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>Linux</code><br />
| via <code>System.getProperty("os.name")</code><br />
|-<br />
| os_version<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>3.2.0-3-amd64</code><br />
| via <code>System.getProperty("os.version")</code><br />
|-<br />
| players_current<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| players_max<br />
| {{no}}<br />
| {{yes}}<br />
| <code>20</code><br />
| <br />
|-<br />
| players_seen<br />
| {{no}}<br />
| {{yes}}<br />
| <code>4</code><br />
| counts files in world/players<br />
|-<br />
| server_brand<br />
| {{no}}<br />
| {{yes}}<br />
| <code>vanilla</code><br />
| via <code>getServerModName()</code> (hardcoded to "vanilla", overwritten by bukkit et al)<br />
|-<br />
| singleplayer<br />
| {{no}}<br />
| {{yes}}<br />
| <code>false</code><br />
| whether or not the server is running to support a singleplayer session<br />
|-<br />
| snooper_count<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>0</code><br />
| how many times the snooper has reported so far<br />
|-<br />
| snooper_token<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>dfe921ac-0293-4e42-8d99-1316cdd626d8</code><br />
| via <code>java.util.UUID.randomUUID().toString()</code> (unique per program launch)<br />
|-<br />
| texpack_name<br />
| {{yes}}<br />
| {{no}}<br />
| <code>Default</code><br />
| <br />
|-<br />
| texpack_resolution<br />
| {{yes}}<br />
| {{no}}<br />
| <code>16</code><br />
| <br />
|-<br />
| uses_auth<br />
| {{no}}<br />
| {{yes}}<br />
| <code>true</code><br />
| corresponds to <code>online-mode</code> in server.properties<br />
|-<br />
| version<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>1.4.2</code><br />
| <br />
|-<br />
| vsync_enabled<br />
| {{yes}}<br />
| {{no}}<br />
| <code>true</code><br />
| <br />
|-<br />
| whitelist_count<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| whitelist_enabled<br />
| {{no}}<br />
| {{yes}}<br />
| <code>false</code><br />
| <br />
|-<br />
| world[''n''][chunks_loaded]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>978</code><br />
| <br />
|-<br />
| world[''n''][difficulty]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>1</code><br />
| <br />
|-<br />
| world[''n''][dimension]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| world[''n''][generator_name]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>default</code><br />
| <br />
|-<br />
| world[''n''][generator_version]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>1</code><br />
| <br />
|-<br />
| world[''n''][hardcore]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>false</code><br />
| <br />
|-<br />
| world[''n''][height]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>256</code><br />
| <br />
|-<br />
| world[''n''][mode]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>SURVIVAL</code><br />
| <br />
|-<br />
| worlds<br />
| {{no}}<br />
| {{yes}}<br />
| <code>3</code><br />
|}<br />
<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Game_files&diff=4178Game files2013-07-15T16:27:58Z<p>Sadimusi: Added category</p>
<hr />
<div>== Game ==<br />
All available version of the game itself are listed on<br />
http://s3.amazonaws.com/Minecraft.Download/versions/versions.json<br />
<br />
The jar file for a specific version is located at<br />
http://s3.amazonaws.com/Minecraft.Download/versions/<version>/<version>.jar<br />
<br />
Some information on how to properly run said jar are available at<br />
http://s3.amazonaws.com/Minecraft.Download/versions/<version>/<version>.json<br />
<br />
== Libraries ==<br />
The libraries which can be used for all minecraft versions and are downloaded by the launcher are located at<br />
http://s3.amazonaws.com/MinecraftDownload/<br />
<br />
The following files are downloaded from this location:<br />
<br />
* <code>lwjgl.jar</code><br />
* <code>jinput.jar</code><br />
* <code>lwjgl_util.jar</code><br />
* <code>minecraft.jar</code><br />
* <code><operating system>_natives.jar.lzma</code><br />
<br />
The latter is available for the following operating systems:<br />
* <code>windows</code><br />
* <code>linux</code><br />
* <code>macosx</code><br />
* <code>solaris</code><br />
<br />
== Resources == <br />
The game itself downloads further resources from<br />
http://s3.amazonaws.com/MinecraftResources/<br />
<br />
A list of all available resources is available as an XML file at the address above.<br />
<br />
<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Yggdrasil&diff=4177Yggdrasil2013-07-15T16:27:31Z<p>Sadimusi: Redirected page to Authentication</p>
<hr />
<div>#REDIRECT [[Authentication]]</div>Sadimusihttps://wiki.vg/index.php?title=Session&diff=4176Session2013-07-15T16:26:53Z<p>Sadimusi: Redirected page to Authentication</p>
<hr />
<div>#REDIRECT [[Authentication]]</div>Sadimusihttps://wiki.vg/index.php?title=Legacy_Mojang_Authentication&diff=4175Legacy Mojang Authentication2013-07-15T16:26:37Z<p>Sadimusi: Moved here from Session</p>
<hr />
<div>The minecraft client and server communicate with Mojang to validate player sessions. This page describes some of the operations.<br />
<br />
== Authentication ==<br />
<br />
Minecraft 1.6 introduced a new authentication scheme called Yggdrasil which completely replaces the [[Legacy_Authentication|previous authentication system]].<br />
<br />
=== Request format ===<br />
<br />
All requests to Yggdrasil are made to the following server:<br />
<br />
https://authserver.mojang.com<br />
<br />
Further, they are expected to fulfill the following rules:<br />
<br />
* Are <code>POST</code> requests<br />
* Have the <code>Content-Type</code> header set to <code>application/json</code><br />
* Contain a [http://json.org JSON]-encoded dictionary as payload<br />
<br />
If a request was successful the server will respond with:<br />
<br />
* Status code <code>200</code><br />
* A [http://json.org JSON]-encoded dictionary according to the specifications below<br />
<br />
If however a request fails, the server will respond with:<br />
<br />
* An appropriate, non-200 [http://en.wikipedia.org/wiki/List_of_HTTP_status_codes HTTP status code]<br />
* A [http://json.org JSON]-encoded dictionary following this format:<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"error": "Short description of the error",<br />
"errorMessage": "Longer description which can be shown to the user",<br />
"cause": "Cause of the error" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
=== Session ID ===<br />
<br />
Whenever a Mojang service requires a session ID, you can simply combine a valid <code>accessToken</code> with a profile identifier as follows:<br />
<br />
token:<accessToken>:<profile ID><br />
<br />
=== Authenticate ===<br />
<br />
This method is used whenever a user tries to log in using his password.<br />
<br />
==== Endpoint ====<br />
/authenticate<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"agent": { // optional<br />
"name": "Minecraft", // So far this is the only encountered value<br />
"version": 1 // This number might be increased<br />
// by the vanilla client in the future<br />
},<br />
"username": "mojang account name", // Can be an email address or player name for<br />
// unmigrated accounts<br />
"password": "mojang account password",<br />
"clientToken": "client identifier" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
The <code>clientToken</code> should be a randomly generated identifier and must be identical for each request.<br />
In case it is omitted the server will generate a random token based on Java's [http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html#toString() UUID.toString()] which should then be stored by the client. This will however also invalidate all previously acquired <code>accessToken</code>s for this user across all clients.<br />
<br />
<br />
==== Response ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "random access token", // hexadecimal<br />
"clientToken": "client identifier", // identical to the one received<br />
"availableProfiles": [ // only present if the agent field was received<br />
{<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
],<br />
"selectedProfile": { // only present if the agent field was received<br />
"id": "profile identifier",<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
'''Note:''' If a user wishes to stay logged in on his computer you are strongly advised to store the received <code>accessToken</code> instead of the password itself.<br />
<br />
Currently each account will only have one single profile, multiple profiles per account are however planned in the future.<br />
<br />
=== Refresh ===<br />
<br />
This method is used to refresh an expired but valid <code>accessToken</code>. It can be uses to keep a user logged in between gaming sessions and is preferred over storing the user's password in a file (see [[lastlogin]]). <br />
<br />
==== Endpoint ====<br />
/refresh<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "valid accessToken",<br />
"clientToken": "client identifier" // This needs to be identical to the one used<br />
// to obtain the accessToken in the first place<br />
}<br />
</syntaxhighlight><br />
<br />
Note: The provided <code>accessToken</code> gets invalidated.<br />
<br />
==== Response ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "random access token", // hexadecimal<br />
"clientToken": "client identifier", // identical to the one received<br />
"selectedProfile": {<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
== Joining a Server ==<br />
<br />
See [[Protocol Encryption]] for details on encrypting connections.<br />
<br />
=== Client operation ===<br />
<br />
# Client connects to server<br />
# Client sends a [[Protocol#0x02|0x02 handshake]] containing the current player name<br />
# Client receives an [[Protocol#0xFD|0xFD encryption request]] with the server's public key and four verification bytes.<br />
# Client generates a symmetric key.<br />
# Client sends a HTTP request to <br />
#:<pre>http://session.minecraft.net/game/joinserver.jsp?user=<player name>&sessionId=<session id>&serverId=<server hash></pre><br />
#:Note: See the [[#Session ID|Session ID]] section on how the <code>&lt;session id&gt;</code> is generated.<br />
#:If the response is '''OK''' then continue, otherwise stop<br />
# Client sends [[Protocol#0xFC|0xFC encryption response]] - client encrypts shared secret and verification token with the server's public key<br />
# Server checks validity and sends [[Protocol#0xFC|0xFC encryption response]] with two empty arrays<br />
# Both sides enable AES/CFB2 encryption using the shared secret generated by the client<br />
# Client sends [[Protocol#0xCD|0xCD client status]] with a payload of 0 (ready to spawn)<br />
# Server sends [[Protocol#0x01|0x01 login]]<br />
# ... receive map chunks, etc...<br />
<br />
=== Server operation ===<br />
<br />
# Server generates a 1024-bit RSA keypair.<br />
# ...<br />
# Server answers TCP connection request and receives a [[Protocol#0x02|0x02 handshake]] from the client.<br />
# Server sends [[Protocol#0xFD|0xFD encryption request]] with its public key and a verification token.<br />
# Server receives [[Protocol#0xFC|0xFC encryption response]] from client and decrypts the shared secret.<br />
# Server verifies the validity of the verification token. If this isn't verified, it kicks the client.<br />
# Server sends a HTTP request to<br />
#:<pre>http://session.minecraft.net/game/checkserver.jsp?user=<username>&serverId=<server hash></pre><br />
#:If it returns '''YES''' then the client is authenticated and allowed to join. Otherwise the client will/should be [[Protocol#0xFF|kicked]] with “Failed to verify username!”<br />
# Server sends a [[Protocol#0xFC|0xFC encryption response]] packet with two empty arrays.<br />
# Both sides enable AES/CFB2 encryption.<br />
# Server receives [[Protocol#0xCD|0xCD client status]] with a payload of , indicating "ready to spawn"<br />
# Server sends [[Protocol#0x01|0x01 login]]<br />
# ... send map chunks, etc...<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Legacy_Minecraft_Authentication&diff=4174Legacy Minecraft Authentication2013-07-15T16:25:23Z<p>Sadimusi: Added category</p>
<hr />
<div>'''This system was used by Minecraft versions prior to 1.6 and might be discontinued at any moment without warning.'''<br />
== Login ==<br />
<br />
To log the player in, the official launcher sends an HTTPS POST (GET appears to suffice as well) request to:<br />
<pre>https://login.minecraft.net</pre><br />
with the postdata:<br />
?user=<username>&password=<password>&version=<launcher version><br />
and a "application/x-www-form-urlencoded" Content-Type header.<br />
<br />
After migrating to Mojang accounts, email address is used instead of username, but the procedure stays the same.<br />
<br />
The current launcher version is "13" (for new launcher it's "14"), sending a value lower than 12 will cause the server to return "Old version", however you can send any large number and it will return as expected. If the login succeeded, it will return 5 ':' delimited values.<br />
1343825972000:deprecated:SirCmpwn:7ae9007b9909de05ea58e94199a33b30c310c69c:dba0c48e1c584963b9e93a038a66bb98<br />
#'''current version''' of the game files (not the launcher itself). This is a unix timestamp which the launcher compares to the ~/.minecraft/bin/version file.<br />
#Previously contained a '''download ticket''' for requesting new versions of minecraft.jar from the server. Now contains only "deprecated".<br />
#'''case-correct username'''. For mojang accounts, the user's actual username is returned here instead of the email used to log in.<br />
#'''sessionId''' - a unique ID for your current session.<br />
#'''UID''' - currently unused, introduced near August 8th, 2012. Grum says this is the unique ID for the user, potentially for changing Minecraft names in future.<br />
<br />
If the request is missing a parameter, the server will return "Bad response". If the login information is incorrect, the server will return "Bad login". If the login information is correct but the account isn't premium, the server will return "User not premium". If your minecraft.net account has been migrated to a Mojang account but you're logging in with your minecraft.net username the server will return "Acount migrated, use e-mail".<br />
<br />
== Keep-alive ==<br />
<br />
Every 6000 ticks, the client sends an HTTPS request to<br />
<pre>https://login.minecraft.net/session?name=<username>&session=<session id></pre><br />
The client discards the server's response.<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Legacy_Minecraft_Authentication&diff=4173Legacy Minecraft Authentication2013-07-15T16:24:55Z<p>Sadimusi: Moved from Session</p>
<hr />
<div>'''This system was used by Minecraft versions prior to 1.6 and might be discontinued at any moment without warning.'''<br />
== Login ==<br />
<br />
To log the player in, the official launcher sends an HTTPS POST (GET appears to suffice as well) request to:<br />
<pre>https://login.minecraft.net</pre><br />
with the postdata:<br />
?user=<username>&password=<password>&version=<launcher version><br />
and a "application/x-www-form-urlencoded" Content-Type header.<br />
<br />
After migrating to Mojang accounts, email address is used instead of username, but the procedure stays the same.<br />
<br />
The current launcher version is "13" (for new launcher it's "14"), sending a value lower than 12 will cause the server to return "Old version", however you can send any large number and it will return as expected. If the login succeeded, it will return 5 ':' delimited values.<br />
1343825972000:deprecated:SirCmpwn:7ae9007b9909de05ea58e94199a33b30c310c69c:dba0c48e1c584963b9e93a038a66bb98<br />
#'''current version''' of the game files (not the launcher itself). This is a unix timestamp which the launcher compares to the ~/.minecraft/bin/version file.<br />
#Previously contained a '''download ticket''' for requesting new versions of minecraft.jar from the server. Now contains only "deprecated".<br />
#'''case-correct username'''. For mojang accounts, the user's actual username is returned here instead of the email used to log in.<br />
#'''sessionId''' - a unique ID for your current session.<br />
#'''UID''' - currently unused, introduced near August 8th, 2012. Grum says this is the unique ID for the user, potentially for changing Minecraft names in future.<br />
<br />
If the request is missing a parameter, the server will return "Bad response". If the login information is incorrect, the server will return "Bad login". If the login information is correct but the account isn't premium, the server will return "User not premium". If your minecraft.net account has been migrated to a Mojang account but you're logging in with your minecraft.net username the server will return "Acount migrated, use e-mail".<br />
<br />
== Keep-alive ==<br />
<br />
Every 6000 ticks, the client sends an HTTPS request to<br />
<pre>https://login.minecraft.net/session?name=<username>&session=<session id></pre><br />
The client discards the server's response.</div>Sadimusihttps://wiki.vg/index.php?title=Session&diff=4172Session2013-07-15T16:21:33Z<p>Sadimusi: Added refresh method + removed sections which were moved to their own pages</p>
<hr />
<div>The minecraft client and server communicate with minecraft.net to validate player sessions. This page describes some of the operations.<br />
<br />
== Authentication ==<br />
<br />
Minecraft 1.6 introduced a new authentication scheme called Yggdrasil which completely replaces the [[#Outdated authentication system|previous authentication system]].<br />
<br />
=== Request format ===<br />
<br />
All requests to Yggdrasil are made to the following server:<br />
<br />
https://authserver.mojang.com<br />
<br />
Further, they are expected to fulfill the following rules:<br />
<br />
* Are <code>POST</code> requests<br />
* Have the <code>Content-Type</code> header set to <code>application/json</code><br />
* Contain a [http://json.org JSON]-encoded dictionary as payload<br />
<br />
If a request was successful the server will respond with:<br />
<br />
* Status code <code>200</code><br />
* A [http://json.org JSON]-encoded dictionary according to the specifications below<br />
<br />
If however a request fails, the server will respond with:<br />
<br />
* An appropriate, non-200 [http://en.wikipedia.org/wiki/List_of_HTTP_status_codes HTTP status code]<br />
* A [http://json.org JSON]-encoded dictionary following this format:<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"error": "Short description of the error",<br />
"errorMessage": "Longer description which can be shown to the user",<br />
"cause": "Cause of the error" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
=== Session ID ===<br />
<br />
Whenever a Mojang service requires a session ID, you can simply combine a valid <code>accessToken</code> with a profile identifier as follows:<br />
<br />
token:<accessToken>:<profile ID><br />
<br />
=== Authenticate ===<br />
<br />
This method is used whenever a user tries to log in using his password.<br />
<br />
==== Endpoint ====<br />
/authenticate<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"agent": { // optional<br />
"name": "Minecraft", // So far this is the only encountered value<br />
"version": 1 // This number might be increased<br />
// by the vanilla client in the future<br />
},<br />
"username": "mojang account name", // Can be an email address or player name for<br />
// unmigrated accounts<br />
"password": "mojang account password",<br />
"clientToken": "client identifier" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
The <code>clientToken</code> should be a randomly generated identifier and must be identical for each request.<br />
In case it is omitted the server will generate a random token based on Java's [http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html#toString() UUID.toString()] which should then be stored by the client. This will however also invalidate all previously acquired <code>accessToken</code>s for this user across all clients.<br />
<br />
<br />
==== Response ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "random access token", // hexadecimal<br />
"clientToken": "client identifier", // identical to the one received<br />
"availableProfiles": [ // only present if the agent field was received<br />
{<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
],<br />
"selectedProfile": { // only present if the agent field was received<br />
"id": "profile identifier",<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
'''Note:''' If a user wishes to stay logged in on his computer you are strongly advised to store the received <code>accessToken</code> instead of the password itself.<br />
<br />
Currently each account will only have one single profile, multiple profiles per account are however planned in the future.<br />
<br />
=== Refresh ===<br />
<br />
This method is used to refresh an expired but valid <code>accessToken</code>. It can be uses to keep a user logged in between gaming sessions and is preferred over storing the user's password in a file (see [[lastlogin]]). <br />
<br />
==== Endpoint ====<br />
/refresh<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "valid accessToken",<br />
"clientToken": "client identifier" // This needs to be identical to the one used<br />
// to obtain the accessToken in the first place<br />
}<br />
</syntaxhighlight><br />
<br />
Note: The provided <code>accessToken</code> gets invalidated.<br />
<br />
==== Response ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "random access token", // hexadecimal<br />
"clientToken": "client identifier", // identical to the one received<br />
"selectedProfile": {<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
== Joining a Server ==<br />
<br />
See [[Protocol Encryption]] for details on encrypting connections.<br />
<br />
=== Client operation ===<br />
<br />
# Client connects to server<br />
# Client sends a [[Protocol#0x02|0x02 handshake]] containing the current player name<br />
# Client receives an [[Protocol#0xFD|0xFD encryption request]] with the server's public key and four verification bytes.<br />
# Client generates a symmetric key.<br />
# Client sends a HTTP request to <br />
#:<pre>http://session.minecraft.net/game/joinserver.jsp?user=<player name>&sessionId=<session id>&serverId=<server hash></pre><br />
#:Note: See the [[#Session ID|Session ID]] section on how the <code>&lt;session id&gt;</code> is generated.<br />
#:If the response is '''OK''' then continue, otherwise stop<br />
# Client sends [[Protocol#0xFC|0xFC encryption response]] - client encrypts shared secret and verification token with the server's public key<br />
# Server checks validity and sends [[Protocol#0xFC|0xFC encryption response]] with two empty arrays<br />
# Both sides enable AES/CFB2 encryption using the shared secret generated by the client<br />
# Client sends [[Protocol#0xCD|0xCD client status]] with a payload of 0 (ready to spawn)<br />
# Server sends [[Protocol#0x01|0x01 login]]<br />
# ... receive map chunks, etc...<br />
<br />
=== Server operation ===<br />
<br />
# Server generates a 1024-bit RSA keypair.<br />
# ...<br />
# Server answers TCP connection request and receives a [[Protocol#0x02|0x02 handshake]] from the client.<br />
# Server sends [[Protocol#0xFD|0xFD encryption request]] with its public key and a verification token.<br />
# Server receives [[Protocol#0xFC|0xFC encryption response]] from client and decrypts the shared secret.<br />
# Server verifies the validity of the verification token. If this isn't verified, it kicks the client.<br />
# Server sends a HTTP request to<br />
#:<pre>http://session.minecraft.net/game/checkserver.jsp?user=<username>&serverId=<server hash></pre><br />
#:If it returns '''YES''' then the client is authenticated and allowed to join. Otherwise the client will/should be [[Protocol#0xFF|kicked]] with “Failed to verify username!”<br />
# Server sends a [[Protocol#0xFC|0xFC encryption response]] packet with two empty arrays.<br />
# Both sides enable AES/CFB2 encryption.<br />
# Server receives [[Protocol#0xCD|0xCD client status]] with a payload of , indicating "ready to spawn"<br />
# Server sends [[Protocol#0x01|0x01 login]]<br />
# ... send map chunks, etc...<br />
<br />
<br />
== Outdated authentication system ==<br />
This system was used by Minecraft versions prior to 1.6 and might be discontinued at any moment without warning.<br />
<br />
=== Login ===<br />
<br />
To log the player in, the official launcher sends an HTTPS POST (GET appears to suffice as well) request to:<br />
<pre>https://login.minecraft.net</pre><br />
with the postdata:<br />
?user=<username>&password=<password>&version=<launcher version><br />
and a "application/x-www-form-urlencoded" Content-Type header.<br />
<br />
After migrating to Mojang accounts, email address is used instead of username, but the procedure stays the same.<br />
<br />
The current launcher version is "13" (for new launcher it's "14"), sending a value lower than 12 will cause the server to return "Old version", however you can send any large number and it will return as expected. If the login succeeded, it will return 5 ':' delimited values.<br />
1343825972000:deprecated:SirCmpwn:7ae9007b9909de05ea58e94199a33b30c310c69c:dba0c48e1c584963b9e93a038a66bb98<br />
#'''current version''' of the game files (not the launcher itself). This is a unix timestamp which the launcher compares to the ~/.minecraft/bin/version file.<br />
#Previously contained a '''download ticket''' for requesting new versions of minecraft.jar from the server. Now contains only "deprecated".<br />
#'''case-correct username'''. For mojang accounts, the user's actual username is returned here instead of the email used to log in.<br />
#'''sessionId''' - a unique ID for your current session.<br />
#'''UID''' - currently unused, introduced near August 8th, 2012. Grum says this is the unique ID for the user, potentially for changing Minecraft names in future.<br />
<br />
If the request is missing a parameter, the server will return "Bad response". If the login information is incorrect, the server will return "Bad login". If the login information is correct but the account isn't premium, the server will return "User not premium". If your minecraft.net account has been migrated to a Mojang account but you're logging in with your minecraft.net username the server will return "Acount migrated, use e-mail".<br />
<br />
=== Keep-alive ===<br />
<br />
Every 6000 ticks, the client sends an HTTPS request to<br />
<pre>https://login.minecraft.net/session?name=<username>&session=<session id></pre><br />
The client discards the server's response.<br />
<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Yggdrasil&diff=4171Yggdrasil2013-07-15T14:09:06Z<p>Sadimusi: Redirected page to Session</p>
<hr />
<div>#REDIRECT [[Session]]</div>Sadimusihttps://wiki.vg/index.php?title=Legacy_Mojang_Authentication&diff=4170Legacy Mojang Authentication2013-07-15T14:06:51Z<p>Sadimusi: Redirected page to Session#Authentication</p>
<hr />
<div>#REDIRECT [[Session#Authentication]]</div>Sadimusihttps://wiki.vg/index.php?title=Main_Page&diff=4169Main Page2013-07-15T14:06:16Z<p>Sadimusi: Added game files and snoop mechanism to modern documentation section</p>
<hr />
<div>__NOTOC____NOEDITSECTION__<br />
{{Box|<br />
BORDER = #9999FF|<br />
BACKGROUND = #99CCFF|<br />
WIDTH = 100%|<br />
ICON = |<br />
HEADING = Minecraft Modern |<br />
CONTENT = <br />
[[File:Banner beta.png|link=Category:Minecraft Modern]]<br />
<br />
Minecraft Modern is the latest (and only updated) version of Minecraft which requires a paid account to download, update and play. Most of the new development projects focus on either creating entirely new programs from scratch that interoperate with Minecraft (such as a bot or server) or modding projects that wrap the client or server and provide bug fixes, new features and enhancements to existing features.<br />
<br />
=== Documentation ===<br />
There are ongoing efforts to keep reverse engineered documentation updated, but it isn't as easy as it sounds. The protocol generally changes with each release, and both the Client and Server classes get rearranged on each release. Below are links to the current documentation segments, which '''may or may not be up to date'''.<br />
<br />
* [[Protocol FAQ]]<br />
* [[Protocol|Current Protocol Specification]]<br />
* [[Pre-release protocol|Pre-release Protocol Specificaton]]<br />
* [[Rcon]] and [[Query]] protocol specifications<br />
* [[Authentication|Authentication Scheme]]<br />
* [[Protocol Encryption]]<br />
* [[Game Files|Location of Game Files]]<br />
* [[Snoop|Snoop Mechanism]]<br />
* [[Map Format]] (See also: mirror of the old [[NBT]].txt)<br />
<br />
=== Tools & Mods ===<br />
* [[Client List|Clients]] - third-party Minecraft clients.<br />
* [[Server List|Servers]] - third-party Minecraft servers.<br />
* [[Library List|Libraries]] - libraries to interface with Minecraft data files or network protocols.<br />
* [[Utility List|Utilities]] - tools that interface with a client, server, or data files, such as proxies, bots, or inventory editors.<br />
* [[Wrapper List|Wrappers]] - mods that override features in the client or server<br />
* [http://b.wiki.vg/ Burger Vitrine] shows differences in data and protocol between arbitrary versions.<br />
* [[:Code Snippets]]<br />
<br />
=== Tutorials & Guides ===<br />
* [[How to Write a Client]]<br />
* [[Chat|How Chat Works]]<br />
<br />
For more info, check out [[:Category:Minecraft Modern|Minecraft Modern]].<br />
}}<br />
<br />
{{Box|<br />
BORDER = #9999FF|<br />
BACKGROUND = #99CCFF|<br />
WIDTH = 100%|<br />
ICON = |<br />
HEADING = Minecraft Classic |<br />
CONTENT = <br />
[[File:Banner classic.png|link=Category:Minecraft Classic]]<br />
<br />
Minecraft Classic is the original version of Minecraft, available for free to the public. It's still available off of the main website today and is still played by many people, with an active development community. As it's been around since 2010, and because it's so simplistic, there are many, many programs made to work with Classic - there are over '''18+''' servers alone, written in everything from C++ to PureBasic to Perl. It's highly recommend if you're planning to do a development project at this point to instead look into the Minecraft Modern specifications.<br />
<br />
=== Documentation ===<br />
As there is no longer any work being done on classic, the documentation for it is stable. If you create something that works with it, it probably always will.<br />
* [[Classic Protocol|Protocol Specification]]<br />
* [[Classic DAT Format|Server Map Format (.dat)]]<br />
* [[MCLevel Format|Saved Level Format (.mclevel)]]<br />
<br />
=== Source Code Snippets ===<br />
Source code snippets provide insight into how specific features work or can be accomplished, and by themselves are generally free to use in your own program.<br />
* Deserializing the level.dat file format ([[deserialize.c|C]], [https://gist.github.com/324122945a569a513bae C#])<br />
* [[:Category:Code Snippets|More...]]<br />
<br />
=== Tools and Mods ===<br />
Useful information & links<br />
* [[Classic Client List|Clients]] - third-party Classic clients.<br />
* [[Classic Server List|Servers]] - third-party Classic servers.<br />
* [[Classic Library List|Libraries]] - libraries to interface with Minecraft data files or network protocols.<br />
* [[Classic Utility List|Utilities]] - tools that interface with a client, server, or data files, such as proxies or bots.<br />
* [[Classic Wrapper List|Wrappers]] - mods that override features in the client or server.<br />
<br />
For more info, check out [[:Category:Minecraft Classic|Minecraft Classic]].<br />
}}<br />
<br />
{{Box|<br />
BORDER = #9999FF|<br />
BACKGROUND = #99CCFF|<br />
WIDTH = 100%|<br />
ICON = |<br />
HEADING = Minecraft Pocket Edition |<br />
CONTENT = <br />
[[File:Banner pocket.png|link=Category:Pocket Minecraft]]<br />
<br />
Pocket Minecraft is the version of Minecraft for portable systems such as Android or iOS devices. It currently has very little documentation.<br />
<br />
=== Documentation ===<br />
The documentation for Pocket Minecraft is currently lacking and needs improvement.<br />
* [[Pocket Minecraft Protocol|Protocol Specification]]<br />
* [[Pocket Edition FAQ|FAQ]]<br />
* [[Pocket Realms|Pocket Realms]]<br />
* [[Pocket Minecraft Map Format|Map Format]]<br />
<br />
=== Tools ===<br />
Useful information & links<br />
* [[Pocket Edition Program List|Program list]] - third-party PE programs<br />
<br />
For more info, check out [[:Category:Pocket Minecraft|Pocket Minecraft]].<br />
<br />
}}</div>Sadimusihttps://wiki.vg/index.php?title=Game_files&diff=4168Game files2013-07-15T14:02:10Z<p>Sadimusi: Created page with "== Game == All available version of the game itself are listed on http://s3.amazonaws.com/Minecraft.Download/versions/versions.json The jar file for a specific version is l..."</p>
<hr />
<div>== Game ==<br />
All available version of the game itself are listed on<br />
http://s3.amazonaws.com/Minecraft.Download/versions/versions.json<br />
<br />
The jar file for a specific version is located at<br />
http://s3.amazonaws.com/Minecraft.Download/versions/<version>/<version>.jar<br />
<br />
Some information on how to properly run said jar are available at<br />
http://s3.amazonaws.com/Minecraft.Download/versions/<version>/<version>.json<br />
<br />
== Libraries ==<br />
The libraries which can be used for all minecraft versions and are downloaded by the launcher are located at<br />
http://s3.amazonaws.com/MinecraftDownload/<br />
<br />
The following files are downloaded from this location:<br />
<br />
* <code>lwjgl.jar</code><br />
* <code>jinput.jar</code><br />
* <code>lwjgl_util.jar</code><br />
* <code>minecraft.jar</code><br />
* <code><operating system>_natives.jar.lzma</code><br />
<br />
The latter is available for the following operating systems:<br />
* <code>windows</code><br />
* <code>linux</code><br />
* <code>macosx</code><br />
* <code>solaris</code><br />
<br />
== Resources == <br />
The game itself downloads further resources from<br />
http://s3.amazonaws.com/MinecraftResources/<br />
<br />
A list of all available resources is available as an XML file at the address above.</div>Sadimusihttps://wiki.vg/index.php?title=Snoop&diff=4167Snoop2013-07-15T13:30:26Z<p>Sadimusi: Created page with "Every 15 minutes, minecraft sends a HTTP POST request giving stats. This can be disabled in server.properties * '''client''': http://snoop.minecraft.net/client?version=1 * ''..."</p>
<hr />
<div>Every 15 minutes, minecraft sends a HTTP POST request giving stats. This can be disabled in server.properties<br />
<br />
* '''client''': http://snoop.minecraft.net/client?version=1<br />
* '''server''': http://snoop.minecraft.net/server?version=1<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! Field<br />
!style="width: 72px" | Client<br />
!style="width: 72px" | Server<br />
! Example<br />
! Notes<br />
|-<br />
| applet<br />
| {{yes}}<br />
| {{no}}<br />
| <code>true</code><br />
| <br />
|-<br />
| avg_rec_packet_count<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| avg_rec_packet_size<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| avg_sent_packet_count<br />
| {{no}}<br />
| {{yes}}<br />
| <code>6</code><br />
| <br />
|-<br />
| avg_sent_packet_size<br />
| {{no}}<br />
| {{yes}}<br />
| <code>44</code><br />
| <br />
|-<br />
| avg_tick_ms<br />
| {{no}}<br />
| {{yes}}<br />
| <code>3</code><br />
| <br />
|-<br />
| client_brand<br />
| {{yes}}<br />
| {{no}}<br />
| <code>vanilla</code><br />
| via <code>ClientBrandRetriever.getClientModName()</code><br />
|-<br />
| cpu_cores<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2</code><br />
| via <code>Runtime.getRuntime().availableProcessors()</code><br />
|-<br />
| dedicated<br />
| {{no}}<br />
| {{yes}}<br />
| <code>true</code><br />
| <br />
|-<br />
| display_frequency<br />
| {{yes}}<br />
| {{no}}<br />
| <code>60</code><br />
| via <code>org.lwjgl.opengl.Display.getDisplayMode().getFrequency()</code><br />
|-<br />
| display_type<br />
| {{yes}}<br />
| {{no}}<br />
| <code>windowed</code><br />
| <code>windowed</code> or <code>fullscreen</code><br />
|-<br />
| fps<br />
| {{yes}}<br />
| {{no}}<br />
| <code>60</code><br />
| <br />
|-<br />
| gl_caps[''key'']<br />
| {{yes}}<br />
| {{no}}<br />
| ''varies by key''<br />
| via <code>org.lwjgl.opengl.GLContext.getCapabilities().GL_ARB_''key''</code><br />
|-<br />
| gl_max_texture_size<br />
| {{yes}}<br />
| {{no}}<br />
| <code>8192</code><br />
| <br />
|-<br />
| gui_state<br />
| {{no}}<br />
| {{yes}}<br />
| <code>disabled</code><br />
| <code>enabled</code> or <code>disabled</code><br />
|-<br />
| gui_supported<br />
| {{no}}<br />
| {{yes}}<br />
| <code>headless</code><br />
| via <code>java.awt.GraphicsEnvironment.isHeadless()</code> (<code>headless</code> or <code>supported</code>)<br />
|-<br />
| java_version<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>1.6.0_24</code><br />
| via <code>System.getProperty("java.version")</code><br />
|-<br />
| jvm_arg[''n'']<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>-Xms2800M</code><br />
| via <code>java.lang.management.ManagementFactory.getRuntimeMXBean().getInputArguments()</code> (-X args only)<br />
|-<br />
| jvm_args<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2</code><br />
| see above<br />
|-<br />
| memory_free<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2429082024</code><br />
| via <code>Runtime.getRuntime().freeMemory()</code><br />
|-<br />
| memory_max<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2813722624</code><br />
| via <code>Runtime.getRuntime().maxMemory()</code><br />
|-<br />
| memory_total<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2813722624</code><br />
| via <code>Runtime.getRuntime().totalMemory()</code><br />
|-<br />
| opengl_vendor<br />
| {{yes}}<br />
| {{no}}<br />
| <code>NVIDIA Corporation</code><br />
| via <code>GL11.glGetString(GL_VENDOR)</code><br />
|-<br />
| opengl_version<br />
| {{yes}}<br />
| {{no}}<br />
| <code>3.3.0 NVIDIA 302.17</code><br />
| via <code>GL11.glGetString(GL_VERSION)</code><br />
|-<br />
| os_architecture<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>amd64</code><br />
| via <code>System.getProperty("os.arch")</code><br />
|-<br />
| os_name<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>Linux</code><br />
| via <code>System.getProperty("os.name")</code><br />
|-<br />
| os_version<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>3.2.0-3-amd64</code><br />
| via <code>System.getProperty("os.version")</code><br />
|-<br />
| players_current<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| players_max<br />
| {{no}}<br />
| {{yes}}<br />
| <code>20</code><br />
| <br />
|-<br />
| players_seen<br />
| {{no}}<br />
| {{yes}}<br />
| <code>4</code><br />
| counts files in world/players<br />
|-<br />
| server_brand<br />
| {{no}}<br />
| {{yes}}<br />
| <code>vanilla</code><br />
| via <code>getServerModName()</code> (hardcoded to "vanilla", overwritten by bukkit et al)<br />
|-<br />
| singleplayer<br />
| {{no}}<br />
| {{yes}}<br />
| <code>false</code><br />
| whether or not the server is running to support a singleplayer session<br />
|-<br />
| snooper_count<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>0</code><br />
| how many times the snooper has reported so far<br />
|-<br />
| snooper_token<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>dfe921ac-0293-4e42-8d99-1316cdd626d8</code><br />
| via <code>java.util.UUID.randomUUID().toString()</code> (unique per program launch)<br />
|-<br />
| texpack_name<br />
| {{yes}}<br />
| {{no}}<br />
| <code>Default</code><br />
| <br />
|-<br />
| texpack_resolution<br />
| {{yes}}<br />
| {{no}}<br />
| <code>16</code><br />
| <br />
|-<br />
| uses_auth<br />
| {{no}}<br />
| {{yes}}<br />
| <code>true</code><br />
| corresponds to <code>online-mode</code> in server.properties<br />
|-<br />
| version<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>1.4.2</code><br />
| <br />
|-<br />
| vsync_enabled<br />
| {{yes}}<br />
| {{no}}<br />
| <code>true</code><br />
| <br />
|-<br />
| whitelist_count<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| whitelist_enabled<br />
| {{no}}<br />
| {{yes}}<br />
| <code>false</code><br />
| <br />
|-<br />
| world[''n''][chunks_loaded]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>978</code><br />
| <br />
|-<br />
| world[''n''][difficulty]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>1</code><br />
| <br />
|-<br />
| world[''n''][dimension]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| world[''n''][generator_name]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>default</code><br />
| <br />
|-<br />
| world[''n''][generator_version]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>1</code><br />
| <br />
|-<br />
| world[''n''][hardcore]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>false</code><br />
| <br />
|-<br />
| world[''n''][height]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>256</code><br />
| <br />
|-<br />
| world[''n''][mode]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>SURVIVAL</code><br />
| <br />
|-<br />
| worlds<br />
| {{no}}<br />
| {{yes}}<br />
| <code>3</code><br />
|}</div>Sadimusihttps://wiki.vg/index.php?title=Session&diff=4166Session2013-07-15T13:28:47Z<p>Sadimusi: Fixed session ID section</p>
<hr />
<div>The minecraft client and server communicate with minecraft.net to validate player sessions. This page describes some of the operations.<br />
<br />
== Authentication ==<br />
<br />
Minecraft 1.6 introduced a new authentication scheme called Yggdrasil which completely replaces the [[#Outdated authentication system|previous authentication system]].<br />
<br />
=== Request format ===<br />
<br />
All requests to Yggdrasil are made to the following server:<br />
<br />
https://authserver.mojang.com<br />
<br />
Further, they are expected to fulfill the following rules:<br />
<br />
* Are <code>POST</code> requests<br />
* Have the <code>Content-Type</code> header set to <code>application/json</code><br />
* Contain a [http://json.org JSON]-encoded dictionary as payload<br />
<br />
If a request was successful the server will respond with:<br />
<br />
* Status code <code>200</code><br />
* A [http://json.org JSON]-encoded dictionary according to the specifications below<br />
<br />
If however a request fails, the server will respond with:<br />
<br />
* An appropriate, non-200 [http://en.wikipedia.org/wiki/List_of_HTTP_status_codes HTTP status code]<br />
* A [http://json.org JSON]-encoded dictionary following this format:<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"error": "Short description of the error",<br />
"errorMessage": "Longer description which can be shown to the user",<br />
"cause": "Cause of the error" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
=== Session ID ===<br />
Whenever a Mojang service requires a session ID, you can simply combine a valid <code>accessToken</code> with a profile identifier as follows:<br />
<br />
token:<accessToken>:<profile ID><br />
<br />
=== Authenticate ===<br />
This method is used whenever a user tries to log in using his password.<br />
<br />
==== Endpoint ====<br />
/authenticate<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"agent": {<br />
"name": "Minecraft", // So far this is the only encountered value<br />
"version": 1 // This number might be increased<br />
// by the vanilla client in the future<br />
},<br />
"username": "mojang account name", // Can be an email address or player name for<br />
// unmigrated accounts<br />
"password": "mojang account password",<br />
"clientToken": "client identifier" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
The <code>clientToken</code> should be a randomly generated identifier and must identical for each request.<br />
In case it is omitted the server will generate a random token based on Java's [http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html#toString() UUID.toString()] which should then be stored by the client.<br />
<br />
==== Response ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "random access token", // hexadecimal<br />
"clientToken": "client identifier", // identical to the one received<br />
"availableProfiles": [<br />
{<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
],<br />
"selectedProfile": {<br />
"id": "profile identifier",<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
'''Note:''' If a user wishes to stay logged in on his computer you are strongly advised to store the received <code>accessToken</code> instead of the password itself.<br />
<br />
Currently each account will only have one single profile, multiple profiles per account are however planned in the future.<br />
<br />
<br />
== Updating ==<br />
<br />
To update, the launcher downloads files from <br />
<pre>http://s3.amazonaws.com/MinecraftDownload/</pre><br />
It takes the unix timestamp from the login request and stores it in ~/.minecraft/bin/version<br /><br />
The following files are downloaded from /MinecraftDownload/ in this exact order:<br /><br />
*lwjgl.jar<br />
*jinput.jar<br />
*lwjgl_util.jar<br />
*minecraft.jar<br />
And then the natives.jar appropriate for the following operating systems: windows, linux, macosx, and solaris<br />
*<os-from-list-above>_natives.jar.lzma<br />
<br />
When downloading minecraft.jar, GET variables are set as follows: ?user=foo&ticket=deprecated, although they seem unnecessary to successfully downloading the file. <br /><br />
Furthermore, the downloaded files are all verified via MD5 which is sent via ETag by the server on the page for each file.<br />
<br />
Further resources are stored in /MinecraftResources. Loading /MinecraftResources provides an XML formatted list of resources, some of which are downloaded by Minecraft and not the launcher.<br />
<br />
=== Updating 1.6 ===<br />
<br />
With the new launcher updating happens by downloading information from https://s3.amazonaws.com/Minecraft.Download/versions/versions.json and https://s3.amazonaws.com/Minecraft.Download/versions/1.6.2/1.6.2.json<br />
<br />
<br />
== Snoop ==<br />
<br />
Every 15 minutes, minecraft sends a HTTP POST request giving stats. This can be disabled in server.properties<br />
<br />
* '''client''': http://snoop.minecraft.net/client?version=1<br />
* '''server''': http://snoop.minecraft.net/server?version=1<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! Field<br />
!style="width: 72px" | Client<br />
!style="width: 72px" | Server<br />
! Example<br />
! Notes<br />
|-<br />
| applet<br />
| {{yes}}<br />
| {{no}}<br />
| <code>true</code><br />
| <br />
|-<br />
| avg_rec_packet_count<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| avg_rec_packet_size<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| avg_sent_packet_count<br />
| {{no}}<br />
| {{yes}}<br />
| <code>6</code><br />
| <br />
|-<br />
| avg_sent_packet_size<br />
| {{no}}<br />
| {{yes}}<br />
| <code>44</code><br />
| <br />
|-<br />
| avg_tick_ms<br />
| {{no}}<br />
| {{yes}}<br />
| <code>3</code><br />
| <br />
|-<br />
| client_brand<br />
| {{yes}}<br />
| {{no}}<br />
| <code>vanilla</code><br />
| via <code>ClientBrandRetriever.getClientModName()</code><br />
|-<br />
| cpu_cores<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2</code><br />
| via <code>Runtime.getRuntime().availableProcessors()</code><br />
|-<br />
| dedicated<br />
| {{no}}<br />
| {{yes}}<br />
| <code>true</code><br />
| <br />
|-<br />
| display_frequency<br />
| {{yes}}<br />
| {{no}}<br />
| <code>60</code><br />
| via <code>org.lwjgl.opengl.Display.getDisplayMode().getFrequency()</code><br />
|-<br />
| display_type<br />
| {{yes}}<br />
| {{no}}<br />
| <code>windowed</code><br />
| <code>windowed</code> or <code>fullscreen</code><br />
|-<br />
| fps<br />
| {{yes}}<br />
| {{no}}<br />
| <code>60</code><br />
| <br />
|-<br />
| gl_caps[''key'']<br />
| {{yes}}<br />
| {{no}}<br />
| ''varies by key''<br />
| via <code>org.lwjgl.opengl.GLContext.getCapabilities().GL_ARB_''key''</code><br />
|-<br />
| gl_max_texture_size<br />
| {{yes}}<br />
| {{no}}<br />
| <code>8192</code><br />
| <br />
|-<br />
| gui_state<br />
| {{no}}<br />
| {{yes}}<br />
| <code>disabled</code><br />
| <code>enabled</code> or <code>disabled</code><br />
|-<br />
| gui_supported<br />
| {{no}}<br />
| {{yes}}<br />
| <code>headless</code><br />
| via <code>java.awt.GraphicsEnvironment.isHeadless()</code> (<code>headless</code> or <code>supported</code>)<br />
|-<br />
| java_version<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>1.6.0_24</code><br />
| via <code>System.getProperty("java.version")</code><br />
|-<br />
| jvm_arg[''n'']<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>-Xms2800M</code><br />
| via <code>java.lang.management.ManagementFactory.getRuntimeMXBean().getInputArguments()</code> (-X args only)<br />
|-<br />
| jvm_args<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2</code><br />
| see above<br />
|-<br />
| memory_free<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2429082024</code><br />
| via <code>Runtime.getRuntime().freeMemory()</code><br />
|-<br />
| memory_max<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2813722624</code><br />
| via <code>Runtime.getRuntime().maxMemory()</code><br />
|-<br />
| memory_total<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2813722624</code><br />
| via <code>Runtime.getRuntime().totalMemory()</code><br />
|-<br />
| opengl_vendor<br />
| {{yes}}<br />
| {{no}}<br />
| <code>NVIDIA Corporation</code><br />
| via <code>GL11.glGetString(GL_VENDOR)</code><br />
|-<br />
| opengl_version<br />
| {{yes}}<br />
| {{no}}<br />
| <code>3.3.0 NVIDIA 302.17</code><br />
| via <code>GL11.glGetString(GL_VERSION)</code><br />
|-<br />
| os_architecture<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>amd64</code><br />
| via <code>System.getProperty("os.arch")</code><br />
|-<br />
| os_name<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>Linux</code><br />
| via <code>System.getProperty("os.name")</code><br />
|-<br />
| os_version<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>3.2.0-3-amd64</code><br />
| via <code>System.getProperty("os.version")</code><br />
|-<br />
| players_current<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| players_max<br />
| {{no}}<br />
| {{yes}}<br />
| <code>20</code><br />
| <br />
|-<br />
| players_seen<br />
| {{no}}<br />
| {{yes}}<br />
| <code>4</code><br />
| counts files in world/players<br />
|-<br />
| server_brand<br />
| {{no}}<br />
| {{yes}}<br />
| <code>vanilla</code><br />
| via <code>getServerModName()</code> (hardcoded to "vanilla", overwritten by bukkit et al)<br />
|-<br />
| singleplayer<br />
| {{no}}<br />
| {{yes}}<br />
| <code>false</code><br />
| whether or not the server is running to support a singleplayer session<br />
|-<br />
| snooper_count<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>0</code><br />
| how many times the snooper has reported so far<br />
|-<br />
| snooper_token<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>dfe921ac-0293-4e42-8d99-1316cdd626d8</code><br />
| via <code>java.util.UUID.randomUUID().toString()</code> (unique per program launch)<br />
|-<br />
| texpack_name<br />
| {{yes}}<br />
| {{no}}<br />
| <code>Default</code><br />
| <br />
|-<br />
| texpack_resolution<br />
| {{yes}}<br />
| {{no}}<br />
| <code>16</code><br />
| <br />
|-<br />
| uses_auth<br />
| {{no}}<br />
| {{yes}}<br />
| <code>true</code><br />
| corresponds to <code>online-mode</code> in server.properties<br />
|-<br />
| version<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>1.4.2</code><br />
| <br />
|-<br />
| vsync_enabled<br />
| {{yes}}<br />
| {{no}}<br />
| <code>true</code><br />
| <br />
|-<br />
| whitelist_count<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| whitelist_enabled<br />
| {{no}}<br />
| {{yes}}<br />
| <code>false</code><br />
| <br />
|-<br />
| world[''n''][chunks_loaded]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>978</code><br />
| <br />
|-<br />
| world[''n''][difficulty]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>1</code><br />
| <br />
|-<br />
| world[''n''][dimension]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| world[''n''][generator_name]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>default</code><br />
| <br />
|-<br />
| world[''n''][generator_version]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>1</code><br />
| <br />
|-<br />
| world[''n''][hardcore]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>false</code><br />
| <br />
|-<br />
| world[''n''][height]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>256</code><br />
| <br />
|-<br />
| world[''n''][mode]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>SURVIVAL</code><br />
| <br />
|-<br />
| worlds<br />
| {{no}}<br />
| {{yes}}<br />
| <code>3</code><br />
|}<br />
<br />
== Joining a Server ==<br />
<br />
See [[Protocol Encryption]] for details on encrypting connections.<br />
<br />
=== Client operation ===<br />
<br />
# Client connects to server<br />
# Client sends a [[Protocol#0x02|0x02 handshake]] containing the current player name<br />
# Client receives an [[Protocol#0xFD|0xFD encryption request]] with the server's public key and four verification bytes.<br />
# Client generates a symmetric key.<br />
# Client sends a HTTP request to <br />
#:<pre>http://session.minecraft.net/game/joinserver.jsp?user=<player name>&sessionId=<session id>&serverId=<server hash></pre><br />
#:Note: See the [[#Session ID|Session ID]] section on how the <code>&lt;session id&gt;</code> is generated.<br />
#:If the response is '''OK''' then continue, otherwise stop<br />
# Client sends [[Protocol#0xFC|0xFC encryption response]] - client encrypts shared secret and verification token with the server's public key<br />
# Server checks validity and sends [[Protocol#0xFC|0xFC encryption response]] with two empty arrays<br />
# Both sides enable AES/CFB2 encryption using the shared secret generated by the client<br />
# Client sends [[Protocol#0xCD|0xCD client status]] with a payload of 0 (ready to spawn)<br />
# Server sends [[Protocol#0x01|0x01 login]]<br />
# ... receive map chunks, etc...<br />
<br />
=== Server operation ===<br />
<br />
# Server generates a 1024-bit RSA keypair.<br />
# ...<br />
# Server answers TCP connection request and receives a [[Protocol#0x02|0x02 handshake]] from the client.<br />
# Server sends [[Protocol#0xFD|0xFD encryption request]] with its public key and a verification token.<br />
# Server receives [[Protocol#0xFC|0xFC encryption response]] from client and decrypts the shared secret.<br />
# Server verifies the validity of the verification token. If this isn't verified, it kicks the client.<br />
# Server sends a HTTP request to<br />
#:<pre>http://session.minecraft.net/game/checkserver.jsp?user=<username>&serverId=<server hash></pre><br />
#:If it returns '''YES''' then the client is authenticated and allowed to join. Otherwise the client will/should be [[Protocol#0xFF|kicked]] with “Failed to verify username!”<br />
# Server sends a [[Protocol#0xFC|0xFC encryption response]] packet with two empty arrays.<br />
# Both sides enable AES/CFB2 encryption.<br />
# Server receives [[Protocol#0xCD|0xCD client status]] with a payload of , indicating "ready to spawn"<br />
# Server sends [[Protocol#0x01|0x01 login]]<br />
# ... send map chunks, etc...<br />
<br />
<br />
== Outdated authentication system ==<br />
This system was used by Minecraft versions prior to 1.6 and might be discontinued at any moment without warning.<br />
<br />
=== Login ===<br />
<br />
To log the player in, the official launcher sends an HTTPS POST (GET appears to suffice as well) request to:<br />
<pre>https://login.minecraft.net</pre><br />
with the postdata:<br />
?user=<username>&password=<password>&version=<launcher version><br />
and a "application/x-www-form-urlencoded" Content-Type header.<br />
<br />
After migrating to Mojang accounts, email address is used instead of username, but the procedure stays the same.<br />
<br />
The current launcher version is "13" (for new launcher it's "14"), sending a value lower than 12 will cause the server to return "Old version", however you can send any large number and it will return as expected. If the login succeeded, it will return 5 ':' delimited values.<br />
1343825972000:deprecated:SirCmpwn:7ae9007b9909de05ea58e94199a33b30c310c69c:dba0c48e1c584963b9e93a038a66bb98<br />
#'''current version''' of the game files (not the launcher itself). This is a unix timestamp which the launcher compares to the ~/.minecraft/bin/version file.<br />
#Previously contained a '''download ticket''' for requesting new versions of minecraft.jar from the server. Now contains only "deprecated".<br />
#'''case-correct username'''. For mojang accounts, the user's actual username is returned here instead of the email used to log in.<br />
#'''sessionId''' - a unique ID for your current session.<br />
#'''UID''' - currently unused, introduced near August 8th, 2012. Grum says this is the unique ID for the user, potentially for changing Minecraft names in future.<br />
<br />
If the request is missing a parameter, the server will return "Bad response". If the login information is incorrect, the server will return "Bad login". If the login information is correct but the account isn't premium, the server will return "User not premium". If your minecraft.net account has been migrated to a Mojang account but you're logging in with your minecraft.net username the server will return "Acount migrated, use e-mail".<br />
<br />
=== Keep-alive ===<br />
<br />
Every 6000 ticks, the client sends an HTTPS request to<br />
<pre>https://login.minecraft.net/session?name=<username>&session=<session id></pre><br />
The client discards the server's response.<br />
<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Session&diff=4165Session2013-07-15T12:56:52Z<p>Sadimusi: Improved description of Yggdrasil authentication + moved some sections around</p>
<hr />
<div>The minecraft client and server communicate with minecraft.net to validate player sessions. This page describes some of the operations.<br />
<br />
== Authentication ==<br />
<br />
Minecraft 1.6 introduced a new authentication scheme called Yggdrasil which completely replaces the [[#Outdated authentication system|previous authentication system]].<br />
<br />
=== Request format ===<br />
<br />
All requests to Yggdrasil are made to the following server:<br />
<br />
https://authserver.mojang.com<br />
<br />
Further, they are expected to fulfill the following rules:<br />
<br />
* Are <code>POST</code> requests<br />
* Have the <code>Content-Type</code> header set to <code>application/json</code><br />
* Contain a [http://json.org JSON]-encoded dictionary as payload<br />
<br />
If a request was successful the server will respond with:<br />
<br />
* Status code <code>200</code><br />
* A [http://json.org JSON]-encoded dictionary according to the specifications below<br />
<br />
If however a request fails, the server will respond with:<br />
<br />
* An appropriate, non-200 [http://en.wikipedia.org/wiki/List_of_HTTP_status_codes HTTP status code]<br />
* A [http://json.org JSON]-encoded dictionary following this format:<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"error": "Short description of the error",<br />
"errorMessage": "Longer description which can be shown to the user",<br />
"cause": "Cause of the error" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
=== Session ID ===<br />
Whenever a Mojang service requires a session ID, you can simply combine a valid <code>accessToken</code> with a profile identifier as follows:<br />
<br />
accessToken:profileID<br />
<br />
=== Authenticate ===<br />
This method is used whenever a user tries to log in using his password.<br />
<br />
==== Endpoint ====<br />
/authenticate<br />
<br />
==== Payload ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"agent": {<br />
"name": "Minecraft", // So far this is the only encountered value<br />
"version": 1 // This number might be increased<br />
// by the vanilla client in the future<br />
},<br />
"username": "mojang account name", // Can be an email address or player name for<br />
// unmigrated accounts<br />
"password": "mojang account password",<br />
"clientToken": "client identifier" // optional<br />
}<br />
</syntaxhighlight><br />
<br />
The <code>clientToken</code> should be a randomly generated identifier and must identical for each request.<br />
In case it is omitted the server will generate a random token based on Java's [http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html#toString() UUID.toString()] which should then be stored by the client.<br />
<br />
==== Response ====<br />
<syntaxhighlight lang="javascript"><br />
{<br />
"accessToken": "random access token", // hexadecimal<br />
"clientToken": "client identifier", // identical to the one received<br />
"availableProfiles": [<br />
{<br />
"id": "profile identifier", // hexadecimal<br />
"name": "player name"<br />
}<br />
],<br />
"selectedProfile": {<br />
"id": "profile identifier",<br />
"name": "player name"<br />
}<br />
}<br />
</syntaxhighlight><br />
'''Note:''' If a user wishes to stay logged in on his computer you are strongly advised to store the received <code>accessToken</code> instead of the password itself.<br />
<br />
Currently each account will only have one single profile, multiple profiles per account are however planned in the future.<br />
<br />
<br />
== Updating ==<br />
<br />
To update, the launcher downloads files from <br />
<pre>http://s3.amazonaws.com/MinecraftDownload/</pre><br />
It takes the unix timestamp from the login request and stores it in ~/.minecraft/bin/version<br /><br />
The following files are downloaded from /MinecraftDownload/ in this exact order:<br /><br />
*lwjgl.jar<br />
*jinput.jar<br />
*lwjgl_util.jar<br />
*minecraft.jar<br />
And then the natives.jar appropriate for the following operating systems: windows, linux, macosx, and solaris<br />
*<os-from-list-above>_natives.jar.lzma<br />
<br />
When downloading minecraft.jar, GET variables are set as follows: ?user=foo&ticket=deprecated, although they seem unnecessary to successfully downloading the file. <br /><br />
Furthermore, the downloaded files are all verified via MD5 which is sent via ETag by the server on the page for each file.<br />
<br />
Further resources are stored in /MinecraftResources. Loading /MinecraftResources provides an XML formatted list of resources, some of which are downloaded by Minecraft and not the launcher.<br />
<br />
=== Updating 1.6 ===<br />
<br />
With the new launcher updating happens by downloading information from https://s3.amazonaws.com/Minecraft.Download/versions/versions.json and https://s3.amazonaws.com/Minecraft.Download/versions/1.6.2/1.6.2.json<br />
<br />
<br />
== Snoop ==<br />
<br />
Every 15 minutes, minecraft sends a HTTP POST request giving stats. This can be disabled in server.properties<br />
<br />
* '''client''': http://snoop.minecraft.net/client?version=1<br />
* '''server''': http://snoop.minecraft.net/server?version=1<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! Field<br />
!style="width: 72px" | Client<br />
!style="width: 72px" | Server<br />
! Example<br />
! Notes<br />
|-<br />
| applet<br />
| {{yes}}<br />
| {{no}}<br />
| <code>true</code><br />
| <br />
|-<br />
| avg_rec_packet_count<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| avg_rec_packet_size<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| avg_sent_packet_count<br />
| {{no}}<br />
| {{yes}}<br />
| <code>6</code><br />
| <br />
|-<br />
| avg_sent_packet_size<br />
| {{no}}<br />
| {{yes}}<br />
| <code>44</code><br />
| <br />
|-<br />
| avg_tick_ms<br />
| {{no}}<br />
| {{yes}}<br />
| <code>3</code><br />
| <br />
|-<br />
| client_brand<br />
| {{yes}}<br />
| {{no}}<br />
| <code>vanilla</code><br />
| via <code>ClientBrandRetriever.getClientModName()</code><br />
|-<br />
| cpu_cores<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2</code><br />
| via <code>Runtime.getRuntime().availableProcessors()</code><br />
|-<br />
| dedicated<br />
| {{no}}<br />
| {{yes}}<br />
| <code>true</code><br />
| <br />
|-<br />
| display_frequency<br />
| {{yes}}<br />
| {{no}}<br />
| <code>60</code><br />
| via <code>org.lwjgl.opengl.Display.getDisplayMode().getFrequency()</code><br />
|-<br />
| display_type<br />
| {{yes}}<br />
| {{no}}<br />
| <code>windowed</code><br />
| <code>windowed</code> or <code>fullscreen</code><br />
|-<br />
| fps<br />
| {{yes}}<br />
| {{no}}<br />
| <code>60</code><br />
| <br />
|-<br />
| gl_caps[''key'']<br />
| {{yes}}<br />
| {{no}}<br />
| ''varies by key''<br />
| via <code>org.lwjgl.opengl.GLContext.getCapabilities().GL_ARB_''key''</code><br />
|-<br />
| gl_max_texture_size<br />
| {{yes}}<br />
| {{no}}<br />
| <code>8192</code><br />
| <br />
|-<br />
| gui_state<br />
| {{no}}<br />
| {{yes}}<br />
| <code>disabled</code><br />
| <code>enabled</code> or <code>disabled</code><br />
|-<br />
| gui_supported<br />
| {{no}}<br />
| {{yes}}<br />
| <code>headless</code><br />
| via <code>java.awt.GraphicsEnvironment.isHeadless()</code> (<code>headless</code> or <code>supported</code>)<br />
|-<br />
| java_version<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>1.6.0_24</code><br />
| via <code>System.getProperty("java.version")</code><br />
|-<br />
| jvm_arg[''n'']<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>-Xms2800M</code><br />
| via <code>java.lang.management.ManagementFactory.getRuntimeMXBean().getInputArguments()</code> (-X args only)<br />
|-<br />
| jvm_args<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2</code><br />
| see above<br />
|-<br />
| memory_free<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2429082024</code><br />
| via <code>Runtime.getRuntime().freeMemory()</code><br />
|-<br />
| memory_max<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2813722624</code><br />
| via <code>Runtime.getRuntime().maxMemory()</code><br />
|-<br />
| memory_total<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>2813722624</code><br />
| via <code>Runtime.getRuntime().totalMemory()</code><br />
|-<br />
| opengl_vendor<br />
| {{yes}}<br />
| {{no}}<br />
| <code>NVIDIA Corporation</code><br />
| via <code>GL11.glGetString(GL_VENDOR)</code><br />
|-<br />
| opengl_version<br />
| {{yes}}<br />
| {{no}}<br />
| <code>3.3.0 NVIDIA 302.17</code><br />
| via <code>GL11.glGetString(GL_VERSION)</code><br />
|-<br />
| os_architecture<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>amd64</code><br />
| via <code>System.getProperty("os.arch")</code><br />
|-<br />
| os_name<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>Linux</code><br />
| via <code>System.getProperty("os.name")</code><br />
|-<br />
| os_version<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>3.2.0-3-amd64</code><br />
| via <code>System.getProperty("os.version")</code><br />
|-<br />
| players_current<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| players_max<br />
| {{no}}<br />
| {{yes}}<br />
| <code>20</code><br />
| <br />
|-<br />
| players_seen<br />
| {{no}}<br />
| {{yes}}<br />
| <code>4</code><br />
| counts files in world/players<br />
|-<br />
| server_brand<br />
| {{no}}<br />
| {{yes}}<br />
| <code>vanilla</code><br />
| via <code>getServerModName()</code> (hardcoded to "vanilla", overwritten by bukkit et al)<br />
|-<br />
| singleplayer<br />
| {{no}}<br />
| {{yes}}<br />
| <code>false</code><br />
| whether or not the server is running to support a singleplayer session<br />
|-<br />
| snooper_count<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>0</code><br />
| how many times the snooper has reported so far<br />
|-<br />
| snooper_token<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>dfe921ac-0293-4e42-8d99-1316cdd626d8</code><br />
| via <code>java.util.UUID.randomUUID().toString()</code> (unique per program launch)<br />
|-<br />
| texpack_name<br />
| {{yes}}<br />
| {{no}}<br />
| <code>Default</code><br />
| <br />
|-<br />
| texpack_resolution<br />
| {{yes}}<br />
| {{no}}<br />
| <code>16</code><br />
| <br />
|-<br />
| uses_auth<br />
| {{no}}<br />
| {{yes}}<br />
| <code>true</code><br />
| corresponds to <code>online-mode</code> in server.properties<br />
|-<br />
| version<br />
| {{yes}}<br />
| {{yes}}<br />
| <code>1.4.2</code><br />
| <br />
|-<br />
| vsync_enabled<br />
| {{yes}}<br />
| {{no}}<br />
| <code>true</code><br />
| <br />
|-<br />
| whitelist_count<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| whitelist_enabled<br />
| {{no}}<br />
| {{yes}}<br />
| <code>false</code><br />
| <br />
|-<br />
| world[''n''][chunks_loaded]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>978</code><br />
| <br />
|-<br />
| world[''n''][difficulty]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>1</code><br />
| <br />
|-<br />
| world[''n''][dimension]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>0</code><br />
| <br />
|-<br />
| world[''n''][generator_name]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>default</code><br />
| <br />
|-<br />
| world[''n''][generator_version]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>1</code><br />
| <br />
|-<br />
| world[''n''][hardcore]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>false</code><br />
| <br />
|-<br />
| world[''n''][height]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>256</code><br />
| <br />
|-<br />
| world[''n''][mode]<br />
| {{no}}<br />
| {{yes}}<br />
| <code>SURVIVAL</code><br />
| <br />
|-<br />
| worlds<br />
| {{no}}<br />
| {{yes}}<br />
| <code>3</code><br />
|}<br />
<br />
== Joining a Server ==<br />
<br />
See [[Protocol Encryption]] for details on encrypting connections.<br />
<br />
=== Client operation ===<br />
<br />
# Client connects to server<br />
# Client sends a [[Protocol#0x02|0x02 handshake]] containing the current player name<br />
# Client receives an [[Protocol#0xFD|0xFD encryption request]] with the server's public key and four verification bytes.<br />
# Client generates a symmetric key.<br />
# Client sends a HTTP request to <br />
#:<pre>http://session.minecraft.net/game/joinserver.jsp?user=<player name>&sessionId=<session id>&serverId=<server hash></pre><br />
#:Note: See the [[#Session ID|Session ID]] section on how the <code>&lt;session id&gt;</code> is generated.<br />
#:If the response is '''OK''' then continue, otherwise stop<br />
# Client sends [[Protocol#0xFC|0xFC encryption response]] - client encrypts shared secret and verification token with the server's public key<br />
# Server checks validity and sends [[Protocol#0xFC|0xFC encryption response]] with two empty arrays<br />
# Both sides enable AES/CFB2 encryption using the shared secret generated by the client<br />
# Client sends [[Protocol#0xCD|0xCD client status]] with a payload of 0 (ready to spawn)<br />
# Server sends [[Protocol#0x01|0x01 login]]<br />
# ... receive map chunks, etc...<br />
<br />
=== Server operation ===<br />
<br />
# Server generates a 1024-bit RSA keypair.<br />
# ...<br />
# Server answers TCP connection request and receives a [[Protocol#0x02|0x02 handshake]] from the client.<br />
# Server sends [[Protocol#0xFD|0xFD encryption request]] with its public key and a verification token.<br />
# Server receives [[Protocol#0xFC|0xFC encryption response]] from client and decrypts the shared secret.<br />
# Server verifies the validity of the verification token. If this isn't verified, it kicks the client.<br />
# Server sends a HTTP request to<br />
#:<pre>http://session.minecraft.net/game/checkserver.jsp?user=<username>&serverId=<server hash></pre><br />
#:If it returns '''YES''' then the client is authenticated and allowed to join. Otherwise the client will/should be [[Protocol#0xFF|kicked]] with “Failed to verify username!”<br />
# Server sends a [[Protocol#0xFC|0xFC encryption response]] packet with two empty arrays.<br />
# Both sides enable AES/CFB2 encryption.<br />
# Server receives [[Protocol#0xCD|0xCD client status]] with a payload of , indicating "ready to spawn"<br />
# Server sends [[Protocol#0x01|0x01 login]]<br />
# ... send map chunks, etc...<br />
<br />
<br />
== Outdated authentication system ==<br />
This system was used by Minecraft versions prior to 1.6 and might be discontinued at any moment without warning.<br />
<br />
=== Login ===<br />
<br />
To log the player in, the official launcher sends an HTTPS POST (GET appears to suffice as well) request to:<br />
<pre>https://login.minecraft.net</pre><br />
with the postdata:<br />
?user=<username>&password=<password>&version=<launcher version><br />
and a "application/x-www-form-urlencoded" Content-Type header.<br />
<br />
After migrating to Mojang accounts, email address is used instead of username, but the procedure stays the same.<br />
<br />
The current launcher version is "13" (for new launcher it's "14"), sending a value lower than 12 will cause the server to return "Old version", however you can send any large number and it will return as expected. If the login succeeded, it will return 5 ':' delimited values.<br />
1343825972000:deprecated:SirCmpwn:7ae9007b9909de05ea58e94199a33b30c310c69c:dba0c48e1c584963b9e93a038a66bb98<br />
#'''current version''' of the game files (not the launcher itself). This is a unix timestamp which the launcher compares to the ~/.minecraft/bin/version file.<br />
#Previously contained a '''download ticket''' for requesting new versions of minecraft.jar from the server. Now contains only "deprecated".<br />
#'''case-correct username'''. For mojang accounts, the user's actual username is returned here instead of the email used to log in.<br />
#'''sessionId''' - a unique ID for your current session.<br />
#'''UID''' - currently unused, introduced near August 8th, 2012. Grum says this is the unique ID for the user, potentially for changing Minecraft names in future.<br />
<br />
If the request is missing a parameter, the server will return "Bad response". If the login information is incorrect, the server will return "Bad login". If the login information is correct but the account isn't premium, the server will return "User not premium". If your minecraft.net account has been migrated to a Mojang account but you're logging in with your minecraft.net username the server will return "Acount migrated, use e-mail".<br />
<br />
=== Keep-alive ===<br />
<br />
Every 6000 ticks, the client sends an HTTPS request to<br />
<pre>https://login.minecraft.net/session?name=<username>&session=<session id></pre><br />
The client discards the server's response.<br />
<br />
<br />
[[Category:Protocol Details]]<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Utility_List&diff=4122Utility List2013-07-10T12:20:05Z<p>Sadimusi: Updated mc4p</p>
<hr />
<div>{{ToolsNavbox}}<br />
A list of tools to help out your Minecraft development.<br style="clear:both;" /><br />
<br />
{| class="wikitable sortable" border="1" style="width: auto;text-align: center"<br />
|+ Tools<br />
|-<br />
! scope="col" | Name<br />
! style="width: 400px" scope="col" class="unsortable" | Description<br />
! style="width: 150px" scope="col" | Last Supported Protocol<br />
! scope="col" | Language<br />
! scope="col" class="unsortable" | Operating System<br />
! scope="col" | Author<br />
! scope="col" | Development Status<br />
|-<br />
| [https://github.com/sadimusi/mc4p mc4p] || A 1.6.2-compatible fork of [https://github.com/mmcgill/mc3p m3cp] || {{yes|#74}} - 1.6.2 || Python || Windows, Mac, & Linux || [[User:sadimusi|sadimusi]] || {{yes|Active}}<br />
|-<br />
| [https://code.google.com/p/mc-server/source/browse/#svn%2Ftrunk%2FTools%2FProtoProxy ProtoProxy] || A subproject of [https://code.google.com/p/mc-server/ MCServer], protocol proxy performing a man-in-the-middle attack on the protocol encryption, and parsing basic packets. || {{no|#73}} - 1.6.1 || C++ || Windows || [[user:xoft|xoft]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/SirCmpwn/SMProxy SMProxy] || SMProxy is a powerful debugging tool for Minecraft that can be used to log and manipulate communication between a server and client. || {{no|#73}} - 1.6.1 || C# || Windows, Mac, & Linux || [[User:SirCmpwn|SirCmpwn]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/superjoe30/mcserve mcserve] || gives you an "online mode whitelist" (or blacklist) plus realtime web interface || {{no|#60}} - 1.5 || node.js || Windows, Mac, & Linux || [[user:Superjoe|superjoe]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/bencvt/McPacketSniffer McPacketSniffer] || A Minecraft client mod that logs packets to text files || {{no|#47}} - 1.4.4 || Java || Windows, Mac, & Linux || [[User:Benc|bencvt]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/mmcgill/mc3p m3cp] || Actively maintained Python Minecraft proxy with plugin support. || {{no|#29}} - 1.2.5 || Python || Windows, Mac, & Linux || mmcgill || {{no|Inactive}}<br />
|-<br />
| [http://code.google.com/p/netminecraftmapviewer/ NetMinecraftMapViewer] || Map viewer showing entity locations and special blocks via TCP proxy || {{no|#29}} - 1.2.5 || C# || || || {{no|Inactive}}<br />
|-<br />
| [https://github.com/Maincraft/MCProxy MCProxy] || A java minecraft-proxy that can load plugins. || {{no|#29}} - 1.2.5 || Java || || Maincraft || {{no|Inactive}}<br />
|-<br />
| [https://github.com/Nadrin/mcproxy mcproxy] || A modular client and server-side network protocol proxy || {{no|#29}} - 1.2.5 || C || || Nadrin || {{no|Inactive}}<br />
|-<br />
| [https://github.com/ScottBrooks/minecraft-dissector WiresharkDissector] || A wireshark dissector for the Minecraft protocol || {{no|#28}} - 1.2 || C || || ScottBrooks || {{no|Inactive}}<br />
|-<br />
| [http://github.com/aniero/golem golem] || Ruby 1.9 client, acts as a standalone bot or transparent proxy || {{no|#10}} - 1.4b || Ruby || || aniero || {{no|Inactive}}<br />
|-<br />
| [https://github.com/ReDucTor/mineproxy Mineproxy] || mineproxy || {{unknown|}} || C & C++ || || ReDucTor || {{no|Inactive}}<br />
|-<br />
| [https://github.com/glguy/minecraft-proxy minecraft-proxy] || A Minecraft protocol proxy || {{unknown|}} || Haskell || || glguy || {{no|Inactive}}<br />
|}<br />
<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Utility_List&diff=1420Utility List2013-05-22T03:15:09Z<p>Sadimusi: Updated mc3p</p>
<hr />
<div>{{ToolsNavbox}}<br />
A list of tools to help out your Minecraft development.<br style="clear:both;" /><br />
<br />
{| class="wikitable sortable" border="1" style="width: auto;text-align: center"<br />
|+ Tools<br />
|-<br />
! scope="col" | Name<br />
! style="width: 400px" scope="col" class="unsortable" | Description<br />
! style="width: 150px" scope="col" | Last Supported Protocol<br />
! scope="col" | Language<br />
! scope="col" class="unsortable" | Operating System<br />
! scope="col" | Author<br />
! scope="col" | Development Status<br />
|-<br />
| [https://code.google.com/p/mc-server/ ProtoProxy] || a subproject of MCServer, protocol proxy performing a man-in-the-middle attack on the protocol encryption, and parses basic packets. || {{yes|#61}} - 1.5.2 || C++ || Windows || [[user:xoft|xoft]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/sadimusi/mc3p sadimusi/mc3p] || A 1.5.2-compatible fork of [https://github.com/mmcgill/mc3p m3cp] || {{yes|#61}} - 1.5.2 || Python || Windows, Mac, & Linux || [[User:sadimusi|sadimusi]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/SirCmpwn/SMProxy SMProxy] || SMProxy is a powerful debugging tool for Minecraft that can be used to log and manipulate communication between a server and client. || {{no|#60}} - 1.5 || C# || Windows, Mac, & Linux || [[User:SirCmpwn|SirCmpwn]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/superjoe30/mcserve mcserve] || gives you an "online mode whitelist" (or blacklist) plus realtime web interface || {{no|#60}} - 1.5 || node.js || Windows, Mac, & Linux || [[user:Superjoe|superjoe]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/bencvt/McPacketSniffer McPacketSniffer] || A Minecraft client mod that logs packets to text files || {{no|#47}} - 1.4.4 || Java || Windows, Mac, & Linux || [[User:Benc|bencvt]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/mmcgill/mc3p m3cp] || Actively maintained Python Minecraft proxy with plugin support. || {{no|#29}} - 1.2.5 || Python || Windows, Mac, & Linux || mmcgill || {{no|Inactive}}<br />
|-<br />
| [http://code.google.com/p/netminecraftmapviewer/ NetMinecraftMapViewer] || Map viewer showing entity locations and special blocks via TCP proxy || {{no|#29}} - 1.2.5 || C# || || || {{no|Inactive}}<br />
|-<br />
| [https://github.com/Maincraft/MCProxy MCProxy] || A java minecraft-proxy that can load plugins. || {{no|#29}} - 1.2.5 || Java || || Maincraft || {{no|Inactive}}<br />
|-<br />
| [https://github.com/ScottBrooks/minecraft-dissector WiresharkDissector] || A wireshark dissector for the Minecraft protocol || {{no|#28}} - 1.2 || C || || ScottBrooks || {{no|Inactive}}<br />
|-<br />
| [http://github.com/aniero/golem golem] || Ruby 1.9 client, acts as a standalone bot or transparent proxy || {{no|#10}} - 1.4b || Ruby || || aniero || {{no|Inactive}}<br />
|-<br />
| [https://github.com/ReDucTor/mineproxy Mineproxy] || mineproxy || {{unknown|}} || C & C++ || || ReDucTor || {{no|Inactive}}<br />
|-<br />
| [https://github.com/glguy/minecraft-proxy minecraft-proxy] || A Minecraft protocol proxy || {{unknown|}} || Haskell || || glguy || {{no|Inactive}}<br />
|-<br />
| [https://github.com/Nadrin/mcproxy mcproxy] || A modular client and server-side network protocol proxy || {{no|#29}} - 1.2.5 || C || || Nadrin || {{no|Inactive}}<br />
|}<br />
<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Utility_List&diff=1414Utility List2013-01-08T06:14:36Z<p>Sadimusi: </p>
<hr />
<div>{{ToolsNavbox}}<br />
A list of tools to help out your Minecraft development.<br style="clear:both;" /><br />
<br />
{| class="wikitable sortable" border="1" style="width: auto;text-align: center"<br />
|+ Tools<br />
|-<br />
! scope="col" | Name<br />
! style="width: 400px" scope="col" class="unsortable" | Description<br />
! style="width: 150px" scope="col" | Last Supported Protocol<br />
! scope="col" | Language<br />
! scope="col" class="unsortable" | Operating System<br />
! scope="col" | Author<br />
! scope="col" | Development Status<br />
|-<br />
| [https://code.google.com/p/mc-server/ ProtoProxy] || a subproject of MCServer, protocol proxy performing a man-in-the-middle attack on the protocol encryption, and parses basic packets. || {{yes|#51}} - 1.4.6 || C++ || Windows || [[user:xoft|xoft]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/SirCmpwn/SMProxy SMProxy] || SMProxy is a powerful debugging tool for Minecraft that can be used to log and manipulate communication between a server and client. || {{yes|#51}} - 1.4.6 || C# || Windows, Mac, & Linux || [[User:SirCmpwn|SirCmpwn]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/sadimusi/mc3p sadimusi/mc3p] || A 1.4.6-compatible fork of [https://github.com/mmcgill/mc3p m3cp] || {{yes|#52}} - 13w01b || Python || Windows, Mac, & Linux || [[User:sadimusi|sadimusi]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/bencvt/McPacketSniffer McPacketSniffer] || A Minecraft client mod that logs packets to text files || {{no|#47}} - 1.4.4 || Java || Windows, Mac, & Linux || [[User:Benc|bencvt]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/mmcgill/mc3p m3cp] || Actively maintained Python Minecraft proxy with plugin support. || {{no|#29}} - 1.2.5 || Python || Windows, Mac, & Linux || mmcgill || {{no|Inactive}}<br />
|-<br />
| [http://code.google.com/p/netminecraftmapviewer/ NetMinecraftMapViewer] || Map viewer showing entity locations and special blocks via TCP proxy || {{no|#29}} - 1.2.5 || C# || || || {{no|Inactive}}<br />
|-<br />
| [https://github.com/Maincraft/MCProxy MCProxy] || A java minecraft-proxy that can load plugins. || {{no|#29}} - 1.2.5 || Java || || Maincraft || {{no|Inactive}}<br />
|-<br />
| [https://github.com/ScottBrooks/minecraft-dissector WiresharkDissector] || A wireshark dissector for the Minecraft protocol || {{no|#28}} - 1.2 || C || || ScottBrooks || {{no|Inactive}}<br />
|-<br />
| [http://github.com/aniero/golem golem] || Ruby 1.9 client, acts as a standalone bot or transparent proxy || {{no|#10}} - 1.4b || Ruby || || aniero || {{no|Inactive}}<br />
|-<br />
| [https://github.com/ReDucTor/mineproxy Mineproxy] || mineproxy || {{unknown|}} || C & C++ || || ReDucTor || {{no|Inactive}}<br />
|-<br />
| [https://github.com/glguy/minecraft-proxy minecraft-proxy] || A Minecraft protocol proxy || {{unknown|}} || Haskell || || glguy || {{no|Inactive}}<br />
|-<br />
| [https://github.com/Nadrin/mcproxy mcproxy] || A modular client and server-side network protocol proxy || {{no|#29}} - 1.2.5 || C || || Nadrin || {{no|Inactive}}<br />
|}<br />
<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Utility_List&diff=1413Utility List2013-01-08T06:13:54Z<p>Sadimusi: </p>
<hr />
<div>{{ToolsNavbox}}<br />
A list of tools to help out your Minecraft development.<br style="clear:both;" /><br />
<br />
{| class="wikitable sortable" border="1" style="width: auto;text-align: center"<br />
|+ Tools<br />
|-<br />
! scope="col" | Name<br />
! style="width: 400px" scope="col" class="unsortable" | Description<br />
! style="width: 150px" scope="col" | Last Supported Protocol<br />
! scope="col" | Language<br />
! scope="col" class="unsortable" | Operating System<br />
! scope="col" | Author<br />
! scope="col" | Development Status<br />
|-<br />
| [https://code.google.com/p/mc-server/ ProtoProxy] || a subproject of MCServer, protocol proxy performing a man-in-the-middle attack on the protocol encryption, and parses basic packets. || {{yes|#51}} - 1.4.6 || C++ || Windows || [[user:xoft|xoft]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/SirCmpwn/SMProxy SMProxy] || SMProxy is a powerful debugging tool for Minecraft that can be used to log and manipulate communication between a server and client. || {{yes|#51}} - 1.4.6 || C# || Windows, Mac, & Linux || [[User:SirCmpwn|SirCmpwn]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/sadimusi/mc3p sadimusi/mc3p] || A 1.4.6-compatible fork of [https://github.com/mmcgill/mc3p m3cp] || {{yes|#42}} - 13w01b || Python || Windows, Mac, & Linux || [[User:sadimusi|sadimusi]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/bencvt/McPacketSniffer McPacketSniffer] || A Minecraft client mod that logs packets to text files || {{no|#47}} - 1.4.4 || Java || Windows, Mac, & Linux || [[User:Benc|bencvt]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/mmcgill/mc3p m3cp] || Actively maintained Python Minecraft proxy with plugin support. || {{no|#29}} - 1.2.5 || Python || Windows, Mac, & Linux || mmcgill || {{no|Inactive}}<br />
|-<br />
| [http://code.google.com/p/netminecraftmapviewer/ NetMinecraftMapViewer] || Map viewer showing entity locations and special blocks via TCP proxy || {{no|#29}} - 1.2.5 || C# || || || {{no|Inactive}}<br />
|-<br />
| [https://github.com/Maincraft/MCProxy MCProxy] || A java minecraft-proxy that can load plugins. || {{no|#29}} - 1.2.5 || Java || || Maincraft || {{no|Inactive}}<br />
|-<br />
| [https://github.com/ScottBrooks/minecraft-dissector WiresharkDissector] || A wireshark dissector for the Minecraft protocol || {{no|#28}} - 1.2 || C || || ScottBrooks || {{no|Inactive}}<br />
|-<br />
| [http://github.com/aniero/golem golem] || Ruby 1.9 client, acts as a standalone bot or transparent proxy || {{no|#10}} - 1.4b || Ruby || || aniero || {{no|Inactive}}<br />
|-<br />
| [https://github.com/ReDucTor/mineproxy Mineproxy] || mineproxy || {{unknown|}} || C & C++ || || ReDucTor || {{no|Inactive}}<br />
|-<br />
| [https://github.com/glguy/minecraft-proxy minecraft-proxy] || A Minecraft protocol proxy || {{unknown|}} || Haskell || || glguy || {{no|Inactive}}<br />
|-<br />
| [https://github.com/Nadrin/mcproxy mcproxy] || A modular client and server-side network protocol proxy || {{no|#29}} - 1.2.5 || C || || Nadrin || {{no|Inactive}}<br />
|}<br />
<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Utility_List&diff=1403Utility List2012-10-26T07:43:10Z<p>Sadimusi: Updated to 1.4.2</p>
<hr />
<div>{{ToolsNavbox}}<br />
A list of tools to help out your Minecraft development.<br style="clear:both;" /><br />
<br />
{| class="wikitable sortable" border="1" style="width: auto;text-align: center"<br />
|+ Tools<br />
|-<br />
! scope="col" | Name<br />
! style="width: 400px" scope="col" class="unsortable" | Description<br />
! style="width: 150px" scope="col" | Last Supported Protocol<br />
! scope="col" | Language<br />
! scope="col" class="unsortable" | Operating System<br />
! scope="col" | Author<br />
! scope="col" | Development Status<br />
|-<br />
| [https://github.com/sadimusi/mc3p sadimusi/mc3p] || A 1.4.2-compatible fork of [https://github.com/mmcgill/mc3p m3cp] || {{yes|#47}} - 1.4.2 || Python || Windows, Mac, & Linux || [[User:sadimusi|sadimusi]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/SirCmpwn/SMProxy SMProxy] || SMProxy is a powerful debugging tool for Minecraft that can be used to log and manipulate communication between a server and client. || {{no|#39}} - 1.3.2 || C# || Windows, Mac, & Linux || [[User:SirCmpwn|SirCmpwn]] || {{yes|Active}}<br />
|-<br />
| [https://code.google.com/p/mc-server/ ProtoProxy] || a subproject of MCServer, protocol proxy performing a man-in-the-middle attack on the protocol encryption, and parses basic packets. || {{no|#39}} - 1.3.2 || C++ || Windows || [[user:xoft|xoft]] || {{yes|Active}}<br />
|-<br />
| [https://github.com/mmcgill/mc3p m3cp] || Actively maintained Python Minecraft proxy with plugin support. || {{no|#29}} - 1.2.5 || Python || Windows, Mac, & Linux || mmcgill || {{no|Inactive}}<br />
|-<br />
| [http://code.google.com/p/netminecraftmapviewer/ NetMinecraftMapViewer] || Map viewer showing entity locations and special blocks via TCP proxy || {{no|#29}} - 1.2.5 || C# || || || {{no|Inactive}}<br />
|-<br />
| [https://github.com/Maincraft/MCProxy MCProxy] || A java minecraft-proxy that can load plugins. || {{no|#29}} - 1.2.5 || Java || || Maincraft || {{no|Inactive}}<br />
|-<br />
| [https://github.com/ScottBrooks/minecraft-dissector WiresharkDissector] || A wireshark dissector for the Minecraft protocol || {{no|#28}} - 1.2 || C || || ScottBrooks || {{no|Inactive}}<br />
|-<br />
| [http://github.com/aniero/golem golem] || Ruby 1.9 client, acts as a standalone bot or transparent proxy || {{no|#10}} - 1.4b || Ruby || || aniero || {{no|Inactive}}<br />
|-<br />
| [https://github.com/ReDucTor/mineproxy Mineproxy] || mineproxy || {{unknown|}} || C & C++ || || ReDucTor || {{no|Inactive}}<br />
|-<br />
| [https://github.com/glguy/minecraft-proxy minecraft-proxy] || A Minecraft protocol proxy || {{unknown|}} || Haskell || || glguy || {{no|Inactive}}<br />
|-<br />
| [https://github.com/Nadrin/mcproxy mcproxy] || A modular client and server-side network protocol proxy || {{unknown|}} || C || || Nadrin || {{no|Inactive}}<br />
|}<br />
<br />
[[Category:Minecraft Modern]]</div>Sadimusihttps://wiki.vg/index.php?title=Pre-release_protocol&diff=2874Pre-release protocol2012-07-28T23:23:42Z<p>Sadimusi: /* Respawn (0x09) */</p>
<hr />
<div>This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently 1.2.5) to the current pre-release (or weekly release).<br />
<br />
== New packets ==<br />
<br />
=== Map Chunk Bulk (0x38) ===<br />
<br />
To reduce the number of bytes this packet is used to send chunk columns together for better compression results. The packet contains up to 100 chunk columns (later this might be reduced to 50).<br />
<br />
The data part is a zlib compressed byte array containing the chunk data. The meta data part specifies which chunks in which order the data part exists of. <br />
<br />
To split this packet into chunks you need to uncompress the data array. Then you can iterate through the data part. Each part is 10240 * n + 256 bytes. n is the number of chunks in the current chunk column(this is the number of flags set in the primary bitmap). 10240 is the amount of bytes for each chunk without add bitmap, 256 bytes are used for biomes. The second short in the meta data part is not yet in use. It could specify if the chunk uses the add bitmap part, because it has very high block ids, but not in the current snapshot. <br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=5 | 0x38<br />
| class="col1 centeralign" | Chunk Column Count<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4" | The number of chunk columns in this packet<br />
|- class="row2"<br />
| class="col1 centeralign" | Chunk data size<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | the size of the data field<br />
|- class="row3"<br />
| class="col1 centeralign" | Data<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4" | compressed chunk data<br />
|- class="row4"<br />
| class="col1 centeralign" | meta information<br />
| class="col2 centeralign" | chunk bulk meta information<br />
| class="col3 centeralign" |<br />
| class="col4 centeralign" | Chunk column count times the Meta information structure (See notes for details)<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 7 + (Chunk data size) + 12 * (Chunk Column Count) bytes<br />
|}<br />
<br />
<br />
====Chunk Bulk Meta Information Structure====<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col1 centeralign" | Chunk Column X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 10<br />
| class="col4" | The X coordinate of the specific chunk column<br />
|- class="row2"<br />
| class="col1 centeralign" | Chunk Column Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 10<br />
| class="col4" | The Z coordinate of the specific chunk column<br />
|- class="row3"<br />
| class="col1 centeralign" | Chunk Primary bitmap<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | 15<br />
| class="col4" | A bitmap which specifies which chunk is not empty in this chunk column<br />
|- class="row4"<br />
| class="col1 centeralign" | Chunk Add bitmap?<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | 0<br />
| class="col4" | A bitmap which specifies which chunk need add information because of very high block ids. not yet used. needs verification<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="3" | 12 bytes<br />
|}<br />
<br />
<br />
=== Tab-complete (0xCB) ===<br />
<br />
''Two-way''<br />
<br />
Sent C->S when the user presses [tab] while writing text. The payload contains all text behind the cursor.<br />
<br />
The server responds with an auto-completion of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported.<br />
<br />
In the event of more than one possible completion, the server responds with the options packed into the single string field, separated by a null character. Note that as strings are UTF-16, this is two bytes wide.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" | 0xCB<br />
| class="col1 centeralign" | Text<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row3"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 3 bytes + length of string<br />
|}<br />
<br />
=== Locale and View Distance (0xCC) ===<br />
<br />
''Client to server''<br />
<br />
Sent when the player connects, or when settings are changed.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0xCC<br />
| class="col1 centeralign" | Locale<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | en_GB<br />
|- class="row2"<br />
| class="col1 centeralign" | View distance<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4" | 0-3 for 'far', 'normal', 'short', 'tiny'.<br />
|- class="row3"<br />
| class="col1 centeralign" | Chat flags<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 8<br />
| class="col4" | Chat settings. See notes below.<br />
|- class="row4"<br />
| class="col1 centeralign" | Difficulty<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4 centeralign" | Client-side difficulty from options.txt<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 8 bytes + length of string<br />
|}<br />
<br />
Chat flags has several values packed into one byte.<br />
<br />
'''Chat Enabled:''' Bits 0-1. 00: Enabled. 01: Commands only. 10: Hidden.<br />
<br />
'''Colors Enabled:''' Bit 3. 0: Disabled. 1: Enabled.<br />
<br />
=== Client Statuses (0xCD) ===<br />
<br />
''Client to server''<br />
<br />
Sent when the client is ready to complete login and when the client is ready to respawn after death.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="1" | 0xCD<br />
| class="col1 centeralign" | Payload<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4" | Bit field. 0: Initial spawn, 1: Respawn after death<br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="5" | 2 bytes<br />
|}<br />
<br />
=== Encryption Key Response (0xFC) ===<br />
<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0xFC<br />
| class="col1 centeralign" | Shared secret length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Shared secret<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" |<br />
|- class="row3"<br />
| class="col1 centeralign" | Verify token length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token response<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 5 bytes + length of shared secret + length of token<br />
|}<br />
<br />
=== Encryption Key Request (0xFD) ===<br />
<br />
''Server to client''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0xFD<br />
| class="col1 centeralign" | Server id<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Public key length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Public key<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 7 bytes + length of string + length of key + length of token<br />
|}<br />
<br />
<br />
<br />
<br />
<br />
=== Named Sound Effect (0x3E) ===<br />
<br />
''Server to client''<br />
<br />
Used to play a sound effect on the client.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x3E<br />
| class="col1 centeralign" | Sound name<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | step.grass<br />
| class="col4 centeralign" | 250<br />
|- class="row2"<br />
| class="col1 centeralign" | Effect position X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect X multiplied by 8<br />
|- class="row3"<br />
| class="col1 centeralign" | Effect position Y<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect Y multiplied with 8<br />
|- class="row4"<br />
| class="col1 centeralign" | Effect position Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect Z multiplied with 8<br />
|- class="row5"<br />
| class="col1 centeralign" | Volume<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | 9<br />
| class="col4 centeralign" | 1 is 100%, can be more<br />
|- class="row6"<br />
| class="col1 centeralign" | Pitch<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 1<br />
| class="col4 centeralign" | 63 is 100%, can be more<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 20 bytes + length of string<br />
|}<br />
<br />
=== Block Break Animation (0x37) ===<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=5 | 0x37<br />
| class="col1 centeralign" | EID?<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | Entity breaking the block?<br />
|- class="row2"<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" rowspan=3 | Block position<br />
|- class="row2"<br />
| class="col1 centeralign" | Y<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 1<br />
| class="col4" | ?<br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 4 bytes<br />
|}<br />
<br />
== Changed Data Type ==<br />
<br />
=== Slot Data ===<br />
<br />
Parsing or encoding of [[Slot Data]] no longer requires a list of all enchantable item IDs. Every slot transmitted now includes a short that indicates the length of the NBT data. As before, a length of -1 means there is no NBT data.<br />
<br />
This change affects any packets with [[Slot Data]], including:<br />
* 0x0F (Player Block Placement)<br />
* 0x10 (Held Item Change)<br />
* 0x66 (Click Window)<br />
* 0x67 (Set Slot)<br />
* 0x68 (Set Window Items)<br />
* 0x6B (Creative Inventory Action)<br />
* 0x05 (Entity Equipment)<br />
<br />
== Changed packets ==<br />
<br />
=== Login Request (0x01) ===<br />
<br />
''Server to Client''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="7" | 0x01<br />
| class="col1 centeralign" | Entity ID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>1298</code><br />
| class="col4" | The Players Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Level Type<br />
| class="col1 centeralign" | string<br />
| class="col2 centeralign" | default<br />
| class="col3" | default or SUPERFLAT; level-type in server.properties<br />
|- class="row3"<br />
| class="col0 centeralign" | Server mode<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | 0 for survival, 1 for creative<br />
|- class="row4"<br />
| class="col0 centeralign" | Dimension<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|- class="row5"<br />
| class="col0 centeralign" | Difficulty<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>1</code><br />
| class="col3" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard<br />
|- class="row6"<br />
| class="col0 centeralign" | Not used<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Only 0 observed from vanilla server, was previously world height<br />
|- class="row7"<br />
| class="col0 centeralign" | Max players<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>8</code><br />
| class="col3" | Used by the client to draw the player list<br />
|- class="row8"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 12 bytes + length of strings<br />
|}<br />
<br />
=== Handshake (0x02) ===<br />
<br />
''Client to server''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0x02<br />
| class="col1 centeralign" | Protocol Version<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>38</code><br />
| class="col4" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Username<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <code>TkTech</code><br />
| class="col4" | The username of the player attempting to connect<br />
|- class="row3"<br />
| class="col1 centeralign" | Server Host<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <code>localhost</code><br />
| class="col4" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Server Port<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>25565</code><br />
| class="col4" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 10 bytes + length of strings<br />
|}<br />
<br />
=== Entity Equipment (0x05) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="3" | 0x05<br />
| class="col1 centeralign" | Entity ID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 0x00010643<br />
| class="col4" | Named Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Slot<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | 4<br />
| class="col3" | Equipment slot: 0=held, 1-4=armor slot <br />
|- class="row3"<br />
| class="col0 centeralign" | Item<br />
| class="col1 centeralign" | slot<br />
| class="col2 centeralign" | <br />
| class="col3" | Item in slot format<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes<br />
|}<br />
<br />
=== Respawn (0x09) ===<br />
<br />
''Server to Client''<br />
<br />
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0x09<br />
| class="col1 centeralign" | Dimension<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|- class="row2"<br />
| class="col1 centeralign" | Difficulty<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard. <code>1</code> is always sent c->s<br />
|- class="row3"<br />
| class="col1 centeralign" | Creative mode<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>0</code> for survival, <code>1</code> for creative.<br />
|- class="row4"<br />
| class="col1 centeralign" | World height<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <code>256</code><br />
| class="col4" | Defaults to <code>256</code><br />
|- class="row5"<br />
| class="col1 centeralign" | Level Type<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | default<br />
| class="col4" | See [[#0x01|0x01 login]]<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes + length of string<br />
|}<br />
<br />
=== Player Block Placement (0x0F) ===<br />
<br />
''Client to Server''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="8" | 0x0F<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>32</code><br />
| class="col4" | Block position<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>64</code><br />
| class="col3" | Block position<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>32</code><br />
| class="col3 leftalign" | Block position<br />
|- class="row4"<br />
| class="col0 centeralign" | Direction<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>3</code><br />
| class="col3" | The offset to use for block/item placement (see below)<br />
|- class="row5"<br />
| class="col0 centeralign" | Held item<br />
| class="col1 centeralign" | [[Slot_Data|slot]]<br />
| class="col2 centeralign" | <br />
| class="col3" | <br />
|- class="row6"<br />
| class="col0 centeralign" | Cursor position X<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | 0 - 16<br />
| class="col3" | The position of the crosshair on the block<br />
|- class="row7"<br />
| class="col0 centeralign" | Cursor position Y<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | 0 - 16<br />
| class="col3" | <br />
|- class="row8"<br />
| class="col0 centeralign" | Cursor position Z<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | 0 - 16<br />
| class="col3" | <br />
|- class="row9"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes + slot data<br />
|}<br />
<br />
=== Spawn Named Entity (0x14) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0 centeralign" | Packet ID<br />
! class="col1 rightalign" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="9" | 0x14<br />
| class="col1" | EID<br />
| class="col2" | int<br />
| class="col3" | <code>94453</code><br />
| class="col4" | Player ID<br />
|- class="row2"<br />
| class="col0" | Player Name<br />
| class="col1" | string<br />
| class="col2" | <code>Twdtwd</code><br />
| class="col3" | Max length of 16<br />
|- class="row3"<br />
| class="col0" | X<br />
| class="col1" | int<br />
| class="col2" | <code>784</code><br />
| class="col3" | Player X as Absolute Integer<br />
|- class="row4"<br />
| class="col0" | Y<br />
| class="col1" | int<br />
| class="col2" | <code>2131</code><br />
| class="col3" | Player Y as Absolute Integer<br />
|- class="row5"<br />
| class="col0" | Z<br />
| class="col1" | int<br />
| class="col2" | <code>-752</code><br />
| class="col3" | Player Z as Absolute Integer<br />
|- class="row6"<br />
| class="col0" | Yaw<br />
| class="col1" | byte<br />
| class="col2" | <code>0</code><br />
| class="col3" | Player rotation as a packed byte<br />
|- class="row7"<br />
| class="col0" | Pitch<br />
| class="col1" | byte<br />
| class="col2" | <code>0</code><br />
| class="col3" | Player rotation as a packed byte<br />
|- class="row8"<br />
| class="col0" | Current Item<br />
| class="col1" | short<br />
| class="col2" | <code>0</code><br />
| class="col3" | The item the player is currently holding. Note that this should be 0 for "no item", unlike -1 used in other packets. A negative value crashes clients.<br />
|- class="row9"<br />
| class="col0" | Metadata<br />
| class="col1" | Metadata<br />
| class="col2" | <code>127</code><br />
| class="col3" | <br />
|- class="row10"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 bytes + length of strings + metadata (at least 1)<br />
|}<br />
<br />
=== Spawn Object/Vehicle (0x17) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when an Object/Vehicle is created. The throwers entity id is now used for fishing floats too.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="9" | 0x17<br />
| class="col1 centeralign" | EID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>62</code><br />
| class="col4" | Entity ID of the Object<br />
|- class="row2"<br />
| class="col0 centeralign" | Type<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>11</code><br />
| class="col3" | The type of object (see [[Entities#Objects]])<br />
|- class="row3"<br />
| class="col0 centeralign" | X<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>16080</code><br />
| class="col3" | The Absolute Integer X Position of the object<br />
|- class="row4"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>2299</code><br />
| class="col3" | The Absolute Integer Y Position of the object<br />
|- class="row5"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>592</code><br />
| class="col3" | The Absolute Integer Z Position of the object<br />
|- class="row6"<br />
| class="col0 centeralign" | thrower's entity ID<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | If this is bigger than 0, this is a entity trown by a other entity and the next 3 fields are sent.<br />
|- class="row7"<br />
| class="col0 centeralign" | Speed X<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the X axis.<br />
|- class="row5"<br />
| class="col0 centeralign" | Speed Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Y axis.<br />
|- class="row5"<br />
| class="col0 centeralign" | Speed Z<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Z axis.<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 or 28 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x18}}<br />
<br />
=== Spawn Mob (0x18) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when a Mob Entity is Spawned<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="12" | 0x18<br />
| class="col1 centeralign" | EID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>446</code><br />
| class="col4" | Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Type<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>91</code><br />
| class="col3" | The type of mob. See [[Entities#Mobs]]<br />
|- class="row3"<br />
| class="col0 centeralign" | X<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>13366</code><br />
| class="col3" | The Absolute Integer X Position of the object<br />
|- class="row4"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>2176</code><br />
| class="col3" | The Absolute Integer Y Position of the object<br />
|- class="row5"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>1680</code><br />
| class="col3" | The Absolute Integer Z Position of the object<br />
|- class="row6"<br />
| class="col0 centeralign" | Yaw<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>-27</code><br />
| class="col3" | The yaw in steps of 2p/256<br />
|- class="row7"<br />
| class="col0 centeralign" | Pitch<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | The pitch in steps of 2p/256<br />
|- class="row8"<br />
| class="col0 centeralign" | Head Yaw<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <br />
| class="col3" | Head yaw in steps of 2p/256<br />
|- class="row9"<br />
| class="col0 centeralign" | Velocity Z<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row10"<br />
| class="col0 centeralign" | Velocity X<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row11"<br />
| class="col0 centeralign" | Velocity Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row12"<br />
| class="col0 centeralign" | Metadata<br />
| class="col1 centeralign" | Metadata<br />
| class="col2 centeralign" | <code>127</code><br />
| class="col3" | Varies by mob, see [[Entities]]<br />
|- class="row13"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 27 bytes + Metadata (at least 1)<br />
|}<br />
<br />
<br />
{{anchor|0x19}}<br />
<br />
=== Destroy Entity (0x1D) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when an list of Entities is to be destroyed on the client.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 " rowspan="2" | 0x1D<br />
| class="col1 centeralign" | Entity Count<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>3</code><br />
| class="col4 centeralign" | The amount of entities which should be destroyed<br />
|- class="row21"<br />
| class="col1 centeralign" | Entity IDs<br />
| class="col2 centeralign" | array of int<br />
| class="col3 centeralign" | <code>452, 546, 123</code><br />
| class="col4 centeralign" | The list of entity ids which should be destroyed<br />
|- class="row32"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 2 + (entity count * 4) bytes<br />
|}<br />
<br />
<br />
{{anchor|0x1E}}<br />
<br />
=== Chunk Data (0x33) ===<br />
<br />
''Server to Client''<br />
<br />
See also: [[Map Format]]<br />
<br />
Chunks are sent a column at a time, with some sections optionally missing from each packet (those consisting only of air).<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="7" | 0x33<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | Chunk X Coordinate (*16 to get true X)<br />
|- class="row2"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" |<br />
| class="col3" | Chunk Z Coordinate (*16 to get true Z)<br />
|- class="row3"<br />
| class="col0 centeralign" | Ground-up continuous<br />
| class="col1 centeralign" | boolean<br />
| class="col2 centeralign" | <br />
| class="col3" | This is True if the packet represents all sections in this vertical column, where the primary bit map specifies exactly which sections are included, and which are air.<br />
|- class="row4"<br />
| class="col0 centeralign" | Primary bit map<br />
| class="col1 centeralign" | unsigned short<br />
| class="col2 centeralign" | 15<br />
| class="col3" | Bitmask with 1 for every 16x16x16 section which data follows in the compressed data.<br />
|- class="row5"<br />
| class="col0 centeralign" | Add bit map<br />
| class="col1 centeralign" | unsigned short<br />
| class="col2 centeralign" | 0<br />
| class="col3" | Same as above, but this is used exclusively for the 'add' portion of the payload<br />
|- class="row6"<br />
| class="col0 centeralign" | Compressed size<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <br />
| class="col3" | Size of compressed chunk data.<br />
|- class="row78"<br />
| class="col0 centeralign" | Compressed data<br />
| class="col1 centeralign" | unsigned byte array<br />
| class="col2 centeralign" | <code>…</code><br />
| class="col3" | The chunk data is compressed using ZLib Deflate function.<br />
|- class="row8"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 bytes + Compressed chunk size<br />
|}<br />
<br />
<br />
=== Block Change (0x35) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0x35<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>502</code><br />
| class="col4" | Block X Coordinate<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>71</code><br />
| class="col3" | Block Y Coordinate<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>18</code><br />
| class="col3" | Block Z Coordinate<br />
|- class="row4"<br />
| class="col0 centeralign" | Block Type<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>78</code><br />
| class="col3" | The new block type for the block<br />
|- class="row5"<br />
| class="col0 centeralign" | Block Metadata<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | The new Metadata for the block<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 13 bytes<br />
|}<br />
<br />
=== Block Action (0x36) ===<br />
<br />
''Server to Client''<br />
<br />
This packet is used for a number of things:<br />
* <div class="li">Chests opening and closing<br />
* Pistons pushing and pulling<br />
* Note blocks playing<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x36<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>502</code><br />
| class="col4" | Block X Coordinate<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>71</code><br />
| class="col3" | Block Y Coordinate<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>18</code><br />
| class="col3" | Block Z Coordinate<br />
|- class="row4"<br />
| class="col0 centeralign" | Byte 1<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>3</code><br />
| class="col3" | Varies depending on block - see below<br />
|- class="row5"<br />
| class="col0 centeralign" | Byte 2<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>17</code><br />
| class="col3" | Varies depending on block - see below<br />
|- class="row6"<br />
| class="col0 centeralign" | Block ID<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>29</code><br />
| class="col3" | The block id this action is set for<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 13 bytes<br />
|}<br />
<br />
See Also: [[Block Actions]]<br />
<br />
=== Update Tile Entity (0x84) ===<br />
<br />
''Server to Client''<br />
<br />
Essentially a block update on a tile entity.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x84<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <br />
| class="col3" | <br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <br />
| class="col3" | <br />
|- class="row4"<br />
| class="col0 centeralign" | Action<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <br />
| class="col3" | The type of update to perform<br />
|- class="row5"<br />
| class="col0 centeralign" | Data length<br />
| class="col1 centeralign" | Short<br />
| class="col2 centeralign" | <br />
| class="col3" | Varies<br />
|- class="row6"<br />
| class="col0 centeralign" | NBT Data<br />
| class="col1 centeralign" | Byte Array - Present if data length > 0<br />
| class="col2 centeralign" | <br />
| class="col3" | Varies<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 12 + itemstack bytes<br />
|}<br />
<br />
'''Actions'''<br />
<br />
* '''1''': Set mob displayed inside a mob spawner. Custom 1 contains the [[Entities#Mobs|mob type]]<br />
<br />
=== Explosion (0x3C) ===<br />
<br />
''Server to Client''<br />
<br />
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=9 | 0x3C<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | double<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row1"<br />
| class="col1 centeralign" | Y<br />
| class="col2 centeralign" | double<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row1"<br />
| class="col1 centeralign" | Z<br />
| class="col2 centeralign" | double<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row1"<br />
| class="col1 centeralign" | Radius<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | 3.0<br />
| class="col4" | Currently unused in the client<br />
|- class="row2"<br />
| class="col1 centeralign" | Record count<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | This is the count, not the size. The size is 3 times this value.<br />
|- class="row3"<br />
| class="col1 centeralign" | Records<br />
| class="col2 centeralign" | (byte, byte, byte) × count<br />
| class="col3 centeralign" | <br />
| class="col4" | Each record is 3 bytes, which seem to be XYZ offsets of affected blocks.<br />
|- class="row4"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row5"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row6"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 45 bytes + 3*(Record count) bytes<br />
|}<br />
<br />
=== Player Abilities (0xCA) ===<br />
This packet has now been compressed into 3 bytes. The latter 2 bytes are used to indicate the walking and flying sppeds respectively, while the first byte is used to determine the value of 4 booleans.<br />
<br />
These booleans are whether damage is disabled (god mode), whether the player is flying, whether the player can fly, and whether the player is in creative mode.<br />
<br />
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.<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=4 | 0xCA<br />
| class="col1 centeralign" | Flags<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 5<br />
| class="col4" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Flying speed<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 12<br />
| class="col4" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Walking speed<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 25<br />
| class="col4" | <br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 4 bytes<br />
|}<br />
<br />
== Removed packets ==<br />
<br />
=== Chunk Allocation Packet (0x32) ===<br />
The chunk Allocation Packet is not longer in use. Memory will automatically allocated with a incoming Map Chunk packet. To deallocate memory you need to send a MapChunk packet, which only contains biome data for plains(all biome bytes set to 1). So the Add and Primary bitmap must set to 0, and Ground-up continuous to true. Because the payload of this packet is compressed and static you can use a hardcoded value for it, so you don't need to compress it each time.<br />
<br />
This is the payload which is used in the Compressed Data part to deallocate a chunk column:<br />
<br />
0x78, 0x9C, 0x63, 0x64, 0x1C, 0xD9, 0x00, 0x00, 0x81, 0x80, 0x01, 0x01<br />
<br />
== Protocol History ==<br />
<br />
=== 2012-07-24 ===<br />
* 12w30c<br />
* Protocol version 39<br />
* Changed packets 0x84<br />
<br />
=== 2012-07-23 ===<br />
* 12w30a<br />
* Protocol version is still 38<br />
* Changed packets 0x14 and 0x35<br />
<br />
=== 2012-07-05 ===<br />
* 12w27a<br />
* Protocol version is now 38<br />
* Added packet 0x38<br />
<br />
=== 2012-06-21 ===<br />
* 12w25a<br />
* Packet 0xFC and 0xFD include a 4 byte long byte array. This is hashed with the public RSA key and sent back. See [[Protocol Encryption]] for further info.<br />
* Packet 0x3E changed to include float rather than byte.<br />
<br />
=== 2012-06-14 ===<br />
* 12w24a<br />
* Protocol version is now 36<br />
* Changed Packet 0x01(Login Request), only used as Login Reply<br />
* New Packet 0xCD used for Login Request and Respawn (1 byte payload)<br />
* All items (except the empty hand) now send enchantment data<br />
<br />
=== 2012-06-07 ===<br />
* 12w23b<br />
* Protocol version is now 35<br />
* Change packet: Player Block Placement<br />
* New Packet: Block breaking animation<br />
<br />
=== 2012-05-24 ===<br />
* 12w21a<br />
* No packet changes but the algorithm was changed to AES128 with the shared key as the IV, will be described in [[Protocol Encryption]]<br />
<br />
=== 2012-05-10 ===<br />
* 12w19a<br />
* No packet changes, but an other encryption algorythm is used, described in [[Protocol Encryption]]<br />
* The items which are not enchantable in 12w18a are now readded<br />
* Fishing floats, spawned by a 0x17 packet do now use the extra fields<br />
<br />
=== 2012-05-03 ===<br />
* 12w18a<br />
* Protocol version is now 32<br />
* New packet: 0x3D Name Sound Effect<br />
* Changed packet: 0x01 Login Request<br />
* Changed packet: 0x02 Handshake<br />
* Changed packet: 0xCA Player Abilities<br />
* Changed packet: 0xCC Locale and View Distance<br />
* Changed packet: 0x09 Respawn<br />
* Removed packet: 0x32 Map Column Allocation<br />
* This items are not enchantable in this version: 0x103, 0x105, 0x15A, 0x167, 0x10C, 0x10D, 0x10E, 0x10F, 0x122, 0x110, 0x111, 0x112, 0x113, 0x123, 0x10B, 0x100, 0x101, 0x102, 0x124, 0x114, 0x115, 0x116, 0x117, 0x125, 0x11B, 0x11C, 0x11D, 0x11E, 0x126<br />
<br />
=== 2012-04-26 ===<br />
* 12w17a<br />
* Protocol version is now 31<br />
* RC4 based encryption, described in [[Protocol Encryption]]<br />
* Changed packet: 0x01 Login Request<br />
* Changed packet: 0x02 Handshake<br />
* Changed packet: 0xCC Locale and View Distance<br />
* Changed packet: 0xCA Player Abilities <br />
* New packet: 0xFC Encryption Key Response<br />
* New packet: 0xFD Encryption Key Request<br />
* New Item: Book & Quills (0x182) is enchantable<br />
* New Item: Written Book (0x183) is enchantable<br />
<br />
=== 2012-04-19 ===<br />
* 12w16a<br />
* Protocol version is now 30<br />
* New packet: 0xCB Tab-complete<br />
* New packet: 0xCC Locale and View Distance</div>Sadimusihttps://wiki.vg/index.php?title=Pre-release_protocol&diff=2873Pre-release protocol2012-07-28T23:23:29Z<p>Sadimusi: /* Respawn (0x09) */ Removed Client->Server</p>
<hr />
<div>This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently 1.2.5) to the current pre-release (or weekly release).<br />
<br />
== New packets ==<br />
<br />
=== Map Chunk Bulk (0x38) ===<br />
<br />
To reduce the number of bytes this packet is used to send chunk columns together for better compression results. The packet contains up to 100 chunk columns (later this might be reduced to 50).<br />
<br />
The data part is a zlib compressed byte array containing the chunk data. The meta data part specifies which chunks in which order the data part exists of. <br />
<br />
To split this packet into chunks you need to uncompress the data array. Then you can iterate through the data part. Each part is 10240 * n + 256 bytes. n is the number of chunks in the current chunk column(this is the number of flags set in the primary bitmap). 10240 is the amount of bytes for each chunk without add bitmap, 256 bytes are used for biomes. The second short in the meta data part is not yet in use. It could specify if the chunk uses the add bitmap part, because it has very high block ids, but not in the current snapshot. <br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=5 | 0x38<br />
| class="col1 centeralign" | Chunk Column Count<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4" | The number of chunk columns in this packet<br />
|- class="row2"<br />
| class="col1 centeralign" | Chunk data size<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | the size of the data field<br />
|- class="row3"<br />
| class="col1 centeralign" | Data<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4" | compressed chunk data<br />
|- class="row4"<br />
| class="col1 centeralign" | meta information<br />
| class="col2 centeralign" | chunk bulk meta information<br />
| class="col3 centeralign" |<br />
| class="col4 centeralign" | Chunk column count times the Meta information structure (See notes for details)<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 7 + (Chunk data size) + 12 * (Chunk Column Count) bytes<br />
|}<br />
<br />
<br />
====Chunk Bulk Meta Information Structure====<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col1 centeralign" | Chunk Column X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 10<br />
| class="col4" | The X coordinate of the specific chunk column<br />
|- class="row2"<br />
| class="col1 centeralign" | Chunk Column Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 10<br />
| class="col4" | The Z coordinate of the specific chunk column<br />
|- class="row3"<br />
| class="col1 centeralign" | Chunk Primary bitmap<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | 15<br />
| class="col4" | A bitmap which specifies which chunk is not empty in this chunk column<br />
|- class="row4"<br />
| class="col1 centeralign" | Chunk Add bitmap?<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | 0<br />
| class="col4" | A bitmap which specifies which chunk need add information because of very high block ids. not yet used. needs verification<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="3" | 12 bytes<br />
|}<br />
<br />
<br />
=== Tab-complete (0xCB) ===<br />
<br />
''Two-way''<br />
<br />
Sent C->S when the user presses [tab] while writing text. The payload contains all text behind the cursor.<br />
<br />
The server responds with an auto-completion of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported.<br />
<br />
In the event of more than one possible completion, the server responds with the options packed into the single string field, separated by a null character. Note that as strings are UTF-16, this is two bytes wide.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" | 0xCB<br />
| class="col1 centeralign" | Text<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row3"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 3 bytes + length of string<br />
|}<br />
<br />
=== Locale and View Distance (0xCC) ===<br />
<br />
''Client to server''<br />
<br />
Sent when the player connects, or when settings are changed.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0xCC<br />
| class="col1 centeralign" | Locale<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | en_GB<br />
|- class="row2"<br />
| class="col1 centeralign" | View distance<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4" | 0-3 for 'far', 'normal', 'short', 'tiny'.<br />
|- class="row3"<br />
| class="col1 centeralign" | Chat flags<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 8<br />
| class="col4" | Chat settings. See notes below.<br />
|- class="row4"<br />
| class="col1 centeralign" | Difficulty<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4 centeralign" | Client-side difficulty from options.txt<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 8 bytes + length of string<br />
|}<br />
<br />
Chat flags has several values packed into one byte.<br />
<br />
'''Chat Enabled:''' Bits 0-1. 00: Enabled. 01: Commands only. 10: Hidden.<br />
<br />
'''Colors Enabled:''' Bit 3. 0: Disabled. 1: Enabled.<br />
<br />
=== Client Statuses (0xCD) ===<br />
<br />
''Client to server''<br />
<br />
Sent when the client is ready to complete login and when the client is ready to respawn after death.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="1" | 0xCD<br />
| class="col1 centeralign" | Payload<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4" | Bit field. 0: Initial spawn, 1: Respawn after death<br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="5" | 2 bytes<br />
|}<br />
<br />
=== Encryption Key Response (0xFC) ===<br />
<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0xFC<br />
| class="col1 centeralign" | Shared secret length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Shared secret<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" |<br />
|- class="row3"<br />
| class="col1 centeralign" | Verify token length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token response<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 5 bytes + length of shared secret + length of token<br />
|}<br />
<br />
=== Encryption Key Request (0xFD) ===<br />
<br />
''Server to client''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0xFD<br />
| class="col1 centeralign" | Server id<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Public key length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Public key<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 7 bytes + length of string + length of key + length of token<br />
|}<br />
<br />
<br />
<br />
<br />
<br />
=== Named Sound Effect (0x3E) ===<br />
<br />
''Server to client''<br />
<br />
Used to play a sound effect on the client.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x3E<br />
| class="col1 centeralign" | Sound name<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | step.grass<br />
| class="col4 centeralign" | 250<br />
|- class="row2"<br />
| class="col1 centeralign" | Effect position X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect X multiplied by 8<br />
|- class="row3"<br />
| class="col1 centeralign" | Effect position Y<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect Y multiplied with 8<br />
|- class="row4"<br />
| class="col1 centeralign" | Effect position Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect Z multiplied with 8<br />
|- class="row5"<br />
| class="col1 centeralign" | Volume<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | 9<br />
| class="col4 centeralign" | 1 is 100%, can be more<br />
|- class="row6"<br />
| class="col1 centeralign" | Pitch<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 1<br />
| class="col4 centeralign" | 63 is 100%, can be more<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 20 bytes + length of string<br />
|}<br />
<br />
=== Block Break Animation (0x37) ===<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=5 | 0x37<br />
| class="col1 centeralign" | EID?<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | Entity breaking the block?<br />
|- class="row2"<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" rowspan=3 | Block position<br />
|- class="row2"<br />
| class="col1 centeralign" | Y<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 1<br />
| class="col4" | ?<br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 4 bytes<br />
|}<br />
<br />
== Changed Data Type ==<br />
<br />
=== Slot Data ===<br />
<br />
Parsing or encoding of [[Slot Data]] no longer requires a list of all enchantable item IDs. Every slot transmitted now includes a short that indicates the length of the NBT data. As before, a length of -1 means there is no NBT data.<br />
<br />
This change affects any packets with [[Slot Data]], including:<br />
* 0x0F (Player Block Placement)<br />
* 0x10 (Held Item Change)<br />
* 0x66 (Click Window)<br />
* 0x67 (Set Slot)<br />
* 0x68 (Set Window Items)<br />
* 0x6B (Creative Inventory Action)<br />
* 0x05 (Entity Equipment)<br />
<br />
== Changed packets ==<br />
<br />
=== Login Request (0x01) ===<br />
<br />
''Server to Client''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="7" | 0x01<br />
| class="col1 centeralign" | Entity ID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>1298</code><br />
| class="col4" | The Players Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Level Type<br />
| class="col1 centeralign" | string<br />
| class="col2 centeralign" | default<br />
| class="col3" | default or SUPERFLAT; level-type in server.properties<br />
|- class="row3"<br />
| class="col0 centeralign" | Server mode<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | 0 for survival, 1 for creative<br />
|- class="row4"<br />
| class="col0 centeralign" | Dimension<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|- class="row5"<br />
| class="col0 centeralign" | Difficulty<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>1</code><br />
| class="col3" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard<br />
|- class="row6"<br />
| class="col0 centeralign" | Not used<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Only 0 observed from vanilla server, was previously world height<br />
|- class="row7"<br />
| class="col0 centeralign" | Max players<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>8</code><br />
| class="col3" | Used by the client to draw the player list<br />
|- class="row8"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 12 bytes + length of strings<br />
|}<br />
<br />
=== Handshake (0x02) ===<br />
<br />
''Client to server''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0x02<br />
| class="col1 centeralign" | Protocol Version<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>38</code><br />
| class="col4" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Username<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <code>TkTech</code><br />
| class="col4" | The username of the player attempting to connect<br />
|- class="row3"<br />
| class="col1 centeralign" | Server Host<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <code>localhost</code><br />
| class="col4" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Server Port<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>25565</code><br />
| class="col4" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 10 bytes + length of strings<br />
|}<br />
<br />
=== Entity Equipment (0x05) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="3" | 0x05<br />
| class="col1 centeralign" | Entity ID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 0x00010643<br />
| class="col4" | Named Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Slot<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | 4<br />
| class="col3" | Equipment slot: 0=held, 1-4=armor slot <br />
|- class="row3"<br />
| class="col0 centeralign" | Item<br />
| class="col1 centeralign" | slot<br />
| class="col2 centeralign" | <br />
| class="col3" | Item in slot format<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes<br />
|}<br />
<br />
=== Respawn (0x09) ===<br />
<br />
'''Server to Client'''<br />
<br />
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0x09<br />
| class="col1 centeralign" | Dimension<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|- class="row2"<br />
| class="col1 centeralign" | Difficulty<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard. <code>1</code> is always sent c->s<br />
|- class="row3"<br />
| class="col1 centeralign" | Creative mode<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>0</code> for survival, <code>1</code> for creative.<br />
|- class="row4"<br />
| class="col1 centeralign" | World height<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <code>256</code><br />
| class="col4" | Defaults to <code>256</code><br />
|- class="row5"<br />
| class="col1 centeralign" | Level Type<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | default<br />
| class="col4" | See [[#0x01|0x01 login]]<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes + length of string<br />
|}<br />
<br />
=== Player Block Placement (0x0F) ===<br />
<br />
''Client to Server''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="8" | 0x0F<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>32</code><br />
| class="col4" | Block position<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>64</code><br />
| class="col3" | Block position<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>32</code><br />
| class="col3 leftalign" | Block position<br />
|- class="row4"<br />
| class="col0 centeralign" | Direction<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>3</code><br />
| class="col3" | The offset to use for block/item placement (see below)<br />
|- class="row5"<br />
| class="col0 centeralign" | Held item<br />
| class="col1 centeralign" | [[Slot_Data|slot]]<br />
| class="col2 centeralign" | <br />
| class="col3" | <br />
|- class="row6"<br />
| class="col0 centeralign" | Cursor position X<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | 0 - 16<br />
| class="col3" | The position of the crosshair on the block<br />
|- class="row7"<br />
| class="col0 centeralign" | Cursor position Y<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | 0 - 16<br />
| class="col3" | <br />
|- class="row8"<br />
| class="col0 centeralign" | Cursor position Z<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | 0 - 16<br />
| class="col3" | <br />
|- class="row9"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes + slot data<br />
|}<br />
<br />
=== Spawn Named Entity (0x14) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0 centeralign" | Packet ID<br />
! class="col1 rightalign" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="9" | 0x14<br />
| class="col1" | EID<br />
| class="col2" | int<br />
| class="col3" | <code>94453</code><br />
| class="col4" | Player ID<br />
|- class="row2"<br />
| class="col0" | Player Name<br />
| class="col1" | string<br />
| class="col2" | <code>Twdtwd</code><br />
| class="col3" | Max length of 16<br />
|- class="row3"<br />
| class="col0" | X<br />
| class="col1" | int<br />
| class="col2" | <code>784</code><br />
| class="col3" | Player X as Absolute Integer<br />
|- class="row4"<br />
| class="col0" | Y<br />
| class="col1" | int<br />
| class="col2" | <code>2131</code><br />
| class="col3" | Player Y as Absolute Integer<br />
|- class="row5"<br />
| class="col0" | Z<br />
| class="col1" | int<br />
| class="col2" | <code>-752</code><br />
| class="col3" | Player Z as Absolute Integer<br />
|- class="row6"<br />
| class="col0" | Yaw<br />
| class="col1" | byte<br />
| class="col2" | <code>0</code><br />
| class="col3" | Player rotation as a packed byte<br />
|- class="row7"<br />
| class="col0" | Pitch<br />
| class="col1" | byte<br />
| class="col2" | <code>0</code><br />
| class="col3" | Player rotation as a packed byte<br />
|- class="row8"<br />
| class="col0" | Current Item<br />
| class="col1" | short<br />
| class="col2" | <code>0</code><br />
| class="col3" | The item the player is currently holding. Note that this should be 0 for "no item", unlike -1 used in other packets. A negative value crashes clients.<br />
|- class="row9"<br />
| class="col0" | Metadata<br />
| class="col1" | Metadata<br />
| class="col2" | <code>127</code><br />
| class="col3" | <br />
|- class="row10"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 bytes + length of strings + metadata (at least 1)<br />
|}<br />
<br />
=== Spawn Object/Vehicle (0x17) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when an Object/Vehicle is created. The throwers entity id is now used for fishing floats too.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="9" | 0x17<br />
| class="col1 centeralign" | EID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>62</code><br />
| class="col4" | Entity ID of the Object<br />
|- class="row2"<br />
| class="col0 centeralign" | Type<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>11</code><br />
| class="col3" | The type of object (see [[Entities#Objects]])<br />
|- class="row3"<br />
| class="col0 centeralign" | X<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>16080</code><br />
| class="col3" | The Absolute Integer X Position of the object<br />
|- class="row4"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>2299</code><br />
| class="col3" | The Absolute Integer Y Position of the object<br />
|- class="row5"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>592</code><br />
| class="col3" | The Absolute Integer Z Position of the object<br />
|- class="row6"<br />
| class="col0 centeralign" | thrower's entity ID<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | If this is bigger than 0, this is a entity trown by a other entity and the next 3 fields are sent.<br />
|- class="row7"<br />
| class="col0 centeralign" | Speed X<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the X axis.<br />
|- class="row5"<br />
| class="col0 centeralign" | Speed Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Y axis.<br />
|- class="row5"<br />
| class="col0 centeralign" | Speed Z<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Z axis.<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 or 28 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x18}}<br />
<br />
=== Spawn Mob (0x18) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when a Mob Entity is Spawned<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="12" | 0x18<br />
| class="col1 centeralign" | EID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>446</code><br />
| class="col4" | Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Type<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>91</code><br />
| class="col3" | The type of mob. See [[Entities#Mobs]]<br />
|- class="row3"<br />
| class="col0 centeralign" | X<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>13366</code><br />
| class="col3" | The Absolute Integer X Position of the object<br />
|- class="row4"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>2176</code><br />
| class="col3" | The Absolute Integer Y Position of the object<br />
|- class="row5"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>1680</code><br />
| class="col3" | The Absolute Integer Z Position of the object<br />
|- class="row6"<br />
| class="col0 centeralign" | Yaw<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>-27</code><br />
| class="col3" | The yaw in steps of 2p/256<br />
|- class="row7"<br />
| class="col0 centeralign" | Pitch<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | The pitch in steps of 2p/256<br />
|- class="row8"<br />
| class="col0 centeralign" | Head Yaw<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <br />
| class="col3" | Head yaw in steps of 2p/256<br />
|- class="row9"<br />
| class="col0 centeralign" | Velocity Z<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row10"<br />
| class="col0 centeralign" | Velocity X<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row11"<br />
| class="col0 centeralign" | Velocity Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row12"<br />
| class="col0 centeralign" | Metadata<br />
| class="col1 centeralign" | Metadata<br />
| class="col2 centeralign" | <code>127</code><br />
| class="col3" | Varies by mob, see [[Entities]]<br />
|- class="row13"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 27 bytes + Metadata (at least 1)<br />
|}<br />
<br />
<br />
{{anchor|0x19}}<br />
<br />
=== Destroy Entity (0x1D) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when an list of Entities is to be destroyed on the client.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 " rowspan="2" | 0x1D<br />
| class="col1 centeralign" | Entity Count<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>3</code><br />
| class="col4 centeralign" | The amount of entities which should be destroyed<br />
|- class="row21"<br />
| class="col1 centeralign" | Entity IDs<br />
| class="col2 centeralign" | array of int<br />
| class="col3 centeralign" | <code>452, 546, 123</code><br />
| class="col4 centeralign" | The list of entity ids which should be destroyed<br />
|- class="row32"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 2 + (entity count * 4) bytes<br />
|}<br />
<br />
<br />
{{anchor|0x1E}}<br />
<br />
=== Chunk Data (0x33) ===<br />
<br />
''Server to Client''<br />
<br />
See also: [[Map Format]]<br />
<br />
Chunks are sent a column at a time, with some sections optionally missing from each packet (those consisting only of air).<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="7" | 0x33<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | Chunk X Coordinate (*16 to get true X)<br />
|- class="row2"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" |<br />
| class="col3" | Chunk Z Coordinate (*16 to get true Z)<br />
|- class="row3"<br />
| class="col0 centeralign" | Ground-up continuous<br />
| class="col1 centeralign" | boolean<br />
| class="col2 centeralign" | <br />
| class="col3" | This is True if the packet represents all sections in this vertical column, where the primary bit map specifies exactly which sections are included, and which are air.<br />
|- class="row4"<br />
| class="col0 centeralign" | Primary bit map<br />
| class="col1 centeralign" | unsigned short<br />
| class="col2 centeralign" | 15<br />
| class="col3" | Bitmask with 1 for every 16x16x16 section which data follows in the compressed data.<br />
|- class="row5"<br />
| class="col0 centeralign" | Add bit map<br />
| class="col1 centeralign" | unsigned short<br />
| class="col2 centeralign" | 0<br />
| class="col3" | Same as above, but this is used exclusively for the 'add' portion of the payload<br />
|- class="row6"<br />
| class="col0 centeralign" | Compressed size<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <br />
| class="col3" | Size of compressed chunk data.<br />
|- class="row78"<br />
| class="col0 centeralign" | Compressed data<br />
| class="col1 centeralign" | unsigned byte array<br />
| class="col2 centeralign" | <code>…</code><br />
| class="col3" | The chunk data is compressed using ZLib Deflate function.<br />
|- class="row8"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 bytes + Compressed chunk size<br />
|}<br />
<br />
<br />
=== Block Change (0x35) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0x35<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>502</code><br />
| class="col4" | Block X Coordinate<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>71</code><br />
| class="col3" | Block Y Coordinate<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>18</code><br />
| class="col3" | Block Z Coordinate<br />
|- class="row4"<br />
| class="col0 centeralign" | Block Type<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>78</code><br />
| class="col3" | The new block type for the block<br />
|- class="row5"<br />
| class="col0 centeralign" | Block Metadata<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | The new Metadata for the block<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 13 bytes<br />
|}<br />
<br />
=== Block Action (0x36) ===<br />
<br />
''Server to Client''<br />
<br />
This packet is used for a number of things:<br />
* <div class="li">Chests opening and closing<br />
* Pistons pushing and pulling<br />
* Note blocks playing<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x36<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>502</code><br />
| class="col4" | Block X Coordinate<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>71</code><br />
| class="col3" | Block Y Coordinate<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>18</code><br />
| class="col3" | Block Z Coordinate<br />
|- class="row4"<br />
| class="col0 centeralign" | Byte 1<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>3</code><br />
| class="col3" | Varies depending on block - see below<br />
|- class="row5"<br />
| class="col0 centeralign" | Byte 2<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>17</code><br />
| class="col3" | Varies depending on block - see below<br />
|- class="row6"<br />
| class="col0 centeralign" | Block ID<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>29</code><br />
| class="col3" | The block id this action is set for<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 13 bytes<br />
|}<br />
<br />
See Also: [[Block Actions]]<br />
<br />
=== Update Tile Entity (0x84) ===<br />
<br />
''Server to Client''<br />
<br />
Essentially a block update on a tile entity.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x84<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <br />
| class="col3" | <br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <br />
| class="col3" | <br />
|- class="row4"<br />
| class="col0 centeralign" | Action<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <br />
| class="col3" | The type of update to perform<br />
|- class="row5"<br />
| class="col0 centeralign" | Data length<br />
| class="col1 centeralign" | Short<br />
| class="col2 centeralign" | <br />
| class="col3" | Varies<br />
|- class="row6"<br />
| class="col0 centeralign" | NBT Data<br />
| class="col1 centeralign" | Byte Array - Present if data length > 0<br />
| class="col2 centeralign" | <br />
| class="col3" | Varies<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 12 + itemstack bytes<br />
|}<br />
<br />
'''Actions'''<br />
<br />
* '''1''': Set mob displayed inside a mob spawner. Custom 1 contains the [[Entities#Mobs|mob type]]<br />
<br />
=== Explosion (0x3C) ===<br />
<br />
''Server to Client''<br />
<br />
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=9 | 0x3C<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | double<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row1"<br />
| class="col1 centeralign" | Y<br />
| class="col2 centeralign" | double<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row1"<br />
| class="col1 centeralign" | Z<br />
| class="col2 centeralign" | double<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row1"<br />
| class="col1 centeralign" | Radius<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | 3.0<br />
| class="col4" | Currently unused in the client<br />
|- class="row2"<br />
| class="col1 centeralign" | Record count<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | This is the count, not the size. The size is 3 times this value.<br />
|- class="row3"<br />
| class="col1 centeralign" | Records<br />
| class="col2 centeralign" | (byte, byte, byte) × count<br />
| class="col3 centeralign" | <br />
| class="col4" | Each record is 3 bytes, which seem to be XYZ offsets of affected blocks.<br />
|- class="row4"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row5"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row6"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 45 bytes + 3*(Record count) bytes<br />
|}<br />
<br />
=== Player Abilities (0xCA) ===<br />
This packet has now been compressed into 3 bytes. The latter 2 bytes are used to indicate the walking and flying sppeds respectively, while the first byte is used to determine the value of 4 booleans.<br />
<br />
These booleans are whether damage is disabled (god mode), whether the player is flying, whether the player can fly, and whether the player is in creative mode.<br />
<br />
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.<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=4 | 0xCA<br />
| class="col1 centeralign" | Flags<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 5<br />
| class="col4" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Flying speed<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 12<br />
| class="col4" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Walking speed<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 25<br />
| class="col4" | <br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 4 bytes<br />
|}<br />
<br />
== Removed packets ==<br />
<br />
=== Chunk Allocation Packet (0x32) ===<br />
The chunk Allocation Packet is not longer in use. Memory will automatically allocated with a incoming Map Chunk packet. To deallocate memory you need to send a MapChunk packet, which only contains biome data for plains(all biome bytes set to 1). So the Add and Primary bitmap must set to 0, and Ground-up continuous to true. Because the payload of this packet is compressed and static you can use a hardcoded value for it, so you don't need to compress it each time.<br />
<br />
This is the payload which is used in the Compressed Data part to deallocate a chunk column:<br />
<br />
0x78, 0x9C, 0x63, 0x64, 0x1C, 0xD9, 0x00, 0x00, 0x81, 0x80, 0x01, 0x01<br />
<br />
== Protocol History ==<br />
<br />
=== 2012-07-24 ===<br />
* 12w30c<br />
* Protocol version 39<br />
* Changed packets 0x84<br />
<br />
=== 2012-07-23 ===<br />
* 12w30a<br />
* Protocol version is still 38<br />
* Changed packets 0x14 and 0x35<br />
<br />
=== 2012-07-05 ===<br />
* 12w27a<br />
* Protocol version is now 38<br />
* Added packet 0x38<br />
<br />
=== 2012-06-21 ===<br />
* 12w25a<br />
* Packet 0xFC and 0xFD include a 4 byte long byte array. This is hashed with the public RSA key and sent back. See [[Protocol Encryption]] for further info.<br />
* Packet 0x3E changed to include float rather than byte.<br />
<br />
=== 2012-06-14 ===<br />
* 12w24a<br />
* Protocol version is now 36<br />
* Changed Packet 0x01(Login Request), only used as Login Reply<br />
* New Packet 0xCD used for Login Request and Respawn (1 byte payload)<br />
* All items (except the empty hand) now send enchantment data<br />
<br />
=== 2012-06-07 ===<br />
* 12w23b<br />
* Protocol version is now 35<br />
* Change packet: Player Block Placement<br />
* New Packet: Block breaking animation<br />
<br />
=== 2012-05-24 ===<br />
* 12w21a<br />
* No packet changes but the algorithm was changed to AES128 with the shared key as the IV, will be described in [[Protocol Encryption]]<br />
<br />
=== 2012-05-10 ===<br />
* 12w19a<br />
* No packet changes, but an other encryption algorythm is used, described in [[Protocol Encryption]]<br />
* The items which are not enchantable in 12w18a are now readded<br />
* Fishing floats, spawned by a 0x17 packet do now use the extra fields<br />
<br />
=== 2012-05-03 ===<br />
* 12w18a<br />
* Protocol version is now 32<br />
* New packet: 0x3D Name Sound Effect<br />
* Changed packet: 0x01 Login Request<br />
* Changed packet: 0x02 Handshake<br />
* Changed packet: 0xCA Player Abilities<br />
* Changed packet: 0xCC Locale and View Distance<br />
* Changed packet: 0x09 Respawn<br />
* Removed packet: 0x32 Map Column Allocation<br />
* This items are not enchantable in this version: 0x103, 0x105, 0x15A, 0x167, 0x10C, 0x10D, 0x10E, 0x10F, 0x122, 0x110, 0x111, 0x112, 0x113, 0x123, 0x10B, 0x100, 0x101, 0x102, 0x124, 0x114, 0x115, 0x116, 0x117, 0x125, 0x11B, 0x11C, 0x11D, 0x11E, 0x126<br />
<br />
=== 2012-04-26 ===<br />
* 12w17a<br />
* Protocol version is now 31<br />
* RC4 based encryption, described in [[Protocol Encryption]]<br />
* Changed packet: 0x01 Login Request<br />
* Changed packet: 0x02 Handshake<br />
* Changed packet: 0xCC Locale and View Distance<br />
* Changed packet: 0xCA Player Abilities <br />
* New packet: 0xFC Encryption Key Response<br />
* New packet: 0xFD Encryption Key Request<br />
* New Item: Book & Quills (0x182) is enchantable<br />
* New Item: Written Book (0x183) is enchantable<br />
<br />
=== 2012-04-19 ===<br />
* 12w16a<br />
* Protocol version is now 30<br />
* New packet: 0xCB Tab-complete<br />
* New packet: 0xCC Locale and View Distance</div>Sadimusihttps://wiki.vg/index.php?title=Pre-release_protocol&diff=2872Pre-release protocol2012-07-28T23:20:33Z<p>Sadimusi: /* Login Request (0x01) */ Removed Client->Server</p>
<hr />
<div>This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently 1.2.5) to the current pre-release (or weekly release).<br />
<br />
== New packets ==<br />
<br />
=== Map Chunk Bulk (0x38) ===<br />
<br />
To reduce the number of bytes this packet is used to send chunk columns together for better compression results. The packet contains up to 100 chunk columns (later this might be reduced to 50).<br />
<br />
The data part is a zlib compressed byte array containing the chunk data. The meta data part specifies which chunks in which order the data part exists of. <br />
<br />
To split this packet into chunks you need to uncompress the data array. Then you can iterate through the data part. Each part is 10240 * n + 256 bytes. n is the number of chunks in the current chunk column(this is the number of flags set in the primary bitmap). 10240 is the amount of bytes for each chunk without add bitmap, 256 bytes are used for biomes. The second short in the meta data part is not yet in use. It could specify if the chunk uses the add bitmap part, because it has very high block ids, but not in the current snapshot. <br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=5 | 0x38<br />
| class="col1 centeralign" | Chunk Column Count<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4" | The number of chunk columns in this packet<br />
|- class="row2"<br />
| class="col1 centeralign" | Chunk data size<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | the size of the data field<br />
|- class="row3"<br />
| class="col1 centeralign" | Data<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4" | compressed chunk data<br />
|- class="row4"<br />
| class="col1 centeralign" | meta information<br />
| class="col2 centeralign" | chunk bulk meta information<br />
| class="col3 centeralign" |<br />
| class="col4 centeralign" | Chunk column count times the Meta information structure (See notes for details)<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 7 + (Chunk data size) + 12 * (Chunk Column Count) bytes<br />
|}<br />
<br />
<br />
====Chunk Bulk Meta Information Structure====<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col1 centeralign" | Chunk Column X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 10<br />
| class="col4" | The X coordinate of the specific chunk column<br />
|- class="row2"<br />
| class="col1 centeralign" | Chunk Column Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 10<br />
| class="col4" | The Z coordinate of the specific chunk column<br />
|- class="row3"<br />
| class="col1 centeralign" | Chunk Primary bitmap<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | 15<br />
| class="col4" | A bitmap which specifies which chunk is not empty in this chunk column<br />
|- class="row4"<br />
| class="col1 centeralign" | Chunk Add bitmap?<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | 0<br />
| class="col4" | A bitmap which specifies which chunk need add information because of very high block ids. not yet used. needs verification<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="3" | 12 bytes<br />
|}<br />
<br />
<br />
=== Tab-complete (0xCB) ===<br />
<br />
''Two-way''<br />
<br />
Sent C->S when the user presses [tab] while writing text. The payload contains all text behind the cursor.<br />
<br />
The server responds with an auto-completion of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported.<br />
<br />
In the event of more than one possible completion, the server responds with the options packed into the single string field, separated by a null character. Note that as strings are UTF-16, this is two bytes wide.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" | 0xCB<br />
| class="col1 centeralign" | Text<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row3"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 3 bytes + length of string<br />
|}<br />
<br />
=== Locale and View Distance (0xCC) ===<br />
<br />
''Client to server''<br />
<br />
Sent when the player connects, or when settings are changed.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0xCC<br />
| class="col1 centeralign" | Locale<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | en_GB<br />
|- class="row2"<br />
| class="col1 centeralign" | View distance<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4" | 0-3 for 'far', 'normal', 'short', 'tiny'.<br />
|- class="row3"<br />
| class="col1 centeralign" | Chat flags<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 8<br />
| class="col4" | Chat settings. See notes below.<br />
|- class="row4"<br />
| class="col1 centeralign" | Difficulty<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4 centeralign" | Client-side difficulty from options.txt<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 8 bytes + length of string<br />
|}<br />
<br />
Chat flags has several values packed into one byte.<br />
<br />
'''Chat Enabled:''' Bits 0-1. 00: Enabled. 01: Commands only. 10: Hidden.<br />
<br />
'''Colors Enabled:''' Bit 3. 0: Disabled. 1: Enabled.<br />
<br />
=== Client Statuses (0xCD) ===<br />
<br />
''Client to server''<br />
<br />
Sent when the client is ready to complete login and when the client is ready to respawn after death.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="1" | 0xCD<br />
| class="col1 centeralign" | Payload<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4" | Bit field. 0: Initial spawn, 1: Respawn after death<br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="5" | 2 bytes<br />
|}<br />
<br />
=== Encryption Key Response (0xFC) ===<br />
<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0xFC<br />
| class="col1 centeralign" | Shared secret length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Shared secret<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" |<br />
|- class="row3"<br />
| class="col1 centeralign" | Verify token length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token response<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 5 bytes + length of shared secret + length of token<br />
|}<br />
<br />
=== Encryption Key Request (0xFD) ===<br />
<br />
''Server to client''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0xFD<br />
| class="col1 centeralign" | Server id<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Public key length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Public key<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 7 bytes + length of string + length of key + length of token<br />
|}<br />
<br />
<br />
<br />
<br />
<br />
=== Named Sound Effect (0x3E) ===<br />
<br />
''Server to client''<br />
<br />
Used to play a sound effect on the client.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x3E<br />
| class="col1 centeralign" | Sound name<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | step.grass<br />
| class="col4 centeralign" | 250<br />
|- class="row2"<br />
| class="col1 centeralign" | Effect position X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect X multiplied by 8<br />
|- class="row3"<br />
| class="col1 centeralign" | Effect position Y<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect Y multiplied with 8<br />
|- class="row4"<br />
| class="col1 centeralign" | Effect position Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect Z multiplied with 8<br />
|- class="row5"<br />
| class="col1 centeralign" | Volume<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | 9<br />
| class="col4 centeralign" | 1 is 100%, can be more<br />
|- class="row6"<br />
| class="col1 centeralign" | Pitch<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 1<br />
| class="col4 centeralign" | 63 is 100%, can be more<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 20 bytes + length of string<br />
|}<br />
<br />
=== Block Break Animation (0x37) ===<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=5 | 0x37<br />
| class="col1 centeralign" | EID?<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | Entity breaking the block?<br />
|- class="row2"<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" rowspan=3 | Block position<br />
|- class="row2"<br />
| class="col1 centeralign" | Y<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 1<br />
| class="col4" | ?<br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 4 bytes<br />
|}<br />
<br />
== Changed Data Type ==<br />
<br />
=== Slot Data ===<br />
<br />
Parsing or encoding of [[Slot Data]] no longer requires a list of all enchantable item IDs. Every slot transmitted now includes a short that indicates the length of the NBT data. As before, a length of -1 means there is no NBT data.<br />
<br />
This change affects any packets with [[Slot Data]], including:<br />
* 0x0F (Player Block Placement)<br />
* 0x10 (Held Item Change)<br />
* 0x66 (Click Window)<br />
* 0x67 (Set Slot)<br />
* 0x68 (Set Window Items)<br />
* 0x6B (Creative Inventory Action)<br />
* 0x05 (Entity Equipment)<br />
<br />
== Changed packets ==<br />
<br />
=== Login Request (0x01) ===<br />
<br />
''Server to Client''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="7" | 0x01<br />
| class="col1 centeralign" | Entity ID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>1298</code><br />
| class="col4" | The Players Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Level Type<br />
| class="col1 centeralign" | string<br />
| class="col2 centeralign" | default<br />
| class="col3" | default or SUPERFLAT; level-type in server.properties<br />
|- class="row3"<br />
| class="col0 centeralign" | Server mode<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | 0 for survival, 1 for creative<br />
|- class="row4"<br />
| class="col0 centeralign" | Dimension<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|- class="row5"<br />
| class="col0 centeralign" | Difficulty<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>1</code><br />
| class="col3" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard<br />
|- class="row6"<br />
| class="col0 centeralign" | Not used<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Only 0 observed from vanilla server, was previously world height<br />
|- class="row7"<br />
| class="col0 centeralign" | Max players<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>8</code><br />
| class="col3" | Used by the client to draw the player list<br />
|- class="row8"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 12 bytes + length of strings<br />
|}<br />
<br />
=== Handshake (0x02) ===<br />
<br />
''Client to server''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0x02<br />
| class="col1 centeralign" | Protocol Version<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>38</code><br />
| class="col4" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Username<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <code>TkTech</code><br />
| class="col4" | The username of the player attempting to connect<br />
|- class="row3"<br />
| class="col1 centeralign" | Server Host<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <code>localhost</code><br />
| class="col4" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Server Port<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>25565</code><br />
| class="col4" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 10 bytes + length of strings<br />
|}<br />
<br />
=== Entity Equipment (0x05) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="3" | 0x05<br />
| class="col1 centeralign" | Entity ID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 0x00010643<br />
| class="col4" | Named Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Slot<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | 4<br />
| class="col3" | Equipment slot: 0=held, 1-4=armor slot <br />
|- class="row3"<br />
| class="col0 centeralign" | Item<br />
| class="col1 centeralign" | slot<br />
| class="col2 centeralign" | <br />
| class="col3" | Item in slot format<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes<br />
|}<br />
<br />
=== Respawn (0x09) ===<br />
<br />
''Two-Way''<br />
<br />
Sent by the client when the player presses the "Respawn" button after dying. The server then teleports the user to the spawn point, and sends a respawn packet in response. The client will not leave the respawn screen until it receives a respawn packet.<br />
<br />
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.<br />
<br />
'''Client to Server'''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
|- class="row1"<br />
| class="col0 centeralign" | 0x09<br />
|}<br />
<br />
'''Server to Client'''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0x09<br />
| class="col1 centeralign" | Dimension<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|- class="row2"<br />
| class="col1 centeralign" | Difficulty<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard. <code>1</code> is always sent c->s<br />
|- class="row3"<br />
| class="col1 centeralign" | Creative mode<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>0</code> for survival, <code>1</code> for creative.<br />
|- class="row4"<br />
| class="col1 centeralign" | World height<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <code>256</code><br />
| class="col4" | Defaults to <code>256</code><br />
|- class="row5"<br />
| class="col1 centeralign" | Level Type<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | default<br />
| class="col4" | See [[#0x01|0x01 login]]<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes + length of string<br />
|}<br />
<br />
=== Player Block Placement (0x0F) ===<br />
<br />
''Client to Server''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="8" | 0x0F<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>32</code><br />
| class="col4" | Block position<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>64</code><br />
| class="col3" | Block position<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>32</code><br />
| class="col3 leftalign" | Block position<br />
|- class="row4"<br />
| class="col0 centeralign" | Direction<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>3</code><br />
| class="col3" | The offset to use for block/item placement (see below)<br />
|- class="row5"<br />
| class="col0 centeralign" | Held item<br />
| class="col1 centeralign" | [[Slot_Data|slot]]<br />
| class="col2 centeralign" | <br />
| class="col3" | <br />
|- class="row6"<br />
| class="col0 centeralign" | Cursor position X<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | 0 - 16<br />
| class="col3" | The position of the crosshair on the block<br />
|- class="row7"<br />
| class="col0 centeralign" | Cursor position Y<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | 0 - 16<br />
| class="col3" | <br />
|- class="row8"<br />
| class="col0 centeralign" | Cursor position Z<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | 0 - 16<br />
| class="col3" | <br />
|- class="row9"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes + slot data<br />
|}<br />
<br />
=== Spawn Named Entity (0x14) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0 centeralign" | Packet ID<br />
! class="col1 rightalign" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="9" | 0x14<br />
| class="col1" | EID<br />
| class="col2" | int<br />
| class="col3" | <code>94453</code><br />
| class="col4" | Player ID<br />
|- class="row2"<br />
| class="col0" | Player Name<br />
| class="col1" | string<br />
| class="col2" | <code>Twdtwd</code><br />
| class="col3" | Max length of 16<br />
|- class="row3"<br />
| class="col0" | X<br />
| class="col1" | int<br />
| class="col2" | <code>784</code><br />
| class="col3" | Player X as Absolute Integer<br />
|- class="row4"<br />
| class="col0" | Y<br />
| class="col1" | int<br />
| class="col2" | <code>2131</code><br />
| class="col3" | Player Y as Absolute Integer<br />
|- class="row5"<br />
| class="col0" | Z<br />
| class="col1" | int<br />
| class="col2" | <code>-752</code><br />
| class="col3" | Player Z as Absolute Integer<br />
|- class="row6"<br />
| class="col0" | Yaw<br />
| class="col1" | byte<br />
| class="col2" | <code>0</code><br />
| class="col3" | Player rotation as a packed byte<br />
|- class="row7"<br />
| class="col0" | Pitch<br />
| class="col1" | byte<br />
| class="col2" | <code>0</code><br />
| class="col3" | Player rotation as a packed byte<br />
|- class="row8"<br />
| class="col0" | Current Item<br />
| class="col1" | short<br />
| class="col2" | <code>0</code><br />
| class="col3" | The item the player is currently holding. Note that this should be 0 for "no item", unlike -1 used in other packets. A negative value crashes clients.<br />
|- class="row9"<br />
| class="col0" | Metadata<br />
| class="col1" | Metadata<br />
| class="col2" | <code>127</code><br />
| class="col3" | <br />
|- class="row10"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 bytes + length of strings + metadata (at least 1)<br />
|}<br />
<br />
=== Spawn Object/Vehicle (0x17) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when an Object/Vehicle is created. The throwers entity id is now used for fishing floats too.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="9" | 0x17<br />
| class="col1 centeralign" | EID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>62</code><br />
| class="col4" | Entity ID of the Object<br />
|- class="row2"<br />
| class="col0 centeralign" | Type<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>11</code><br />
| class="col3" | The type of object (see [[Entities#Objects]])<br />
|- class="row3"<br />
| class="col0 centeralign" | X<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>16080</code><br />
| class="col3" | The Absolute Integer X Position of the object<br />
|- class="row4"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>2299</code><br />
| class="col3" | The Absolute Integer Y Position of the object<br />
|- class="row5"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>592</code><br />
| class="col3" | The Absolute Integer Z Position of the object<br />
|- class="row6"<br />
| class="col0 centeralign" | thrower's entity ID<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | If this is bigger than 0, this is a entity trown by a other entity and the next 3 fields are sent.<br />
|- class="row7"<br />
| class="col0 centeralign" | Speed X<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the X axis.<br />
|- class="row5"<br />
| class="col0 centeralign" | Speed Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Y axis.<br />
|- class="row5"<br />
| class="col0 centeralign" | Speed Z<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Z axis.<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 or 28 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x18}}<br />
<br />
=== Spawn Mob (0x18) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when a Mob Entity is Spawned<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="12" | 0x18<br />
| class="col1 centeralign" | EID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>446</code><br />
| class="col4" | Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Type<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>91</code><br />
| class="col3" | The type of mob. See [[Entities#Mobs]]<br />
|- class="row3"<br />
| class="col0 centeralign" | X<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>13366</code><br />
| class="col3" | The Absolute Integer X Position of the object<br />
|- class="row4"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>2176</code><br />
| class="col3" | The Absolute Integer Y Position of the object<br />
|- class="row5"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>1680</code><br />
| class="col3" | The Absolute Integer Z Position of the object<br />
|- class="row6"<br />
| class="col0 centeralign" | Yaw<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>-27</code><br />
| class="col3" | The yaw in steps of 2p/256<br />
|- class="row7"<br />
| class="col0 centeralign" | Pitch<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | The pitch in steps of 2p/256<br />
|- class="row8"<br />
| class="col0 centeralign" | Head Yaw<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <br />
| class="col3" | Head yaw in steps of 2p/256<br />
|- class="row9"<br />
| class="col0 centeralign" | Velocity Z<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row10"<br />
| class="col0 centeralign" | Velocity X<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row11"<br />
| class="col0 centeralign" | Velocity Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row12"<br />
| class="col0 centeralign" | Metadata<br />
| class="col1 centeralign" | Metadata<br />
| class="col2 centeralign" | <code>127</code><br />
| class="col3" | Varies by mob, see [[Entities]]<br />
|- class="row13"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 27 bytes + Metadata (at least 1)<br />
|}<br />
<br />
<br />
{{anchor|0x19}}<br />
<br />
=== Destroy Entity (0x1D) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when an list of Entities is to be destroyed on the client.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 " rowspan="2" | 0x1D<br />
| class="col1 centeralign" | Entity Count<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>3</code><br />
| class="col4 centeralign" | The amount of entities which should be destroyed<br />
|- class="row21"<br />
| class="col1 centeralign" | Entity IDs<br />
| class="col2 centeralign" | array of int<br />
| class="col3 centeralign" | <code>452, 546, 123</code><br />
| class="col4 centeralign" | The list of entity ids which should be destroyed<br />
|- class="row32"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 2 + (entity count * 4) bytes<br />
|}<br />
<br />
<br />
{{anchor|0x1E}}<br />
<br />
=== Chunk Data (0x33) ===<br />
<br />
''Server to Client''<br />
<br />
See also: [[Map Format]]<br />
<br />
Chunks are sent a column at a time, with some sections optionally missing from each packet (those consisting only of air).<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="7" | 0x33<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | Chunk X Coordinate (*16 to get true X)<br />
|- class="row2"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" |<br />
| class="col3" | Chunk Z Coordinate (*16 to get true Z)<br />
|- class="row3"<br />
| class="col0 centeralign" | Ground-up continuous<br />
| class="col1 centeralign" | boolean<br />
| class="col2 centeralign" | <br />
| class="col3" | This is True if the packet represents all sections in this vertical column, where the primary bit map specifies exactly which sections are included, and which are air.<br />
|- class="row4"<br />
| class="col0 centeralign" | Primary bit map<br />
| class="col1 centeralign" | unsigned short<br />
| class="col2 centeralign" | 15<br />
| class="col3" | Bitmask with 1 for every 16x16x16 section which data follows in the compressed data.<br />
|- class="row5"<br />
| class="col0 centeralign" | Add bit map<br />
| class="col1 centeralign" | unsigned short<br />
| class="col2 centeralign" | 0<br />
| class="col3" | Same as above, but this is used exclusively for the 'add' portion of the payload<br />
|- class="row6"<br />
| class="col0 centeralign" | Compressed size<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <br />
| class="col3" | Size of compressed chunk data.<br />
|- class="row78"<br />
| class="col0 centeralign" | Compressed data<br />
| class="col1 centeralign" | unsigned byte array<br />
| class="col2 centeralign" | <code>…</code><br />
| class="col3" | The chunk data is compressed using ZLib Deflate function.<br />
|- class="row8"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 bytes + Compressed chunk size<br />
|}<br />
<br />
<br />
=== Block Change (0x35) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0x35<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>502</code><br />
| class="col4" | Block X Coordinate<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>71</code><br />
| class="col3" | Block Y Coordinate<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>18</code><br />
| class="col3" | Block Z Coordinate<br />
|- class="row4"<br />
| class="col0 centeralign" | Block Type<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>78</code><br />
| class="col3" | The new block type for the block<br />
|- class="row5"<br />
| class="col0 centeralign" | Block Metadata<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | The new Metadata for the block<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 13 bytes<br />
|}<br />
<br />
=== Block Action (0x36) ===<br />
<br />
''Server to Client''<br />
<br />
This packet is used for a number of things:<br />
* <div class="li">Chests opening and closing<br />
* Pistons pushing and pulling<br />
* Note blocks playing<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x36<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>502</code><br />
| class="col4" | Block X Coordinate<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>71</code><br />
| class="col3" | Block Y Coordinate<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>18</code><br />
| class="col3" | Block Z Coordinate<br />
|- class="row4"<br />
| class="col0 centeralign" | Byte 1<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>3</code><br />
| class="col3" | Varies depending on block - see below<br />
|- class="row5"<br />
| class="col0 centeralign" | Byte 2<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>17</code><br />
| class="col3" | Varies depending on block - see below<br />
|- class="row6"<br />
| class="col0 centeralign" | Block ID<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>29</code><br />
| class="col3" | The block id this action is set for<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 13 bytes<br />
|}<br />
<br />
See Also: [[Block Actions]]<br />
<br />
=== Update Tile Entity (0x84) ===<br />
<br />
''Server to Client''<br />
<br />
Essentially a block update on a tile entity.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x84<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <br />
| class="col3" | <br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <br />
| class="col3" | <br />
|- class="row4"<br />
| class="col0 centeralign" | Action<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <br />
| class="col3" | The type of update to perform<br />
|- class="row5"<br />
| class="col0 centeralign" | Data length<br />
| class="col1 centeralign" | Short<br />
| class="col2 centeralign" | <br />
| class="col3" | Varies<br />
|- class="row6"<br />
| class="col0 centeralign" | NBT Data<br />
| class="col1 centeralign" | Byte Array - Present if data length > 0<br />
| class="col2 centeralign" | <br />
| class="col3" | Varies<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 12 + itemstack bytes<br />
|}<br />
<br />
'''Actions'''<br />
<br />
* '''1''': Set mob displayed inside a mob spawner. Custom 1 contains the [[Entities#Mobs|mob type]]<br />
<br />
=== Explosion (0x3C) ===<br />
<br />
''Server to Client''<br />
<br />
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=9 | 0x3C<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | double<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row1"<br />
| class="col1 centeralign" | Y<br />
| class="col2 centeralign" | double<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row1"<br />
| class="col1 centeralign" | Z<br />
| class="col2 centeralign" | double<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row1"<br />
| class="col1 centeralign" | Radius<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | 3.0<br />
| class="col4" | Currently unused in the client<br />
|- class="row2"<br />
| class="col1 centeralign" | Record count<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | This is the count, not the size. The size is 3 times this value.<br />
|- class="row3"<br />
| class="col1 centeralign" | Records<br />
| class="col2 centeralign" | (byte, byte, byte) × count<br />
| class="col3 centeralign" | <br />
| class="col4" | Each record is 3 bytes, which seem to be XYZ offsets of affected blocks.<br />
|- class="row4"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row5"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row6"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 45 bytes + 3*(Record count) bytes<br />
|}<br />
<br />
=== Player Abilities (0xCA) ===<br />
This packet has now been compressed into 3 bytes. The latter 2 bytes are used to indicate the walking and flying sppeds respectively, while the first byte is used to determine the value of 4 booleans.<br />
<br />
These booleans are whether damage is disabled (god mode), whether the player is flying, whether the player can fly, and whether the player is in creative mode.<br />
<br />
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.<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=4 | 0xCA<br />
| class="col1 centeralign" | Flags<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 5<br />
| class="col4" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Flying speed<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 12<br />
| class="col4" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Walking speed<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 25<br />
| class="col4" | <br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 4 bytes<br />
|}<br />
<br />
== Removed packets ==<br />
<br />
=== Chunk Allocation Packet (0x32) ===<br />
The chunk Allocation Packet is not longer in use. Memory will automatically allocated with a incoming Map Chunk packet. To deallocate memory you need to send a MapChunk packet, which only contains biome data for plains(all biome bytes set to 1). So the Add and Primary bitmap must set to 0, and Ground-up continuous to true. Because the payload of this packet is compressed and static you can use a hardcoded value for it, so you don't need to compress it each time.<br />
<br />
This is the payload which is used in the Compressed Data part to deallocate a chunk column:<br />
<br />
0x78, 0x9C, 0x63, 0x64, 0x1C, 0xD9, 0x00, 0x00, 0x81, 0x80, 0x01, 0x01<br />
<br />
== Protocol History ==<br />
<br />
=== 2012-07-24 ===<br />
* 12w30c<br />
* Protocol version 39<br />
* Changed packets 0x84<br />
<br />
=== 2012-07-23 ===<br />
* 12w30a<br />
* Protocol version is still 38<br />
* Changed packets 0x14 and 0x35<br />
<br />
=== 2012-07-05 ===<br />
* 12w27a<br />
* Protocol version is now 38<br />
* Added packet 0x38<br />
<br />
=== 2012-06-21 ===<br />
* 12w25a<br />
* Packet 0xFC and 0xFD include a 4 byte long byte array. This is hashed with the public RSA key and sent back. See [[Protocol Encryption]] for further info.<br />
* Packet 0x3E changed to include float rather than byte.<br />
<br />
=== 2012-06-14 ===<br />
* 12w24a<br />
* Protocol version is now 36<br />
* Changed Packet 0x01(Login Request), only used as Login Reply<br />
* New Packet 0xCD used for Login Request and Respawn (1 byte payload)<br />
* All items (except the empty hand) now send enchantment data<br />
<br />
=== 2012-06-07 ===<br />
* 12w23b<br />
* Protocol version is now 35<br />
* Change packet: Player Block Placement<br />
* New Packet: Block breaking animation<br />
<br />
=== 2012-05-24 ===<br />
* 12w21a<br />
* No packet changes but the algorithm was changed to AES128 with the shared key as the IV, will be described in [[Protocol Encryption]]<br />
<br />
=== 2012-05-10 ===<br />
* 12w19a<br />
* No packet changes, but an other encryption algorythm is used, described in [[Protocol Encryption]]<br />
* The items which are not enchantable in 12w18a are now readded<br />
* Fishing floats, spawned by a 0x17 packet do now use the extra fields<br />
<br />
=== 2012-05-03 ===<br />
* 12w18a<br />
* Protocol version is now 32<br />
* New packet: 0x3D Name Sound Effect<br />
* Changed packet: 0x01 Login Request<br />
* Changed packet: 0x02 Handshake<br />
* Changed packet: 0xCA Player Abilities<br />
* Changed packet: 0xCC Locale and View Distance<br />
* Changed packet: 0x09 Respawn<br />
* Removed packet: 0x32 Map Column Allocation<br />
* This items are not enchantable in this version: 0x103, 0x105, 0x15A, 0x167, 0x10C, 0x10D, 0x10E, 0x10F, 0x122, 0x110, 0x111, 0x112, 0x113, 0x123, 0x10B, 0x100, 0x101, 0x102, 0x124, 0x114, 0x115, 0x116, 0x117, 0x125, 0x11B, 0x11C, 0x11D, 0x11E, 0x126<br />
<br />
=== 2012-04-26 ===<br />
* 12w17a<br />
* Protocol version is now 31<br />
* RC4 based encryption, described in [[Protocol Encryption]]<br />
* Changed packet: 0x01 Login Request<br />
* Changed packet: 0x02 Handshake<br />
* Changed packet: 0xCC Locale and View Distance<br />
* Changed packet: 0xCA Player Abilities <br />
* New packet: 0xFC Encryption Key Response<br />
* New packet: 0xFD Encryption Key Request<br />
* New Item: Book & Quills (0x182) is enchantable<br />
* New Item: Written Book (0x183) is enchantable<br />
<br />
=== 2012-04-19 ===<br />
* 12w16a<br />
* Protocol version is now 30<br />
* New packet: 0xCB Tab-complete<br />
* New packet: 0xCC Locale and View Distance</div>Sadimusihttps://wiki.vg/index.php?title=Pre-release_protocol&diff=2868Pre-release protocol2012-07-28T08:18:04Z<p>Sadimusi: Cleaned up 0x0f</p>
<hr />
<div>This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently 1.2.5) to the current pre-release (or weekly release).<br />
<br />
== New packets ==<br />
<br />
=== Map Chunk Bulk (0x38) ===<br />
<br />
To reduce the number of bytes this packet is used to send chunk columns together for better compression results. The packet contains up to 100 chunk columns (later this might be reduced to 50).<br />
<br />
The data part is a zlib compressed byte array containing the chunk data. The meta data part specifies which chunks in which order the data part exists of. <br />
<br />
To split this packet into chunks you need to uncompress the data array. Then you can iterate through the data part. Each part is 10240 * n + 256 bytes. n is the number of chunks in the current chunk column(this is the number of flags set in the primary bitmap). 10240 is the amount of bytes for each chunk without add bitmap, 256 bytes are used for biomes. The second short in the meta data part is not yet in use. It could specify if the chunk uses the add bitmap part, because it has very high block ids, but not in the current snapshot. <br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=5 | 0x38<br />
| class="col1 centeralign" | Chunk Column Count<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4" | The number of chunk columns in this packet<br />
|- class="row2"<br />
| class="col1 centeralign" | Chunk data size<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | the size of the data field<br />
|- class="row3"<br />
| class="col1 centeralign" | Data<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4" | compressed chunk data<br />
|- class="row4"<br />
| class="col1 centeralign" | meta information<br />
| class="col2 centeralign" | chunk bulk meta information<br />
| class="col3 centeralign" |<br />
| class="col4 centeralign" | Chunk column count times the Meta information structure (See notes for details)<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 7 + (Chunk data size) + 12 * (Chunk Column Count) bytes<br />
|}<br />
<br />
<br />
====Chunk Bulk Meta Information Structure====<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col1 centeralign" | Chunk Column X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 10<br />
| class="col4" | The X coordinate of the specific chunk column<br />
|- class="row2"<br />
| class="col1 centeralign" | Chunk Column Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 10<br />
| class="col4" | The Z coordinate of the specific chunk column<br />
|- class="row3"<br />
| class="col1 centeralign" | Chunk Primary bitmap<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | 15<br />
| class="col4" | A bitmap which specifies which chunk is not empty in this chunk column<br />
|- class="row4"<br />
| class="col1 centeralign" | Chunk Add bitmap?<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | 0<br />
| class="col4" | A bitmap which specifies which chunk need add information because of very high block ids. not yet used. needs verification<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="3" | 12 bytes<br />
|}<br />
<br />
<br />
=== Tab-complete (0xCB) ===<br />
<br />
''Two-way''<br />
<br />
Sent C->S when the user presses [tab] while writing text. The payload contains all text behind the cursor.<br />
<br />
The server responds with an auto-completion of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported.<br />
<br />
In the event of more than one possible completion, the server responds with the options packed into the single string field, separated by a null character. Note that as strings are UTF-16, this is two bytes wide.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" | 0xCB<br />
| class="col1 centeralign" | Text<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row3"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 3 bytes + length of string<br />
|}<br />
<br />
=== Locale and View Distance (0xCC) ===<br />
<br />
''Client to server''<br />
<br />
Sent when the player connects, or when settings are changed.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0xCC<br />
| class="col1 centeralign" | Locale<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | en_GB<br />
|- class="row2"<br />
| class="col1 centeralign" | View distance<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4" | 0-3 for 'far', 'normal', 'short', 'tiny'.<br />
|- class="row3"<br />
| class="col1 centeralign" | Chat flags<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 8<br />
| class="col4" | Chat settings. See notes below.<br />
|- class="row4"<br />
| class="col1 centeralign" | Difficulty<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4 centeralign" | Client-side difficulty from options.txt<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 8 bytes + length of string<br />
|}<br />
<br />
Chat flags has several values packed into one byte.<br />
<br />
'''Chat Enabled:''' Bits 0-1. 00: Enabled. 01: Commands only. 10: Hidden.<br />
<br />
'''Colors Enabled:''' Bit 3. 0: Disabled. 1: Enabled.<br />
<br />
=== Client Statuses (0xCD) ===<br />
<br />
''Client to server''<br />
<br />
Sent when the client is ready to complete login and when the client is ready to respawn after death.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="1" | 0xCD<br />
| class="col1 centeralign" | Payload<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4" | Bit field. 0: Initial spawn, 1: Respawn after death<br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="5" | 2 bytes<br />
|}<br />
<br />
=== Encryption Key Response (0xFC) ===<br />
<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0xFC<br />
| class="col1 centeralign" | Shared secret length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Shared secret<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" |<br />
|- class="row3"<br />
| class="col1 centeralign" | Verify token length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token response<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 5 bytes + length of shared secret + length of token<br />
|}<br />
<br />
=== Encryption Key Request (0xFD) ===<br />
<br />
''Server to client''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0xFD<br />
| class="col1 centeralign" | Server id<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Public key length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Public key<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 7 bytes + length of string + length of key + length of token<br />
|}<br />
<br />
<br />
<br />
<br />
<br />
=== Named Sound Effect (0x3E) ===<br />
<br />
''Server to client''<br />
<br />
Used to play a sound effect on the client.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x3E<br />
| class="col1 centeralign" | Sound name<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | step.grass<br />
| class="col4 centeralign" | 250<br />
|- class="row2"<br />
| class="col1 centeralign" | Effect position X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect X multiplied by 8<br />
|- class="row3"<br />
| class="col1 centeralign" | Effect position Y<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect Y multiplied with 8<br />
|- class="row4"<br />
| class="col1 centeralign" | Effect position Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect Z multiplied with 8<br />
|- class="row5"<br />
| class="col1 centeralign" | Volume<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | 9<br />
| class="col4 centeralign" | 1 is 100%, can be more<br />
|- class="row6"<br />
| class="col1 centeralign" | Pitch<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 1<br />
| class="col4 centeralign" | 63 is 100%, can be more<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 20 bytes + length of string<br />
|}<br />
<br />
=== Block Break Animation (0x37) ===<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=5 | 0x37<br />
| class="col1 centeralign" | EID?<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | Entity breaking the block?<br />
|- class="row2"<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" rowspan=3 | Block position<br />
|- class="row2"<br />
| class="col1 centeralign" | Y<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 1<br />
| class="col4" | ?<br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 4 bytes<br />
|}<br />
<br />
== Changed Data Type ==<br />
<br />
=== Item Meta Data ===<br />
<br />
The meta data for items no longer requires a table. If an item has no meta data, the byte array is given a length of -1.<br />
<br />
This affects at least packet 0x6B (Creative inventory).<br />
<br />
== Changed packets ==<br />
<br />
=== Login Request (0x01) ===<br />
<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
'''Client to Server'''<br />
<br />
Just 1 byte C->S<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
|- class="row1"<br />
| class="col0 centeralign" | 0x01<br />
|}<br />
<br />
'''Server to Client'''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="7" | 0x01<br />
| class="col1 centeralign" | Entity ID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>1298</code><br />
| class="col4" | The Players Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Level Type<br />
| class="col1 centeralign" | string<br />
| class="col2 centeralign" | default<br />
| class="col3" | default or SUPERFLAT; level-type in server.properties<br />
|- class="row3"<br />
| class="col0 centeralign" | Server mode<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | 0 for survival, 1 for creative<br />
|- class="row4"<br />
| class="col0 centeralign" | Dimension<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|- class="row5"<br />
| class="col0 centeralign" | Difficulty<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>1</code><br />
| class="col3" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard<br />
|- class="row6"<br />
| class="col0 centeralign" | Not used<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Only 0 observed from vanilla server, was previously world height<br />
|- class="row7"<br />
| class="col0 centeralign" | Max players<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>8</code><br />
| class="col3" | Used by the client to draw the player list<br />
|- class="row8"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 12 bytes + length of strings<br />
|}<br />
<br />
=== Handshake (0x02) ===<br />
<br />
''Client to server''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0x02<br />
| class="col1 centeralign" | Protocol Version<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>38</code><br />
| class="col4" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Username<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <code>TkTech</code><br />
| class="col4" | The username of the player attempting to connect<br />
|- class="row3"<br />
| class="col1 centeralign" | Server Host<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <code>localhost</code><br />
| class="col4" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Server Port<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>25565</code><br />
| class="col4" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 10 bytes + length of strings<br />
|}<br />
<br />
=== Entity Equipment (0x05) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="3" | 0x05<br />
| class="col1 centeralign" | Entity ID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 0x00010643<br />
| class="col4" | Named Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Slot<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | 4<br />
| class="col3" | Equipment slot: 0=held, 1-4=armor slot <br />
|- class="row3"<br />
| class="col0 centeralign" | Item<br />
| class="col1 centeralign" | slot<br />
| class="col2 centeralign" | <br />
| class="col3" | Item in slot format<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes<br />
|}<br />
<br />
=== Respawn (0x09) ===<br />
<br />
''Two-Way''<br />
<br />
Sent by the client when the player presses the "Respawn" button after dying. The server then teleports the user to the spawn point, and sends a respawn packet in response. The client will not leave the respawn screen until it receives a respawn packet.<br />
<br />
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.<br />
<br />
'''Client to Server'''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
|- class="row1"<br />
| class="col0 centeralign" | 0x09<br />
|}<br />
<br />
'''Server to Client'''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0x09<br />
| class="col1 centeralign" | Dimension<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|- class="row2"<br />
| class="col1 centeralign" | Difficulty<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard. <code>1</code> is always sent c->s<br />
|- class="row3"<br />
| class="col1 centeralign" | Creative mode<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>0</code> for survival, <code>1</code> for creative.<br />
|- class="row4"<br />
| class="col1 centeralign" | World height<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <code>256</code><br />
| class="col4" | Defaults to <code>256</code><br />
|- class="row5"<br />
| class="col1 centeralign" | Level Type<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | default<br />
| class="col4" | See [[#0x01|0x01 login]]<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes + length of string<br />
|}<br />
<br />
=== Player Block Placement (0x0F) ===<br />
<br />
''Client to Server''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="8" | 0x0F<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>32</code><br />
| class="col4" | Block position<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>64</code><br />
| class="col3" | Block position<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>32</code><br />
| class="col3 leftalign" | Block position<br />
|- class="row4"<br />
| class="col0 centeralign" | Direction<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>3</code><br />
| class="col3" | The offset to use for block/item placement (see below)<br />
|- class="row5"<br />
| class="col0 centeralign" | Held item<br />
| class="col1 centeralign" | [[Slot_Data|slot]]<br />
| class="col2 centeralign" | <br />
| class="col3" | <br />
|- class="row6"<br />
| class="col0 centeralign" | Cursor position X<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | 0 - 16<br />
| class="col3" | The position of the crosshair on the block<br />
|- class="row7"<br />
| class="col0 centeralign" | Cursor position Y<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | 0 - 16<br />
| class="col3" | <br />
|- class="row8"<br />
| class="col0 centeralign" | Cursor position Z<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | 0 - 16<br />
| class="col3" | <br />
|- class="row9"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes + slot data<br />
|}<br />
<br />
=== Spawn Named Entity (0x14) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0 centeralign" | Packet ID<br />
! class="col1 rightalign" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="9" | 0x14<br />
| class="col1" | EID<br />
| class="col2" | int<br />
| class="col3" | <code>94453</code><br />
| class="col4" | Player ID<br />
|- class="row2"<br />
| class="col0" | Player Name<br />
| class="col1" | string<br />
| class="col2" | <code>Twdtwd</code><br />
| class="col3" | Max length of 16<br />
|- class="row3"<br />
| class="col0" | X<br />
| class="col1" | int<br />
| class="col2" | <code>784</code><br />
| class="col3" | Player X as Absolute Integer<br />
|- class="row4"<br />
| class="col0" | Y<br />
| class="col1" | int<br />
| class="col2" | <code>2131</code><br />
| class="col3" | Player Y as Absolute Integer<br />
|- class="row5"<br />
| class="col0" | Z<br />
| class="col1" | int<br />
| class="col2" | <code>-752</code><br />
| class="col3" | Player Z as Absolute Integer<br />
|- class="row6"<br />
| class="col0" | Yaw<br />
| class="col1" | byte<br />
| class="col2" | <code>0</code><br />
| class="col3" | Player rotation as a packed byte<br />
|- class="row7"<br />
| class="col0" | Pitch<br />
| class="col1" | byte<br />
| class="col2" | <code>0</code><br />
| class="col3" | Player rotation as a packed byte<br />
|- class="row8"<br />
| class="col0" | Current Item<br />
| class="col1" | short<br />
| class="col2" | <code>0</code><br />
| class="col3" | The item the player is currently holding. Note that this should be 0 for "no item", unlike -1 used in other packets. A negative value crashes clients.<br />
|- class="row9"<br />
| class="col0" | Metadata<br />
| class="col1" | Metadata<br />
| class="col2" | <code>127</code><br />
| class="col3" | <br />
|- class="row10"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 bytes + length of strings + metadata (at least 1)<br />
|}<br />
<br />
=== Spawn Object/Vehicle (0x17) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when an Object/Vehicle is created. The throwers entity id is now used for fishing floats too.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="9" | 0x17<br />
| class="col1 centeralign" | EID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>62</code><br />
| class="col4" | Entity ID of the Object<br />
|- class="row2"<br />
| class="col0 centeralign" | Type<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>11</code><br />
| class="col3" | The type of object (see [[Entities#Objects]])<br />
|- class="row3"<br />
| class="col0 centeralign" | X<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>16080</code><br />
| class="col3" | The Absolute Integer X Position of the object<br />
|- class="row4"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>2299</code><br />
| class="col3" | The Absolute Integer Y Position of the object<br />
|- class="row5"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>592</code><br />
| class="col3" | The Absolute Integer Z Position of the object<br />
|- class="row6"<br />
| class="col0 centeralign" | thrower's entity ID<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | If this is bigger than 0, this is a entity trown by a other entity and the next 3 fields are sent.<br />
|- class="row7"<br />
| class="col0 centeralign" | Speed X<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the X axis.<br />
|- class="row5"<br />
| class="col0 centeralign" | Speed Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Y axis.<br />
|- class="row5"<br />
| class="col0 centeralign" | Speed Z<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Z axis.<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 or 28 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x18}}<br />
<br />
=== Spawn Mob (0x18) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when a Mob Entity is Spawned<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="12" | 0x18<br />
| class="col1 centeralign" | EID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>446</code><br />
| class="col4" | Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Type<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>91</code><br />
| class="col3" | The type of mob. See [[Entities#Mobs]]<br />
|- class="row3"<br />
| class="col0 centeralign" | X<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>13366</code><br />
| class="col3" | The Absolute Integer X Position of the object<br />
|- class="row4"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>2176</code><br />
| class="col3" | The Absolute Integer Y Position of the object<br />
|- class="row5"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>1680</code><br />
| class="col3" | The Absolute Integer Z Position of the object<br />
|- class="row6"<br />
| class="col0 centeralign" | Yaw<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>-27</code><br />
| class="col3" | The yaw in steps of 2p/256<br />
|- class="row7"<br />
| class="col0 centeralign" | Pitch<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | The pitch in steps of 2p/256<br />
|- class="row8"<br />
| class="col0 centeralign" | Head Yaw<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <br />
| class="col3" | Head yaw in steps of 2p/256<br />
|- class="row9"<br />
| class="col0 centeralign" | Velocity Z<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row10"<br />
| class="col0 centeralign" | Velocity X<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row11"<br />
| class="col0 centeralign" | Velocity Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row12"<br />
| class="col0 centeralign" | Metadata<br />
| class="col1 centeralign" | Metadata<br />
| class="col2 centeralign" | <code>127</code><br />
| class="col3" | Varies by mob, see [[Entities]]<br />
|- class="row13"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 27 bytes + Metadata (at least 1)<br />
|}<br />
<br />
<br />
{{anchor|0x19}}<br />
<br />
=== Destroy Entity (0x1D) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when an list of Entities is to be destroyed on the client.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 " rowspan="2" | 0x1D<br />
| class="col1 centeralign" | Entity Count<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>3</code><br />
| class="col4 centeralign" | The amount of entities which should be destroyed<br />
|- class="row21"<br />
| class="col1 centeralign" | Entity IDs<br />
| class="col2 centeralign" | array of int<br />
| class="col3 centeralign" | <code>452, 546, 123</code><br />
| class="col4 centeralign" | The list of entity ids which should be destroyed<br />
|- class="row32"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 2 + (entity count * 4) bytes<br />
|}<br />
<br />
<br />
{{anchor|0x1E}}<br />
<br />
=== Chunk Data (0x33) ===<br />
<br />
''Server to Client''<br />
<br />
See also: [[Map Format]]<br />
<br />
Chunks are sent a column at a time, with some sections optionally missing from each packet (those consisting only of air).<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="7" | 0x33<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | Chunk X Coordinate (*16 to get true X)<br />
|- class="row2"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" |<br />
| class="col3" | Chunk Z Coordinate (*16 to get true Z)<br />
|- class="row3"<br />
| class="col0 centeralign" | Ground-up continuous<br />
| class="col1 centeralign" | boolean<br />
| class="col2 centeralign" | <br />
| class="col3" | This is True if the packet represents all sections in this vertical column, where the primary bit map specifies exactly which sections are included, and which are air.<br />
|- class="row4"<br />
| class="col0 centeralign" | Primary bit map<br />
| class="col1 centeralign" | unsigned short<br />
| class="col2 centeralign" | 15<br />
| class="col3" | Bitmask with 1 for every 16x16x16 section which data follows in the compressed data.<br />
|- class="row5"<br />
| class="col0 centeralign" | Add bit map<br />
| class="col1 centeralign" | unsigned short<br />
| class="col2 centeralign" | 0<br />
| class="col3" | Same as above, but this is used exclusively for the 'add' portion of the payload<br />
|- class="row6"<br />
| class="col0 centeralign" | Compressed size<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <br />
| class="col3" | Size of compressed chunk data.<br />
|- class="row78"<br />
| class="col0 centeralign" | Compressed data<br />
| class="col1 centeralign" | unsigned byte array<br />
| class="col2 centeralign" | <code>…</code><br />
| class="col3" | The chunk data is compressed using ZLib Deflate function.<br />
|- class="row8"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 bytes + Compressed chunk size<br />
|}<br />
<br />
<br />
=== Block Change (0x35) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0x35<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>502</code><br />
| class="col4" | Block X Coordinate<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>71</code><br />
| class="col3" | Block Y Coordinate<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>18</code><br />
| class="col3" | Block Z Coordinate<br />
|- class="row4"<br />
| class="col0 centeralign" | Block Type<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>78</code><br />
| class="col3" | The new block type for the block<br />
|- class="row5"<br />
| class="col0 centeralign" | Block Metadata<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | The new Metadata for the block<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 13 bytes<br />
|}<br />
<br />
=== Block Action (0x36) ===<br />
<br />
''Server to Client''<br />
<br />
This packet is used for a number of things:<br />
* <div class="li">Chests opening and closing<br />
* Pistons pushing and pulling<br />
* Note blocks playing<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x36<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>502</code><br />
| class="col4" | Block X Coordinate<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>71</code><br />
| class="col3" | Block Y Coordinate<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>18</code><br />
| class="col3" | Block Z Coordinate<br />
|- class="row4"<br />
| class="col0 centeralign" | Byte 1<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>3</code><br />
| class="col3" | Varies depending on block - see below<br />
|- class="row5"<br />
| class="col0 centeralign" | Byte 2<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>17</code><br />
| class="col3" | Varies depending on block - see below<br />
|- class="row6"<br />
| class="col0 centeralign" | Block ID<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>29</code><br />
| class="col3" | The block id this action is set for<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 13 bytes<br />
|}<br />
<br />
See Also: [[Block Actions]]<br />
<br />
=== Update Tile Entity (0x84) ===<br />
<br />
''Server to Client''<br />
<br />
Essentially a block update on a tile entity.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x84<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <br />
| class="col3" | <br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <br />
| class="col3" | <br />
|- class="row4"<br />
| class="col0 centeralign" | Action<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <br />
| class="col3" | The type of update to perform<br />
|- class="row5"<br />
| class="col0 centeralign" | Data length<br />
| class="col1 centeralign" | Short<br />
| class="col2 centeralign" | <br />
| class="col3" | Varies<br />
|- class="row6"<br />
| class="col0 centeralign" | NBT Data<br />
| class="col1 centeralign" | Byte Array - Present if data length > 0<br />
| class="col2 centeralign" | <br />
| class="col3" | Varies<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 12 + itemstack bytes<br />
|}<br />
<br />
'''Actions'''<br />
<br />
* '''1''': Set mob displayed inside a mob spawner. Custom 1 contains the [[Entities#Mobs|mob type]]<br />
<br />
=== Explosion (0x3C) ===<br />
<br />
''Server to Client''<br />
<br />
Sent when an explosion occurs (creepers, TNT, and ghast fireballs).<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=9 | 0x3C<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | double<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row1"<br />
| class="col1 centeralign" | Y<br />
| class="col2 centeralign" | double<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row1"<br />
| class="col1 centeralign" | Z<br />
| class="col2 centeralign" | double<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row1"<br />
| class="col1 centeralign" | Radius<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | 3.0<br />
| class="col4" | Currently unused in the client<br />
|- class="row2"<br />
| class="col1 centeralign" | Record count<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | This is the count, not the size. The size is 3 times this value.<br />
|- class="row3"<br />
| class="col1 centeralign" | Records<br />
| class="col2 centeralign" | (byte, byte, byte) × count<br />
| class="col3 centeralign" | <br />
| class="col4" | Each record is 3 bytes, which seem to be XYZ offsets of affected blocks.<br />
|- class="row4"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row5"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row6"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 45 bytes + 3*(Record count) bytes<br />
|}<br />
<br />
=== Player Abilities (0xCA) ===<br />
This packet has now been compressed into 3 bytes. The latter 2 bytes are used to indicate the walking and flying sppeds respectively, while the first byte is used to determine the value of 4 booleans.<br />
<br />
These booleans are whether damage is disabled (god mode), whether the player is flying, whether the player can fly, and whether the player is in creative mode.<br />
<br />
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.<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=4 | 0xCA<br />
| class="col1 centeralign" | Flags<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 5<br />
| class="col4" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Flying speed<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 12<br />
| class="col4" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Walking speed<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 25<br />
| class="col4" | <br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 4 bytes<br />
|}<br />
<br />
== Removed packets ==<br />
<br />
=== Chunk Allocation Packet (0x32) ===<br />
The chunk Allocation Packet is not longer in use. Memory will automatically allocated with a incoming Map Chunk packet. To deallocate memory you need to send a MapChunk packet, which only contains biome data for plains(all biome bytes set to 1). So the Add and Primary bitmap must set to 0, and Ground-up continuous to true. Because the payload of this packet is compressed and static you can use a hardcoded value for it, so you don't need to compress it each time.<br />
<br />
This is the payload which is used in the Compressed Data part to deallocate a chunk column:<br />
<br />
0x78, 0x9C, 0x63, 0x64, 0x1C, 0xD9, 0x00, 0x00, 0x81, 0x80, 0x01, 0x01<br />
<br />
== Protocol History ==<br />
<br />
=== 2012-07-24 ===<br />
* 12w30c<br />
* Protocol version 39<br />
* Changed packets 0x84<br />
<br />
=== 2012-07-23 ===<br />
* 12w30a<br />
* Protocol version is still 38<br />
* Changed packets 0x14 and 0x35<br />
<br />
=== 2012-07-05 ===<br />
* 12w27a<br />
* Protocol version is now 38<br />
* Added packet 0x38<br />
<br />
=== 2012-06-21 ===<br />
* 12w25a<br />
* Packet 0xFC and 0xFD include a 4 byte long byte array. This is hashed with the public RSA key and sent back. See [[Protocol Encryption]] for further info.<br />
* Packet 0x3E changed to include float rather than byte.<br />
<br />
=== 2012-06-14 ===<br />
* 12w24a<br />
* Protocol version is now 36<br />
* Changed Packet 0x01(Login Request), only used as Login Reply<br />
* New Packet 0xCD used for Login Request and Respawn (1 byte payload)<br />
* All items (except the empty hand) now send enchantment data<br />
<br />
=== 2012-06-07 ===<br />
* 12w23b<br />
* Protocol version is now 35<br />
* Change packet: Player Block Placement<br />
* New Packet: Block breaking animation<br />
<br />
=== 2012-05-24 ===<br />
* 12w21a<br />
* No packet changes but the algorithm was changed to AES128 with the shared key as the IV, will be described in [[Protocol Encryption]]<br />
<br />
=== 2012-05-10 ===<br />
* 12w19a<br />
* No packet changes, but an other encryption algorythm is used, described in [[Protocol Encryption]]<br />
* The items which are not enchantable in 12w18a are now readded<br />
* Fishing floats, spawned by a 0x17 packet do now use the extra fields<br />
<br />
=== 2012-05-03 ===<br />
* 12w18a<br />
* Protocol version is now 32<br />
* New packet: 0x3D Name Sound Effect<br />
* Changed packet: 0x01 Login Request<br />
* Changed packet: 0x02 Handshake<br />
* Changed packet: 0xCA Player Abilities<br />
* Changed packet: 0xCC Locale and View Distance<br />
* Changed packet: 0x09 Respawn<br />
* Removed packet: 0x32 Map Column Allocation<br />
* This items are not enchantable in this version: 0x103, 0x105, 0x15A, 0x167, 0x10C, 0x10D, 0x10E, 0x10F, 0x122, 0x110, 0x111, 0x112, 0x113, 0x123, 0x10B, 0x100, 0x101, 0x102, 0x124, 0x114, 0x115, 0x116, 0x117, 0x125, 0x11B, 0x11C, 0x11D, 0x11E, 0x126<br />
<br />
=== 2012-04-26 ===<br />
* 12w17a<br />
* Protocol version is now 31<br />
* RC4 based encryption, described in [[Protocol Encryption]]<br />
* Changed packet: 0x01 Login Request<br />
* Changed packet: 0x02 Handshake<br />
* Changed packet: 0xCC Locale and View Distance<br />
* Changed packet: 0xCA Player Abilities <br />
* New packet: 0xFC Encryption Key Response<br />
* New packet: 0xFD Encryption Key Request<br />
* New Item: Book & Quills (0x182) is enchantable<br />
* New Item: Written Book (0x183) is enchantable<br />
<br />
=== 2012-04-19 ===<br />
* 12w16a<br />
* Protocol version is now 30<br />
* New packet: 0xCB Tab-complete<br />
* New packet: 0xCC Locale and View Distance</div>Sadimusihttps://wiki.vg/index.php?title=Pre-release_protocol&diff=2853Pre-release protocol2012-07-18T05:24:28Z<p>Sadimusi: /* Player Abilities (0xCA) */ Swapped flying and walking speed</p>
<hr />
<div>This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently 1.2.5) to the current pre-release (or weekly release).<br />
<br />
== New packets ==<br />
<br />
=== Map Chunk Bulk (0x38) ===<br />
<br />
To reduce the number of bytes this packet is used to send chunk columns together for better compression results. The packet contains up to 100 chunk columns (later this might be reduced to 50).<br />
<br />
The data part is a zlib compressed byte array containing the chunk data. The meta data part specifies which chunks in which order the data part exists of. <br />
<br />
To split this packet into chunks you need to uncompress the data array. Then you can iterate through the data part. Each part is 10240 * n + 256 bytes. n is the number of chunks in the current chunk column(this is the number of flags set in the primary bitmap). 10240 is the amount of bytes for each chunk without add bitmap, 256 bytes are used for biomes. The second short in the meta data part is not yet in use. It could specify if the chunk uses the add bitmap part, because it has very high block ids, but not in the current snapshot. <br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=5 | 0x38<br />
| class="col1 centeralign" | Chunk Column Count<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4" | The number of chunk columns in this packet<br />
|- class="row2"<br />
| class="col1 centeralign" | Chunk data size<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | the size of the data field<br />
|- class="row3"<br />
| class="col1 centeralign" | Data<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4" | compressed chunk data<br />
|- class="row4"<br />
| class="col1 centeralign" | meta information<br />
| class="col2 centeralign" | chunk bulk meta information<br />
| class="col3 centeralign" |<br />
| class="col4 centeralign" | Chunk column count times the Meta information structure (See notes for details)<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 7 + (Chunk data size) + 12 * (Chunk Column Count) bytes<br />
|}<br />
<br />
<br />
====Chunk Bulk Meta Information Structure====<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col1 centeralign" | Chunk Column X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 10<br />
| class="col4" | The X coordinate of the specific chunk column<br />
|- class="row2"<br />
| class="col1 centeralign" | Chunk Column Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 10<br />
| class="col4" | The Z coordinate of the specific chunk column<br />
|- class="row3"<br />
| class="col1 centeralign" | Chunk Primary bitmap<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | 15<br />
| class="col4" | A bitmap which specifies which chunk is not empty in this chunk column<br />
|- class="row4"<br />
| class="col1 centeralign" | Chunk Add bitmap?<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | 0<br />
| class="col4" | A bitmap which specifies which chunk need add information because of very high block ids. not yet used. needs verification<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="3" | 12 bytes<br />
|}<br />
<br />
<br />
=== Tab-complete (0xCB) ===<br />
<br />
''Two-way''<br />
<br />
Sent C->S when the user presses [tab] while writing text. The payload contains all text behind the cursor.<br />
<br />
The server responds with an auto-completion of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported.<br />
<br />
In the event of more than one possible completion, the server responds with the options packed into the single string field, separated by a null character. Note that as strings are UTF-16, this is two bytes wide.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" | 0xCB<br />
| class="col1 centeralign" | Text<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row3"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 3 bytes + length of string<br />
|}<br />
<br />
=== Locale and View Distance (0xCC) ===<br />
<br />
''Client to server''<br />
<br />
Sent when the player connects, or when settings are changed.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0xCC<br />
| class="col1 centeralign" | Locale<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | en_GB<br />
|- class="row2"<br />
| class="col1 centeralign" | View distance<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4" | 0-3 for 'far', 'normal', 'short', 'tiny'.<br />
|- class="row3"<br />
| class="col1 centeralign" | Chat flags<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 8<br />
| class="col4" | Chat settings. See notes below.<br />
|- class="row4"<br />
| class="col1 centeralign" | Difficulty<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4 centeralign" | Client-side difficulty from options.txt<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 8 bytes + length of string<br />
|}<br />
<br />
Chat flags has several values packed into one byte.<br />
<br />
'''Chat Enabled:''' Bits 0-1. 00: Enabled. 01: Commands only. 10: Hidden.<br />
<br />
'''Colors Enabled:''' Bit 3. 0: Disabled. 1: Enabled.<br />
<br />
=== Client Statuses (0xCD) ===<br />
<br />
''Client to server''<br />
<br />
Sent when the client is ready to complete login and when the client is ready to respawn after death.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="1" | 0xCD<br />
| class="col1 centeralign" | Payload<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4" | Bit field. 0: Initial spawn, 1: Respawn after death<br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="5" | 2 bytes<br />
|}<br />
<br />
=== Encryption Key Response (0xFC) ===<br />
<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0xFC<br />
| class="col1 centeralign" | Shared secret length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Shared secret<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" |<br />
|- class="row3"<br />
| class="col1 centeralign" | Verify token length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token response<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 5 bytes + length of shared secret + length of token<br />
|}<br />
<br />
=== Encryption Key Request (0xFD) ===<br />
<br />
''Server to client''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0xFD<br />
| class="col1 centeralign" | Server id<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Public key length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Public key<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Verify token<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 7 bytes + length of string + length of key + length of token<br />
|}<br />
<br />
=== Named Sound Effect (0x3E) ===<br />
<br />
''Server to client''<br />
<br />
Used to play a sound effect on the client.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x3E<br />
| class="col1 centeralign" | Sound name<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | step.grass<br />
| class="col4 centeralign" | 250<br />
|- class="row2"<br />
| class="col1 centeralign" | Effect position X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect X multiplied by 8<br />
|- class="row3"<br />
| class="col1 centeralign" | Effect position Y<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect Y multiplied with 8<br />
|- class="row4"<br />
| class="col1 centeralign" | Effect position Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect Z multiplied with 8<br />
|- class="row5"<br />
| class="col1 centeralign" | Volume<br />
| class="col2 centeralign" | float<br />
| class="col3 centeralign" | 9<br />
| class="col4 centeralign" | 1 is 100%, can be more<br />
|- class="row6"<br />
| class="col1 centeralign" | Pitch<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 1<br />
| class="col4 centeralign" | 63 is 100%, can be more<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 20 bytes + length of string<br />
|}<br />
<br />
=== Block Break Animation (0x37) ===<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=5 | 0x37<br />
| class="col1 centeralign" | EID?<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | Entity breaking the block?<br />
|- class="row2"<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" rowspan=3 | Block position<br />
|- class="row2"<br />
| class="col1 centeralign" | Y<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 1<br />
| class="col4" | ?<br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 4 bytes<br />
|}<br />
<br />
== Changed packets ==<br />
<br />
=== Login Request (0x01) ===<br />
<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
'''Client to Server'''<br />
<br />
Just 1 byte C->S<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
|- class="row1"<br />
| class="col0 centeralign" | 0x01<br />
|}<br />
<br />
'''Server to Client'''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="7" | 0x01<br />
| class="col1 centeralign" | Entity ID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>1298</code><br />
| class="col4" | The Players Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Level Type<br />
| class="col1 centeralign" | string<br />
| class="col2 centeralign" | default<br />
| class="col3" | default or SUPERFLAT; level-type in server.properties<br />
|- class="row3"<br />
| class="col0 centeralign" | Server mode<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | 0 for survival, 1 for creative<br />
|- class="row4"<br />
| class="col0 centeralign" | Dimension<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|- class="row5"<br />
| class="col0 centeralign" | Difficulty<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>1</code><br />
| class="col3" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard<br />
|- class="row6"<br />
| class="col0 centeralign" | Not used<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Only 0 observed from vanilla server, was previously world height<br />
|- class="row7"<br />
| class="col0 centeralign" | Max players<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>8</code><br />
| class="col3" | Used by the client to draw the player list<br />
|- class="row8"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 12 bytes + length of strings<br />
|}<br />
<br />
=== Handshake (0x02) ===<br />
<br />
''Client to server''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0x02<br />
| class="col1 centeralign" | Protocol Version<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>38</code><br />
| class="col4" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Username<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <code>TkTech</code><br />
| class="col4" | The username of the player attempting to connect<br />
|- class="row3"<br />
| class="col1 centeralign" | Server Host<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <code>localhost</code><br />
| class="col4" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Server Port<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>25565</code><br />
| class="col4" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 10 bytes + length of strings<br />
|}<br />
<br />
=== Entity Equipment (0x05) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="3" | 0x05<br />
| class="col1 centeralign" | Entity ID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 0x00010643<br />
| class="col4" | Named Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Slot<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | 4<br />
| class="col3" | Equipment slot: 0=held, 1-4=armor slot <br />
|- class="row3"<br />
| class="col0 centeralign" | Item<br />
| class="col1 centeralign" | slot<br />
| class="col2 centeralign" | <br />
| class="col3" | Item in slot format<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes<br />
|}<br />
<br />
=== Respawn (0x09) ===<br />
<br />
''Two-Way''<br />
<br />
Sent by the client when the player presses the "Respawn" button after dying. The server then teleports the user to the spawn point, and sends a respawn packet in response. The client will not leave the respawn screen until it receives a respawn packet.<br />
<br />
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.<br />
<br />
'''Client to Server'''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
|- class="row1"<br />
| class="col0 centeralign" | 0x09<br />
|}<br />
<br />
'''Server to Client'''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0x09<br />
| class="col1 centeralign" | Dimension<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|- class="row2"<br />
| class="col1 centeralign" | Difficulty<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard. <code>1</code> is always sent c->s<br />
|- class="row3"<br />
| class="col1 centeralign" | Creative mode<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>0</code> for survival, <code>1</code> for creative.<br />
|- class="row4"<br />
| class="col1 centeralign" | World height<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <code>256</code><br />
| class="col4" | Defaults to <code>256</code><br />
|- class="row5"<br />
| class="col1 centeralign" | Level Type<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | default<br />
| class="col4" | See [[#0x01|0x01 login]]<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes + length of string<br />
|}<br />
<br />
=== Spawn Object/Vehicle (0x17) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when an Object/Vehicle is created. The throwers entity id is now used for fishing floats too.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="9" | 0x17<br />
| class="col1 centeralign" | EID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>62</code><br />
| class="col4" | Entity ID of the Object<br />
|- class="row2"<br />
| class="col0 centeralign" | Type<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>11</code><br />
| class="col3" | The type of object (see [[Entities#Objects]])<br />
|- class="row3"<br />
| class="col0 centeralign" | X<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>16080</code><br />
| class="col3" | The Absolute Integer X Position of the object<br />
|- class="row4"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>2299</code><br />
| class="col3" | The Absolute Integer Y Position of the object<br />
|- class="row5"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>592</code><br />
| class="col3" | The Absolute Integer Z Position of the object<br />
|- class="row6"<br />
| class="col0 centeralign" | thrower's entity ID<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | If this is bigger than 0, this is a entity trown by a other entity and the next 3 fields are sent.<br />
|- class="row7"<br />
| class="col0 centeralign" | Speed X<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the X axis.<br />
|- class="row5"<br />
| class="col0 centeralign" | Speed Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Y axis.<br />
|- class="row5"<br />
| class="col0 centeralign" | Speed Z<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Z axis.<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 or 28 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x18}}<br />
<br />
=== Spawn Mob (0x18) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when a Mob Entity is Spawned<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="12" | 0x18<br />
| class="col1 centeralign" | EID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>446</code><br />
| class="col4" | Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Type<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>91</code><br />
| class="col3" | The type of mob. See [[Entities#Mobs]]<br />
|- class="row3"<br />
| class="col0 centeralign" | X<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>13366</code><br />
| class="col3" | The Absolute Integer X Position of the object<br />
|- class="row4"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>2176</code><br />
| class="col3" | The Absolute Integer Y Position of the object<br />
|- class="row5"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>1680</code><br />
| class="col3" | The Absolute Integer Z Position of the object<br />
|- class="row6"<br />
| class="col0 centeralign" | Yaw<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>-27</code><br />
| class="col3" | The yaw in steps of 2p/256<br />
|- class="row7"<br />
| class="col0 centeralign" | Pitch<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | The pitch in steps of 2p/256<br />
|- class="row8"<br />
| class="col0 centeralign" | Head Yaw<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <br />
| class="col3" | Head yaw in steps of 2p/256<br />
|- class="row9"<br />
| class="col0 centeralign" | Velocity Z<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row10"<br />
| class="col0 centeralign" | Velocity X<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row11"<br />
| class="col0 centeralign" | Velocity Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <br />
|- class="row12"<br />
| class="col0 centeralign" | Metadata<br />
| class="col1 centeralign" | Metadata<br />
| class="col2 centeralign" | <code>127</code><br />
| class="col3" | Varies by mob, see [[Entities]]<br />
|- class="row13"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 27 bytes + Metadata (at least 1)<br />
|}<br />
<br />
<br />
{{anchor|0x19}}<br />
<br />
=== Destroy Entity (0x1D) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when an list of Entities is to be destroyed on the client.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 " rowspan="2" | 0x1D<br />
| class="col1 centeralign" | Entity Count<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>3</code><br />
| class="col4 centeralign" | The amount of entities which should be destroyed<br />
|- class="row21"<br />
| class="col1 centeralign" | Entity IDs<br />
| class="col2 centeralign" | array of int<br />
| class="col3 centeralign" | <code>452, 546, 123</code><br />
| class="col4 centeralign" | The list of entity ids which should be destroyed<br />
|- class="row32"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 2 + (entity count * 4) bytes<br />
|}<br />
<br />
<br />
{{anchor|0x1E}}<br />
<br />
=== Chunk Data (0x33) ===<br />
<br />
''Server to Client''<br />
<br />
See also: [[Map Format]]<br />
<br />
Chunks are sent a column at a time, with some sections optionally missing from each packet (those consisting only of air).<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="7" | 0x33<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | Chunk X Coordinate (*16 to get true X)<br />
|- class="row2"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" |<br />
| class="col3" | Chunk Z Coordinate (*16 to get true Z)<br />
|- class="row3"<br />
| class="col0 centeralign" | Ground-up continuous<br />
| class="col1 centeralign" | boolean<br />
| class="col2 centeralign" | <br />
| class="col3" | This is True if the packet represents all sections in this vertical column, where the primary bit map specifies exactly which sections are included, and which are air.<br />
|- class="row4"<br />
| class="col0 centeralign" | Primary bit map<br />
| class="col1 centeralign" | unsigned short<br />
| class="col2 centeralign" | 15<br />
| class="col3" | Bitmask with 1 for every 16x16x16 section which data follows in the compressed data.<br />
|- class="row5"<br />
| class="col0 centeralign" | Add bit map<br />
| class="col1 centeralign" | unsigned short<br />
| class="col2 centeralign" | 0<br />
| class="col3" | Same as above, but this is used exclusively for the 'add' portion of the payload<br />
|- class="row6"<br />
| class="col0 centeralign" | Compressed size<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <br />
| class="col3" | Size of compressed chunk data.<br />
|- class="row78"<br />
| class="col0 centeralign" | Compressed data<br />
| class="col1 centeralign" | unsigned byte array<br />
| class="col2 centeralign" | <code>…</code><br />
| class="col3" | The chunk data is compressed using ZLib Deflate function.<br />
|- class="row8"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 bytes + Compressed chunk size<br />
|}<br />
<br />
=== Block Action (0x36) ===<br />
<br />
''Server to Client''<br />
<br />
This packet is used for a number of things:<br />
* <div class="li">Chests opening and closing<br />
* Pistons pushing and pulling<br />
* Note blocks playing<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x36<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>502</code><br />
| class="col4" | Block X Coordinate<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>71</code><br />
| class="col3" | Block Y Coordinate<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>18</code><br />
| class="col3" | Block Z Coordinate<br />
|- class="row4"<br />
| class="col0 centeralign" | Byte 1<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>3</code><br />
| class="col3" | Varies depending on block - see below<br />
|- class="row5"<br />
| class="col0 centeralign" | Byte 2<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>17</code><br />
| class="col3" | Varies depending on block - see below<br />
|- class="row6"<br />
| class="col0 centeralign" | Block ID<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>29</code><br />
| class="col3" | The block id this action is set for<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 13 bytes<br />
|}<br />
<br />
See Also: [[Block Actions]]<br />
<br />
<br />
=== Player Abilities (0xCA) ===<br />
This packet has now been compressed into 3 bytes. The latter 2 bytes are used to indicate the walking and flying sppeds respectively, while the first byte is used to determine the value of 4 booleans.<br />
<br />
These booleans are whether damage is disabled (god mode), whether the player is flying, whether the player can fly, and whether the player is in creative mode.<br />
<br />
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.<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=4 | 0xCA<br />
| class="col1 centeralign" | Flags<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 5<br />
| class="col4" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Flying speed<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 12<br />
| class="col4" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Walking speed<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 25<br />
| class="col4" | <br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 4 bytes<br />
|}<br />
<br />
=== Player Block Placement (0x0F) ===<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="8" | 0x0F<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>32</code><br />
| class="col4" | Block position<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>64</code><br />
| class="col3" | Block position<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>32</code><br />
| class="col3 leftalign" | Block position<br />
|- class="row4"<br />
| class="col0 centeralign" | Direction<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>3</code><br />
| class="col3" | The offset to use for block/item placement (see below)<br />
|- class="row5"<br />
| class="col0 centeralign" | Held item<br />
| class="col1 centeralign" | [[Slot_Data|slot]]<br />
| class="col2 centeralign" | <br />
| class="col3" |<br />
|- class="row6"<br />
| class="col0 centeralign" | Unknown<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0 - 0x0B</code> (or more)<br />
| class="col3" | ?<br />
|- class="row6"<br />
| class="col0 centeralign" | Unknown<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0 - 0x10</code><br />
| class="col3" | ?<br />
|- class="row6"<br />
| class="col0 centeralign" | Unknown<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0 - 0x10</code><br />
| class="col3" | ?<br />
|- class="row9"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes + slot data<br />
|}<br />
<br />
== Removed packets ==<br />
<br />
=== Chunk Allocation Packet (0x32) ===<br />
The chunk Allocation Packet is not longer in use. Memory will automatically allocated with a incoming Map Chunk packet. To deallocate memory you need to send a MapChunk packet, which only contains biome data for plains(all biome bytes set to 1). So the Add and Primary bitmap must set to 0, and Ground-up continuous to true. Because the payload of this packet is compressed and static you can use a hardcoded value for it, so you don't need to compress it each time.<br />
<br />
This is the payload which is used in the Compressed Data part to deallocate a chunk column:<br />
<br />
0x78, 0x9C, 0x63, 0x64, 0x1C, 0xD9, 0x00, 0x00, 0x81, 0x80, 0x01, 0x01<br />
<br />
== Protocol History ==<br />
<br />
=== 2012-07-05 ===<br />
* 12w27a<br />
* Protocol version is now 38<br />
* Added packet 0x38<br />
<br />
=== 2012-06-21 ===<br />
* 12w25a<br />
* Packet 0xFC and 0xFD include a 4 byte long byte array. This is hashed with the public RSA key and sent back. See [[Protocol Encryption]] for further info.<br />
* Packet 0x3E changed to include float rather than byte.<br />
<br />
=== 2012-06-14 ===<br />
* 12w24a<br />
* Protocol version is now 36<br />
* Changed Packet 0x01(Login Request), only used as Login Reply<br />
* New Packet 0xCD used for Login Request and Respawn (1 byte payload)<br />
* All items (except the empty hand) now send enchantment data<br />
<br />
=== 2012-06-07 ===<br />
* 12w23b<br />
* Protocol version is now 35<br />
* Change packet: Player Block Placement<br />
* New Packet: Block breaking animation<br />
<br />
=== 2012-05-24 ===<br />
* 12w21a<br />
* No packet changes but the algorithm was changed to AES128 with the shared key as the IV, will be described in [[Protocol Encryption]]<br />
<br />
=== 2012-05-10 ===<br />
* 12w19a<br />
* No packet changes, but an other encryption algorythm is used, described in [[Protocol Encryption]]<br />
* The items which are not enchantable in 12w18a are now readded<br />
* Fishing floats, spawned by a 0x17 packet do now use the extra fields<br />
<br />
=== 2012-05-03 ===<br />
* 12w18a<br />
* Protocol version is now 32<br />
* New packet: 0x3D Name Sound Effect<br />
* Changed packet: 0x01 Login Request<br />
* Changed packet: 0x02 Handshake<br />
* Changed packet: 0xCA Player Abilities<br />
* Changed packet: 0xCC Locale and View Distance<br />
* Changed packet: 0x09 Respawn<br />
* Removed packet: 0x32 Map Column Allocation<br />
* This items are not enchantable in this version: 0x103, 0x105, 0x15A, 0x167, 0x10C, 0x10D, 0x10E, 0x10F, 0x122, 0x110, 0x111, 0x112, 0x113, 0x123, 0x10B, 0x100, 0x101, 0x102, 0x124, 0x114, 0x115, 0x116, 0x117, 0x125, 0x11B, 0x11C, 0x11D, 0x11E, 0x126<br />
<br />
=== 2012-04-26 ===<br />
* 12w17a<br />
* Protocol version is now 31<br />
* RC4 based encryption, described in [[Protocol Encryption]]<br />
* Changed packet: 0x01 Login Request<br />
* Changed packet: 0x02 Handshake<br />
* Changed packet: 0xCC Locale and View Distance<br />
* Changed packet: 0xCA Player Abilities <br />
* New packet: 0xFC Encryption Key Response<br />
* New packet: 0xFD Encryption Key Request<br />
* New Item: Book & Quills (0x182) is enchantable<br />
* New Item: Written Book (0x183) is enchantable<br />
<br />
=== 2012-04-19 ===<br />
* 12w16a<br />
* Protocol version is now 30<br />
* New packet: 0xCB Tab-complete<br />
* New packet: 0xCC Locale and View Distance</div>Sadimusihttps://wiki.vg/index.php?title=Protocol_Encryption&diff=3407Protocol Encryption2012-07-13T02:53:42Z<p>Sadimusi: Undo revision 2491 by Shoghicp (talk) - This is a horrible example</p>
<hr />
<div>As of 12w17a, minecraft implements SSL-like encryption.<br />
<br />
== Overview ==<br />
<br />
#Client connects to server<br />
#'''C->S''' 0x02 handshake<br />
#'''S->C''' 0xFD encryption request - server sends its public key and 4 random bytes<br />
#Client generates symmetric key (shared secret)<br />
#Client authenticates via session.minecraft.net<br />
#Client encrypts these 4 bytes with the servers public key.<br />
#'''C->S''' 0xFC encryption response - client encrypts shared secret with server's public key and sends along with encrypted 4 bytes<br />
#Server checks that the encrypted bytes match<br />
#Server decrypts shared secret with its private key<br />
#Server checks player authenticity via session.minecraft.net<br />
#'''S->C''' 0xFC encryption response - empty payload<br />
#Server enables AES stream encryption<br />
#Client enables AES stream encryption<br />
#'''C->S''' 0xCD - Payload of 0 (byte)<br />
#'''S->C''' 0x01 login<br />
#see [[Protocol FAQ]] to get information about what happens next.<br />
<br />
For a Code example you can have a look at this example of a Chat Bot using a C# Protocol Library: <br />
https://minecraftprotocol.codeplex.com/SourceControl/changeset/view/68979#1204175<br />
<br />
== Key Exchange ==<br />
<br />
The server generates a 1024-bit RSA keypair on startup. The key, when packed into a 0xFD packet, is in ASN.1 format as defined by x.509.<br />
The ASN.1 structure looks as follows<br />
<br />
SubjectPublicKeyInfo ::= SEQUENCE {<br />
algorithm SEQUENCE {<br />
algorithm OBJECT IDENTIFIER<br />
parameters ANY OPTIONAL<br />
}<br />
subjectPublicKey BITSTRING<br />
}<br />
<br />
SubjectPublicKey ::= SEQUENCE {<br />
modulus INTEGER<br />
publicExponent INTEGER<br />
}<br />
<br />
If you're struggling to import this using a crypto library, you can convert it to common PEM by base64-encoding and wrapping in '-----BEGIN PUBLIC KEY-----' and '-----END PUBLIC KEY-----'.<br />
<br />
== Symmetric Encryption ==<br />
<br />
12w18a:<br />
<br />
On receipt of a 0xFD from the server, the client will generate a 16-byte shared secret, to be used with the RC4 stream cipher. It then encrypts it with the server's public key (PKCS#1 padded), and sends it to the server with a 0xFC.<br />
<br />
The server decrypts the shared secret using its private key. It then sends a 0xFC to the client with an empty payload, and enables RC4 encryption. Similarly, the client will also enable encryption upon receipt of the empty 0xFC. From this point forward, everything is encrypted.<br />
<br />
12w19a:<br />
<br />
On receipt of a 0xFD from the server, the client will generate a 32-byte shared secret, to be used with the HC-256 stream cipher. It then encrypts it with the server's public key (PKCS#1 padded), and sends it to the server with a 0xFC.<br />
<br />
The server decrypts the shared secret using its private key. It then sends a 0xFC to the client with an empty payload, and enables HC-256 encryption. For the Initial Vector (IV) Both sides use the first 16 byte of the key. Similarly, the client will also enable encryption upon receipt of the empty 0xFC. From this point forward, everything is encrypted.<br />
<br />
<br />
12w21a:<br />
<br />
On receipt of a 0xFD from the server, the client will generate a 16-byte shared secret, to be used with the AES/CFB8 stream cipher. It then encrypts it with the server's public key (PKCS#1 padded), and sends it to the server with a 0xFC.<br />
<br />
The server decrypts the shared secret using its private key. It then sends a 0xFC to the client with an empty payload, and enables AES/CFB8 encryption. For the Initial Vector (IV) and AES setup, both sides use the secret key. Similarly, the client will also enable encryption upon receipt of the empty 0xFC. From this point forward, everything is encrypted.<br />
<br />
12w25a:<br />
<br />
On receipt of a 0xFD from the server, the client will generate a 16-byte shared secret, to be used with the AES/CFB8 stream cipher. It then encrypts it with the server's public key (PKCS#1 padded), and sends it to the server along the token recieved in 0xFD encrypted with server's public key with a 0xFC.<br />
<br />
The server decrypts the shared secret and token using its private key, and checks if the token is the same. It then sends a 0xFC to the client with an empty payload, and enables AES/CFB8 encryption. For the Initial Vector (IV) and AES setup, both sides use the secret key. Similarly, the client will also enable encryption upon receipt of the empty 0xFC. From this point forward, everything is encrypted.<br />
<br />
== Authentication ==<br />
<br />
Both server and client need to make a request to session.minecraft.net if the server is in online-mode.<br />
<br />
=== Client ===<br />
<br />
After generating the shared secret, the client generates the following hash:<br />
<br />
sha1 := Sha1()<br />
sha1.update(ASCII encoding of the serverId string from 0xFC) <br />
sha1.update(shared secret) <br />
sha1.update(server's encoded public key from 0xFC) <br />
hash := sha1.hexdigest() # String of hex characters<br />
<br />
[[File:Icon_exclaim.gif|:!:]] Note that the Sha1.hexdigest() method used by minecraft removes leading zeros and uses the two's-complement of negative numbers prefixed with a minus sign:<br />
<br />
sha1(Notch) : 4ed1f46bbe04bc756bcb17c0c7ce3e4632f06a48<br />
sha1(jeb_) : -7c9d5b0044c130109a5d7b5fb5c317c02b4e28c1<br />
sha1(simon) : 88e16a1019277b15d58faf0541e11910eb756f6<br />
<br />
The resulting hash is then sent via an HTTP GET request to<br />
<nowiki>http://session.minecraft.net/game/joinserver.jsp?user=</nowiki>''username''&sessionId=''[[Session#Login|user_session]]''&serverId=''hash''<br />
If it returns '''OK''' then continue, otherwise stop<br />
<br />
=== Server ===<br />
<br />
After decrypting the shared secret in 0xFD, the sever generates the login hash as above and sends it to<br />
<nowiki>http://session.minecraft.net/game/checkserver.jsp?user=</nowiki>''username''&serverId=''hash''<br />
<br />
If the response is '''YES''' then the client is authenticated and allowed to join. Otherwise the client will/should be [[Protocol#Disconnect.2FKick_.280xFF.29|kicked]] (unencrypted) with "Failed to verify username!"</div>Sadimusihttps://wiki.vg/index.php?title=Pre-release_protocol&diff=2824Pre-release protocol2012-06-16T01:40:15Z<p>Sadimusi: /* 2012-06-14 */</p>
<hr />
<div>This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently 1.2.5) to the current pre-release (or weekly release).<br />
<br />
== New packets ==<br />
<br />
=== Tab-complete (0xCB) ===<br />
<br />
''Two-way''<br />
<br />
Sent C->S when the user presses [tab] while writing text. The payload contains all text behind the cursor.<br />
<br />
The server responds with an auto-completion of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported.<br />
<br />
In the event of more than one possible completion, the server responds with the options packed into the single string field, separated by a null character. Note that as strings are UTF-16, this is two bytes wide.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" | 0xCB<br />
| class="col1 centeralign" | Text<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row3"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 3 bytes + length of string<br />
|}<br />
<br />
=== Locale and View Distance (0xCC) ===<br />
<br />
''Client to server''<br />
<br />
Sent when the player connects, or when settings are changed.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0xCC<br />
| class="col1 centeralign" | Locale<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | en_GB<br />
|- class="row2"<br />
| class="col1 centeralign" | View distance<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4" | 0-3 for 'far', 'normal', 'short', 'tiny'.<br />
|- class="row3"<br />
| class="col1 centeralign" | Chat flags<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 8<br />
| class="col4" | Bit field. 0: chat enabled, 2: colors enabled<br />
|- class="row4"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4 centeralign" | First three bits(bitmask 0x7) are used as a number, bit four(bitmask 0x8) is used as bool<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 8 bytes + length of string<br />
|}<br />
<br />
=== Encryption Key Response (0xFC) ===<br />
<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="2" | 0xFC<br />
| class="col1 centeralign" | Shared secret length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Shared secret<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row3"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 3 bytes + length of shared secret<br />
|}<br />
<br />
=== Encryption Key Request (0xFD) ===<br />
<br />
''Server to client''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="3" | 0xFD<br />
| class="col1 centeralign" | Server id<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Public key length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Public key<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 5 bytes + length of string + length of key<br />
|}<br />
<br />
=== Named Sound Effect (0x3E) ===<br />
<br />
''Server to client''<br />
<br />
Used to play a sound effect on the client.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x3E<br />
| class="col1 centeralign" | Sound name<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | step.grass<br />
| class="col4 centeralign" | 250<br />
|- class="row2"<br />
| class="col1 centeralign" | Effect position X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect X multiplied by 8<br />
|- class="row3"<br />
| class="col1 centeralign" | Effect position Y<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect Y multiplied with 8<br />
|- class="row4"<br />
| class="col1 centeralign" | Effect position Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect Z multiplied with 8<br />
|- class="row5"<br />
| class="col1 centeralign" | Volume<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 9<br />
| class="col4 centeralign" | 63 is 100%, can be more<br />
|- class="row6"<br />
| class="col1 centeralign" | Pitch<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 63<br />
| class="col4 centeralign" | 63 is 100%, can be more<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 17 bytes + length of string<br />
|}<br />
<br />
=== Block Break Animation (0x37) ===<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=5 | 0x37<br />
| class="col1 centeralign" | EID?<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | Entity breaking the block?<br />
|- class="row2"<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" rowspan=3 | Block position<br />
|- class="row2"<br />
| class="col1 centeralign" | Y<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 1<br />
| class="col4" | ?<br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 4 bytes<br />
|}<br />
<br />
== Changed packets ==<br />
<br />
=== Login Request (0x01) ===<br />
<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
'''Client to Server'''<br />
<br />
Just 1 byte C->S<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
|- class="row1"<br />
| class="col0 centeralign" | 0x01<br />
|}<br />
<br />
'''Server to Client'''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="7" | 0x01<br />
| class="col1 centeralign" | Entity ID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>1298</code><br />
| class="col4" | The Players Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Level Type<br />
| class="col1 centeralign" | string<br />
| class="col2 centeralign" | default<br />
| class="col3" | default or SUPERFLAT; level-type in server.properties<br />
|- class="row3"<br />
| class="col0 centeralign" | Server mode<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | 0 for survival, 1 for creative<br />
|- class="row4"<br />
| class="col0 centeralign" | Dimension<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|- class="row5"<br />
| class="col0 centeralign" | Difficulty<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>1</code><br />
| class="col3" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard<br />
|- class="row6"<br />
| class="col0 centeralign" | Not used<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Only 0 observed from vanilla server, was previously world height<br />
|- class="row7"<br />
| class="col0 centeralign" | Max players<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>8</code><br />
| class="col3" | Used by the client to draw the player list<br />
|- class="row8"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 12 bytes + length of strings<br />
|}<br />
<br />
=== Handshake (0x02) ===<br />
<br />
''Client to server''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0x02<br />
| class="col1 centeralign" | Protocol Version<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>32</code><br />
| class="col4" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Username<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <code>TkTech</code><br />
| class="col4" | The username of the player attempting to connect<br />
|- class="row3"<br />
| class="col1 centeralign" | Server Host<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <code>localhost</code><br />
| class="col4" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Server Port<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>25565</code><br />
| class="col4" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 10 bytes + length of strings<br />
|}<br />
<br />
=== Entity Equipment (0x05) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="3" | 0x05<br />
| class="col1 centeralign" | Entity ID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 0x00010643<br />
| class="col4" | Named Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Slot<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | 4<br />
| class="col3" | Equipment slot: 0=held, 1-4=armor slot <br />
|- class="row3"<br />
| class="col0 centeralign" | Item<br />
| class="col1 centeralign" | slot<br />
| class="col2 centeralign" | <br />
| class="col3" | Item in slot format<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes<br />
|}<br />
<br />
=== Respawn (0x09) ===<br />
<br />
''Two-Way''<br />
<br />
Sent by the client when the player presses the "Respawn" button after dying. The server then teleports the user to the spawn point, and sends a respawn packet in response. The client will not leave the respawn screen until it receives a respawn packet.<br />
<br />
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.<br />
<br />
'''Client to Server'''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
|- class="row1"<br />
| class="col0 centeralign" | 0x09<br />
|}<br />
<br />
'''Server to Client'''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0x09<br />
| class="col1 centeralign" | Dimension<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|- class="row2"<br />
| class="col1 centeralign" | Difficulty<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard. <code>1</code> is always sent c->s<br />
|- class="row3"<br />
| class="col1 centeralign" | Creative mode<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>0</code> for survival, <code>1</code> for creative.<br />
|- class="row4"<br />
| class="col1 centeralign" | World height<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <code>256</code><br />
| class="col4" | Defaults to <code>256</code><br />
|- class="row5"<br />
| class="col1 centeralign" | Level Type<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | default<br />
| class="col4" | See [[#0x01|0x01 login]]<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes + length of string<br />
|}<br />
<br />
=== Spawn Object/Vehicle (0x17) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when an Object/Vehicle is created. The throwers entity id is now used for fishing floats too.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="9" | 0x17<br />
| class="col1 centeralign" | EID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>62</code><br />
| class="col4" | Entity ID of the Object<br />
|- class="row2"<br />
| class="col0 centeralign" | Type<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>11</code><br />
| class="col3" | The type of object (see [[Entities#Objects]])<br />
|- class="row3"<br />
| class="col0 centeralign" | X<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>16080</code><br />
| class="col3" | The Absolute Integer X Position of the object<br />
|- class="row4"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>2299</code><br />
| class="col3" | The Absolute Integer Y Position of the object<br />
|- class="row5"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>592</code><br />
| class="col3" | The Absolute Integer Z Position of the object<br />
|- class="row6"<br />
| class="col0 centeralign" | thrower's entity ID<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | If this is bigger than 0, this is a entity trown by a other entity and the next 3 fields are sent.<br />
|- class="row7"<br />
| class="col0 centeralign" | Speed X<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the X axis.<br />
|- class="row5"<br />
| class="col0 centeralign" | Speed Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Y axis.<br />
|- class="row5"<br />
| class="col0 centeralign" | Speed Z<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Z axis.<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 or 28 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x18}}<br />
<br />
<br />
=== Player Abilities (0xCA) ===<br />
This packet changed with 12w17a. It now contains 3 booleans but the values of these 3 booleans are not currently known.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=4 | 0xCA<br />
| class="col1 centeralign" | Flags<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 5<br />
| class="col4" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Walking speed<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 12<br />
| class="col4" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Flying speed<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 25<br />
| class="col4" | <br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 4 bytes<br />
|}<br />
<br />
=== Player Block Placement (0x0F) ===<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="8" | 0x0F<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>32</code><br />
| class="col4" | Block position<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>64</code><br />
| class="col3" | Block position<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>32</code><br />
| class="col3 leftalign" | Block position<br />
|- class="row4"<br />
| class="col0 centeralign" | Direction<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>3</code><br />
| class="col3" | The offset to use for block/item placement (see below)<br />
|- class="row5"<br />
| class="col0 centeralign" | Held item<br />
| class="col1 centeralign" | [[Slot_Data|slot]]<br />
| class="col2 centeralign" | <br />
| class="col3" |<br />
|- class="row6"<br />
| class="col0 centeralign" | Unknown<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0 - 0x0B</code> (or more)<br />
| class="col3" | ?<br />
|- class="row6"<br />
| class="col0 centeralign" | Unknown<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0 - 0x10</code><br />
| class="col3" | ?<br />
|- class="row6"<br />
| class="col0 centeralign" | Unknown<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0 - 0x10</code><br />
| class="col3" | ?<br />
|- class="row9"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes + slot data<br />
|}<br />
<br />
== Protocol History ==<br />
<br />
=== 2012-06-14 ===<br />
* 12w24a<br />
* Protocol version is now 36<br />
* Changed Packet 0x01(Login Request), only used as Login Reply<br />
* New Packet 0xCD used for Login Request and Respawn (1 byte payload)<br />
* All items (except the empty hand) now send enchantment data<br />
* more...<br />
<br />
=== 2012-06-07 ===<br />
* 12w23b<br />
* Protocol version is now 35<br />
* Change packet: Player Block Placement<br />
* New Packet: Block breaking animation<br />
<br />
=== 2012-05-24 ===<br />
* 12w21a<br />
* No packet changes but the algorithm was changed to AES128 with the shared key as the IV, will be described in [[Protocol Encryption]]<br />
<br />
=== 2012-05-10 ===<br />
* 12w19a<br />
* No packet changes, but an other encryption algorythm is used, described in [[Protocol Encryption]]<br />
* The items which are not enchantable in 12w18a are now readded<br />
* Fishing floats, spawned by a 0x17 packet do now use the extra fields<br />
<br />
=== 2012-05-03 ===<br />
* 12w18a<br />
* Protocol version is now 32<br />
* New packet: 0x3D Name Sound Effect<br />
* Changed packet: 0x01 Login Request<br />
* Changed packet: 0x02 Handshake<br />
* Changed packet: 0xCA Player Abilities<br />
* Changed packet: 0xCC Locale and View Distance<br />
* Changed packet: 0x09 Respawn<br />
* Removed packet: 0x32 Map Column Allocation<br />
* This items are not enchantable in this version: 0x103, 0x105, 0x15A, 0x167, 0x10C, 0x10D, 0x10E, 0x10F, 0x122, 0x110, 0x111, 0x112, 0x113, 0x123, 0x10B, 0x100, 0x101, 0x102, 0x124, 0x114, 0x115, 0x116, 0x117, 0x125, 0x11B, 0x11C, 0x11D, 0x11E, 0x126<br />
<br />
=== 2012-04-26 ===<br />
* 12w17a<br />
* Protocol version is now 31<br />
* RC4 based encryption, described in [[Protocol Encryption]]<br />
* Changed packet: 0x01 Login Request<br />
* Changed packet: 0x02 Handshake<br />
* Changed packet: 0xCC Locale and View Distance<br />
* Changed packet: 0xCA Player Abilities <br />
* New packet: 0xFC Encryption Key Response<br />
* New packet: 0xFD Encryption Key Request<br />
* New Item: Book & Quills (0x182) is enchantable<br />
* New Item: Written Book (0x183) is enchantable<br />
<br />
=== 2012-04-19 ===<br />
* 12w16a<br />
* Protocol version is now 30<br />
* New packet: 0xCB Tab-complete<br />
* New packet: 0xCC Locale and View Distance</div>Sadimusihttps://wiki.vg/index.php?title=User_talk:Sadimusi&diff=3444User talk:Sadimusi2012-06-13T03:47:16Z<p>Sadimusi: Created page with "I dont like red links --Ceiru 01:43, 28 October 2011 (MST)"</p>
<hr />
<div>I dont like red links<br />
--[[User:Ceiru|Ceiru]] 01:43, 28 October 2011 (MST)</div>Sadimusihttps://wiki.vg/index.php?title=Pre-release_protocol&diff=2821Pre-release protocol2012-06-11T16:27:29Z<p>Sadimusi: /* Player Abilities (0xCA) */</p>
<hr />
<div>This page documents the changes from the [[Protocol|last stable Minecraft release]] (currently 1.2.5) to the current pre-release (or weekly release).<br />
<br />
== New packets ==<br />
<br />
=== Tab-complete (0xCB) ===<br />
<br />
''Two-way''<br />
<br />
Sent C->S when the user presses [tab] while writing text. The payload contains all text behind the cursor.<br />
<br />
The server responds with an auto-completion of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported.<br />
<br />
In the event of more than one possible completion, the server responds with the options packed into the single string field, separated by a null character. Note that as strings are UTF-16, this is two bytes wide.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" | 0xCB<br />
| class="col1 centeralign" | Text<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <br />
| class="col4" | <br />
|- class="row3"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 3 bytes + length of string<br />
|}<br />
<br />
=== Locale and View Distance (0xCC) ===<br />
<br />
''Client to server''<br />
<br />
Sent when the player connects, or when settings are changed.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0xCC<br />
| class="col1 centeralign" | Locale<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | en_GB<br />
|- class="row2"<br />
| class="col1 centeralign" | View distance<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4" | 0-3 for 'far', 'normal', 'short', 'tiny'.<br />
|- class="row3"<br />
| class="col1 centeralign" | Chat flags<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 8<br />
| class="col4" | Bit field. 0: chat enabled, 2: colors enabled<br />
|- class="row4"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 0<br />
| class="col4 centeralign" | First three bits(bitmask 0x7) are used as a number, bit four(bitmask 0x8) is used as bool<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 8 bytes + length of string<br />
|}<br />
<br />
=== Encryption Key Response (0xFC) ===<br />
<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="2" | 0xFC<br />
| class="col1 centeralign" | Shared secret length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Shared secret<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row3"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 3 bytes + length of shared secret<br />
|}<br />
<br />
=== Encryption Key Request (0xFD) ===<br />
<br />
''Server to client''<br />
<br />
See [[Protocol Encryption]] for information on this packet.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="3" | 0xFD<br />
| class="col1 centeralign" | Server id<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Public key length<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Public key<br />
| class="col2 centeralign" | byte array<br />
| class="col3 centeralign" | <br />
| class="col4 centeralign" | <br />
|- class="row4"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 5 bytes + length of string + length of key<br />
|}<br />
<br />
=== Named Sound Effect (0x3E) ===<br />
<br />
''Server to client''<br />
<br />
Used to play a sound effect on the client.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="6" | 0x3E<br />
| class="col1 centeralign" | Sound name<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | step.grass<br />
| class="col4 centeralign" | 250<br />
|- class="row2"<br />
| class="col1 centeralign" | Effect position X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect X multiplied by 8<br />
|- class="row3"<br />
| class="col1 centeralign" | Effect position Y<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect Y multiplied with 8<br />
|- class="row4"<br />
| class="col1 centeralign" | Effect position Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 250<br />
| class="col4 centeralign" | effect Z multiplied with 8<br />
|- class="row5"<br />
| class="col1 centeralign" | Volume<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 9<br />
| class="col4 centeralign" | 63 is 100%, can be more<br />
|- class="row6"<br />
| class="col1 centeralign" | Pitch<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 63<br />
| class="col4 centeralign" | 63 is 100%, can be more<br />
|- class="row7"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 17 bytes + length of string<br />
|}<br />
<br />
=== Block Break Animation (0x37) ===<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=5 | 0x37<br />
| class="col1 centeralign" | EID?<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" | Entity breaking the block?<br />
|- class="row2"<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
| class="col4" rowspan=3 | Block position<br />
|- class="row2"<br />
| class="col1 centeralign" | Y<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Z<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Unknown<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 1<br />
| class="col4" | ?<br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 4 bytes<br />
|}<br />
<br />
== Changed packets ==<br />
<br />
=== Login Request (0x01) ===<br />
<br />
''Two-Way''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
'''Client to Server'''<br />
<br />
Just 1 byte C->S<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
|- class="row1"<br />
| class="col0 centeralign" | 0x01<br />
|}<br />
<br />
'''Server to Client'''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="7" | 0x01<br />
| class="col1 centeralign" | Entity ID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>1298</code><br />
| class="col4" | The Players Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Level Type<br />
| class="col1 centeralign" | string<br />
| class="col2 centeralign" | default<br />
| class="col3" | default or SUPERFLAT; level-type in server.properties<br />
|- class="row3"<br />
| class="col0 centeralign" | Server mode<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | 0 for survival, 1 for creative<br />
|- class="row4"<br />
| class="col0 centeralign" | Dimension<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|- class="row5"<br />
| class="col0 centeralign" | Difficulty<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>1</code><br />
| class="col3" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard<br />
|- class="row6"<br />
| class="col0 centeralign" | Not used<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Only 0 observed from vanilla server, was previously world height<br />
|- class="row7"<br />
| class="col0 centeralign" | Max players<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>8</code><br />
| class="col3" | Used by the client to draw the player list<br />
|- class="row8"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 12 bytes + length of strings<br />
|}<br />
<br />
=== Handshake (0x02) ===<br />
<br />
''Client to server''<br />
<br />
See [[Protocol Encryption]] for information on logging in.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="4" | 0x02<br />
| class="col1 centeralign" | Protocol Version<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>32</code><br />
| class="col4" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Username<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <code>TkTech</code><br />
| class="col4" | The username of the player attempting to connect<br />
|- class="row3"<br />
| class="col1 centeralign" | Server Host<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | <code>localhost</code><br />
| class="col4" | <br />
|- class="row4"<br />
| class="col1 centeralign" | Server Port<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>25565</code><br />
| class="col4" | <br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 10 bytes + length of strings<br />
|}<br />
<br />
=== Entity Equipment (0x05) ===<br />
<br />
''Server to Client''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="3" | 0x05<br />
| class="col1 centeralign" | Entity ID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | 0x00010643<br />
| class="col4" | Named Entity ID<br />
|- class="row2"<br />
| class="col0 centeralign" | Slot<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | 4<br />
| class="col3" | Equipment slot: 0=held, 1-4=armor slot <br />
|- class="row3"<br />
| class="col0 centeralign" | Item<br />
| class="col1 centeralign" | slot<br />
| class="col2 centeralign" | <br />
| class="col3" | Item in slot format<br />
|- class="row5"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes<br />
|}<br />
<br />
=== Respawn (0x09) ===<br />
<br />
''Two-Way''<br />
<br />
Sent by the client when the player presses the "Respawn" button after dying. The server then teleports the user to the spawn point, and sends a respawn packet in response. The client will not leave the respawn screen until it receives a respawn packet.<br />
<br />
To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically.<br />
<br />
'''Client to Server'''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
|- class="row1"<br />
| class="col0 centeralign" | 0x09<br />
|}<br />
<br />
'''Server to Client'''<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="5" | 0x09<br />
| class="col1 centeralign" | Dimension<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>-1</code>: The Nether, <code>0</code>: The Overworld, <code>1</code>: The End<br />
|- class="row2"<br />
| class="col1 centeralign" | Difficulty<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>0</code> thru <code>3</code> for Peaceful, Easy, Normal, Hard. <code>1</code> is always sent c->s<br />
|- class="row3"<br />
| class="col1 centeralign" | Creative mode<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | <code>1</code><br />
| class="col4" | <code>0</code> for survival, <code>1</code> for creative.<br />
|- class="row4"<br />
| class="col1 centeralign" | World height<br />
| class="col2 centeralign" | short<br />
| class="col3 centeralign" | <code>256</code><br />
| class="col4" | Defaults to <code>256</code><br />
|- class="row5"<br />
| class="col1 centeralign" | Level Type<br />
| class="col2 centeralign" | string<br />
| class="col3 centeralign" | default<br />
| class="col4" | See [[#0x01|0x01 login]]<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes + length of string<br />
|}<br />
<br />
=== Spawn Object/Vehicle (0x17) ===<br />
<br />
''Server to Client''<br />
<br />
Sent by the server when an Object/Vehicle is created. The throwers entity id is now used for fishing floats too.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="9" | 0x17<br />
| class="col1 centeralign" | EID<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>62</code><br />
| class="col4" | Entity ID of the Object<br />
|- class="row2"<br />
| class="col0 centeralign" | Type<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>11</code><br />
| class="col3" | The type of object (see [[Entities#Objects]])<br />
|- class="row3"<br />
| class="col0 centeralign" | X<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>16080</code><br />
| class="col3" | The Absolute Integer X Position of the object<br />
|- class="row4"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>2299</code><br />
| class="col3" | The Absolute Integer Y Position of the object<br />
|- class="row5"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>592</code><br />
| class="col3" | The Absolute Integer Z Position of the object<br />
|- class="row6"<br />
| class="col0 centeralign" | thrower's entity ID<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | If this is bigger than 0, this is a entity trown by a other entity and the next 3 fields are sent.<br />
|- class="row7"<br />
| class="col0 centeralign" | Speed X<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the X axis.<br />
|- class="row5"<br />
| class="col0 centeralign" | Speed Y<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Y axis.<br />
|- class="row5"<br />
| class="col0 centeralign" | Speed Z<br />
| class="col1 centeralign" | short<br />
| class="col2 centeralign" | <code>0</code><br />
| class="col3" | Not sent if the thrower entity ID is 0. The speed of this entity along the Z axis.<br />
|- class="row6"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 22 or 28 bytes<br />
|}<br />
<br />
<br />
{{anchor|0x18}}<br />
<br />
<br />
=== Player Abilities (0xCA) ===<br />
This packet changed with 12w17a. It now contains 3 booleans but the values of these 3 booleans are not currently known.<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan=4 | 0xCA<br />
| class="col1 centeralign" | Flags<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 5<br />
| class="col4" | <br />
|- class="row2"<br />
| class="col1 centeralign" | Walking speed<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 12<br />
| class="col4" | <br />
|- class="row3"<br />
| class="col1 centeralign" | Flying speed<br />
| class="col2 centeralign" | byte<br />
| class="col3 centeralign" | 25<br />
| class="col4" | <br />
|- class="row2"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 4 bytes<br />
|}<br />
<br />
=== Player Block Placement (0x0F) ===<br />
<br />
{| class="wikitable"<br />
|- class="row0"<br />
! class="col0" | Packet ID<br />
! class="col1" | Field Name<br />
! class="col2" | Field Type<br />
! class="col3" | Example<br />
! class="col4" | Notes<br />
|- class="row1"<br />
| class="col0 centeralign" rowspan="8" | 0x0F<br />
| class="col1 centeralign" | X<br />
| class="col2 centeralign" | int<br />
| class="col3 centeralign" | <code>32</code><br />
| class="col4" | Block position<br />
|- class="row2"<br />
| class="col0 centeralign" | Y<br />
| class="col1 centeralign" | unsigned byte<br />
| class="col2 centeralign" | <code>64</code><br />
| class="col3" | Block position<br />
|- class="row3"<br />
| class="col0 centeralign" | Z<br />
| class="col1 centeralign" | int<br />
| class="col2 centeralign" | <code>32</code><br />
| class="col3 leftalign" | Block position<br />
|- class="row4"<br />
| class="col0 centeralign" | Direction<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>3</code><br />
| class="col3" | The offset to use for block/item placement (see below)<br />
|- class="row5"<br />
| class="col0 centeralign" | Held item<br />
| class="col1 centeralign" | [[Slot_Data|slot]]<br />
| class="col2 centeralign" | <br />
| class="col3" |<br />
|- class="row6"<br />
| class="col0 centeralign" | Unknown<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0 - 0x0B</code> (or more)<br />
| class="col3" | ?<br />
|- class="row6"<br />
| class="col0 centeralign" | Unknown<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0 - 0x10</code><br />
| class="col3" | ?<br />
|- class="row6"<br />
| class="col0 centeralign" | Unknown<br />
| class="col1 centeralign" | byte<br />
| class="col2 centeralign" | <code>0 - 0x10</code><br />
| class="col3" | ?<br />
|- class="row9"<br />
! class="col0" | Total Size:<br />
| class="col1 rightalign" colspan="4" | 11 bytes + slot data<br />
|}<br />
<br />
== Protocol History ==<br />
<br />
=== 2012-06-07 ===<br />
* 12w23b<br />
* Protocol version is now 35<br />
* Change packet: Player Block Placement<br />
* Change packet: Entity Equipment<br />
* New Packet: Block breaking animation<br />
* Removed packet: Pre Chunk<br />
<br />
=== 2012-05-24 ===<br />
* 12w21a<br />
* No packet changes but the algorithm was changed to AES128 with the shared key as the IV, will be described in [[Protocol Encryption]]<br />
<br />
=== 2012-05-10 ===<br />
* 12w19a<br />
* No packet changes, but an other encryption algorythm is used, described in [[Protocol Encryption]]<br />
* The items which are not enchantable in 12w18a are now readded<br />
* Fishing floats, spawned by a 0x17 packet do now use the extra fields<br />
<br />
=== 2012-05-03 ===<br />
* 12w18a<br />
* Protocol version is now 32<br />
* New packet: 0x3D Name Sound Effect<br />
* Changed packet: 0x01 Login Request<br />
* Changed packet: 0x02 Handshake<br />
* Changed packet: 0xCA Player Abilities<br />
* Changed packet: 0xCC Locale and View Distance<br />
* Changed packet: 0x09 Respawn<br />
* Removed packet: 0x32 Map Column Allocation<br />
* This items are not enchantable in this version: 0x103, 0x105, 0x15A, 0x167, 0x10C, 0x10D, 0x10E, 0x10F, 0x122, 0x110, 0x111, 0x112, 0x113, 0x123, 0x10B, 0x100, 0x101, 0x102, 0x124, 0x114, 0x115, 0x116, 0x117, 0x125, 0x11B, 0x11C, 0x11D, 0x11E, 0x126<br />
<br />
=== 2012-04-26 ===<br />
* 12w17a<br />
* Protocol version is now 31<br />
* RC4 based encryption, described in [[Protocol Encryption]]<br />
* Changed packet: 0x01 Login Request<br />
* Changed packet: 0x02 Handshake<br />
* Changed packet: 0xCC Locale and View Distance<br />
* Changed packet: 0xCA Player Abilities <br />
* New packet: 0xFC Encryption Key Response<br />
* New packet: 0xFD Encryption Key Request<br />
* New Item: Book & Quills (0x182) is enchantable<br />
* New Item: Written Book (0x183) is enchantable<br />
<br />
=== 2012-04-19 ===<br />
* 12w16a<br />
* Protocol version is now 30<br />
* New packet: 0xCB Tab-complete<br />
* New packet: 0xCC Locale and View Distance</div>Sadimusihttps://wiki.vg/index.php?title=Talk:Slot_Data&diff=3440Talk:Slot Data2012-06-07T06:55:30Z<p>Sadimusi: </p>
<hr />
<div>== Clarity on "array of slot" for Set Window Items (0x68) ==<br />
<br />
Would you consider elaborating further on the presentation of the slot structure and specifically the array of slot structure? Providing a python example similar to the one in the "entity metadata format" page would be very helpful. I've struggled to get read support for this packet implemented.<br />
:The [[Protocol#Set_Window_Items_.280x68.29 | Set Window Items]] packet sends multiple slots after eachother, prefixed with the number of slots. Here's a pseudo-python example:<br />
def send_set_window_items(window, items):<br />
send_byte(0x68)<br />
send_byte(window.id)<br />
send_short(len(items))<br />
for item in items:<br />
send_slot(item)<br />
:--[[User:Sadimusi|Sadimusi]] 23:55, 6 June 2012 (MST)</div>Sadimusihttps://wiki.vg/index.php?title=Protocol_Encryption&diff=3400Protocol Encryption2012-05-26T00:02:00Z<p>Sadimusi: Fixed RSA padding</p>
<hr />
<div>As of 12w17a, minecraft implements SSL-like encryption.<br />
<br />
== Overview ==<br />
<br />
#Client connects to server<br />
#'''C->S''' 0x02 handshake<br />
#'''S->C''' 0xFD encryption request - server sends its public key<br />
#Client generates symmetric key (shared secret)<br />
#Client authenticates via session.minecraft.net<br />
#'''C->S''' 0xFC encryption response - client encrypts shared secret with server's public key and sends<br />
#Server decrypts shared secret with its private key<br />
#Server checks player authenticity via session.minecraft.net<br />
#'''S->C''' 0xFC encryption response - empty payload<br />
#Server enables AES stream encryption<br />
#Client enables AES stream encryption<br />
#'''C->S''' 0x01 login<br />
#'''S->C''' 0x01 login<br />
#see [[Protocol FAQ]] to get information about what happens next.<br />
<br />
For a Code example you can have a look at this example of a Chat Bot using a C# Protocol Library: <br />
https://minecraftprotocol.codeplex.com/SourceControl/changeset/view/68979#1204175<br />
<br />
== Key Exchange ==<br />
<br />
The server generates a 1024-bit RSA keypair on startup. The key, when packed into a 0xFD packet, is in ASN.1 format as defined by x.509.<br />
The ASN.1 structure looks as follows<br />
<br />
SubjectPublicKeyInfo ::= SEQUENCE {<br />
algorithm SEQUENCE {<br />
algorithm OBJECT IDENTIFIER<br />
parameters ANY OPTIONAL<br />
}<br />
subjectPublicKey BITSTRING<br />
}<br />
<br />
SubjectPublicKey ::= SEQUENCE {<br />
modulus INTEGER<br />
publicExponent INTEGER<br />
}<br />
<br />
If you're struggling to import this using a crypto library, you can convert it to common PEM by base64-encoding and wrapping in '-----BEGIN PUBLIC KEY-----' and '-----END PUBLIC KEY-----'.<br />
<br />
== Symmetric Encryption ==<br />
<br />
12w18a:<br />
<br />
On receipt of a 0xFD from the server, the client will generate a 16-byte shared secret, to be used with the RC4 stream cipher. It then encrypts it with the server's public key (PKCS#1 padded), and sends it to the server with a 0xFC.<br />
<br />
The server decrypts the shared secret using its private key. It then sends a 0xFC to the client with an empty payload, and enables RC4 encryption. Similarly, the client will also enable encryption upon receipt of the empty 0xFC. From this point forward, everything is encrypted.<br />
<br />
12w19a:<br />
<br />
On receipt of a 0xFD from the server, the client will generate a 32-byte shared secret, to be used with the HC-256 stream cipher. It then encrypts it with the server's public key (PKCS#1 padded), and sends it to the server with a 0xFC.<br />
<br />
The server decrypts the shared secret using its private key. It then sends a 0xFC to the client with an empty payload, and enables HC-256 encryption. For the Initial Vector (IV) Both sides use the first 16 byte of the key. Similarly, the client will also enable encryption upon receipt of the empty 0xFC. From this point forward, everything is encrypted.<br />
<br />
<br />
12w21a:<br />
<br />
On receipt of a 0xFD from the server, the client will generate a 32-byte shared secret, to be used with the AES/CFB stream cipher. It then encrypts it with the server's public key (PKCS#1 padded), and sends it to the server with a 0xFC.<br />
<br />
The server decrypts the shared secret using its private key. It then sends a 0xFC to the client with an empty payload, and enables AES/CFB encryption. For the Initial Vector (IV) Both sides use the secret key. Similarly, the client will also enable encryption upon receipt of the empty 0xFC. From this point forward, everything is encrypted.<br />
<br />
== Authentication ==<br />
<br />
Both server and client need to make a request to session.minecraft.net if the server is in online-mode.<br />
<br />
=== Client ===<br />
<br />
After generating the shared secret, the client generates the following hash:<br />
<br />
sha1 := Sha1()<br />
sha1.update(serverId from 0xFC) <br />
sha1.update(shared secret) <br />
sha1.update(server's encoded public key from 0xFC) <br />
hash := sha1.hexdigest() # String of hex characters<br />
<br />
[[File:Icon_exclaim.gif|:!:]] Note that the Sha1.hexdigest() method used by minecraft removes leading zeros and uses the two's-complement of negative numbers prefixed with a minus sign:<br />
<br />
sha1(Notch) : 4ed1f46bbe04bc756bcb17c0c7ce3e4632f06a48<br />
sha1(jeb_) : -7c9d5b0044c130109a5d7b5fb5c317c02b4e28c1<br />
sha1(simon) : 88e16a1019277b15d58faf0541e11910eb756f6<br />
<br />
The resulting hash is then sent via an HTTP GET request to<br />
<nowiki>http://session.minecraft.net/game/joinserver.jsp?user=</nowiki>''username''&sessionId=''[[Session#Login|user_session]]''&serverId=''hash''<br />
If it returns '''OK''' then continue, otherwise stop<br />
<br />
=== Server ===<br />
<br />
After decrypting the shared secret in 0xFD, the sever generates the login hash as above and sends it to<br />
<nowiki>http://session.minecraft.net/game/checkserver.jsp?user=</nowiki>''username''&serverId=''hash''<br />
<br />
If the response is '''YES''' then the client is authenticated and allowed to join. Otherwise the client will/should be [[Protocol#Disconnect.2FKick_.280xFF.29|kicked]] (unencrypted) with "Failed to verify username!"</div>Sadimusihttps://wiki.vg/index.php?title=Protocol_Encryption&diff=3397Protocol Encryption2012-05-19T02:20:23Z<p>Sadimusi: /* Client */ Fixed login hash order</p>
<hr />
<div>As of 12w17a, minecraft implements SSL-like encryption.<br />
<br />
== Overview ==<br />
<br />
#Client connects to server<br />
#'''C->S''' 0x02 handshake<br />
#'''S->C''' 0xFD encryption request - server sends its public key<br />
#Client generates symmetric key (shared secret)<br />
#Client authenticates via session.minecraft.net<br />
#'''C->S''' 0xFC encryption response - client encrypts shared secret with server's public key and sends<br />
#Server decrypts shared secret with its private key<br />
#Server checks player authenticity via session.minecraft.net<br />
#'''S->C''' 0xFC encryption response - empty payload<br />
#Server enables RC4 stream encryption<br />
#Client enables RC4 stream encryption<br />
#'''C->S''' 0x01 login<br />
#'''S->C''' 0x01 login<br />
#see [[Protocol FAQ]] to get information about what happens next.<br />
<br />
For a Code example you can have a look at this example of a Chat Bot using a C# Protocol Library: <br />
https://minecraftprotocol.codeplex.com/SourceControl/changeset/view/68979#1204175<br />
<br />
== Key Exchange ==<br />
<br />
The server generates a 1024-bit RSA keypair on startup. The key, when packed into a 0xFD packet, is in ASN.1 format as defined by x.509.<br />
The ASN.1 structure looks as follows<br />
<br />
SubjectPublicKeyInfo ::= SEQUENCE {<br />
algorithm SEQUENCE {<br />
algorithm OBJECT IDENTIFIER<br />
parameters ANY OPTIONAL<br />
}<br />
subjectPublicKey BITSTRING<br />
}<br />
<br />
SubjectPublicKey ::= SEQUENCE {<br />
modulus INTEGER<br />
publicExponent INTEGER<br />
}<br />
<br />
If you're struggling to import this using a crypto library, you can convert it to common PEM by base64-encoding and wrapping in '-----BEGIN PUBLIC KEY-----' and '-----END PUBLIC KEY-----'.<br />
<br />
== Symmetric Encryption ==<br />
<br />
12w18a:<br />
<br />
On receipt of a 0xFD from the server, the client will generate a 16-byte shared secret, to be used with the RC4 stream cipher. It then encrypts it with the server's public key (PKCS#1 padded), and sends it to the server with a 0xFC.<br />
<br />
The server decrypts the shared secret using its private key. It then sends a 0xFC to the client with an empty payload, and enables RC4 encryption. Similarly, the client will also enable encryption upon receipt of the empty 0xFC. From this point forward, everything is encrypted.<br />
<br />
12w19a:<br />
<br />
On receipt of a 0xFD from the server, the client will generate a 32-byte shared secret, to be used with the HC-256 stream cipher. It then encrypts it with the server's public key (PKCS#1 padded), and sends it to the server with a 0xFC.<br />
<br />
The server decrypts the shared secret using its private key. It then sends a 0xFC to the client with an empty payload, and enables HC-256 encryption. For the Initial Vector (IV) Both sides use the first 16 byte of the key. Similarly, the client will also enable encryption upon receipt of the empty 0xFC. From this point forward, everything is encrypted.<br />
<br />
== Authentication ==<br />
<br />
Both server and client need to make a request to session.minecraft.net if the server is in online-mode.<br />
<br />
=== Client ===<br />
<br />
After generating the shared secret, the client generates the following hash:<br />
<br />
sha1 := Sha1()<br />
sha1.update(serverId from 0xFC) <br />
sha1.update(shared secret) <br />
sha1.update(server's encoded public key from 0xFC) <br />
hash := sha1.hexdigest() # String of hex characters<br />
<br />
[[File:Icon_exclaim.gif|:!:]] Note that the Sha1.hexdigest() method used by minecraft removes leading zeros and uses the two's-complement of negative numbers prefixed with a minus sign:<br />
<br />
sha1(Notch) : 4ed1f46bbe04bc756bcb17c0c7ce3e4632f06a48<br />
sha1(jeb_) : -7c9d5b0044c130109a5d7b5fb5c317c02b4e28c1<br />
sha1(simon) : 88e16a1019277b15d58faf0541e11910eb756f6<br />
<br />
The resulting hash is then sent via an HTTP GET request to<br />
<nowiki>http://session.minecraft.net/game/joinserver.jsp?user=</nowiki>''username''&sessionId=''[[Session#Login|user_session]]''&serverId=''hash''<br />
If it returns '''OK''' then continue, otherwise stop<br />
<br />
=== Server ===<br />
<br />
After decrypting the shared secret in 0xFD, the sever generates the login hash as above and sends it to<br />
<nowiki>http://session.minecraft.net/game/checkserver.jsp?user=</nowiki>''username''&serverId=''hash''<br />
<br />
If the response is '''YES''' then the client is authenticated and allowed to join. Otherwise the client will/should be [[Protocol#Disconnect.2FKick_.280xFF.29|kicked]] (unencrypted) with "Failed to verify username!"</div>Sadimusihttps://wiki.vg/index.php?title=Protocol_Encryption&diff=3391Protocol Encryption2012-05-04T05:54:43Z<p>Sadimusi: Cleaned up authentication</p>
<hr />
<div>As of 12w17a, minecraft implements SSL-like encryption.<br />
<br />
== Overview ==<br />
<br />
#Client connects to server<br />
#'''C->S''' 0x02 handshake<br />
#'''S->C''' 0xFD encryption request - server sends its public key<br />
#Client generates symmetric key (shared secret)<br />
#Client authenticates via session.minecraft.net<br />
#'''C->S''' 0xFC encryption response - client encrypts shared secret with server's public key and sends<br />
#Server decrypts shared secret with its private key<br />
#Server checks player authenticity via session.minecraft.net<br />
#'''S->C''' 0xFC encryption response - empty payload<br />
#Server enables RC4 stream encryption<br />
#Client enables RC4 stream encryption<br />
#'''C->S''' 0x01 login<br />
#'''S->C''' 0x01 login<br />
#see [[Protocol FAQ]] to get information about what happens next.<br />
<br />
== Key Exchange ==<br />
<br />
The server generates a 1024-bit RSA keypair on startup. The key, when packed into a 0xFD packet, is in ASN.1 format as defined by x.509.<br />
The ASN.1 structure looks as follows<br />
<br />
SubjectPublicKeyInfo ::= SEQUENCE {<br />
algorithm SEQUENCE {<br />
algorithm OBJECT IDENTIFIER<br />
parameters ANY OPTIONAL<br />
}<br />
subjectPublicKey BITSTRING<br />
}<br />
<br />
SubjectPublicKey ::= SEQUENCE {<br />
modulus INTEGER<br />
publicExponent INTEGER<br />
}<br />
<br />
If you're struggling to import this using a crypto library, you can convert it to common PEM by base64-encoding and wrapping in '-----BEGIN PUBLIC KEY-----' and '-----END PUBLIC KEY-----'.<br />
<br />
== Symmetric Encryption ==<br />
<br />
On receipt of a 0xFD from the server, the client will generate a 16-byte shared secret, to be used with the RC4 stream cipher. It then encrypts it with the server's public key (PKCS#1 padded), and sends it to the server with a 0xFC.<br />
<br />
The server decrypts the shared secret using its private key. It then sends a 0xFC to the client with an empty payload, and enables RC4 encryption. Similarly, the client will also enable encryption upon receipt of the empty 0xFC. From this point forward, everything is encrypted.<br />
<br />
== Authentication ==<br />
<br />
Both server and client need to make a request to session.minecraft.net if the server is in online-mode.<br />
<br />
=== Client ===<br />
<br />
After generating the shared secret, the client generates the following hash:<br />
<code><br />
hash := sha1(concat(a, b, c))<br />
where:<br />
a = serverId from 0xFC<br />
b = server's public key<br />
c = shared secret<br />
</code><br />
<br />
And sends an HTTP request to<br />
<nowiki>http://session.minecraft.net/game/joinserver.jsp?user=</nowiki>''username''&sessionId=''[[Session#Login|user_session]]''&serverId=''hash''<br />
If it returns '''OK''' then continue, otherwise stop<br />
<br />
=== Server ===<br />
<br />
After decrypting the shared secret in 0xFD, the sever generates the login hash as above and sens it to<br />
<nowiki>http://session.minecraft.net/game/checkserver?user=</nowiki>''username''&serverId=''hash''<br />
<br />
If the response is '''YES''' then the client is authenticated and allowed to join. Otherwise the client will/should be [[Protocol#Disconnect.2FKick_.280xFF.29|kicked]] (unencrypted) with "Failed to verify username!"</div>Sadimusihttps://wiki.vg/index.php?title=Protocol_Encryption&diff=3390Protocol Encryption2012-05-04T05:46:44Z<p>Sadimusi: /* Key Exchange */ added ASN.1 structure</p>
<hr />
<div>As of 12w17a, minecraft implements SSL-like encryption.<br />
<br />
== Overview ==<br />
<br />
#Client connects to server<br />
#'''C->S''' 0x02 handshake<br />
#'''S->C''' 0xFD encryption request - server sends its public key<br />
#Client generates symmetric key (shared secret)<br />
#Client pings minecraft.net<br />
#'''C->S''' 0xFC encryption response - client encrypts shared secret with server's public key and sends<br />
#Server decrypts shared secret with its private key<br />
#Server pings minecraft.net<br />
#'''S->C''' 0xFC encryption response - empty payload<br />
#Server enables RC4 stream encryption<br />
#Client enables RC4 stream encryption<br />
#'''C->S''' 0x01 login<br />
#'''S->C''' 0x01 login<br />
#see [[Protocol FAQ]] to get information about what happens next.<br />
<br />
== Key Exchange ==<br />
<br />
The server generates a 1024-bit RSA keypair on startup. The key, when packed into a 0xFD packet, is in ASN.1 format as defined by x.509.<br />
The ASN.1 structure looks as follows<br />
<br />
SubjectPublicKeyInfo ::= SEQUENCE {<br />
algorithm SEQUENCE {<br />
algorithm OBJECT IDENTIFIER<br />
parameters ANY OPTIONAL<br />
}<br />
subjectPublicKey BITSTRING<br />
}<br />
<br />
SubjectPublicKey ::= SEQUENCE {<br />
modulus INTEGER<br />
publicExponent INTEGER<br />
}<br />
<br />
If you're struggling to import this using a crypto library, you can convert it to common PEM by base64-encoding and wrapping in '-----BEGIN PUBLIC KEY-----' and '-----END PUBLIC KEY-----'.<br />
<br />
== Symmetric Encryption ==<br />
<br />
On receipt of a 0xFD from the server, the client will generate a 16-byte shared secret, to be used with the RC4 stream cipher. It then encrypts it with the server's public key (PKCS#1 padded), and sends it to the server with a 0xFC.<br />
<br />
The server decrypts the shared secret using its private key. It then sends a 0xFC to the client with an empty payload, and enables RC4 encryption. Similarly, the client will also enable encryption upon receipt of the empty 0xFC. From this point forward, everything is encrypted.<br />
<br />
== minecraft.net ==<br />
<br />
Both server and client need to make a request to minecraft.net if the server is in online-mode.<br />
<br />
=== Client ===<br />
<br />
After generating the shared secret, the client generates the following hash:<br />
<code><br />
hash := sha1(concat(a, b, c))<br />
where:<br />
a = serverId from 0xFC<br />
b = server's public key<br />
c = shared secret<br />
</code><br />
<br />
And sends an HTTP request to<br />
<br />
<code><br />
<nowiki>http://session.minecraft.net/game/joinserver.jsp?user=</nowiki>''username''&sessionId=''[[Session#Login|user_session]]''&serverId=''hash''<br />
</code><br />
<br />
If it returns '''OK''' then continue, otherwise stop<br />
<br />
=== Server ===<br />
<br />
As above, after decrypting the shared secret in 0xFD.<br />
<br />
If the response is '''YES''' then the client is authenticated and allowed to join. Otherwise the client will/should be [[Protocol#Disconnect.2FKick_.280xFF.29|kicked]] (unencrypted) with "Failed to verify username!"</div>Sadimusi