Skip to content

go-mclib/data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-mclib/data

A repository that contains JSON data and Go bindings for the Minecraft protocol

Usage

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.

Updating to a new Minecraft version

Also see headers of Python script files in scripts/ for more detailed instructions.

  1. Download HTML ("Save page as..." or Ctrl/Cmd + U and copy all text) of https://minecraft.wiki/w/Java_Edition_protocol/Packets
  2. Run mkdir -p data/774; python scripts/import_java_packets.py > data/774/java_packets.json, replacing 774 with the actual protocol version
  3. See fix_packet_ids.py: cd scripts; java -jar -DbundlerMainClass="net.minecraft.data.Main" server.jar --all, then python fix_packet_ids.py 774 (again, replace 774 with the protocol ID you imported in step 2).
  4. Finally, (assuming your WD is at repo root, if not cd to 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).

License

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).

About

Go bindings for Minecraft data

Resources

License

Stars

Watchers

Forks

Packages

No packages published