Package: endermite
endermiteA high-level, opinionated python framework for buildingMinecraft data packs.🚧 This is a huge work in progress 🚧IntroductionMinecraft data packsmake 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.fromendermiteimportComponentfromendermite.decoratorsimportpublic,tickclassHello(Component):"""Output `Hello, world!` each tick when attached to an entity."""@tick@publicdefsay_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 withMonoBehaviourscripts if you've worked with the Unity game engine.InstallationMake sure that you're using Python 3.7 or above. You can install endermite withpip.$pipinstallendermiteYou can check that endermite is correctly installed by trying to use the command-line interface shipped with the package.$ender--versionGetting startedThe easiest way to get started with endermite is to get familiar with the command-line workflow. You can use endermite without it but theenderCLI will usually allow you to be much more productive.$ender--help
Usage:ender[OPTIONS]COMMAND[ARGS]...Command-lineutilitytomanageendermiteprojects.

Options:--versionShowtheversionandexit.--helpShowthismessageandexit.

Commands:buildBuildalltheprojectsofthecurrentworld.initCreateanewendermiteproject.Creating a new projectTheenderCLI lets you create an endermite project inside of a Minecraft world folder by running theinitcommand. Note that you can create as many endermite projects as you want in the same world.$enderinit
endermitevX.X.X

Creatingendermiteproject.

Projectname[testing_endermite]:tutorial
Projectdescription[Anendermiteproject]:
Projectauthor[N/A]:
Projectversion[0.1.0]:

Abouttocreate.../.minecraft/saves/testing_endermite/@endermite/tutorial.

Isthisok?[Y/n]:

Done!The project created by theenderCLI is simply a python package that exports an endermiteProjectobject.Building your endermite projectsYou can use thebuildcommand to build all the projects you created in a specific Minecraft world. The command will output the corresponding data packs in thedatapacksdirectory.$enderbuild
endermitevX.X.X

Buildingendermiteprojects.

Attemptingtobuild"tutorial"...
Done!(tookX.XXXs)Running thebuildcommand with the--watchoption will rebuild your projects whenever you make modifications to the@endermitedirectory. It lets you forget about having to run thebuildcommand manually.$enderbuild--watch
endermitevX.X.X

Buildingendermiteprojects.

Watchingdirectory.../.minecraft/saves/testing_endermite/@endermite.

HH:MM:SSXchangesdetected

Attemptingtobuild"tutorial"...
Done!(tookX.XXXs)Remember that you still need to run/reloadin-game.ContributingContributions are welcome. Make sure that Python 3.7 or newer is installed and create a virtual environment in the project directory.$python-mvenvenvThis will create a virtual environment in theenvdirectory. If you're not familiar with virtual environments, please check out theofficial documentation. You can now activate the virtual environment.# Windows$env\Scripts\activate.bat# Unix or MacOS$sourceenv/bin/activateRemember to activate the virtual environment every time you work on the project! Let's install the dependencies for theendermitepackage and the necessary development dependencies.(env)$pipinstall-U-rrequirements.txt-rrequirements.dev.txtYou should now be able to lint the source code and to run the tests withtox.(env)$toxThe project relies onpylintandpytestfor linting and testing. If you're not familiar with these tools, you can check out their respective documentation.License -MIT