Skip to main content

endermite

Build Status PyPI Version Python Version

A high-level, opinionated python framework for building Minecraft data packs.

🚧 This is a huge work in progress 🚧

Introduction

Minecraft data packs make it possible for anyone to customize the game by writing bits of JSON and a few functions. The underlying format is simple and straight-forward, making it easy to parse, but it hasn't been created with a specific developer experience in mind. When you sit down in front of your text editor, it can be hard to figure out how you're supposed to make use of the available features to do what you want to do.

Endermite is a python framework that combines and exposes data pack features through a layer of abstraction. It aims to make it easier to develop, encapsulate and compose behavior by providing a component-based approach.

from endermite import Component
from endermite.decorators import public, tick

class Hello(Component):
    """Output `Hello, world!` each tick when attached to an entity."""

    @tick
    @public
    def say_hello(self):
        self.say('Hello, world!')

Components are coupled pieces of state and behavior that can be attached to entities. They're conceptually similar to what you might be used to with MonoBehaviour scripts if you've worked with the Unity game engine.

Installation

Make sure that you're using Python 3.7 or above. You can install endermite with pip.

$ pip install endermite

You can check that endermite is correctly installed by trying to use the command-line interface shipped with the package.

$ ender --version

Getting started

The easiest way to get started with endermite is to get familiar with the command-line workflow. You can use endermite without it but the ender CLI will usually allow you to be much more productive.

$ ender --help
Usage: ender [OPTIONS] COMMAND [ARGS]...

  Command-line utility to manage endermite projects.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  build  Build all the projects of the current world.
  init   Create a new endermite project.

Creating a new project

The ender CLI lets you create an endermite project inside of a Minecraft world folder by running the init command. Note that you can create as many endermite projects as you want in the same world.

$ ender init
endermite vX.X.X

Creating endermite project.

Project name [testing_endermite]: tutorial
Project description [An endermite project]:
Project author [N/A]:
Project version [0.1.0]:

About to create .../.minecraft/saves/testing_endermite/@endermite/tutorial.

Is this ok? [Y/n]:

Done!

The project created by the ender CLI is simply a python package that exports an endermite Project object.

Building your endermite projects

You can use the build command to build all the projects you created in a specific Minecraft world. The command will output the corresponding data packs in the datapacks directory.

$ ender build
endermite vX.X.X

Building endermite projects.

Attempting to build "tutorial"...
Done! (took X.XXXs)

Running the build command with the --watch option will rebuild your projects whenever you make modifications to the @endermite directory. It lets you forget about having to run the build command manually.

$ ender build --watch
endermite vX.X.X

Building endermite projects.

Watching directory .../.minecraft/saves/testing_endermite/@endermite.

HH:MM:SS X changes detected

Attempting to build "tutorial"...
Done! (took X.XXXs)

Remember that you still need to run /reload in-game.

Contributing

Contributions are welcome. Make sure that Python 3.7 or newer is installed and create a virtual environment in the project directory.

$ python -m venv env

This will create a virtual environment in the env directory. If you're not familiar with virtual environments, please check out the official documentation. You can now activate the virtual environment.

# Windows
$ env\Scripts\activate.bat

# Unix or MacOS
$ source env/bin/activate

Remember to activate the virtual environment every time you work on the project! Let's install the dependencies for the endermite package and the necessary development dependencies.

(env) $ pip install -U -r requirements.txt -r requirements.dev.txt

You should now be able to lint the source code and to run the tests with tox.

(env) $ tox

The project relies on pylint and pytest for linting and testing. If you're not familiar with these tools, you can check out their respective documentation.


License - MIT

Release files for endermite 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for endermite 0.0.7
File Size Uploaded
endermite-0.0.7.tar.gz 16.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for endermite 0.0.7
File Interpreter ABI Platform
endermite-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 35.8 kB

Release files / endermite-0.0.7.tar.gz

Download URL endermite-0.0.7.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
53f79b2a1187cf8ee218be1e68c6ef857a5bab82d1f8122211def8f6872e9096
BLAKE2b-256 checksum
How to use checksums
0703aa59f03227a746a896bf181c6523cbbc8a5d2041848a03a4723c39407af0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.1

Release files / endermite-0.0.7-py3-none-any.whl

Download URL endermite-0.0.7-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f5e5cb19632fb649e308788b3dcb1e1a855637a31b145f80b66e8deea86da08
BLAKE2b-256 checksum
How to use checksums
5d18295c70e90d00410ea01c806c7ac5008827c7a8f605a82c7aaca9f52c84b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page