Skip to main content

The Minecraft pack development kit

Project description

logo

Beet

GitHub Actions PyPI PyPI - Python Version Code style: black

The Minecraft pack development kit.

Introduction

Minecraft resource packs and data packs work well as distribution formats but can be pretty limiting as authoring formats. Without the ability to parametrize or create abstractions over assets and data pack resources, projects and libraries created by the community are greatly limited when it comes to reusability and interoperability.

There's been a lot of attempts at establishing standardized tooling to improve the development experience and it's becoming more and more apparent that the problem space is fundamentally multi-paradigm. Different problems require different solutions, so providing unified cross-project reusability needs to involve an interoperability layer that's sufficiently unopinionated to let all these paradigms shine through.

The beet project is meant to serve as a platform for building a cooperative tooling ecosystem by providing a flexible composition model and a user-friendly development workflow.

Screencasts

Library

Documentation

from beet import ResourcePack, Texture

# Open a zipped resource pack and add a custom stone texture
with ResourcePack(path="stone.zip") as assets:
    assets["minecraft:block/stone"] = Texture(source_path="custom.png")

The beet library provides carefully crafted primitives for working with Minecraft resource packs and data packs.

  • 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

Documentation

from beet import Context, Function

def greet(ctx: Context):
    """Plugin that adds a function for greeting the player."""
    ctx.data["greet:hello"] = Function(["say hello"], tags=["minecraft:load"])

The beet toolchain is designed to support a wide range of use-cases. The most basic pipeline will let you create configurable resource packs and data packs, but plugins make it easy to implement arbitrarily advanced workflows and tools like linters, asset generators and function pre-processors.

  • Compose plugins that can inspect and edit the generated resource pack and data pack
  • Configure powerful build systems for development and creating releases
  • First-class template integration approachable without prior Python knowledge
  • Link the generated resource pack and data pack to Minecraft
  • Automatically rebuild the project on file changes with watch mode

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:
  -d, --directory DIRECTORY  Use the specified project directory.
  -c, --config FILE          Use the specified config file.
  -l, --log LEVEL            Configure output verbosity.
  -v, --version              Show the version and exit.
  -h, --help                 Show this message and exit.

Commands:
  build  Build the current project.
  cache  Inspect or clear the cache.
  link   Link the generated resource pack and data pack to Minecraft.
  watch  Watch the project directory and build on file changes.

Status

You can expect current releases to be pretty stable, but the project as a whole should still be considered alpha.

The main reason is that resource pack and data pack coverage is currently lacking in certain areas. Exposing a consistent interface for every data pack and resource pack feature can involve design decisions that aren't immediately obvious. You're welcome to open an issue to discuss the implementation of currently unsupported resources. And feel free to ask questions, report bugs, and share your thoughts and impressions.

Contributing

Contributions are welcome. Make sure to first open an issue discussing the problem or the new feature before creating a pull request. The 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

We also use pytest-insta for snapshot testing. Data pack and resource pack snapshots make it easy to monitor and review changes.

$ poetry run pytest --insta review

The project must type-check with pyright. If you're using VSCode the pylance extension should report diagnostics automatically. You can also install the type-checker locally with npm install and run it from the command-line.

$ npm run watch
$ npm run check

The code follows the black code style. Import statements are sorted with isort.

$ poetry run isort beet tests
$ 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.

Source Distribution

beet-0.15.0.tar.gz (39.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beet-0.15.0-py3-none-any.whl (48.0 kB view details)

Uploaded Python 3

File details

Details for the file beet-0.15.0.tar.gz.

File metadata

  • Download URL: beet-0.15.0.tar.gz
  • Upload date:
  • Size: 39.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for beet-0.15.0.tar.gz
Algorithm Hash digest
SHA256 ff3ec79312eb3964bb5cb1ca3c2d0b1530e6288271538406f1ec420d0c7e973a
MD5 c2db0353e47176de6d03d789074da706
BLAKE2b-256 def201e17e31e7ac732f30e643351cf5b8caa3adb0d39063b65a2e5864637359

See more details on using hashes here.

File details

Details for the file beet-0.15.0-py3-none-any.whl.

File metadata

  • Download URL: beet-0.15.0-py3-none-any.whl
  • Upload date:
  • Size: 48.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for beet-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bf47242ec74c76c30932e138b56249a855b60fcdf62c0d35b8f97dd83f1d624
MD5 9a2f24eaaff3b3d84a363e59f0ece662
BLAKE2b-256 f73387370786be67ec8c6a81e183ea1b84ed694da4e31ba9ad93fcd42f231549

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page