How to change difficulty on Minecraft server?

You can change the world difficulty on the Java server with a command, and check the setting at startup via server.properties.

Step by step

  1. Run the difficulty normal, difficulty easy, difficulty hard or difficulty peaceful commands from the console, whichever suits your needs.

  2. Check the line difficulty in server.properties to maintain the expected value after reboot. If the panel settings recreate the file, update the value in the panel as well.

  3. Note that difficulty behavior may be different if you're using a hardcore world. Multi-world add-ons may have per-world settings.

  4. Enter the target world as a normal player and check that the challenge is implemented as expected. Read the setting in the console again after the change.

Keep in mind

Changing difficulty affects some mob and damage behavior. Announcing it to players in advance avoids confusion.

Source and tools