Worlds
One process, several worlds, loaded and unloaded while the server runs.
Every world is a directory under worlds/. The server loads the default world at startup and can
load or unload the rest at any time, which is what lets a lobby, an arena and a survival map share
a single process.
Adding a world
Copy the directory into worlds/ and restart, or load it at runtime from a plugin:
$manager = $this->getServer()->getWorldManager();
if(!$manager->isWorldLoaded("lobby")){
$manager->loadWorld("lobby");
}
$world = $manager->getWorldByName("lobby");unloadWorld() is the other half. Unloading saves the world and frees the memory its chunks were
holding, which matters when you keep a dozen arena copies around.
Moving players between worlds
$world = $this->getServer()->getWorldManager()->getWorldByName("survival");
if($world !== null){
$player->teleport($world->getSafeSpawn());
}No transfer to another server node, no reconnect, no second IP to keep alive.
World formats
| Format | Support |
|---|---|
| LevelDB | The format Bedrock itself writes. Read and written natively. |
| Anvil and friends | Inherited from PocketMine-MP, upgraded on load. |
| Java Edition worlds | Not compatible. Converting one is a separate tool's job. |
Upgrades are one way
A world written by a much older server version is upgraded on load, which rewrites block and item data. Copy the directory before you open an old world with a new server.
Keeping memory sane
Loaded chunks are the bulk of a running server's memory. If you keep many worlds loaded at once,
lower view-distance, unload the worlds nobody is standing in, and watch the numbers with status
before adding more. See Performance.