Commands/difficulty

From Minecraft Wiki
Jump to: navigation, search
difficulty
Restrictions

Operator

Sets the difficulty level (peaceful, easy, etc.).

Syntax[edit]

  • Java Edition
difficulty [easy|hard|normal|peaceful]
  • Bedrock Edition
difficulty <difficulty: Difficulty>
difficulty <difficulty: int>

Arguments[edit]

JE: easy|hard|normal|peaceful
BE: difficulty: Difficulty: Difficulty and difficulty: int: int

Specifies the new difficulty level. Must be one of the following:
If unspecified, querys current difficulty rather than changes it.‌[Java Edition only]

Result[edit]

CommandTriggerJava EditionBedrock Edition
anythe arguments are not specified correctly Unparseable Failed
if the original difficulty is the same as the specified difficulty‌ Failed Successful
On successChanges or queries the game's difficulty

Output[edit]

CommandEditionSituationSuccess Count/execute store succeess .../execute store result ...
anyJava EditionOn fail000
/difficulty ...On success110
/difficultyOn success11the number id of current difficulty(peaceful = 0, easy = 1, normal = 2, hard = 3)
anyBedrock EditionOn fail0N/AN/A
On success1N/AN/A

Note[edit]

On a multiplayer server lasts only until the server is restarted — on restart, difficulty is reloaded from server.properties.

In Hardcore mode, the difficulty doesn't change even when successful.‌[Java Edition only]

Examples[edit]

See also[edit]

  • /gamemode – changes a player's game mode (creative, survival, etc.)

History[edit]

This section needs expansion.
You can help by adding to it.
Java Edition
1.4.212w32aAdded /difficulty.
Pocket Edition
1.0.5alpha 1.0.5.0Added /difficulty.