Instead of mounting the
/data volume, you can instead specify the URL of a ZIP or compressed TAR file containing an archived world. It will be searched for a file
level.dat and the containing subdirectory moved to the directory named by
$LEVEL. This means that most of the archived Minecraft worlds downloadable from the Internet will already be in the correct format.
docker run -d -e WORLD=http://www.example.com/worlds/MySave.zip ...
This URL must be accessible from inside the container. Therefore, you should use an IP address or a globally resolvable FQDN, or else the name of a linked container.
If the archive contains more than one
level.dat, then the one to select can be picked with
WORLD_INDEX, which defaults to 1.
Cloning world from a container path¶
WORLD option can also be used to reference a directory, zip file, or compressed tar file that will be used as a source to clone or extract the world directory.
For example, the following would initially clone the world's content from
/worlds/basic. Also notice in the example that you should use a read-only volume attachment to ensure the clone source remains pristine.
The following diagram shows how this option can be used in a compose deployment with a relative directory:
Overwrite world on start¶
The world will only be downloaded or copied if it doesn't exist already. Set
FORCE_WORLD_COPY=TRUE to force overwrite the world on every server start.
Custom worlds directory path¶
To set a custom worlds directory for the Multiverse plugin on a baremetal server, you'd pass the
--world-dir argument after the jar file.
In order to accomplish the same in a containerized server, set the
EXTRA_ARGS environment variable in your command line or docker compose yaml to the same argument string. For example:
--universeare aliases to
--world-dirand can also be used.
Datapacks can be installed in a similar manner to mods/plugins. There are many environment variables which function in the same way they do for mods:
DATAPACKS: comma-separated list of zip file URL, zip file in container, or directory in container
DATAPACKS_FILE: a text file within the container where each line is a zip file URL, zip file in container, or directory in container
REMOVE_OLD_DATAPACKS: if "true" the datapacks directory is removed of everything matching
REMOVE_OLD_DATAPACKS_INCLUDE, but excluding
REMOVE_OLD_DATAPACKS_EXCLUDEno deeper than
REMOVE_OLD_DATAPACKS_DEPTH: default is 16
REMOVE_OLD_DATAPACKS_INCLUDE: default is
REMOVE_OLD_DATAPACKS_EXCLUDE: default is empty
Datapacks will be placed in
VanillaTweaks datapacks, crafting tweaks, and resource packs can be installed with a share code from the website OR a json file to specify packs to download and install. Datapacks and crafting tweaks will be installed into the current world directory specified by
$LEVEL. As new versions of the packs are retrieved the previous versions will automatically be cleaned up.
The share code is the part following the hash sign, as shown here:
VANILLATWEAKS_FILE: comma separated list of JSON VanillaTweak pack files accessible within the container
VANILLATWEAKS_SHARECODE: comma separated list of share codes
Example of expected VanillaTweaks share codes:
ResourcePacks, DataPacks, and CraftingTweaks all have separate sharecodes
Example of expected VanillaTweaks files: