Minestom wiki
Comment on page

Anvil Loader

This page describes how to load a world folder using AnvilLoader

Loading a world using AnvilLoader

In order to load a world into an instance, use the InstanceContainer#setChunkLoader(IChunkLoader) function.
An example of using this method to load a world is:
InstanceContainer.setChunkLoader(new AnvilLoader("worlds/world"));
This will load the world inside of the worlds/world directory into the InstanceContainer, allowing you to use the instance as before but having the world loaded inside.
In order to load a world, the world folder will only need the /region folder, as it contains the block data.

Saving a world

In order to save a world, you will have to use the InstanceContainer#saveChunksToStorage() function, this will only work if you have previously loaded a world into the instance using AnvilLoader.