Why Pre-generating Chunks is Useful for Performance

If you’re looking to optimize your Minecraft server’s performance and manage your world like a pro, look no further than Chunky. Absolutely necessary for large servers, and still very useful for servers of any size, Chunky can make a massive difference in the experience of everyone playing on the server.

We will be going over Chunky in this article, but there are other chunk pre-generation methods as well. Most are generically named, so just search “pregenerator” or “pre-generator” in Curseforge or Modrinth and you will find many alternatives. Chunky is my favorite, has some of the best documentation, and is one of the most customizable so that’s what we will use for this guide.

In Minecraft, the terrain is separated into sections of 16x16 blocks, from bedrock to high in the sky. These chunks are created when you get close enough in-game. Each chunk generates all vertical blocks in the chunk as well as lighting effects for all of those blocks at the same time. This takes some processing power, and usually many chunks will generate in a short time if a player is exploring. Especially in larger modpacks or when flying through your world very quickly, all of these chunks being generated at once can cause a lot of CPU load all at once, which can create server lag. Pre-generation refers to the process of systematically generating a certain amount of chunks without a player present, whether that’s done by a mod, plugin, or other means.

Chunky, as well as other pre-generation mods and plugins, does all of the hard work of chunk generation up front. This means that while players explore the server afterward, they will not have to generate any chunks as they travel, as long as they are within the area that was pre-generated. With Chunky, you can set a specific area to be pre-generated, and even set a world border to keep players in that area to maximize performance. Or you could generate an area you think will be sufficient and let players explore further if needed.

Minecraft map with lots of unexplored chunks

Look at all that unexplored land. Imagine what secrets it could hold!

Here is the link for all versions of Chunky. You can download Chunky for Forge, Fabric, Neoforge, Bukkit, Folia, Paper, Spigot, and Sponge. If you don't know which version of Chunky to download, it is likely Forge or Fabric, depending on your modpack, or Spigot if you don't have a modpack.

You can also install ChunkyBorder, which allows for custom world borders that adhere to your chunky settings like shape and size. You can find that here.

How to Install Chunky on a Server

Before you can start using Chunky, you need to install it. Chunky runs on both servers and single player worlds. If you run it on a server, you don’t have to install it to your local game. Click this link to see how to add a mod to an existing modpack on a server. Instructions for the plugin version can be found here. The short version of those instructions is to just put the chunky .jar into your mods folder if you’re using Forge or Fabric, or your plugins folder if you’re using any type of plugin server.

How to Pre-generate Chunks

Now that everything is set up, you are almost ready to start generating. You can run these commands in the server console, or in-game. If you want to run these commands in-game, make sure you have OP privileges on the server. Here is how to do that, if you haven't already.

There are many advanced functions and customization options that will not be covered here. If you want more information, be sure to check out the Chunky wiki here.

For this example, I have a Forge 1.20.4 server with Chunky and ChunkyBorder installed. Chunky works basically the same in every version, so these instructions should work for you no matter what version you are using. I will be generating a square with a radius of 5000 blocks, and a world border to match. Here are the steps you can take to follow along:

  1. /chunky center – Sets the center of the area to your player’s location.
  2. /chunky radius 5000 – Sets the radius of the area that will be generated to 5000 blocks.
  3. /chunky shape square – Sets the shape of the area to be square.
  4. /chunky world minecraft:overworld – Tells Chunky to perform the following operation in the overworld. You can use any dimension you want for this, in newer versions of Chunky it will let you tab autocomplete through the different available worlds.
  5. /chunky border add – Adds a border matching the chunky settings set in previous steps. You can specify a different world border shape and size, just follow the autofill options in the command.
  6. /chunky start – Starts the operation. You will see a progress bar at the top of your screen with a percentage complete and a rough time estimate of time remaining. The server will lag during this process. Once the process is complete, the bar will go away.
Minecraft player typing Chunky commands

If you want to pause the operation you can run /chunky pause or /chunky resume. If the server restarts, the operation will pause. You can cancel the operation entirely by running /chunky cancel.

If you want a unique world shape, you can use /chunky shape and choose one of the other options such as star. World borders from ChunkyBorders can conform to these shapes, though they will be invisible, unlike vanilla borders.

If you want to generate dimensions other than the overworld, just run /chunky world <dimension>. For example, running /chunky world minecraft:nether will tell chunky that you want it to operate in the nether dimension. It even supports modded dimensions!

Minecraft map explored in the shape of a star

If you have already generated an area, but you want to generate more later, you can start another generation operation with a larger radius. You can safely generate an area that overlaps with an area that has already been generated, and existing chunks will be skipped.

There are many more options and settings and commands, but those are the basics needed to start pre-generating. Check out the Chunky wiki here for more information on how to use some of the more advanced features.

Performance

While pre-generating your world, Chunky will use a lot of CPU and RAM. It will also take a long time. But it will definitely be faster than manually generating chunks by traveling, and it will be more fun to play without the lag when it’s done generating! You can see how long you have left in the server console on the Akliz website, or in-game with a special progress bar displayed at the top of your screen. Make sure to keep your radius from getting too large. I usually start with a radius of 5000, or 10000 if I’m making a very large world. If you put too large of a number, it could take an extraordinarily long time! I’ve seen some take days or weeks to complete because of the size of the area that was being pre-generated.

Minecraft player waiting for Chunky to finish its task

2 hours and 20 minutes is on the low end of your average Chunky operation.

Timing your pre-generation properly can also make a difference. While the pre-generation operation is running, it will use all server resources available to generate chunks as quickly as possible. I recommend running the pre-generation while players are offline. You could use the Akliz scheduled commands feature to pause and unpause Chunky so that it only runs at times when the least amount of players are online.

To do this, simply navigate to the “Scheduled Tasks” link in your server’s console page, and create a daily task for the command chunky resume at night or at the end of the popular hours for your server, then another daily task for the command chunky pause at the start of the popular hours for your server. This will make it so the pre-generation doesn’t cause lag for all of the server’s players during peak gaming hours. Note that there is no / in the above commands, since all scheduled commands run in the server console, and server console commands do not use a /.

If you want to make Chunky automatically resume an operation when the server restarts, you can change that in the Chunky config file. That would be in /modpack-name/config/chunky/config.json. The line you want to change is:

{
"continueOnRestart": false
}

You’ll want to change that to true. Now it will continue even if the server has a scheduled or automatic restart while it’s going.

Now that you have your chunks generated, map mods can immediately make use of those generated chunks, even if players haven’t been to those chunks. For example, with Dynmap, you can use the command /dynmap fullrender to make Dynmap generate map tiles for all of your newly generated chunks. This will also take a long time, but not nearly as long as the actual chunk generation.

Wrapping Up

There is a lot more to Chunky than what I’ve talked about here, but this will give you a good idea on how to start, especially if you don’t need any fancy options. If you do want to read more about the more advanced features, check out the Chunky wiki here.

Chunky is great for Minecraft servers of all sizes, and I use it on nearly every server I make. Especially with a world border, Chunky can eliminate virtually all chunk generation lag while exploring.

If you’re looking to get the best server performance possible, Chunky is a great way. But an even better way is to get a server from Akliz! Put the two together and you’ll have the fastest server on the block.