[MC-888] /difficulty command doesn't change the default difficulty in the ESC menu (singleplayer) Created: 27/Oct/12  Updated: 30/Apr/17  Resolved: 05/Feb/14

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.2
Fix Version/s: Minecraft 14w04a

Type: Bug
Reporter: Jeremy Dreyer Assignee: [Mojang] Nathan Adams
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows 7, Java 1.7.0_09


Issue Links:
Duplicate
is duplicated by MC-5378 Difficulty command in SP doesn't affe... Resolved
is duplicated by MC-9629 /difficulty resets after reloading th... Resolved
is duplicated by MC-10875 When changing difficulty with command... Resolved
is duplicated by MC-29418 Difficulty Auto Updates on Viewing Op... Resolved
is duplicated by MC-31942 /difficulty doesn't persist in single... Resolved
is duplicated by MC-33203 Difficulty doesn't update properly. Resolved
is duplicated by MC-44335 /difficulty 0 doesn't affect mobs. Resolved
is duplicated by MC-44805 /difficulty doesn't update on singlep... Resolved
is duplicated by MC-45055 /difficulty does not change difficult... Resolved
is duplicated by MC-45249 /difficulty command no longer working Resolved
is duplicated by MC-54436 Difficulty changes when chaning resou... Resolved
is duplicated by MC-2435 Command Block Difficulty Changes Do N... Resolved
is duplicated by MC-3320 Command Block Difficulty Change Resolved
Relates
relates to MC-44368 Difficulty Locking Resolved
relates to MC-78276 Difficulty command doesn't update the... Resolved
Confirmation Status: Unconfirmed

 Description   

I'm not 100% sure whether this is a bug or a feature.

Expectation:
Typing /difficulty <0|1|2|3> into the command line with the allowCommands NBT tag set to 1 or having spawned a world with cheats enabled to change the default difficulty for the save, not just the runtime difficulty

Occurrence:
With the NBT tag allowCommands set to 1, or after spawning a world with cheats enabled, typing /difficulty <0|1|2|3> into the chatbox (command line) does not change the difficulty set by the setting in the ESC menu. The environment correctly reflects the change (mobs despawning when set to 0), but after changing the difficulty and reloading the world the difficulty set by the ESC menu takes precedence over that previously set.



 Comments   
Comment by Jesper the End [ 03/Sep/13 ]

No I meant adding that feature, though I agree that your way of fixing this is better.

Comment by qmagnet [ 03/Sep/13 ]

You can't prevent a hostile from despawning with a tag, This needs to be fixed.

Comment by Jesper the End [ 03/Sep/13 ]

you can use a clock that keeps setting the difficulty to the one you want. That way it isn't a problem anymore on peaceful, on easy/normal/hard however it is still an issue. If you have a boss mob that spawns only once and you set the gamemode to peaceful accidentally it's gone. Maybe add an NBT tag to mobs that prevents them from despawning in peaceful. Or use persistence required

Comment by qmagnet [ 02/Sep/13 ]

When playing on single player, go into the Options screen and set your difficulty to "Peaceful". Next, change difficulty via game commands to "hard" (type /difficulty h or command block). Game will be set to hard and spawn a hostile mob for example. However, if you simply view the Options screen again, the game will auto update difficulty. Hostile mobs disappear.

This is a huge issue with Custom Maps for 2 reasons. If the player simply views the Options screen to go into video settings or something, their difficulty gets updated and can either remove all hostile mobs, or if the command difficulty is has been to peaceful, and the player has difficulty preset to Easy/Normal/Hard, hunger is now an issue.

I'm not asking to update the menu with commands, I'm asking to only change difficulty if the player actually physically presses the Difficulty button.

Comment by Abandoned account [ 11/Feb/13 ]

DAMMIT

This can't be intended!

Comment by Jesper the End [ 11/Feb/13 ]

Too bad, It would've been a nice feature for mapmakers. oh well...

Comment by Abandoned account [ 11/Feb/13 ]

If this works as intended, then it's just stupid because normally after reloading the map everything should be exactly like it was before you left it. Including difficulty.

Comment by Jesper the End [ 08/Nov/12 ]

Not sure if it already happens, but I think it should change the server.properties too.

Comment by Selbram (Tory Clement) [ 27/Oct/12 ]

This is what it is suppose to do in single player.

Comment by Tristan Allen [ 27/Oct/12 ]

Yeah, that only works as a server command. The /difficulty command doesn't affect your menu difficulty.

Comment by Jeremy Dreyer [ 27/Oct/12 ]

Singleplayer

Comment by Tristan Allen [ 27/Oct/12 ]

Are trying this on Multi-player or Single-player?

Generated at Sun Jan 12 11:52:34 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.