Mine Hour logo

View-distance in Minecraft: chunks, lag and pre-generation

View-distance and simulation-distance explained: how many chunks each player loads, how to measure TPS and pre-generate the map with Chunky to put an end to exploration lag.

· 6 min read

the sun shines through the clouds over a vineyard

View-distance in Minecraft: chunks, lag and pre-generation

Your server runs smoothly with everyone at the base. Then someone puts on an elytra, flies 2,000 blocks and the chat turns into a chorus of "it's lagging". The culprit is almost never the internet or the RAM: it's the work of generating and loading chunks that the server does on the spot. This guide is about that — understanding distances, measuring the problem and pre-generating the world before players step on it.

Why chunks are the bottleneck

A chunk is a 16×16 block column. The server needs to generate the terrain (biome, elevation, caves, structures), save it to disk and send it to clients. Each player makes the server keep a square area loaded around them: (2 × distance + 1)² chunks.

Distance

Chunks per player

4

81

6

169

8

289

10

441

12

625

16

1,089

32

4,225

Notice that doubling the distance doesn't double the cost: it multiplies it by four. Five friends at distance 12 already means more than 3,000 chunk positions to manage — and, if they're exploring, many of them don't exist yet and need to be generated from scratch.

Generating new terrain is one of the heaviest tasks in the game. That's when the classic appears in the console:

[Server thread/WARN]: Can't keep up! Is the server overloaded? Running 3421ms or 68 ticks behind

This warning means the server didn't finish the work within the 50 ms of each tick. In practice: blocks that take a while to break, mobs teleporting and rubber-banding.

view-distance x simulation-distance

These two options are confused all the time, and changing the wrong one solves nothing.

  • view-distance: how much terrain information the server sends to the client. Lowering this saves bandwidth, RAM and sending processing, but leaves the horizon shorter.
  • simulation-distance: how far the server processes the game — mobs walking, redstone, plant growth, spawning. In Java it has existed separately since 1.18, with a default of 10 and a maximum of 32.

Both are in server.properties, at the server root:

# quanto terreno o servidor manda para os jogadores
view-distance=8

# até onde o jogo é simulado de verdade
simulation-distance=6

Rule of thumb: lower the simulation-distance first. It usually gives the biggest relief per unit of "lag" removed and mainly affects farms and automated farms. The view-distance affects the visual experience — below 6 the world starts to look like it has permanent fog.

If your server is Paper, both values still apply in server.properties.

Measure before changing

Changing settings in the dark is a lottery. Install spark (plugin for Paper/Spigot, mod for Fabric/Forge) and look at the numbers during the problem, not after:

/spark tps
/spark profiler start
# ...deixe o lag acontecer por 30 segundos...
/spark profiler stop
/spark health

/spark tps shows TPS and MSPT (milliseconds per tick). Quick reference:

  • 20 TPS / ~50 ms per tick: healthy
  • below 18 TPS: players already feel it
  • below 15 TPS: unacceptable

The profiler report tells you whether time is going to entities, chunks, redstone or plugins. Chunk loading appearing at the top during exploration is the signature of the problem this post solves.

Pre-generating the world with Chunky, step by step

Chunky is the de facto standard for generating the map before players. The idea is simple: pay the generation cost all at once, with the server empty, instead of spreading that cost over the people playing.

  1. Install Chunky. Download the version corresponding to your server type (plugin for Paper/Spigot, mod for Fabric/NeoForge) and put it in plugins/ or mods/.
  2. Define the world to be generated: /chunky world world.
  3. Define the center (usually the spawn): /chunky center 0 0.
  4. Define the radius you want, in blocks: /chunky radius 3000.
  5. Choose the shape — a circle yields more useful terrain per generated chunk: /chunky shape circle.
  6. Start: /chunky start.
  7. Monitor: /chunky progress. If you need to stop, /chunky pause and then /chunky continue.

From the console, without being logged into the game, just remove the slash:

chunky radius 3000
chunky shape circle
chunky start

It's worth doing the math beforehand: a radius of 3,000 blocks in a circle gives about 110 thousand chunks; 5,000 blocks exceed 300 thousand. Expect from tens of minutes to a few hours, depending on the CPU, and a few gigabytes of disk. Run it during off-peak hours, with the server empty — pre-generating with people online is trading one lag for another.

If you use hourly hosting, this is quite cheap: start the server only for pre-generation, let Chunky run and shut it down afterward. On Mine Hour the server pauses automatically when the last player leaves, so idle time doesn't weigh on the bill.

The world border is what closes the loop

Pre-generating without defining a border is a waste of time: the next day someone flies farther and the lag comes back. After generating, lock the area:

/worldborder center 0 0
/worldborder set 6000
/worldborder get

The /worldborder set uses diameter in blocks — 6,000 means 3,000 blocks on each side from the center. Make the border a little smaller than the pre-generated area, so that no one reaches the edge of the already-generated terrain.

If you generated too much and want to trim it down, Chunky has trim, which removes chunks outside a defined radius. Always back up the world beforehand.

Fine-tuning in Paper

With the base ready, you can refine it. Paper splits settings into config/paper-global.yml and config/paper-world-defaults.yml — the names of some sections change between versions, so check the file generated by your build before editing.

# config/paper-world-defaults.yml (trecho ilustrativo: confira as chaves no seu arquivo)
chunk-loading:
  autoconfig-send-distance: true
  target-player-chunk-send-rate: 100.0
  max-concurrent-sends: -1
  • chunk-loading controls the chunk sending queue. Limiting the rate avoids spikes when several players move at the same time.
  • Mob spawn limits are in entities.spawning.spawn-limits (in bukkit.yml on older versions). Fewer mobs per chunk = fewer entities per tick.
  • /gamerule randomTickSpeed 3 is the default. High values speed up plant growth and ice melting, and cost CPU.

Java flags and RAM: the adjustment that doesn't replace the others

Allocating too much RAM doesn't fix a CPU bottleneck. That said, if you control how Java starts, Aikar's flags remain the starting point for Paper servers, with -Xms equal to -Xmx:

java -Xms6G -Xmx6G -XX:+UseG1GC -XX:+ParallelRefProcEnabled \
  -XX:MaxGCPauseMillis=200 -XX:+AlwaysPreTouch \
  -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 \
  -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 \
  -XX:MaxTenuringThreshold=1 -jar paper.jar nogui

In managed hosting this adjustment usually comes ready-made — what's left for you is what's in the configuration files.

Common mistakes

  • Lowering view-distance to 2 and thinking that solved it. The simulation distance is still there, and the world looks ugly.
  • Pre-generating with players online. The gain disappears along the way.
  • Forgetting the world border. Without it, the problem comes back on the first expedition.
  • Changing plans in the hope of fixing it. If MSPT is high due to chunk generation, more RAM changes nothing.
  • Confusing server lag with ping. If only one player complains, it's their network; if everyone freezes together, it's the server.

Conclusion

Exploration lag has a known cause and a three-step solution: measure with spark, adjust view-distance and simulation-distance judiciously, and pre-generate the map with Chunky within a defined border. This solves most cases without spending an extra cent.

Do it in order, one step at a time, and measure after each change — that way you know exactly what worked on your server. And if you're just starting now, you can set everything up on a new server at Mine Hour, run the pre-generation calmly, and only then invite everyone.

Sources