Minecraft protocol library

#net#proto#codegen#python#minecraft::alemi::2021-09-30 17:05


I like Minecraft, and due to its licensing, reverse-engineering the software is allowed and well documented. I made aiocraft, a client from scratch implementing its protocol, binding both rust and python for performant serialization and simple high-level development. The main struggle of this project was codegen: writing definitions for all types and versions in the game would be an enormous effort, so a way to auto generate them is needed. As of now, the codegen results are pushed as individual files to make LSPs and committing happier, but they will eventually be generated on demand upon installing.

Not all protocol versions are supported, but 1.12 and 1.16 have all types implemented.

source code


After creating types and bindings for the core minecraft flows and types, a more developer-friendly way to bots development was necessary. I built treepuncher, an hackable minecraft framework, which easily loads plugins, exposes event hooks and a scheduler and provides persistent storage for credentials.

The client is still incomplete but simple automations can already be built, and at worst it's possible to directly hook on packet events.

source code