Development resources

Map File Format
Blocks, items and data values are common to all map types.

Map Formats

 * .dat Map Format
 * Map Format (NBT) 1 2

Map Editing

 * Map Editing (general)
 * Map Editing (hex)

Libraries

 * Java Classes to Deserialize Maps
 * Java Class to read and write NBT structures

Heartbeats
To be able to connect to a server in Minecraft Classic, a server must broadcast to minecraft.net a so-called "heartbeat" every few minutes.

A "heartbeat" takes the form of an HTTP request to http://www.minecraft.net/heartbeat.jsp. After sending a heartbeat, the URL for the server is returned.

It can be a GET or POST request. A table of the required parameters is below:

Simple Method
The simplest way to send a heartbeat is to open a TCP socket to port 80 on www.minecraft.net, and send the following (with the values changed, obviously):

GET /heartbeat.jsp?port=25565&max=32&name=My%20Server&public=True&version=7&salt=wo6kVAHjxoJcInKx&users=0

Make sure any strings, like name, are escaped.

In response you'll receive some headers and a body. The end of the headers is marked by an empty line, which is easy to detect. (Ignore all data before the double \n) After this, if all is well, you'll get a URL to the server after that. Else you'll get a nice HTML error message.

Packet Protocol
The data here regards Minecraft Classic. For info on the protocol for Minecraft Alpha, see the TkTech wiki page as well as the authentication protocol here.

Every packet starts with a byte representing the Packet ID.

Color Codes
Messages sent from the server to the client can contain color codes, which allow coloring of text for various purposes. An ampersand followed by a hex digit in the message tells the client to switch colors while displaying text. Colour coding at the start of the message will only work if the player ID byte is less than 127. If it's 127 or higher, the game automatically adds &e before the message, making it yellow. However, colour codes after the first character still work. If you use an ID below 127, it doesn't add a colour code, so the ones you use will work.



Mobs

 * See also: Mobs

In multiplayer creative mode, all mobs are treated the same by the client. To create non-player mobs, simply send updates for them as you would a normal player. The client finds a mob's skin by its name, downloading from http://minecraft.net/skin/name.png and defaulting to the generic mob if it doesn't exist. To give your monsters a special skin, you would need to register and pay for an account with the monster's name.

You can also send fake names for actual players in order to force them to have a certain skin.