# How to Disable Hostile Mobs on Your Minecraft Server (/docs/minecraft/toggle-monsters)



import { Step, Steps } from 'fumadocs-ui/components/steps';

You can disable hostile mob spawning two ways: using `spawn-monsters=false` in `server.properties`, or by setting `difficulty=peaceful`. They behave differently — peaceful is instant, spawn-monsters only stops *new* spawns.

spawn-monsters vs difficulty=peaceful [#spawn-monsters-vs-difficultypeaceful]

| Method                 | Effect on existing mobs     | Effect on new spawns | Other side effects                     |
| ---------------------- | --------------------------- | -------------------- | -------------------------------------- |
| `spawn-monsters=false` | Stay until killed/despawned | Blocked              | None                                   |
| `difficulty=peaceful`  | **Despawn immediately**     | Blocked              | Players regen health, no hunger damage |

**Use `peaceful`** if you want hostile mobs gone *right now*. **Use `spawn-monsters=false`** if you want a normal difficulty experience without new hostile mobs.

Disable Hostile Mobs [#disable-hostile-mobs]

<Steps>
  <Step>
    Stop the server [#stop-the-server]

    In the [XGamingServer Panel](https://panel.xgamingserver.com), open **Console** and stop your server.
  </Step>

  <Step>
    Edit server.properties [#edit-serverproperties]

    Click **Files** in the sidebar and open `server.properties`. Set:

    ```properties
    spawn-monsters=false
    ```

    Or, for instant despawn + no hunger:

    ```properties
    difficulty=peaceful
    ```

    Click **Save Content**.
  </Step>

  <Step>
    Start the server [#start-the-server]

    Start from **Console**. Hostile mobs stop spawning immediately.
  </Step>
</Steps>

Other Mob Spawning Toggles [#other-mob-spawning-toggles]

| Property         | Default | Description                                          |
| ---------------- | ------- | ---------------------------------------------------- |
| `spawn-monsters` | `true`  | Hostile mobs (zombies, skeletons, creepers, spiders) |
| `spawn-animals`  | `true`  | Passive mobs (cows, pigs, sheep, chickens)           |
| `spawn-npcs`     | `true`  | Villagers and wandering traders                      |

You can mix these freely — e.g., disable hostile mobs but keep animals for farming.

Per-World or Per-Player Control [#per-world-or-per-player-control]

For finer control (disable mobs in specific regions, allow mob farms but block raids, etc.):

* **WorldGuard** — `mob-spawning deny` flag per region
* **EssentialsX** — `/togglespawn` per-player toggle
* **Spigot/Paper** — set `spawn-limits` and `mob-spawn-range` in `spigot.yml`

Common Issues [#common-issues]

| Problem                         | Fix                                                                                                |
| ------------------------------- | -------------------------------------------------------------------------------------------------- |
| Mobs from spawners still appear | Spawners are not affected by `spawn-monsters=false` — break or disable them manually               |
| Mobs from raids still spawn     | Raid mobs bypass natural spawning rules. Use `/gamerule disableRaids true`                         |
| Monsters reappear after restart | The setting wasn't saved, or a plugin re-enabled spawning                                          |
| Can't sleep — "monsters nearby" | A leftover hostile mob exists. Use `/kill @e[type=zombie]` etc., or set `difficulty=peaceful` once |

Related Guides [#related-guides]

* [Set Difficulty](/docs/minecraft/set-difficulty)
* [Server Properties](/docs/minecraft/server-properties)
* [Hardcore Mode](/docs/minecraft/hardcore-mode)
