mcgen
Python utilities for downloading and processing Minecraft's generated data.
Requirements
- Python 3.8+
- Java 11+ (for invoking the Minecraft server's data generator)
Installation
pip install mcgen
Usage
python -m mcgen --help
mcgen [-h] [--jarpath JARPATH] [--rawpath RAWPATH] [--outpath OUTPATH] [--version VERSION] [--manifest MANIFEST] [--processors [PROCESSORS [PROCESSORS ...]]] [--log LOG]
Download the Minecraft server jar for the specified version, invoke the data generator, and process the output.
optional arguments:
-h, --help show this help message and exit
--jarpath JARPATH Where to download and store the server jar. Default: temp/jars/minecraft_server.{version}.jar
--rawpath RAWPATH Where to store the raw server-generated files. Default: temp/raw/{version}
--outpath OUTPATH Where to write the final processed output. Default: temp/out/{version}
--version VERSION The server version to download and process. Defaults to latest snapshot.
--manifest MANIFEST Where to fetch the version manifest from. Defaults to Mojang's online copy.
--processors [PROCESSORS [PROCESSORS ...]]
Which processors to use in processing the raw server-generated files. Defaults to a set of built-in processors.
--log LOG The level of verbosity at which to print log messages.
Processors
Processors are used to process the raw server-generated data and produce output. They are invoked one after the other, in the order they are defined.
To provide a custom set of processors, use the --processors option like so:
python -m mcgen --processors mcgen.processors.split_registries mcgen.processors.summarize_data
Built-in processors
Several built-in processors are provided in mcgen.processors:
write_version_file- Write the game version to a file.convert_json_files- Convert json files into another form.simplify_blocks- Create an optimized summary of blocks.split_registries- Splitregistries.jsoninto separate files.summarize_data- Create a summary of each vanilla registry.summarize_worldgen- Create a summary of worldgen reports.create_all_tags_data_pack- Generate a data pack with "all" tags.
Custom processors
Processors are Python modules containing a function with the following signature:
def process(ctx: Context, **options):
...
ctxcontains information about the processing contextoptionsis a key-value mapping of arbitrary data
21w39a
Note that in snapshot 21w39a the java command used to invoke the server generator changed:
# Prior to 21w39a:
java -cp {jar_path} net.minecraft.data.Main --server --reports
# From 21w39a onward:
java -DbundlerMainClass=net.minecraft.data.Main -jar {jar_path} --server --reports
If you need to generate data for versions prior to 21w39a, use the --cmd option with the older java command.
Metadata
Release files for mcgen 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcgen-0.8.0.tar.gz | 10.2 kB | Without provenance | Details for mcgen-0.8.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcgen-0.8.0-py3-none-any.whl | Python 3 | none | any | Details for mcgen-0.8.0-py3-none-any.whl |
Total release size: 23.1 kB
Release files / mcgen-0.8.0.tar.gz
| Download URL | mcgen-0.8.0.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3734c1fa8d80bfc960f42d1e385bccbfc7a9d0f63999e0a58ecc8679f14085c8
|
|
BLAKE2b-256 checksum How to use checksums |
de6a2a6d59dfa3ea5a9a8746a684b796dab2de241e4df5f42453b6677bf74990
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.0a2 CPython/3.10.0 Linux/5.4.72-microsoft-standard-WSL2
|
Release files / mcgen-0.8.0-py3-none-any.whl
| Download URL | mcgen-0.8.0-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5dd31573c81b796ace92ba88247b0c08d4254a549aafdbc255201d67852e8529
|
|
BLAKE2b-256 checksum How to use checksums |
b1ad83a0264ddace11bfc2a34de946a13c5ab4a13dd52b764224c6ec0408d6e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.0a2 CPython/3.10.0 Linux/5.4.72-microsoft-standard-WSL2
|
Security for mcgen 0.8.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.