Minecraft – way to lock the difficulty setting in minecraft

minecraft-java-edition

In minecraft, difficulty settings can be changed anytime, and this is in fact (normally) a great feature. Yet, for some reasons given below, I am looking for an option to disable this feature, may it be by a mod or whatever. Does anybody know a way to lock the difficulty setting once a game is created? Or even better (for my purposes): How can I enforce that new games will always use a predetermined, fixed difficulty that cannot be changed?

Some explanation: I have seen many discussions of such a question in the web being stalled by comments like "Aww, man, just show some willpower and don't switch the setting!" In the problem at hand, I am preparing a (single-player) installation of Minecraft for my niece and nephew. They love the game, but they are quite young, and being attacked by a bunch of scary spiders will most certainly lead to severe nightmares, that much I am sure. Hence, I want to technically prevent them from changing the difficulty (either on purpose or by accident) to something other than "peaceful". So please, consider this question as valid.

Best Answer

A slight work around, that would probably be better as it will turn of mobs but keep health regen off, would be to run the game on a server. You would not need a spare computer as you can run it off the same PC as the game. All you need to do is change:

spawn-monsters=true

To:

spawn-monsters=false

In the server's server.properties file. If you are worried about them purposely changing it back you can lock the file to admin access, although if you do this they will not be able to change map.