A powerful Minecraft command library
Project description
Mecha
A powerful Minecraft command library.
Introduction
This package provides a versatile API for generating Minecraft commands in Python. It uses the beet
library to generate functions and integrates natively with the beet
pipeline.
from beet import Context
from mecha import Mecha
def my_plugin(ctx: Context):
mc = ctx.inject(Mecha)
with mc.function("foo"):
mc.say("hello")
You can directly create handles from data pack instances. The library can be used on its own without being part of a beet
pipeline.
from beet import DataPack
from mecha import Mecha
with DataPack(path="demo") as data:
mc = Mecha(data)
with mc.function("foo"):
mc.say("hello")
Installation
The package can be installed with pip
.
$ pip install mecha
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
.
$ poetry run pytest
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 mecha tests
$ poetry run black mecha tests
$ poetry run black --check mecha 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.