Question Understanding how difficulty works

revi

New member
May 13, 2023
1
0
1
Hi! These are the steps I've followed to configure the difficulty on a server running Paper 1.19.4 (build 530).
  1. Create a new, empty directory for the server.
  2. Download Paper and accept the EULA.
  3. Start the server and wait for it to be ready.
  4. The /difficulty command says "The difficulty is Easy".
  5. Gracefully stop the server.
  6. Check the server.properties file, where difficulty is set to easy.
  7. Change that to peaceful before starting the server again.
  8. The /difficulty command still returns "The difficulty is Easy".

Reading the NBT content of world/level.dat I can also see Difficulty hasn't been updated. It's set to 1, which maps to easy.

Even if /difficulty peaceful works, I find this behaviour counter-intuitive. Is this how difficulty is supposed to work? Should we understand this property as something that is used only when new worlds are generated?
 
Version Output
git-Paper-530 (MC: 1.19.4) (Implementing API version 1.19.4-R0.1-SNAPSHOT) (Git: 9daa019)

EterNity

Moderator
Staff member
Dec 13, 2021
61
4
27
18
under your bed!
paper-chan.moe
The server.properties option is only used when world is first created. The value can then be controlled via gamerule commend for each world individually.

Taking into account that a Minecraft server would have 3 or more dimensions, this setup makes the most sense, this allows the freedom of having different difficulties on worlds instead of always reading value in server.properties. I hope this provide some insights to you.
 
  • Like
Reactions: revi