Minestom wiki
Chunk management
This page describes what you need to know about chunks management, more specifically for InstanceContainer

When trying to load a chunk, the instance container does multiple checks in this order:
  1. 1.
    Verify if the chunk is already loaded (stop here if yes)
  2. 2.
    Try to load the chunk from the instance IChunkLoader using IChunkLoader#loadChunk (stop here if the chunk loading is successful)
  3. 3.
    Create a new chunk and execute the instance ChunkGenerator (if any) to it to generate all of the chunk's blocks.
When trying to save a chunk, IChunkLoader#saveChunk is called.

AnvilLoader is the default chunk loader used by all InstanceContainer

Chunk is an abstract class, you can simply create a new class extending it to create your own implementation.
Making your own chunk implementation allows you to customize how you want blocks to be stored, how you want chunks tick to happen, etc...

If you are using a simple InstanceContainer with the default IChunkLoader you will just need to change the instance's chunk supplier
It will be called when a chunk object needs to be provided.
Copy link
Edit on GitHub
On this page
Load/Save Steps
Default behavior
Create your own chunk type
How to make my instance use my implementation