
Simple Mob Switch
Safe and efficient Mob Switch implementation using spawn chunks.
- Загрузки
- 173
- Подписчики
- 3
- Обновлён
- 30 мая 2025 г.
- Лицензия
- MIT
Опубликован 28 мая 2025 г.
SimpleMobSwitch
SimpleMobSwitch is a Fabric mod for Minecraft 1.20.5+ that dynamically controls mob spawning across your server. It automatically adjusts dummy mobs (shulkers) based on player count, utilizing the mob cap mechanism to control natural mob spawning server-wide.
🎯 Key Features
- Dynamic Control: Automatically adjusts mob spawn rates based on current player count
- Simple Commands: Easy on/off toggle with
/mobswitch on/offcommands - High Performance: Minimal performance impact through AI disabling and optimization
- Reliable Design: Uses spawn chunks for consistent, lag-free operation
- Persistent State: Automatically restores settings after server restarts
🔧 Technical Specifications
- Target Dimension: Overworld only
- Placement Method: 3 chunks away from spawn chunks (load level 33 in 1.20.5+)
- Entity Type: Invisible, invulnerable shulkers with disabled AI
- Calculation: Player count × 70 = Required dummy mobs
💡 How It Works
The mod leverages Minecraft's mob cap system by spawning persistent dummy mobs that count toward the global mob limit. When the cap is reached, natural hostile mob spawning is prevented, creating an effective "mob switch" that scales automatically with your server population.
🎮 Usage
- Install the mod on your Fabric server
- Use
/mobswitch onto enable mob spawn control - Use
/mobswitch offto disable and return to normal spawning - The mod automatically adjusts based on player count
⚠️ Requirements
- Minecraft Version: 1.20.5 or higher
- Mod Loader: Fabric Loader
- Permissions: OP level 2 or higher required for commands
- Server Type: Works best on servers where spawn chunks are accessible
Perfect for servers that need reliable mob spawn control without complex redstone contraptions or portal-based chunk loaders.
📚 Additional Resources
Ченджлог
1.0.0Релиз1.21.5 · 30 мая 2025 г.
SimpleMobSwitch Mod - ChangeLog
[1.0.0] - 2025-5-30
🎉 Initial Release
✨ New Features
Dynamic Mob Cap Control System
- Automatically spawns dummy mobs (Shulkers) based on player count
- Basic formula:
Player count × 70 = Required dummy mobs - Real-time mob count adjustment
Command System
/mobswitch on- Enable mob switch/mobswitch off- Disable mob switch- Requires OP permission (level 2+)
Persistence System
- State restoration after server restart
- World data saved in NBTCompound format
- Dummy mob UUID management
Spawn Chunk Method
- Utilizes always-loaded spawn chunks
- Stable chunk loading
- Independent from nether portal methods
🔧 Technical Specifications
- Supported Version: Minecraft 1.20.x + Fabric
- Placement: 3 chunks away from spawn chunk (Y=1000)
- Entity Type: Shulker (
EntityType.SHULKER)
⚡ Performance Optimization
AI Processing Optimization
- Dummy mob AI disabled (
setAiDisabled(true)) - Physics disabled (
setNoGravity(true)) - Sound processing disabled (
setSilent(true))
- Dummy mob AI disabled (
Visual Optimization
- Dummy mobs invisible (
setInvisible(true)) - Custom name hidden (
setCustomNameVisible(false)) - Invulnerable to prevent accidental removal (
setInvulnerable(true))
- Dummy mobs invisible (
Memory Efficiency
- Lightweight UUID-based state management
- Minimal data storage
🛡️ Safety Features
Error Handling
- Proper handling of spawn failures
- State consistency checking
- Detailed logging (INFO, ERROR levels)
Server Lifecycle Management
- Automatic state restoration on startup
- Proper cleanup on shutdown
- Dynamic adjustment on player join/leave
📋 Limitations
- Dimension Limitation: Overworld only
- Permission Requirement: Requires OP permission (level 2+)
- Impact Scope: Affects server-wide mob spawning
🔍 Implementation Details
- Mixin Usage: Minimal intervention to MinecraftServer class
- Non-invasive Design: Minimal impact on existing game systems
- Fabric API: Standard Fabric mod development practices
📖 Usage
- Place the mod in the server's
modsfolder - Start the server
- Execute
/mobswitch oncommand with OP permission - Mob spawning will be automatically controlled based on player count
🎯 Target Users
- Server administrators
- Mob farm operators
- Performance-focused server operators
- Players who want to control mob spawning for building projects
🔗 References
Warning: This mod affects server-wide mob spawning. Always create backups and test in a development environment before use.
Комментарии
Загружаем…