How to disable animals spawning on your Minecraft server

Passive animals — cows, pigs, sheep, chickens, horses and the rest — spawn constantly on a default Minecraft server. Most of the time that is exactly what you want, but on a build server, a minigame map, a hardcore PvP arena, or a performance-tight world running on modest hardware, hundreds of idle livestock chewing up entity ticks is pure overhead. Maybe you want a sterile creative world, maybe you are clawing back TPS, or maybe you simply do not want pigs wandering into your spawn plaza. Whatever the reason, Java Edition gives you several distinct levers to stop animals from spawning, and each one behaves differently.

This guide walks through every reliable method — the spawn-animals server property, the doMobSpawning game rule, peaceful difficulty, and surgical per-region control with WorldGuard. It explains what each one actually does, when a restart is required, why none of them remove animals that have already spawned, and how to pick the right tool for your situation. Everything below is for Java Edition unless stated otherwise.

The fastest answer: spawn-animals=false in server.properties

The most direct, server-wide way to stop passive animals is the spawn-animals key in your server.properties file. It is a simple boolean — true by default — and setting it to false turns off natural spawning of passive/farm animals across the entire server.

Open server.properties (it sits in your server’s root directory), find or add the line, and change it:

spawn-animals=false

This is one of three related spawn toggles. It is important to understand the difference, because people frequently set the wrong one or assume one key covers everything:

server.properties keyDefaultWhat it stops when set to false
spawn-animalstrueNatural spawning of passive/farm animals (cows, pigs, sheep, chickens, etc.)
spawn-monsterstrueNatural spawning of hostile mobs (zombies, skeletons, creepers, etc.)
spawn-npcstrueNatural spawning of villagers (NPCs)

So if your goal is “no animals but keep the monsters” — common on a survival-combat server — you set only spawn-animals=false and leave spawn-monsters=true. If you want a completely empty world with no mobs at all, you would set all three to false (though, as you will see below, a game rule does that more cleanly).

A restart is mandatory

This is the single most common point of confusion. server.properties is read only at server startup. Editing the file while the server is running does nothing — your change just sits there. After saving the file you must fully restart the server (a stop and start, not just a /reload of plugins) for the new value to take effect. If you change the key and animals keep appearing, a missing restart is almost always the cause.

If you are managing your world through a hosting control panel — for example our managed Minecraft server plans — you can usually edit server.properties through the panel’s config editor and hit restart in one place. For a full walkthrough of the configuration file and where it lives, see our Minecraft server documentation.

The runtime answer: /gamerule doMobSpawning false

If you do not want to restart, or you want to toggle spawning live while testing, the game rule route is better. Running this in-game (as an operator) or from the server console stops all natural mob spawning immediately:

/gamerule doMobSpawning false

From the server console you omit the leading slash. The change applies instantly — no restart, no file editing — and it persists in the world data.

The crucial distinction from spawn-animals: doMobSpawning is broader. It governs the global spawning logic for all mobs — animals and monsters and NPCs — through one switch. There is no animals-only game rule. So:

  • Want to stop only animals while monsters still spawn? Use spawn-animals=false in server.properties — the game rule cannot isolate a single category.
  • Want to stop everything from spawning at runtime without a restart? Use /gamerule doMobSpawning false.

The snake_case rename you may run into

Mojang renamed game rules to snake_case in Java 1.21.11. On 1.21.11 and newer the rule is spawn_mobs; on 1.21.10 and earlier it is doMobSpawning. The behavior and default (true) are identical — only the spelling changed. On the newer versions:

/gamerule spawn_mobs false

If a command “doesn’t exist,” check your version and try the other casing. To check a rule’s current value at any time, run it with no value: /gamerule doMobSpawning returns the current setting.

Critical: existing animals are NOT removed

Every method in this guide stops new spawns. None of them despawn the animals that are already in your world. Passive mobs in Minecraft are persistent — once they exist, they stick around. So after you disable spawning, the cows and sheep already loaded in your chunks will remain happily roaming until you remove them manually.

