The Minecraft pack development kit
Project description
beet
The Minecraft pack development kit.
Introduction
As Minecraft's vanilla customization capabilities keep growing, it's becoming more and more apparent that resource packs and data packs can be pretty limiting as an authoring format. Their simple structure allows them to fulfill their initial objective as a distribution format, but without the ability to parametrize or create abstractions over assets and data pack resources, the reusability and interoperability of community-created projects and libraries is greatly limited.
The community is tackling the problem by building independent tooling left and right, from command pre-processors to frameworks of all kinds and full-blown programming languages. However, there's no silver bullet and in situations where a combination of these tools could actually provide the most suited abstractions, the separate toolchains and the poor interoperability make it difficult for them to coexist.
The beet
project is meant to serve as a platform for building interoperable higher-level frameworks by providing a flexible composition model and a unified, user-friendly development workflow.
Library
from beet import ResourcePack, Texture
with ResourcePack(path="stone.zip") as assets:
assets["minecraft:block/stone"] = Texture(source_path="custom.png")
The beet
library provides carefully crafted abstractions for working with Minecraft resource packs and data packs in Python.
- Create, read, edit and merge resource packs and data packs
- Handle zipped and unzipped packs
- Fast and lazy by default, files are transparently loaded when needed
- Statically typed API enabling rich intellisense and autocompletion
Toolchain
from beet import Context, Function
def greet(ctx: Context):
ctx.data["greet:hello"] = Function(["say hello"], tags=["minecraft:load"])
The beet
toolchain makes it easy to create configurable resource packs and data packs by composing pack generators.
- Write simple functions that can edit or inspect the generated resource pack and data pack
- Cache expensive computations and heavy files with a versatile caching API
- Automatically rebuild the project on file changes with watch mode
- Link the project to Minecraft to synchronize the generated resource pack and data pack
Installation
The package can be installed with pip
.
$ pip install beet
You can make sure that beet
was successfully installed by trying to use the toolchain from the command-line.
$ beet --help
Usage: beet [OPTIONS] COMMAND [ARGS]...
The beet toolchain.
Options:
-C, --directory DIRECTORY The project directory.
--version Show the version and exit.
--help Show this message and exit.
Commands:
build Build the current project.
cache Inspect or clear the cache.
init Initialize a new project.
link Link the generated resource pack and data pack to Minecraft.
watch Watch the project directory and rebuild on file changes.
Contributing
Contributions are welcome. This project uses poetry
.
$ poetry install
You can run the tests with poetry run pytest
. We use pytest-minecraft
to run tests against actual Minecraft releases.
$ poetry run pytest
$ poetry run pytest --minecraft-latest
The project must type-check with mypy
and pylint
shouldn't report any error.
$ poetry run mypy
$ poetry run pylint beet tests
The code follows the black
code style.
$ poetry run black beet tests
$ poetry run black --check beet tests
License - MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.