-
Notifications
You must be signed in to change notification settings - Fork 5
Using MPL from the command line
The MPL compiler can not only be used from the GUI of the built in IDE, but also from the command line. This can be done by running the MPL jar-file from the command line with additional arguments:
java -jar MPL.jar [options] <src-file>
You can for example run java -jar MPL-version.jar --help
to get more information on the possible options:
java -jar mpl-compiler-1.2.1-standalone.jar -h
Usage: java -jar MPL.jar [options] <src-file>
Options:
-h, --help
Print information about the commandline usage
-c, --option
Specify compiler options; for instance: debug or transmitter
-o, --output
Specify an output file
Default: stdout
-t, --type
Specify the output type
Default: structure
Possible Values: [structure, command, schematic, cbse, filter]
-v, --version
Specify the target Minecraft version
Default: 16w32a (1.11+)
With this option you can specify additional compiler options. Currently there are three options:
- debug - see Debugging MPL
- delete-on-uninstall delete all command blocks after uninstalling
- transmitter - this option tells the compiler to use redstone blocks instead of the nbt auto
Multiple options are seperated by comma: java -jar MPL-version.jar -c debug,transmitter
With this option you can specify the output file. By default the output will be printed to standard out.
Example: java -jar MPL-version.jar -o testFile.nbt
With this option you can specify the output type. Currently there are five options:
- structure - Creates a structure file that can be imported using a structure block. This is the default type
- schematic - Creates a schematic file
- command - Creates a command that can be used to generate the structure from a command block
- cbse - Creates a CBSE-Project (Command Block Structure Editor)
- filter - Creates a python file that can be used as an MCEdit filter
Example: java -jar MPL-version.jar -t command
With this option you can specify the target Minecraft version. This defaults to the newest supported version. Be careful, because this might include snapshots of future Minecraft versions. Because most versions do not change Minecraft significantly there are only a few versions implemented in MPL. If the specified version is not supported directly you will be told what implementation is used on the command line. Example:
java -jar MPL-version.jar -v 1.10 ...
Falling back to version 15w35a (1.9)
...
java -jar MPL-version.jar -v 16w39c
Falling back to version 16w32a (1.11)