/mcexplore

Use a Minecraft server to generate a square of land

Primary LanguagePythonOtherNOASSERTION

Use a Minecraft server to generate a square of land.

Overview

mcexplore uses a Minecraft server to generate a square land of a specified size, measured in chunks (16x16 blocks) or regions (32x32 chunks).

Requirements

This script requires Python 3 and Twoolie’s NBT library.

Install

On Arch Linux, you can use the AUR to download, build, and install the mcexplore package in the usual way. You will also need to do the same for its dependency, the python-nbt package.

On other distributions, search your package manager for python nbt. If a package for Twoolie’s NBT library is available, install it. Then, download mcexplore.py and make it executable.

On distros that don’t have a package for Twoolie’s NBT library, you should be able to create a python virtualenv, use pip to install the python nbt module into it, then download and install mcexplore. To do that, start by downloading and installing virtualenv through your package manager. Typically the package is called python-virtualenv or python3-virtualenv.

Then, create a new python virtualenv

virtualenv -p python3 ~/venv/python3

Install the nbt module

~/venv/python3/bin/pip install nbt

Download mcexplore and make it executable

wget https://raw.githubusercontent.com/DMBuce/mcexplore/master/mcexplore.py
chmod +x mcexplore.py

Update the shebang in the script so that it uses the python interpreter in the virtualenv.

sed -i "1s,^#\!.*,#\!$HOME/venv/python3/bin/python," mcexplore.py

You can, of course, move the script somewhere inside your PATH if you prefer not to have to type the full path when calling it.

Usage

Always take a backup before running mcexplore against your world.

Recent server jars require agreeing to the Minecraft End User License Agreement (EULA). You can agree to the EULA by setting eula=true in eula.txt. If mcexplore exits with an error about the EULA despite using an old server jar that does not require it, make sure eula.txt is not in your server folder.

If you’re generating a custom dimension with a data pack, make sure that you can load the dimension with e.g. /execute in namespace:dimension_id run teleport @p ~ ~ ~, then shut the server down before running mcexplore.

If mcexplore is in your PATH, your server jar is named minecraft_server.jar, and you want to pregenerate 63x63 chunks (1008x1008 blocks) centered on spawn, you can run

mcexplore 63

To generate the land centered on (0, 0) instead of spawn,

mcexplore -x 0 -z 0 63

To do the same in the Nether or The End,

mcexplore -d minecraft:the_nether=world/DIM-1/region -x 0 -z 0 63
mcexplore -d minecraft:the_end=world/DIM1/region -x 0 -z 0 63

To do the same in a custom Melon dimension created by a data pack,

mcexplore -d melon:the_melon=world/dimensions/melon/the_melon/region -x 0 -z 0 63

To do the same in a more verbose way,

/path/to/mcexplore -v -p /path/to/server -c "java -jar minecraft_server.jar nogui" -d melon:the_melon=world/dimensions/melon/the_melon/region -x 0 -z 0 63 63

Documentation

The available command line options and arguments can be viewed in mcexplore’s help output with mcexplore --help, its manual page with man ./mcexplore.1, or in a browser at https://dmbuce.github.io/mcexplore/mcexplore.1.html .

Project documentation can be found in these files:

  • LICENSE - Terms and conditions

  • README - This document

The changelog can be viewed on GitHub at https://github.com/DMBuce/mcexplore/releases .