A niche little compiler made in python that will go through all your addon files and compile them to an output (such as com_mojang folder) and watch for any changes to compile them instantly!
-
Automatic manifest generation. It will check what you have, such as scripts, and add it to the manifest automatically!
-
Optimized outputs. Removes blank lines, and ignores comments in files. (excluding scripts)
-
Pretty fast. I tested the compiler on a personal project that has about 2000~ varying files, and compiled them all in about 3 seconds!
-
Convert jpeg and webp to png. The compiler will automatically convert jpeg and webp images to png!
-
Automatic texture defining. The compiler can go through all your textures and place them in
item_texture.json
automatically with no need to do it manually. (the texture definition will be the filename, works also for blocks, and texture list) -
Build projects into addons easily! Can compile all your files and then neatly place them into an mcaddon file!
-
Search & Replace words/characters. Use
searcher.json
and insert a keyword to find in each file and replace.
Create a config.json
file at the root directory of your project and set it up:
You can use this example config
Please note that the actual config cannot have comments, and the compiler will fail if you try run it with a commented config
Next create a python script at the root directory of your project, and imort mcpy_compiler
, you may tinker with it, but if you want to just get to it call mcpy_compiler.run()
and it will do everything you need it to do!
from mcpy_compiler import mcpy_compiler
mcpy_compiler.run()
To build a project:
from mcpy_compiler import mcpy_compiler
mcpy_compiler.build(True, True)
If you run into any problems please create a github issue!
- This might work on mac and linux although I can't make any promises, as long as you have the
output
set to something else other than@com_mojang
. - Sometimes a file might compile twice in one go.
- Only webp and jpg/jpeg images will be converted to png.
- The output is erased before new files are compiled into it.