# 🧠 NeuroLag - Smart Mob AI Optimizer
**Version:** 1.6.0
**Minecraft:** 1.21+ (Paper / Purpur recommended)
**Author:** Duong2012G
NeuroLag is an intelligent, TPS-aware mob AI optimization plugin that helps reduce server lag while maintaining smooth gameplay.
---
## ✨ Key Features
### Core Optimization
- Real-time TPS-based state system: **NORMAL / MEDIUM / CRITICAL**
- Hysteresis buffer to prevent state flickering
- Per-world thresholds with player count scaling
- Memory pressure detection
- CPU Throttling
- Region-based optimization
### Advanced Optimizations
- Smart Culling with custom mob weights
- Chunk-aware AI (only optimize mobs far from players)
- Tick Throttling for AI updates
- Animation freezing at long distances
- Spawn suppression during heavy lag
- Pathfinding disable in cold regions
- AI Difficulty Scaling based on world difficulty
### Monitoring & Alerts
- In-game BossBar Dashboard
- **Web Dashboard** (mobile-friendly with authentication)
- **Audio & Visual Alerts** (sounds + particles) - *New in 1.6.0*
- Discord webhook notifications for critical lag & recovery
- Detailed HTML Audit Reports
- Automatic lag reports for prolonged lag events
### Quality of Life
- Config Profiles (Survival, Minigame, Peaceful, etc.)
- Automatic Config Backup with SHA-256 checksum
- Configuration Validator
- Safe Stress Test with cooldown and density protection
- Zone Protection (built-in cuboids + WorldGuard support)
- Predictive Lag Prevention (learns from hourly patterns)
---
## 📥 Installation
1. Download the latest `NeuroLag.jar`
2. Place it in your server's `plugins/` folder
3. Restart the server
4. Configure the plugin in these files:
- `config.yml`
- `features.yml`
- `monitors.yml`
- `systems.yml`
5. Use `/nlag reload` to apply changes
**Recommended:** Use Paper or Purpur for best performance.
---
## 📋 Commands
| Command | Description | Permission |
|---------------------------|------------------------------------------|-----------------------------|
| `/nlag` | Show help menu | `neurolag.admin` |
| `/nlag status` | Display TPS and world states | neurolag.admin |
| `/nlag toggle` | Pause/resume monitoring | neurolag.admin |
| `/nlag reload` | Reload all configurations | neurolag.admin |
| `/nlag audit` | Generate HTML audit report | `neurolag.audit` |
| `/nlag profile <name>` | Switch configuration profile | `neurolag.profile` |
| `/nlag stresstest [count] [minutes]` | Run stress test | `neurolag.stresstest` |
| `/nlag backup [list/restore]` | Manage config backups | `neurolag.backup` |
---
## ⚙️ Important Configuration Files
- **`config.yml`** – Core settings & tiers
- **`features.yml`** – All optimization features
- **`monitors.yml`** – Dashboard, alerts, Discord, web dashboard
- **`systems.yml`** – Profiles, zones, backups, stress test
**Tip:** After editing, always run `/nlag validate` to check for configuration issues.
---
## 🛡️ Security & Stability Improvements (v1.6.0)
- Independent ActionBar alerts
- Configurable sound & particle alerts with per-player cooldown
- Zip-bomb protection in Auto Backup
- SHA-256 checksum verification for backups
- Rate limiting + optional IP whitelist for Web Dashboard
- Strong random token auto-generation for web auth
- Entity count cap in audit reports
- Improved re-entrancy protection
---
## 🌐 Web Dashboard
Access at: `http://your-server-ip:8080`
- Clean, responsive interface
- Real-time TPS + history chart
- Per-world status
- Secure Bearer Token authentication (recommended)
- Rate limiting enabled by default
---
## 📄 License
APACHE 2.0
---
**Thank you for using NeuroLag!**
We hope your server runs smoother and more stably than ever.
---
**Made with ❤️ by Duong2012G**