One of the biggest sources of lag when it comes to hosting a Minecraft server is chunk generation. Chunks are sections of a world, and when any player walks out to unexplored territory, the game server needs to generate chunks. For a vanilla server, chunk generation is easy.

However, when mods are introduced to the fray, world generation can become a burden. As more mods are added to a server, more mods that add new biomes, biome features, or structures will want to add themselves to the generation step. The server can start to slow down with massive, sprawling features. How can someone combat this type of lag?

The most efficient way is a chunk pregenerator. These work by specifying an area of a world to generate all chunks in, performing all generation tasks in one fell swoop. Now, when players explore a region that has been pregenerated, there will be less lag because now the server just has to load what was created, not creating chunks from scratch.

With that all said, how does one pregenerate chunks? We have written a blog on how to use Chunky to pregenerate chunks, allowing for a configurable way to generate chunks. As a mod, it may not be included in all modpacks, so this may not work for everyone. Is there a quick solution?

The Forge/NeoForge built-in tools

Forge and NeoForge are mod loaders for the most part, but these two have extra tools in place that help more than just modders. For this guide, we will look at the /forge and /neoforge commands, but for the sake of this guide, we will use the /neoforge command. For those using Forge, the command is /forge.

There are a few subcommands under the /neoforge command. The dimensions subcommand can list every dimension that is available. The tps command allows us to see the average Ticks Per Second, or TPS, of each dimension. It can be used to get a quick idea of the performance for each dimension and identify where the server is lagging. Here, let’s go over the generate command, a command that allows for generating chunks.

How to use the generate subcommand

The first command we can use is /neoforge generate help to show a quick guide on how to use this command. It will show available methods of the command.

The /neoforge generate command has 4 usages. The help command was the first usage, but there are more we can use, such as stop, status, and start.

Next, we have /neoforge generate status. When we have a pregenerator running, we can use this command to get the current pregeneration progress and status. We also have /neoforge generate stop to stop the current pregeneration task, just in case we made a mistake or we have enough chunks generated.

Now, for the main command. We can start a pregeneration task using /neoforge generate start. We need two things for this command: the coordinates, and a radius. We format this coordinate as <x> <y> <z>, so for example, we can do 0 64 0 to set the centre of the world as the starting point. Then, we need to specify the radius. This will be how many chunks in either direction that will be generated. A chunk is 16 blocks, so we should keep this in mind. Finally, we can optionally specify a progress bar by saying true or false.

By default, running the command in-game runs the pregenerator in the dimension the user is in. For example, if we run /neoforge generate in the Nether, only chunks in the Nether will be pre-generated. We can specify a dimension by using another command in Minecraft, /execute. This command allows us to run a command with specific conditions, such as /execute in minecraft:overworld run <command> will run our command in the overworld.

A breakdown of the /execute command to run the pregenerator in a specific dimension. This example runs the command in the overworld, but we can specify the Nether, the End, and any other custom dimensions.

The pregeneration task

Once we have started the pregenerator, the task is pretty straightforward. The area of pregeneration is a square, so if our radius is specified to be 10 chunks, the generator will generate from -10,-10 to 10,10. This shape can’t be changed, but it does mean that if a server has a reduced world border, we can pregenerate up to the edge of this world border.

These are a few examples of the generate command. If this grid represents the level we are generating, then the coloured squares will be the area that will be generated based on what command was used. A greater radius will generate more chunks. We can also change the starting point of the command if we want to start elsewhere.

We also can’t pause the pregeneration task, unlike mods like Chunky. If this pregeneration task is interrupted, progress is not saved and it will need to be rerun. Luckily, any chunk that was pregenerated is periodically saved to the world, so while the full task is unable to complete, we can still have some of the progress made. If we rerun that same task again, anything already generated will be skipped, speeding up the process back to where the task was initially.

During pregeneration, make sure there are no players online, or that the only player online is the admin running the pregeneration task. Chunk pregeneration can cause heavy load on the server, so the fewer players are online, the quicker the task can be completed, and the smoother the gameplay experience is.

Advantages of using the Forge and NeoForge commands

Chunk pregenerator mods are an incredibly handy tool to have, but not every modpack will include one. With so many of them out there, it can also be hard to pick a good one. This build-in command provided by Forge and NeoForge serves as a convenient way to pregenerate chunks.

It’s also a simple command both in use and execution. All we have to do is specify the start location, how far out to generate chunks, and let it run. There are no additional settings or preferences, so if all you need to do is pregenerate chunks with no fuss, this command can be handy to have.

Pregenerating chunks on a server

If you ever want to take precautions on a server’s performance, or you’re just getting started and already want to scour the lands, then pregeneration will be the right thing to do. Using this built-in command you can get a large chunk of the world ready to explore as soon as possible.

Especially if you have the adventurous kinds of players on your server, pregeneration will be your friend. Couple this with some of the best server hardware around and you’ll have yourself a server experience so buttery smooth, you can almost glide. Want to try it out for yourself? Get yourself a Minecraft server today by purchasing one of our affordable server plans and get started. Need to make some extra changes? Check out our handy guide on setting up and configuring your own server.