Is there a way to lock the difficulty setting in minecraft?

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.


After they start a level, immediately ask them to say:

/gamerule doMobSpawn false

or set their difficulty to Peaceful. Only hard can be locked, which cannot be simple and is only locked automatically on Hardcore.