Mobs Blocker
Mobs Blocker is a simple and effective admin tool to prevent any mob from spawning on your server via a simple command.
Quick challenge
How far can you run before the mobs catch you?
Minecraft check
Confirm your run
Complete the quick check to get your code.
Mobs Blocker
Mobs Blocker
Advanced Spawn Control for Your Server
Mobs Blocker has been completely re-architected to give you granular control over entity spawning. Stop mobs based on specific conditions (natural spawns, spawners, eggs) or apply rules globally across mob categories.
`⚠️ UPDATE NOTICE: This mod has been rewritten and currently ONLY supports version 1.2.0. For version 1.1.0, please check the GitHub repository. Versions below 1.1.0 are no longer supported.`
---
🚀 How It Works & Core Features
The Logic System
Mobs Blocker intercepts every entity spawn attempt and checks rules in this specific order: 1. Global Rules: Is there a rule for this exact Entity ID? (e.g., `minecraft:zombie`) 2. Global Rules: If not, is there a rule for its Category? (e.g., `monsters`) 3. Global Rules: If not, is there a Global rule set?
Key Features
* Server-Side Only: Block mobs based on *how* they spawn (Natural, Spawners, Eggs, Commands). * Server-Side Only: Apply rules to entire categories (e.g., block all `monsters` or `water_creatures`). * Server-Side Only: Apply a rule to *every* entity on the server instantly. * Server-Side Only: Full command system with auto-completion. * Server-Side Only: Uses optimized `HashSet` lookups and hooks into NeoForge events for minimal performance impact. * Server-Side Only: Clients do not need to install this mod.
📜 The Rules System (Understanding Block Types)
When adding a rule, you define what to block. You can block specific sources or use "Inverse Mode" to allow *only* specific sources.
| Rule Keyword | Effect | | :--- | :--- | | `all` | Blocks Inverse spawns for this target. | | `natural` | Blocks natural spawns (darkness, biome generation). | | `spawner` | Blocks mob spawners (dungeons, trial spawners). | | `egg` | Blocks spawn eggs and dispensers. | | `command` | Blocks `/summon` or command block spawns. | | `!natural` | Inverse: Blocks everything *EXCEPT* natural spawns. | | `!spawner` | Inverse: Blocks everything *EXCEPT* spawners. | | `!command` | Inverse: Blocks everything *EXCEPT* commands. |
💻 Command Guide (Usage Examples)
All commands require OP Level 4.
1. Specific Mob Control (`add`)
Target a single entity type.
* Allow Skeletons ONLY from Spawners (Inverse Mode): ```mcfunction /spawnblocker add minecraft:zombie all ``` * Allow Skeletons ONLY from Spawners (Inverse Mode): ```mcfunction /spawnblocker add minecraft:creeper natural ``` * Allow Skeletons ONLY from Spawners (Inverse Mode): ```mcfunction /spawnblocker add minecraft:skeleton !spawner ```
2. Category Presets (`preset`)
Apply rules to groups of mobs. *Available categories:* `monsters`, `creatures`, `ambient`, `water`, `misc`.
* Disable all ambient creatures (Bats, etc.): ```mcfunction /spawnblocker preset monsters natural ``` * Disable all ambient creatures (Bats, etc.): ```mcfunction /spawnblocker preset ambient all ```
3. Global Settings (`global`)
Apply a fallback rule to the entire server.
* Disable Natural Spawning server-wide (Adventure mode style): ```mcfunction /spawnblocker global natural ```
4. Management & Utilities
* Reset Everything (Wipe Config): ```mcfunction /spawnblocker remove minecraft:zombie /spawnblocker remove preset monsters ``` * Reset Everything (Wipe Config): ```mcfunction /spawnblocker list ``` * Reset Everything (Wipe Config): ```mcfunction /spawnblocker reload ``` * Reset Everything (Wipe Config): ```mcfunction /spawnblocker reset ```
📂 Configuration File (Manual Editing)
The configuration is saved automatically to `config/spawnblocker.json`. You can edit this file manually if the server is stopped.
Example `spawnblocker.json`: ```json { "minecraft:phantom": [ "all" ], "preset:monsters": [ "natural" ], "minecraft:zombie": [ "!spawner" ], "global_settings": [ "command" ] }