Sets or queries the difficulty level (peaceful, easy, etc.).
Syntax[]
- Java Edition
difficulty [peaceful|easy|normal|hard]
- Bedrock Edition
difficulty <difficulty: Difficulty>difficulty <difficulty: int>
Arguments[]
JE: peaceful|easy|normal|hard
BE: difficulty: Difficulty: enum and difficulty: int: int
- Specifies the new difficulty level. Must be one of the following:
peaceful(can be abbreviated aspor0[Bedrock Edition only]) for peaceful difficultyeasy(can be abbreviated aseor1[Bedrock Edition only]) for easy difficultynormal(can be abbreviated asnor2[Bedrock Edition only]) for normal difficultyhard(can be abbreviated ashor3[Bedrock Edition only]) for hard difficulty
- If unspecified, queries the current difficulty instead of changing it.[Java Edition only]
Result[]
| Command | Trigger | Java Edition | Bedrock Edition |
|---|---|---|---|
| any | the arguments are not specified correctly | N/A | Unparseable |
| the original difficulty is the same as the specified difficulty | Failed | Successful | |
| Otherwise | Successful | ||
Output[]
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
| any | Java Edition | On fail | 0 | 0 | 0 |
/difficulty ... | On success | 1 | 1 | 0 | |
/difficulty | On success | 1 | 1 | the number id of current difficulty (peaceful = 0, easy = 1, normal = 2, hard = 3) | |
| any | Bedrock Edition | On fail | 0 | N/A | N/A |
| On success | 1 | N/A | N/A |
Note[]
On a multiplayer server difficulty 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[]
- To change the difficulty to hard:
difficulty hard,difficulty h[Bedrock Edition only], ordifficulty 3[Bedrock Edition only]
See also[]
/gamemode– changes a player's game mode (creative, survival, etc.)
History[]
This section needs expansion.
You can help by expanding it.
| Java Edition | |||||
|---|---|---|---|---|---|
| 1.4.2 | 12w32a | Added /difficulty. | |||
| Pocket Edition | |||||
| 1.0.5 | alpha 1.0.5.0 | Added /difficulty. | |||