Updated:

Which kind of lag?

SymptomLikely cause
Everyone lags at once; mobs stutter, crops and furnaces slow downThe server cannot keep up
One player lags; broken blocks reappearThat player's connection or computer
Terrain loads late when movingChunk generation or loading

Measure it

A server runs 20 ticks per second (20 TPS). When one tick takes longer than 50 ms, TPS drops and everything slows.

Check 1: too many entities

/execute if entity @e[type=minecraft:item]

The output is the number of dropped items. Thousands of them are a common cause, and /kill @e[type=minecraft:item] fixes it at once. Huge animal farms and mob storage also add up. The kill command guide has safer selectors.

Check 2: redstone

Clocks that never stop, large hopper chains and piston machines cost a lot. Turn off unused machines with a lever, and put a composter or similar block on top of hoppers that do not need to pull items.

Check 3: distance settings

Lower simulation-distance and view-distance in server.properties to process less of the world. The server.properties guide explains both.

Check 4: new chunk generation

Flying far with an elytra forces new terrain to generate. Pre-generate the world with a plugin such as Chunky, and limit the world with a world border.

Check 5: memory and server software

Too little RAM causes regular freezes. Check -Xmx in the start command. More is not always better; 4–6 GB is a sensible start for a small group. Optimized software such as Paper usually runs lighter than the vanilla server, though plugins and some behavior differ.

When only one player lags

Lower that player's render distance, use a wired connection instead of Wi-Fi, and check how far away the server is.

Common questions

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.