How to pre-generate a Minecraft world with Chunky
When a player walks into land nobody has visited, the server has to create it: terrain, caves, structures, trees. That is the heaviest job a server does, and it is a common cause of lag spikes when players explore or fly with elytra. Pre-generation does that work ahead of time, while nobody is online, so exploring later only has to load existing chunks.
Install Chunky
Chunky is the standard plugin for this. Put it in plugins and restart, see how to install plugins. On Saryno it is a one-click add-on.
The commands
Run these in the console or as an operator:
/chunky world world
/chunky center 0 0
/chunky radius 2000
/chunky start
worldpicks which world to generate. Repeat for the Nether and the End with their names.centeris the middle of the area, in block coordinates. Use your spawn.radiusis how far out from the centre to generate, in blocks.startbegins. Use/chunky progressto see how it is going.
If you need to stop: /chunky pause, then /chunky continue, or /chunky cancel. Chunky remembers the progress and carries on after a restart.
Choosing a radius
The area grows with the square of the radius, so pick carefully.
| Radius | Area | Chunks | Rough disk space |
|---|---|---|---|
| 1000 blocks | 2000 x 2000 | about 15,600 | a few hundred MB |
| 2000 blocks | 4000 x 4000 | about 62,500 | around 1 to 2 GB |
| 5000 blocks | 10,000 x 10,000 | about 390,000 | many GB |
The disk figures are rough and depend on the terrain and the version. A radius of 2000 to 3000 is plenty for most survival servers. Do the most visited areas first, and extend later if you need to.
Match it with a world border
Pre-generating only helps inside the area you generated, so stop players leaving it. A world border does that. The border command takes the diameter, which is twice the radius:
/worldborder center 0 0
/worldborder set 4000
That fits a Chunky radius of 2000. Chunky can also use the existing border as its radius.
When to run it
- When nobody is online. Generation uses a lot of CPU and some memory, and players would feel it.
- Before you open a new server, or before a big event.
- Again later if you grow the border.
It can take from minutes to hours, depending on the radius and the machine, and the progress command shows an estimate.
Memory and storage
A pre-generation run does not need much more memory, but a very large run fills the disk, so check how much space you have first. If you are on a hosted plan, check the storage included in it.
For more ways to cut lag, see how to fix Minecraft server lag.