How to pregenerate your world with Chunky
When a player explores new ground, the server has to create it on the spot: terrain, caves, structures and lighting. That is one of the heaviest jobs it ever does, and it is a major cause of lag spikes on busy servers. Pregenerating means doing that work ahead of time, in the quiet hours, so exploring later costs almost nothing. The usual tool is a plugin called Chunky.
Why it helps
Creating a new chunk takes far more effort than loading one that already exists. If several players run in different directions at once, the server struggles to keep up and the tick rate drops. With the world already generated, the server only has to read files from disk.
It also lets you set a world border with confidence, because you know the whole area exists and has been checked for problems.
What to know before you begin
- It uses a lot of CPU while running. Do it when nobody is online, or at least when few players are.
- It uses disk space. A rough guide: a world covering a 5,000 block radius is around 10,000 by 10,000 blocks across, which is a few hundred region files. Expect on the order of a couple of gigabytes, varying with the terrain. Check your free space first, and see What the CPU, memory and disk numbers on your server mean.
- It does not generate structures you have not enabled, and it does not change existing builds. It only creates chunks that do not exist yet.
- Take a backup first. See Creating and restoring backups.
Chunky works on Paper, Purpur, Fabric, Forge and other common server software. Download the build for your type from its official page.
Running it
Upload Chunky to the plugins folder, or the mods folder for a modded server, then restart. After that, the commands are:
/chunky world world
/chunky center 0 0
/chunky radius 5000
/chunky start
These pick the world, set the centre of the area, set the radius in blocks and begin. Chunky prints progress as it runs, and you can check at any time:
/chunky progress
/chunky pause
/chunky continue
/chunky cancel
If the server restarts in the middle, Chunky remembers where it was and resumes. You can leave it running overnight.
Choosing the radius
The right size depends on your players:
| Players | Sensible radius | Why |
|---|---|---|
| A few friends | 2,000 to 3,000 blocks | More land than they will explore in weeks |
| A small community | 4,000 to 6,000 blocks | Room for several bases and trips |
| A large survival server | 8,000 blocks and up | Bigger needs more time and disk |
Start smaller than you think you need. You can always extend it later, and it is much easier than clearing out land nobody visits.
You should also do the Nether and End separately if they matter to your players, by choosing those worlds in the same way. The Nether is much smaller in distance terms, because one block there equals eight in the overworld, so a small radius covers a lot.
Tie it to a world border
Once the world is generated, set a border at the same size so players cannot wander into un-generated land:
/worldborder center 0 0
/worldborder set 10000
The number is the full width, so a radius of 5,000 uses 10,000. Chunky can also set the border for you with /chunky worldborder. See How to set a world border and spawn for the details.
Keeping the server healthy while it runs
- Watch the tick rate and memory. If the server struggles, pause and continue later. Understanding TPS and MSPT explains what to look for.
- Do not run it alongside a heavy plugin task, such as a large backup.
- Check the console for errors. A broken structure or corrupt region is better found now than by a player.
After it finishes
Take a fresh backup of the pregenerated world. It is a good clean copy, and restoring from it is quicker than regenerating. And if lag returns later, that is probably something else. How to fix server lag walks through the usual causes.
Still stuck? Open a ticket on Discord - run /ticket in any channel, pick a department, and include your Server ID or Invoice ID so we can jump straight in.