A repository that contains JSON data and Go bindings for the Minecraft protocol
See data/ directory for JSON outputs. See scripts/ for scripts to generate the JSON/Go bindings.
go/ folder contains Go package/bindings for the JSON data, to be used in go-mclib/protocol and go-mclib/client.
Also see wlwanpan/mcdata and PrismarineJS/minecraft-data.
Also see headers of Python script files in scripts/ for more detailed instructions.
- Download HTML ("Save page as..." or Ctrl/Cmd + U and copy all text) of https://minecraft.wiki/w/Java_Edition_protocol/Packets
- Run
mkdir -p data/774; python scripts/import_java_packets.py > data/774/java_packets.json, replacing774with the actual protocol version - See
fix_packet_ids.py:cd scripts; java -jar -DbundlerMainClass="net.minecraft.data.Main" server.jar --all, thenpython fix_packet_ids.py 774(again, replace774with the protocol ID you imported in step 2). - Finally, (assuming your WD is at repo root, if not
cdto dir of this file), generate the packets as Go bindings:mkdir -p go/774/java_packets; python scripts/generate_java_packets.py 774. Manually inspect the files, fixing packet structures as necessary (the script is not perfect and sometimes imports the packets incorrectly - in most cases, it's enough to simply copy the definition from the protocol version before).
Licensed under the GNU General Public License v3.0 (as it uses output from the Wiki which has this license - IANAL, but better be safe than sorry - if it's better to choose a different/more appropriate license, feel free to create a PR).