How to Pregenerate a Minecraft World with Chunky
Pregenerate your Minecraft world with Chunky on Paper, then limit it with a border: size, monitoring, resuming after a stop, rollback and troubleshooting.
On this page
When players explore new areas, the server has to create the terrain during the game, which often causes slowdowns. Chunky generates this terrain in advance. A border then prevents players from leaving the prepared area.
This guide follows on from Install and Update Plugins on Paper. It reuses the /opt/minecraft/server folder, the minecraft.service service and the mc-console command.
By the end of this guide, you will have:
- all three dimensions pregenerated over the area you chose
- a border in place in each dimension
- a method to monitor, interrupt and resume generation
Prerequisites
- A Paper server with
mc-console, set up with the Paper guide - Chunky installed. This plugin is used as the example in the Install from Hangar section of that guide
- SSH access with a user that has
sudoprivileges - Free disk space for the generated world and for a backup
Check that Chunky is loaded:
sudo mc-console pluginsChoose the Size
Chunky works with a radius in blocks around a center. The worldborder command, on the other hand, expects a diameter, which is twice the radius.
| Radius | Border (diameter) | Chunks to process, approx. |
|---|---|---|
| 1,000 | 2,000 | 16,000 |
| 2,500 | 5,000 | 99,000 |
| 5,000 | 10,000 | 393,000 |
| 10,000 | 20,000 | 1,565,000 |
Start small: you can enlarge the area later, and Chunky will skip the chunks that already exist. This guide uses a radius of 5000 in the overworld, and 2500 in the Nether and the End. Adjust these values to your disk and processor.
Also generate a margin of 200 blocks beyond the border. A player standing against it still loads the chunks behind it, within their render distance: with view-distance=10, that represents 160 blocks.
Back Up the Server
Stop the server, check the available space and create an archive:
sudo systemctl stop minecraft.service
sudo du -sh /opt/minecraft/server
df -h /opt/minecraft
sudo mkdir -p /opt/minecraft/backups
sudo tar -czf /opt/minecraft/backups/avant-chunky-$(date +%F-%H%M).tar.gz -C /opt/minecraft server
sudo ls -lh /opt/minecraft/backups
sudo systemctl start minecraft.serviceWait until the server is ready before continuing:
sudo journalctl -u minecraft.service -fExit the log view with Ctrl+C after the Done line.
Check the Center and the Current Border
Query the overworld spawn point and the state of the border:
sudo mc-console chunky world minecraft:overworld
sudo mc-console chunky spawn
sudo mc-console worldborder getThe second command displays Center changed to X, Z. Note these values: this guide uses 0 0, so replace them with yours to center the area on the spawn point.
A default border is 59999968 blocks wide. If yours is smaller than the planned area, enlarge it before generating, for the reason given above.
Start the Pregeneration
If possible, run the generation with no players connected, and temporarily disable map plugins such as Dynmap or BlueMap. First, reduce the frequency of messages, which is one line per second by default:
sudo mc-console chunky quiet 30
sudo mc-console chunky start minecraft:overworld square 0 0 5200The arguments are, in order: the world, the shape, the X and Z center, then the radius. The logs should show Task started in minecraft:overworld.
Follow the progress:
sudo journalctl -u minecraft.service -f | grep --line-buffered ChunkyEach line shows the number of chunks processed, the percentage, the estimated time remaining and the speed in chunks per second. Exit the log view with Ctrl+C: the generation keeps running. You can also request the status at any time:
sudo mc-console chunky progressKeep an eye on the disk during the first few percent, then from time to time:
df -h /opt/minecraft
sudo du -sh /opt/minecraft/server/worldGenerate the Nether and the End
When the Task finished for minecraft:overworld line appears, start the other dimensions, one after the other:
sudo mc-console chunky start minecraft:the_nether square 0 0 2700sudo mc-console chunky start minecraft:the_end square 0 0 2700Interrupt and Resume
| Action | Command |
|---|---|
| Pause and save progress | sudo mc-console chunky pause |
| Resume | sudo mc-console chunky continue |
| View progress | sudo mc-console chunky progress |
| Cancel permanently | sudo mc-console chunky cancel, then sudo mc-console chunky confirm |
A normal server stop saves progress, but the task does not restart on its own. Type chunky continue after the restart, or enable automatic resume:
sudo -u minecraft sed -i 's/^continue-on-restart: .*/continue-on-restart: true/' /opt/minecraft/server/plugins/Chunky/config.yml
sudo mc-console chunky reloadCanceling a task does not erase the chunks already generated.
Set the Border
When all tasks are finished, set the border. From the console, commands apply to the overworld:
sudo mc-console worldborder center 0 0
sudo mc-console worldborder set 10000Each dimension has its own border, so use execute in for the other two:
sudo mc-console execute in minecraft:the_nether run worldborder center 0 0
sudo mc-console execute in minecraft:the_nether run worldborder set 5000
sudo mc-console execute in minecraft:the_end run worldborder center 0 0
sudo mc-console execute in minecraft:the_end run worldborder set 5000If your world already has a border, chunky worldborder directly reuses its center and radius for the next task. The ChunkyBorder add-on allows round borders and other shapes.
Verify the Result
sudo mc-console chunky progress
sudo mc-console worldborder get
sudo mc-console execute in minecraft:the_nether run worldborder get
sudo mc-console execute in minecraft:the_end run worldborder get
sudo du -sh /opt/minecraft/server/worldYou should get No tasks running, then The world border is currently 10000 block(s) wide for the overworld and 5000 for the other two dimensions. Then connect and approach the border: the terrain should appear without slowdowns, and the logs should not fill up with Can't keep up! messages.
Roll Back
To remove a border, give it back its default size:
sudo mc-console worldborder set 59999968To get the world back as it was, restore the archive created at the beginning. Replace the file name with the one shown by ls:
sudo systemctl stop minecraft.service
sudo ls -lh /opt/minecraft/backups
sudo mv /opt/minecraft/server /opt/minecraft/server-echec
sudo tar -xzf /opt/minecraft/backups/avant-chunky-YYYY-MM-DD-HHMM.tar.gz -C /opt/minecraft
sudo systemctl start minecraft.serviceThis rollback erases everything built since the backup. If players have kept playing, you can instead delete the chunks outside the area with chunky trim minecraft:overworld square 0 0 5200, then chunky confirm. This deletion is irreversible: make a new backup first, and fully restart the server afterwards.
Troubleshooting
sudo journalctl -u minecraft.service -n 200 --no-pager | grep -iE 'chunky|error|exception'"World minecraft:the_nether not found. Available worlds: …"
This world is not loaded, or its name is different. Use a name from the list displayed. If the Nether or the End is missing, check allow-nether in server.properties and allow-end in bukkit.yml.
"Task already started for …"
A task is already running in this world. Follow it with chunky progress, or cancel it if you want to change the area.
"A task was already started for this world"
An interrupted task has been saved. Type chunky continue to resume it, or chunky confirm to replace it with the new one.
"No tasks to continue."
No saved task exists. The previous one has finished or been canceled. Check the desired area and run chunky start again: chunks that already exist will be skipped.
Generation is slow or the server lags
- The
Can't keep up!message is common during intensive generation. Pause it when players are connected - Speed depends mainly on the processor, the disk and the memory. Chunky recommends an SSD and at least 4 GB of memory
- Test without non-essential plugins and data packs: some of them slow down or block generation
"OutOfMemoryError: Java heap space"
The server is running out of memory. Increase -Xmx on the ExecStart line of /etc/systemd/system/minecraft.service, without exceeding the available memory, then apply the change and resume the task:
sudo systemctl daemon-reload
sudo systemctl restart minecraft.serviceWait for the Done line, then run sudo mc-console chunky continue.
"No space left on device"
The disk is full. Stop the server, free up some space, then check the world when it restarts. If the logs report corrupted chunks, restore your backup.
No animals in a generated area
The area was generated while a border or max-world-size was smaller. Restore the backup, or delete these chunks with chunky trim and generate them again with a large enough border.
To go further, see the Chunky wiki, especially its Commands and World borders pages.