To clear out what is already there, use the vanilla kill command with a target selector. This removes every loaded animal of the listed types around you:

/kill @e[type=#minecraft:axolotl]
# or target specific species:
/kill @e[type=cow]
/kill @e[type=pig]
/kill @e[type=sheep]
/kill @e[type=chicken]

Be careful with broad selectors — /kill @e with no type filter will also delete item frames, armor stands, dropped items, and even players in some setups. Always scope the selector to the entity types you actually want gone. Note also that /kill only affects entities in currently loaded chunks, so distant pre-existing herds survive until those chunks load.

Peaceful difficulty: the nuclear option for hostiles (not animals)

It is worth clearing up a related misconception. Setting your server to peaceful difficulty stops hostile mobs from spawning entirely — but it does not stop passive animals. Cows, pigs and sheep happily spawn on peaceful. So peaceful is the opposite of what you want if your goal is “no animals, keep the monsters,” and it is overkill if your goal is purely about animals.

You can set peaceful via server.properties (requires a restart, like all properties):

difficulty=peaceful

…or live with /difficulty peaceful. Use peaceful when you want a no-combat experience; reach for spawn-animals=false or doMobSpawning when animals specifically are the problem.

Surgical control with WorldGuard (per-region)

The methods above are blunt — they are world-wide or server-wide. What if you want animals everywhere except your spawn town? Or you want to ban only a couple of species in one region? That is where WorldGuard comes in. WorldGuard is a region-protection plugin that runs on Bukkit-family servers (Spigot, Paper, Purpur), so you need a plugin-capable server jar — the vanilla server.jar from Mojang cannot load plugins.

WorldGuard exposes a mob-spawning region flag that takes allow or deny. To stop all mob spawning inside a defined region:

/rg flag  mob-spawning deny

To apply it to the entire world rather than a small region, use the special built-in __global__ region:

/rg flag __global__ mob-spawning deny

Blocking only specific species with deny-spawn

This is WorldGuard’s killer feature for animal control. Where vanilla forces you to choose all-animals or no-animals, the deny-spawn flag accepts a list of specific entity types and blocks only those, leaving everything else free to spawn. For example, to stop cows and pigs from spawning in a region while letting sheep, chickens and all other mobs spawn normally:

/rg flag  deny-spawn cow,pig

The list is comma-separated, no spaces. This level of granularity is impossible with server.properties or game rules, which is exactly why region plugins exist. If you only want to thin out one or two nuisance species rather than nuke all spawning, deny-spawn is the right tool.

Which method should you use?

GoalBest methodRestart needed?
Stop only animals, keep monsters, whole serverspawn-animals=falseYes
Stop all mobs instantly without restarting/gamerule doMobSpawning falseNo
Stop hostile mobs, keep animalsdifficulty=peaceful (or /difficulty peaceful)Property: yes / command: no
Stop mobs in one area onlyWorldGuard mob-spawning deny on a regionNo
Block only a few specific speciesWorldGuard deny-spawn cow,pigNo

For most “I just want fewer animals on my survival server” cases, spawn-animals=false with a restart is the cleanest answer. For testing, temporary changes, or a fully empty creative build world, the game rule is more convenient. For anything zone-specific, WorldGuard wins.

Related performance and config tweaks

Animal spawning is rarely the only knob worth turning when you are tuning a server. If you are here for performance or world control, a few neighbouring guides are worth a look. Overgrown worlds often suffer from spreading plant life as much as wandering mobs — our walkthrough on how to stop vines spreading on your Minecraft server covers the WorldGuard vine-growth flag, which pairs naturally with the spawn flags above. If you run multiple worlds and want different spawn rules in each, setting up the Multiverse plugin lets you isolate a creative build world from a survival world. And if you are starting fresh, picking the right world generation with changing the level-type of your Minecraft server determines what biomes — and therefore which animals — generate in the first place.

Frequently asked questions

Does spawn-animals=false remove the animals already on my server?

No. spawn-animals=false only prevents new passive animals from spawning naturally. Every cow, pig, sheep and chicken already loaded in your world stays exactly where it is, because passive mobs are persistent. To clear existing animals you have to remove them manually with a scoped command such as /kill @e[type=cow] (repeated per species), and remember that only entities in currently loaded chunks are affected.

Why are animals still spawning after I edited server.properties?

Almost always because the server was not fully restarted. server.properties is read only once, at startup, so any edit you make while the server is online is ignored until you stop and start it again. A plugin /reload does not re-read the file. Save your change, perform a complete restart, and confirm the line reads exactly spawn-animals=false with no stray spaces or capitalization. If you need the change to take effect without a restart, use /gamerule doMobSpawning false instead.

What is the difference between spawn-animals=false and doMobSpawning false?

Scope and timing. spawn-animals=false is a server.properties key that stops only passive animals and requires a restart to take effect. /gamerule doMobSpawning false (or spawn_mobs false on Java 1.21.11+) is a game rule that stops all natural mob spawning — animals, monsters and NPCs together — and applies instantly at runtime. Use the property when you want to keep monsters but lose animals; use the game rule when you want everything off without restarting.

Does setting my server to peaceful stop animal spawning?

No. Peaceful difficulty stops only hostile mobs (zombies, skeletons, creepers and the like) from spawning. Passive animals continue to spawn normally on peaceful. If your goal is to remove animals, peaceful is the wrong setting — you want spawn-animals=false or doMobSpawning false. Peaceful is the right choice when you want to disable combat threats while still keeping a stocked countryside of livestock.

Can I disable animal spawning in just one area instead of the whole server?

Yes, with WorldGuard on a Spigot/Paper server. Define a region, then run /rg flag mob-spawning deny to stop all spawns inside it, or /rg flag deny-spawn cow,pig to block only specific species while everything else spawns normally. To affect the whole world through WorldGuard rather than a small zone, target the special __global__ region. Vanilla server.properties and game rules cannot do per-area or per-species control — that flexibility is the whole point of using a region plugin.

How do I stop animals without affecting villagers or monster farms?

Use the targeted server.properties keys. spawn-animals, spawn-monsters and spawn-npcs are three independent toggles, all defaulting to true. Set spawn-animals=false and leave spawn-monsters=true and spawn-npcs=true, and you stop passive farm animals while villagers and your hostile-mob farms keep working. Avoid doMobSpawning false here, since it would shut down monsters and villagers too. Restart the server after editing the properties file for the changes to apply.

Disabling animal spawning is a small change with an outsized impact on a tidy, performant server. Pick the lever that matches your scope — a property for server-wide and animals-only, a game rule for instant all-mob control, peaceful for combat-free play, or WorldGuard for surgical per-region and per-species rules — restart when the method requires it, and clean up any animals that are already loaded. That combination gives you a world that behaves exactly the way you intended.

Free Minecraft Tools

Speed up your server with our free Minecraft tools:

Ready to play?

Run your own Minecraft server with XGamingServer

Spin up an always-on Minecraft server your friends can join in minutes — no port-forwarding, no tech headaches.

99.9%Uptime SLA
< 5 minInstant setup
24/7Human support
DDoSProtected
Instant setup Your server is live in minutes with a one-click control panel.
Mods & plugins Install mods, plugins and workshop content in a few clicks.
DDoS protected Enterprise DDoS mitigation keeps your server online 24/7.
Low-latency hardware Premium CPUs & NVMe SSDs for lag-free multiplayer.
Free backups Automatic backups so your world is never lost.
Real human support Gamers helping gamers — 24/7, no bots, no scripts.

Pick your Minecraft plan & play in minutes

See all plans
Starter $8.40/mo 4 GB RAM Renews $12/mo Buy now
Rookie $17.50/mo 8 GB RAM Renews $25/mo Buy now
Pro $24.50/mo 12 GB RAM Renews $35/mo Buy now