October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Turn Off Hostile Mobs in Minecraft

Set Minecraft to Peaceful for the simplest way to avoid hostile mobs. A mob-spawning game rule can preserve another difficulty, but it suppresses spawning broadly.
WorldMinecraft Length2 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To avoid hostile mobs, set the world to Peaceful difficulty. If you want to keep a different difficulty, you can turn off mob spawning with a game rule—but that affects mobs generally, not just hostiles.

Option 1: Set the world to Peaceful

Peaceful is the simplest built-in choice for avoiding hostile mobs. If commands are enabled and you have permission to use them, enter:

/difficulty peaceful

Mojang lists peaceful as a valid difficulty argument in its command guide. You can also change the difficulty through the world’s settings. Peaceful changes the world’s difficulty; it is not a switch that preserves every effect of another difficulty while disabling only hostile mobs.

Option 2: Stop mob spawning while keeping another difficulty

If you want to retain a non-Peaceful difficulty, use the mob-spawning game rule. In Java, the spelling shown by the reference is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
PDP REALMz Wireless Controller: Minecraft Steve for Nintendo Switch 2
  • Collectible figurine inside the grip and a multi-layered design featuring iconic game scenes
  • Built-in, rechargeable battery and a 30-foot wireless range
  • Expertly designed for all-day comfort and long-lasting performance
  • Brighten your gameplay with LED lighting effects that you can change using the ABXY buttons
  • Officially licensed by Nintendo and Mojang Studios

/gamerule doMobSpawning false

In Bedrock, Microsoft documents the rule as domobspawning:

/gamerule domobspawning false

This rule suppresses mob spawning generally rather than targeting hostile mobs alone. Microsoft’s Bedrock gamerule documentation describes it as controlling whether mobs spawn; the Minecraft Wiki reference likewise says it affects all mobs. As a result, it is not the right choice if you want passive mobs to continue spawning naturally. Check the command suggestions in your installed edition and version if the spelling or syntax differs.

Rank #2
Minecraft - Nintendo Switch
  • Minecraft is a game about placing blocks and going on adventures
  • Explore randomly generated worlds and build amazing things from the simplest of homes to the grandest of castles
  • Play in creative mode with unlimited resources or mine deep into the world in survival mode, crafting weapons and armor to fend off the dangerous mobs
  • Play on the go in handheld or tabletop modes
  • Includes Super Mario Mash-Up, Natural Texture Pack, Biome Settlers Skin Pack, Battle & Beasts Skin Pack, Campfire Tales Skin Pack; Compatible with Nintendo Switch only

Turning off spawning does not remove mobs that are already present, according to the Minecraft Wiki reference. Existing mobs may therefore remain until you deal with them separately.

Enable commands if needed

Commands require the right world settings or multiplayer permissions. Mojang’s command guide explains that Java single-player commands can be enabled when creating a world or later through World Options. In Bedrock single-player, enable Allow Cheats in Game settings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In Bedrock, turning on cheats permanently stops achievement unlocking in that world, even if you later turn cheats off. In multiplayer, you need sufficient permission; if you are on someone else’s server, ask the owner or an administrator.

Which option should you choose?

Option What it changes Best fit
Peaceful difficulty Uses the built-in Peaceful difficulty setting to avoid hostile mobs. You want the straightforward option and do not need to retain another difficulty.
doMobSpawning false (Java) or domobspawning false (Bedrock) Suppresses mob spawning broadly, including passive mobs. You want to keep a non-Peaceful difficulty and accept that wider effect.

Can you turn off hostile mobs but keep animals?

The documented options here do not provide a universal hostile-only toggle. Peaceful is a difficulty setting, while the mob-spawning rule affects mobs generally. If keeping animals spawning naturally is important, do not use the global spawning rule; use Peaceful if its overall difficulty behavior suits your world.

Rank #4
Mattel Minecraft Exploding RC Creeper with Lights & Sounds
  • The Exploding RC Creeper has exploding action and game-authentic movement in real life
  • Press the controller for lights and sounds -- then, press and hold to explode
  • Includes 10 explosion particles to launch into the air and an exclusive DLC digital item code for an in-game accessory
  • The design of the Exploding RC Creeper stays true to the unique, pixelated world of Minecraft
  • Makes a great gift for Minecraft fans and video-game players ages 6 years old and up
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Edition and version caveat

Peaceful can have edition- and version-specific interactions beyond the basic choice of difficulty. For example, Mojang’s Java Snapshot 25w31a notes say a monster spawn egg no longer spawns the mob for one tick when an attempt is made to use it. That note is specific to the cited snapshot and should not be treated as a complete description of current Java or Bedrock behavior.

Quick Recap

SaleBestseller No. 1
PDP REALMz Wireless Controller: Minecraft Steve for Nintendo Switch 2
PDP REALMz Wireless Controller: Minecraft Steve for Nintendo Switch 2
Built-in, rechargeable battery and a 30-foot wireless range; Expertly designed for all-day comfort and long-lasting performance
$54.99
Bestseller No. 2
Minecraft - Nintendo Switch
Minecraft - Nintendo Switch
Minecraft is a game about placing blocks and going on adventures; Play on the go in handheld or tabletop modes
$29.83
Bestseller No. 4
Mattel Minecraft Exploding RC Creeper with Lights & Sounds
Mattel Minecraft Exploding RC Creeper with Lights & Sounds
The Exploding RC Creeper has exploding action and game-authentic movement in real life; Press the controller for lights and sounds -- then, press and hold to explode
$54.99
Bestseller No. 5
Microsoft Xbox Wireless Controller - Minecraft Creeper - Xbox One (Discontinued)
Microsoft Xbox Wireless Controller - Minecraft Creeper - Xbox One (Discontinued)
Get up to twice the wireless range than previous controllers; ABXY buttons with classic Minecraft font
$145.24
Best Value
Microsoft Xbox Wireless Controller - Minecraft Creeper - Xbox One (Discontinued)
  • Prepare to create, explore, and survive your own Minecraft adventure with the Minecraft Creeper controller, featuring the iconic green Creeper design
  • Get up to twice the wireless range than previous controllers
  • ABXY buttons with classic Minecraft font
  • Textured grip for enhanced comfort;Compatible With Xbox One X, Xbox One S, Xbox One, Windows 10
  • Includes Bluetooth technology for gaming on Windows 10 PCs and tablets

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Turn On Vibrant Visuals in MinecraftMinecraftBlog3min
  2. Best Multiplayer Games for Low-End PCsBlog4min
  3. Minecraft: How To Use And Install OptiFineBlog5min
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.