How to change Minecraft server difficulty

Difficulty controls mob damage, hunger and whether hostile mobs spawn at all. Changing it is one line, and the reason it sometimes does not stick catches almost everybody once.

The four settings

Peaceful removes hostile mobs entirely and refills hunger over time. Easy, normal and hard scale mob damage and hunger effects upward, and only on hard can starvation kill you outright rather than leaving you on half a heart.

Hard also lets zombies break down wooden doors and spawn reinforcements, which matters more for a survival base than the raw damage numbers do.

Peaceful is worth knowing about for build servers, since it removes the need for lighting entirely.

In server.properties

Stop the server, open server.properties, and set:

difficulty=normal

Older versions used numbers, where 0 was peaceful and 3 was hard. Modern versions take the word. Save, then start the server.

Edit the file while the server is stopped. A running server rewrites it on shutdown and will overwrite your change, which is the single most common reason a difficulty edit appears to do nothing. The server.properties reference lists the rest of the file.

With a command, while running

/difficulty hard

Takes effect immediately, no restart. This writes to the world rather than to the properties file, which is where the confusion starts.

Why it keeps reverting

There is a lock. If level.dat has DifficultyLocked set, the world ignores both the properties file and the command, and the difficulty you set never applies. That flag is set automatically when a world is created in hardcore mode.

The other cause is the ordering above: you edited the file while the server was running, and the shutdown wrote the old value back over it. Stop first, edit second, start third.

On a multiworld server, difficulty is per world. Setting it globally in the properties file only affects the default world, and each additional world carries its own value.

Hardcore is a separate switch

hardcore=true forces hard difficulty, locks it, and turns death into a ban or spectator mode depending on version. It is not a fifth difficulty level, it is a mode that pins the difficulty and changes what death means.

Turning hardcore off later leaves the difficulty lock in place, so you will need to clear that flag before the setting responds again. If you are running a server around this, our hardcore server list shows how other people handle the death rule, which varies far more than the difficulty does.

Frequently asked questions

Why does my difficulty change keep resetting?

Almost always because the file was edited while the server was running, so the shutdown wrote the old value back. Otherwise the world has DifficultyLocked set in level.dat, usually from being created as hardcore.

Does difficulty affect mob spawn rates?

Not the rate. It affects damage, hunger behaviour, and some mob abilities such as zombies breaking doors on hard. Peaceful is the exception, since it stops hostile spawns entirely.

Can different worlds have different difficulties?

Yes. Difficulty is stored per world, so a multiworld server can run a peaceful build world alongside a hard survival world.

Does peaceful stop mob farms working?

Yes, completely, along with any hostile drops. Anyone relying on a farm for gunpowder or bones will notice immediately, so it is not a setting to flip on a survival server without warning.

Next steps

All guides · Free owner tools · List your server