Skip to content

Instantly share code, notes, and snippets.

@rom1504
Last active May 31, 2017 08:44
Show Gist options
  • Save rom1504/7b4c0cc29fb03122b6a5 to your computer and use it in GitHub Desktop.
Save rom1504/7b4c0cc29fb03122b6a5 to your computer and use it in GitHub Desktop.
List of files representing the minecraft protocol

I believe some standardisation would be useful on that point.

List of files representing the minecraft protocol

Project Format
SpockBot python dictionary
minecraft-data (used by node-minecraft-protocol) json defined by a json schema
hematite rust macro
darkbot xml
pymcprotocol python dictionary
steven go structures
hansihe's elixir mc server domain specific language

However representing the protocol in a simple data structure is not possible for some projects who chose to use the syntax of their language to represent that, for example :

It might however be possible to generate code files from a standard file like ProtocolGen now does using minecraft-data protocol.json

Open questions

  • what is needed for a format to represent the whole minecraft protocol ?
  • what would be the best way for all of these project to use a single data source for the mc proto ?
  • how to sync that information easily with http://wiki.vg/Protocol ? (some idea )
  • as wiki.vg/Protocol is a wiki and wikis are turning to wikidata for information storage and in general the knowledge bases are gaining popularity, would it be possible to somehow represent the protocol in such a way to store it in that kind of knowledge base and link it back to the wiki somehow ?

Format

Formatting language

As can be seen from the list, many formats are possible. The problem is most of these format are language specific, for example python dictionaries can only be used in python and go structures can only be used in go. Using a format like xml or json make it possible to read the protocol file in most languages easily : you will find json and xml parsers in basically every language.

So I believe if a format is going to have any chance to being used in several projects, it has to be in a language independant format like json or xml.

Schema

Choosing a formatting language for the protocol file is only the first step though. It is still needed to choose how data can be represented in that format. For that task, json schema or xsd propose to standardise the representation of the data.

Relation with wiki.vg/Protocol

One way to make the link between a standard file and wiki.vg/Protocol would be to generate wiki.vg/Protocol from that file.

The problem is putting all the description and explanation with text formatting in the protocol file would get messy. One way to go around that is putting description in a separate file written in markdown (or an other formatting language like wikitext) and then generating wiki.vg/Protocol from both the protocol file and the description file. The short field notes could go into the protocol file. The mapping could be done with packet names or packet ids.

Here on the right is a (very simple) proof of concept for that idea using node-minecraft-protocol's protocol.json.

@nevercast
Copy link

Interesting I did a Google search just now and by coincidence turned up this document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment