Protocol Overview

From wiki.vg
Revision as of 13:23, 26 October 2012 by imported>Barneygale (Created page with "This page gives a slightly less technical overview of the minecraft protocol. == Tips == * You need to support '''the entire protocol'''. Packets do ''not'' have a length fi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This page gives a slightly less technical overview of the minecraft protocol.

Tips

  • You need to support the entire protocol. Packets do not have a length field (although some arrays do) and can't be skipped over, so you will need to write generic support for common data types including the slot type and the entity metadata format. While it's okay to do some initial testing in the style of socket.send('\x01'), the reality is you will need to write a decent type packer/unpacker and define packet structures abstractly.
  • Some packets have weird rules, for example in 0x17 spawn object/vehicle the last 3 fields only sent if another field is >0
  • When arrays are sent, you'll sometimes get the data length, sometimes the record count (these are the same if the record length = 1 byte), and sometimes both. On occasion you'll need to use the same length field to unpack more than one array
  • You will need to unpack arrays of dynamic-length datatypes, as in 0x68 set window items
  • Sometimes packets send condensed data in arrays that can be unpacked according to a specific format. However, as the array length is given, this is only necessary if you're actually interested in the data. Examples:
  • If you want to understand enchantment data sent in slot data, you will need to support NBT
  • You will need to support AES, RSA and sha1 as protocol encryption is required

Overview

Authentication

Please see the page on protocol encryption for more details on the authentication process

Player Movement

Packets 0x0A - 0x0D are sent by the minecraft client when the player moves. 0x0D is also sent server->client to update other player positions.

Player Interaction

Entity Spawning

Entity Movement

Entity Misc

Map

Environment

Inventory

See the article on inventory for more details

Client Integration

Misc