Set Difficulty to Peaceful
Switch to Peaceful mode so hostile mobs don't spawn
✅ Verified for Java 26.2 · Bedrock 26.32 — checked June 2026Sets the world to Peaceful difficulty — hostile mobs despawn immediately and won't spawn again, and your health regenerates passively. Passive mobs (cows, sheep, etc.) continue spawning and behaving normally. Switch back with /difficulty normal, hard, or easy.
/difficulty peaceful20 characters
- Java: yes
- Bedrock: yes
- Command block: yes
- Needs cheats / OP: yes
How to use
- Open chat (T on Java, / on Bedrock).
- Paste the command and press Enter.
- Peaceful mode is active; no hostile mobs spawn.
- Run /difficulty normal to restore hostile mob spawning.
Related commands
Give yourself or a player XP levels
/xp add @s 10LTrigger a thunderstorm with lightning
/weather thunder 600See the world seed for reproducibility or map info
/seedBecome nearly invincible
/effect give @p resistance 999999 255 true