Skip to main content
infoServer ErrorsAffects: Java Edition 1.8 and later

How to Fix Server Difficulty Locked

Locked the difficulty, or does it keep resetting? /difficulty still works on a locked world, and a server applies server.properties again at every start.

Quick Fix

Run /difficulty normal (or peaceful, easy, hard) with operator rights or commands allowed; it works even on a locked world. On a dedicated server, also set difficulty in server.properties, because that value is applied again at every start.

Error Message

Are you sure you want to lock the difficulty of this world? This will set this world to always be Normal, and you will never be able to change that again.

How to Fix

1

Singleplayer world with a locked difficulty: open the pause menu, choose Open to LAN, allow commands and start the LAN world. Then run /difficulty normal. The command sets the difficulty even though the world is locked, and the new value is saved with the world.

2

Dedicated server: stop the server, set difficulty=normal (or peaceful, easy, hard) in server.properties and start it again. An old number from 0 to 3 also works; the server converts it to the name.

3

To make the difficulty button in Options usable again, close the world, back it up and open level.dat in an NBT editor. Set DifficultyLocked to 0, or on 26.1 and later set locked inside difficulty_settings to 0.

4

Hardcore worlds stay on Hard. The hardcore setting in server.properties only applies to newly created worlds, so changing it afterwards does not affect a world that already exists.

Common Causes

  • You pressed the lock button next to Difficulty in singleplayer and confirmed. The Options screen won't let you change the difficulty of that world again.
  • Your server keeps going back to the value in server.properties. A dedicated server applies that difficulty every time it starts, so a change made with /difficulty only lasts until the next restart.
  • The world is a Hardcore world. Hardcore always sets the difficulty to Hard, and /difficulty can't change that.
  • You don't have permission for /difficulty. On Java Edition it needs operator permission level 2, or commands allowed in singleplayer.

Diagnostic Steps

  1. Check whether the world is a Hardcore world; if it is, the difficulty will always be Hard.
  2. Run /difficulty without a value to see the current difficulty.
  3. On a server, compare that with the difficulty line in server.properties.
  4. Change it with /difficulty, or edit server.properties and restart.
  5. Restart once more to confirm the server keeps the value you want.

FAQ

What are the difficulty values?

peaceful, easy, normal and hard. server.properties also accepts the old numbers 0 to 3 and quietly converts them to those names.

Can I unlock the difficulty without commands?

Not from the Options screen. The lock is stored in level.dat, so without commands the only way is to edit that file with an NBT editor while the world is closed. Make a backup first.

Why does my server's difficulty reset after a restart?

The dedicated server applies the difficulty from server.properties every time it starts, and that overrides the value saved in the world, locked or not. Change server.properties instead of only using /difficulty.

Does /difficulty work in Hardcore?

The command runs, but the difficulty stays on Hard. Hardcore worlds are always Hard on Java Edition.

Related Errors

Need More Help?