mojira.dev
MC-888

/difficulty command doesn't change the default difficulty in the ESC menu (singleplayer)

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.

Linked issues

MC-2435 Command Block Difficulty Changes Do Not Update The Player Options GUI Resolved MC-3320 Command Block Difficulty Change Resolved MC-5378 Difficulty command in SP doesn't affect difficulty in options menu. Resolved MC-9629 /difficulty resets after reloading the map! Resolved MC-10875 When changing difficulty with command /difficulty, difficulty in options does not change. Resolved

Comments 12

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

Singleplayer

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

Selbram (Tory Clement)

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

Jesper the End

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

2 more comments
Abandoned account

DAMMIT

This can't be intended!

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.

Jesper the End

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

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

Jesper the End

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

Jeremy Dreyer

Nathan Adams

Unconfirmed

Minecraft 1.4.2

Minecraft 14w04a

Retrieved