
NeuroLag
A smart, resource-aware optimization plugin that dynamically adjusts Mob AI based on server TPS and RAM to ensure a lag-free SMP experience
[1.8.0] — 2026-06-01 — Code Audit: Complete Bug-Fix & Refactor Release
Full-source audit pass following v1.7.1. Every bug identified during the review has been fixed in this release. Two partially-finished refactors from the 1.7.x cycle have been completed, and dead code has been removed.
[1.7.1] — 2026-05-18 — Bug Fix Release
This release corrects five bugs identified in a full source-code audit of 1.7.0. Three of them were silent correctness failures that made advertised features behave differently from their documented intent without producing any visible error.
🔴 Critical Fixes
Fixed —
LagEngine— Safe Mode FOLLOW_RANGE silently overwritten every tick- Root cause: After
SafeModeOptimizer.applySafeMode()setFOLLOW_RANGE = 4.0, the lambda inapplyAiBatched()fell through to an unconditionalattr.setBaseValue(attr.getDefaultValue() * multiplier)at the bottom of the loop. In CRITICAL statemultiplier = 1.0, so the attribute was reset to its default value on every single tick — completely negating the FOLLOW_RANGE reduction that Safe Mode is supposed to maintain. - Fix: Added
continueimmediately aftersafeModeOptimizer.applySafeMode(mob)to skip the unconditionalsetBaseValueline, matching the existing pattern used by the pathfinding-distance branch above it. - Impact: Safe Mode now actually reduces mob target-scanning range during CRITICAL
state as documented. Servers using
safe-mode: truewill see measurably lower entity processing cost during lag spikes.
Fixed —
SafeModeOptimizer—NullPointerExceptioncrash on certain entity types- Root cause:
disableExpensiveAI()and the previousrestoreAI()calledmob.getAttribute(FOLLOW_RANGE).setBaseValue(...)without a null-check.getAttribute()returnsnullfor entity types that do not exposeFOLLOW_RANGE(e.g. Slime, Bat, some modded mobs), causing an unhandledNullPointerExceptionthat bubbled up through the scheduler and printed a stack trace every tick. - Fix: Extracted the result of
getAttribute()into a local variable and guarded both call sites withif (attr != null).
Fixed —
SafeModeOptimizer—restoreAI()used a hardcoded FOLLOW_RANGE table- Root cause: The previous implementation maintained an internal
switchtable mappingEntityType → doublefor the restore path. This table was incomplete (missing dozens of types) and ignored any custom attributes set by other plugins or datapacks, silently restoring the wrong range. - Fix: Replaced the hardcoded table with
attr.getDefaultValue(), which reads the actual server-side default and therefore works correctly for all entity types including custom ones.
🟡 Medium Fixes
Fixed —
LagEngine—applyDifficultyScaling()had HARD and EASY inverted- Root cause:
case HARD → tps + 1.0raised the effective TPS, causing optimizations to trigger later on Hard worlds.case EASY → tps - 1.0lowered it, triggering optimizations earlier on Easy worlds. Both are the opposite of what the logic requires: Hard mobs pathfind more aggressively and consume more CPU; optimizations should therefore activate sooner, not later. - Fix: Swapped the offsets —
EASY → tps + 1.0,HARD → tps - 1.0. - Impact: Servers running Hard difficulty worlds will now have mob AI throttled earlier under load, meaningfully reducing the lag window that was previously unaddressed.
Fixed —
WebDashboard— Rate-limit map memory leak on long-running servers- Root cause:
rateLimitCountersandrateLimitWindowsonly cleared onstop(). Each unique IP that ever touched the dashboard created a permanent entry. On servers with public web dashboards, scanner/probe traffic could accumulate thousands of entries over days of uptime without any mechanism to reclaim the memory. - Fix: At the start of each
checkRateLimit()call, entries whose 60-second window has already expired are pruned viaremoveIf, andrateLimitCountersis kept in sync viaretainAll. Cost is amortised O(n) across all incoming requests — negligible compared to the HTTP overhead of each call.
🛠️ Code Quality
Documented —
LagEngine—AIThrottlerfield is intentionally unused- The 1.7.0 refactor extracted
AIThrottleras a separate class but did not update theapplyAiBatched()call site to delegate to it. The inline throttle logic continued to run usingLagEngine's ownthrottleCounters, leavingAIThrottleras unreachable code with its own duplicate counter map. - This release adds an explicit
NOTEcomment on the field explaining why the field exists, why it is not called, and what is required before delegation can be completed safely. No behaviour change — cleanup is deferred to a dedicated refactor release.
- Root cause: After
[1.7.0] — 2026-05-01 — Major Architecture & Algorithm Improvements
🚀 Major Features
-
Safe Mode for Critical State
- Added
safe-modeconfiguration option under critical TPS tier - Implemented
SafeModeOptimizerto selectively disable dangerous AI components while preserving essential game mechanics - Prevents over-optimization that breaks villager trading, mob escaping water, and other critical behaviors
- Added
-
LagEngine Refactoring
- Extracted optimization logic into dedicated classes following Single Responsibility Principle:
MobCuller- Entity culling with intelligent importance scoringAIThrottler- AI throttling and tick managementSpawnSuppressor- Spawn rate adjustment logic
- Improved code maintainability and testability
- Extracted optimization logic into dedicated classes following Single Responsibility Principle:
-
Event-Driven Architecture
- Implemented EventBus pattern for decoupled optimization logic:
OptimizationEventBus- Central event dispatcherOptimizationEvent- Event data containerOptimizationListener- Interface for event handlers- Enables plugins/addons to react to optimization state changes
- Implemented EventBus pattern for decoupled optimization logic:
-
Mob Importance Scoring System
- Created
MobImportanceScorerwith comprehensive importance evaluation:- Base scores for all entity types (bosses: 1000, villagers: 100, hostile: 10-20, etc.)
- Dynamic scoring factors: named mobs (10x), tamed mobs (20x), equipment (1.5x)
- Integration with MobCuller for intelligent culling decisions
- Created
-
Mob Behavior Groups
- Implemented
MobBehaviorGroupssystem for targeted optimization:- PASSIVE (low priority): Cows, pigs, sheep, chickens
- AGGRESSIVE (high priority): Zombies, skeletons, creepers
- NEUTRAL (medium priority): Endermen, iron golems
- SPECIAL (preserve): Villagers, bosses, named mobs
- AQUATIC (water-based): Dolphins, guardians, squids
- Implemented
🧠 Algorithm Improvements
-
RegionOptimizer Enhancements
- Dynamic Region Sizing: Automatically adjusts region size based on player count
- 0-5 players: 16 chunks (large regions)
- 6-20 players: 8 chunks (medium regions)
- 21-50 players: 4 chunks (small regions)
- 50+ players: 2 chunks (very small regions)
- Hot Region Decay: Regions gradually cool down when players leave
- Heat decays at 5% per second when no players present
- Prevents regions from staying hot indefinitely
- Dynamic Region Sizing: Automatically adjusts region size based on player count
-
PredictiveScheduler Algorithms
- EWMA (Exponentially Weighted Moving Average): Better short-term TPS prediction
- Alpha smoothing factor of 0.3 for optimal responsiveness
- Linear Regression: Trend analysis for TPS decline detection
- Combines simple average, EWMA, and trend for robust prediction
- More accurate lag prevention than simple hourly averages
- EWMA (Exponentially Weighted Moving Average): Better short-term TPS prediction
🛠️ Configuration Management
-
Annotation-Based Validation
@ConfigValidationannotation for field-level validation rulesConfigValidatorclass with automatic validation on reload- Validates numeric ranges, required fields, and boundary warnings
- Provides clear error messages and validation reports
-
Config Migration System
- Automatic version checking and stepwise migrations
- Backup creation before migration with rollback capability
- Supports migration of config.yml, features.yml, monitors.yml, systems.yml
- Preserves user settings while updating structure
📚 Documentation
-
Comprehensive Config Guide
CONFIG-GUIDE.mdwith detailed explanations for all settings- Usage examples, recommended values, and troubleshooting tips
- Clear organization by functional areas
-
Enhanced Config Comments
- Added detailed explanations to all YAML configuration files
- Section headers and inline comments for better understanding
- Security notes and setup instructions where applicable
🔧 Code Quality Improvements
-
Single Responsibility Principle
- Each class has a single, well-defined responsibility
- Reduced coupling between components
- Improved testability and maintainability
-
Modern Java Practices
- Updated deprecated Bukkit method usage
- Proper exception handling and logging
- Thread-safe data structures where appropriate
🎯 Performance Optimizations
-
Intelligent Culling
- Prioritizes removing low-importance mobs first
- Preserves named, tamed, and special mobs
- Reduces impact on gameplay while maintaining server performance
-
Targeted Optimization
- Behavior-based optimization strategies
- Different approaches for different mob types
- More efficient than one-size-fits-all approach
🔄 Backward Compatibility
- Seamless Migration
- Automatic config updates preserve existing functionality
- Graceful handling of missing or corrupt configuration files
- No breaking changes to existing setups
🐛 Bug Fixes
-
Fixed Memory Leaks
- Proper cleanup of event listeners and cached data
- Thread-safe collections with proper synchronization
-
Improved Error Handling
- Better exception messages and logging
- Graceful degradation when components fail
- Validation prevents invalid configurations
-
Нет описания изменений
[1.5.2] — 2026-04-23 — Bug Fix & Safety Patch
Fixed —
plugin.yml- Critical: wrong
api-version—api-versionwas set to1.5.1(the plugin version) instead of the required Bukkit API version1.21. Paper rejects plugins with a non-standardapi-versionstring, causing the plugin to either fail to load or log a persistent warning on every server start. Changed toapi-version: 1.21.
Fixed —
WebDashboard- Token not generated when
monitors.ymlis deleted or web dashboard is disabled.ensureStrongToken()was only called after theif (!webDashboardEnabled) returnguard, meaning servers that had the dashboard disabled (or whosemonitors.ymlwas deleted and recreated bysaveResource) would still have the default placeholder token the first time the dashboard was enabled — a silent security hole.ensureStrongToken()now runs before the enabled check on everystart()call.- If
monitors.ymldoes not yet exist,saveResource()is called first to create the file structure before the generated token is written into it.
Fixed —
LagEngine— Culling count wrong when protected zones are present- Protected-zone mobs were counted toward
targetRemoveCountbut never actually removed, causing the cull pass to under-remove and leaving entity counts abovemaxEntitiesindefinitely on servers with active zone protection.cull()now pre-filters protected mobs from the candidate pool before computingtargetRemoveCount, so the removal math uses only the actually-cullable mob count.- The redundant zone check inside the removal loop is kept as a race-condition safety net.
Fixed —
LagEngine— AI update scheduler saturation on very mob-dense worlds- No upper bound on
runTaskLatercalls per tick — on worlds with thousands of entities,applyAiBatched()could schedule dozens of batch tasks in a single tick, queuing more work than the scheduler could drain, leading to compounding latency.- Added
AI_UPDATE_PER_TICK_CAP = 80: at most 80 mob AI updates are scheduled per engine tick. The next monitor tick processes the remaining mobs, spreading load evenly.
- Added
Fixed —
StressTestManager— Server crash on large spawns at low-chunk-count locations- No per-chunk mob density check — spawning 2 000+ mobs at or near the world spawn could
saturate loaded chunks and crash the server within seconds.
- Before spawning, the manager now scans a 7×7 chunk area around the target location and
compares the current entity count against
stress-test.max-mobs-per-chunk(default: 80). - If the limit would be exceeded, the spawn count is automatically reduced to the safe maximum and a warning is logged. If the area is already at capacity, the command is rejected with a descriptive error message.
- Before spawning, the manager now scans a 7×7 chunk area around the target location and
compares the current entity count against
- New config key in
systems.yml:stress-test.max-mobs-per-chunk: 80.
Fixed —
MultiServerSync— MySQL reconnect attempt logged on every polling cycle- When the MySQL database was down for an extended period,
ensureConnected()logged"MySQL connection lost — reconnecting in Xs…"on every poll interval (default every 10 s), flooding the console with hundreds of lines.- Reconnect log messages are now gated behind the same power-of-2 streak filter already used for SQL error warnings (logs on streak 1, 2, 4, 8, 16 …), reducing noise by up to 95% during prolonged outages while still keeping the first occurrence visible.
Config changes
# systems.yml — new in 1.5.2 stress-test: max-mobs-per-chunk: 80 # NEW — per-chunk density safety cap for stress tests- Critical: wrong
[1.5.1] — 2026-04-20 — Code Quality & Performance Patch
Fixed / Improved — ZoneManager
- WorldGuard region cache —
getApplicableRegions()was called for every mob on every monitor tick. Queries are now cached per chunk with a 100-tick TTL (ConcurrentHashMap). Cache is invalidated automatically when TTL expires, eliminating excessive WorldGuard API pressure on large servers. - CuboidZone coords changed from
doubletoint— block-level precision is sufficient; int arithmetic is faster and the record is more memory-efficient. - Zone
initialize()now clears the WG cache on reload.
Fixed / Improved — ProfileManager
- Profile validation before apply — switching to a profile where
critical-tps ≥ medium-tpsormax-entities < 1now returns a clear error instead of silently corrupting the engine state. - Active profile persisted across restarts — the selected profile name is written to
plugins/NeuroLag/active-profile.daton switch and reloaded automatically on startup/reload, so profiles survive server restarts without manual re-selection. switchProfile()return type changed frombooleantoString(null = success,"NOT_FOUND"or error message = failure) — NeuroLag main command updated accordingly.
Fixed / Improved — PredictiveScheduler
- Hand-rolled JSON parser replaced with Gson (bundled by Paper) — the previous
split/replaceAllparser was fragile and could silently produce wrong data on corrupt files. Gson provides safe serialisation and clean error handling; corrupt files now log a warning instead of producing garbage hourly averages. - Loaded samples are capped to the last 60 per hour on load, not only on record.
Fixed / Improved — CpuMonitor
- Graceful fallback for non-Sun JVMs — if
com.sun.management.OperatingSystemMXBeanis unavailable (GraalVM, some container JVMs), the monitor now falls back toOperatingSystemMXBean.getSystemLoadAverage()normalised by CPU count. If even that is unavailable, the feature disables itself gracefully instead of throwing at construction time. - EMA smoothing (α = 0.3) — single-tick CPU spikes no longer toggle the throttle on/off erratically. The exponential moving average keeps the reading stable under transient load.
- Strategy (SUN_PROCESS / SYSTEM_LOAD / DISABLED) is selected once at construction and
stored in an enum — no repeated
instanceofchecks every tick.
Fixed / Improved — RegionOptimizer
- Player chunk position cache —
refresh()now tracks each player's last known chunk. The HOT/COLD region map is only rebuilt when at least one player has moved to a different chunk since the previous call. On a stable server this eliminates the full-player-scan every monitor tick. isBeyondPathfindingDistance()uses the cached positions instead of callingworld.getPlayers()a second time per mob check.
Fixed / Improved — NeuroLagAPI
- Added
NeuroLagAPI.getInstance()for cleaner third-party plugin integration. - JSON payload sent via plugin message channel now uses Gson instead of manual StringBuilder, eliminating potential escape bugs.
Fixed / Improved — LagReporter (Discord)
- Retry with exponential back-off — Discord webhook requests are retried up to 3 times (delays: 1 s → 2 s → 4 s) before giving up. Transient network errors and Discord 429 rate-limit responses no longer silently drop notifications.
- Discord embed payload now built with Gson — no more manual string escaping.
Fixed / Improved — StressTestManager
- Confirmation prompt for spawns > 1 000 mobs — the sender must repeat the command within 30 seconds to confirm. Prevents accidental large spawns.
- Multiple entity types —
stress-test.entity-typesconfig list (default: ZOMBIE, SKELETON, CREEPER) is cycled round-robin across spawned mobs, producing a more realistic mixed load. Invalid or non-spawnable type names log a warning and are skipped.
Fixed / Improved — LagEngine
- Added internal processing metrics:
lastTickMobCountandlastTickProcessingMs. Visible in/nlag status("Last Tick: N mobs, X ms"). ZoneManager.tick()is now called once per engine tick to advance the WG cache TTL counter.
Fixed / Improved — WebDashboard
- Rate limiting now also covers
GET /(the HTML dashboard page), not only/api/*endpoints. - Token auto-generation log output upgraded to
SEVERElevel and formatted as a clearly visible bordered block so admins cannot miss the new token in the console.
Fixed / Improved — ConfigManager / ConfigValidator
- Added
stress-test.entity-typeslist field. ConfigValidatornow checksentity-typeslist is non-empty when stress test is enabled.
Config changes (
systems.yml)stress-test: entity-types: # NEW — 1.5.1 - ZOMBIE - SKELETON - CREEPER- WorldGuard region cache —
[1.5.0] — 2026-04-19 — Security Hardening & Stability Release
Fixed — Security
- [Bug #1] Web dashboard weak default token / no rate limiting / no IP filtering
(
WebDashboard.java,ConfigManager.java,monitors.yml)- Auto-generates a cryptographically strong 24-byte random token on first startup
whenever the default placeholder
"change-this-token-now"is detected. The new token is immediately persisted tomonitors.ymland printed to the console. - Added per-IP rate limiting (sliding 60-second window, configurable via
web-dashboard.rate-limit.max-requests-per-minute, default 60). Returns HTTP 429 when the limit is exceeded. - Added optional IP allow-list (
web-dashboard.ip-whitelist, disabled by default). When enabled, only explicitly listed IPs can reach/api/statusand/api/cmd.
- Auto-generates a cryptographically strong 24-byte random token on first startup
whenever the default placeholder
Fixed — Stability
-
[Bug #2] Stress test could spawn unlimited mobs with no cooldown (
StressTestManager.java,ConfigManager.java,systems.yml)- Hard cap: mob count is clamped to
stress-test.max-mob-count(default 2 000) regardless of the value passed to/nlag stresstest. The sender is notified when the cap applies. - Cooldown: a configurable
stress-test.cooldown-seconds(default 300) must elapse between tests. Attempting to start a test during cooldown shows the remaining time. - Both limits are enforced by
ConfigValidator.
- Hard cap: mob count is clamped to
-
[Bug #3] Redis subscriber join(3000) always timed out on slow networks (
MultiServerSync.java)stop()now holds avolatilereference to the activeJedisPubSubinstance and callspubSub.unsubscribe()beforeinterrupt()+join(). This signals the blockingjedis.subscribe()call to return immediately, sojoin()completes in milliseconds rather than timing out. Prevents connection-pool leaks during rapid/nlag reloadcycles.
-
[Bug #4] Smart culling could remove hundreds of entities in one pass → lag spike (
LagEngine.java)- Added
CULL_PER_TICK_CAP = 50— at most 50 entities are removed per cull invocation. If the entity count remains abovemax-entities-per-worldafter one pass, the next monitor tick handles the remainder. Eliminates the single-frame mob-removal lag spike seen on servers with thousands of entities.
- Added
-
[Bug #5] Predictive scheduler lost all historical data on server restart (
PredictiveScheduler.java)- Hourly TPS samples are now saved to
plugins/NeuroLag/predictive-data.jsononstop()(server shutdown or/nlag reload) and reloaded onstart(). No external library required — uses a compact hand-rolled JSON serializer/parser. The predictor now accumulates knowledge across restarts and becomes effective much faster on busy servers.
- Hourly TPS samples are now saved to
-
[Bug #6] Full plugin reload caused noticeable server stutter (
NeuroLag.java)reloadPluginState()now takes config snapshots before reloading and selectively restarts only the services whose configuration sections actually changed (web dashboard, multi-server sync, predictive scheduler, CPU monitor, boss-bar dashboard). The main monitor task and engine throttle are always restarted cleanly. On a typical/nlag reloadthat only changes TPS thresholds, zero external services are bounced, eliminating the stutter caused by restarting Redis/MySQL connections unnecessarily.
Changed
ConfigValidatornow validates the new stress-test limits and rate-limit settings.systems.yml— addedstress-test.max-mob-countandstress-test.cooldown-seconds.monitors.yml— addedweb-dashboard.rate-limitandweb-dashboard.ip-whitelistsections.
- [Bug #1] Web dashboard weak default token / no rate limiting / no IP filtering
(
[1.4.1] — 2026-04-18 — Bug Fix Release
Fixed — Critical
-
Task leak on reload (
/nlag reload) —BackupManager.start()was called twice inonEnable()(once directly, once viastartRuntimeServices()), causing every scheduled task to be registered a second time on reload. The duplicate direct call has been removed; the initial backup is now triggered asynchronously insidestart()when no backups exist.stopRuntimeServices()now also callsengine.cancelAllPendingBatchTasks()before stopping the throttle task, ensuring all in-flightrunTaskLaterbatch tasks are cancelled before any new tasks are registered. (LagEngine,NeuroLag) -
collectTargets()running every tick on the main thread —LagEngine.collectTargets()calledworld.getLivingEntities()on every monitor tick, causing significant lag spikes on servers with large mob populations. The result is now cached per-world and rebuilt at most once every 4 ticks (~0.2 s). The cache is invalidated onrestoreAll()and on world state transitions. (LagEngine) -
FOLLOW_RANGE not fully restored for protected-zone mobs —
applyAiBatched()setAI = truefor protected mobs but did not always restoreFOLLOW_RANGEto its default value, so mobs could permanently retain a reduced follow range after leaving a zone. The fix unconditionally callsattr.setBaseValue(attr.getDefaultValue())for every protected mob encountered. Additionally, a newrestoreWorld(World)helper is called whenever a world transitions back toNORMAL, guaranteeing a full attribute restore even for mobs that were never re-processed by the batch scheduler. (LagEngine) -
Manual override (
/nlag toggle) not restoring mobs correctly — in-flightrunTaskLaterbatch tasks scheduled byapplyAiBatched()could execute afterrestoreAll()and re-apply AI restrictions or reduced follow ranges, leaving mobs frozen.handleToggle()now callsengine.cancelAllPendingBatchTasks()beforeengine.restoreAll()so no pending task survives the toggle. (LagEngine,NeuroLag)
Fixed — High
-
WebDashboard query-string token auth — passing
?token=...in the URL is insecure (tokens appear in server access logs, browser history, and HTTP referrer headers). The query-string fallback is now disabled by default. A new config keyweb-dashboard.auth.allow-query-token(defaultfalse) must be explicitly set totrueto re-enable it. The existing warning is preserved and now also states the config key needed to disable the fallback permanently. (WebDashboard,ConfigManager,monitors.yml) -
Redis subscriber thread not shutting down gracefully —
MultiServerSync.stop()calledredisSubThread.interrupt()but returned immediately, so the thread could still be holding a Jedis resource whenjedisPool.close()ran, causing pool-exhaustion exceptions in the server log on every reload. The fix addsredisSubThread.join(3000)afterinterrupt(), giving the thread up to 3 seconds to exit cleanly before the pool is closed. (MultiServerSync) -
MySQL reconnect logic throwing repeatedly when DB is down —
ensureConnected()calledDriverManager.getConnection()immediately on every sync cycle failure, flooding the log with stack traces. The fix introduces an atomic error-streak counter and an exponential back-off (sleep time =min(streak * 2, 30)seconds before reconnect). Log output now uses a power-of-two gating strategy (log on streak 1, 2, 4, 8, 16, …) to avoid noise during prolonged outages. (MultiServerSync) -
Batched AI task delay not capped — with 5 000+ mobs the delay between batches could reach 100 ticks (5 seconds), making mobs visibly unresponsive. The delay is now capped at 20 ticks (1 second) regardless of entity count. (
LagEngine) -
Smart culling could remove protected-zone mobs — the culling loop checked
zoneManager.isProtected()only in the main optimization path, not insidecull()itself. Mobs inside protected zones can now never be removed by smart culling. (LagEngine) -
BackupManager not backing up the
lang/directory — the ZIP bundle only included root-level.ymlfiles. Custom language files stored inplugins/NeuroLag/lang/would be lost on restore.collectConfigFiles()now recursively includeslang/*.ymlentries andrestoreZip()correctly recreates thelang/subdirectory on restore. (BackupManager)
-
[1.4.0] — Stability + lifecycle fix release
Fixed
- Removed the command-level permission wall in
plugin.ymlso feature-specific permissions can actually work. - Reworked
/nlag toggleso manual override now restores mobs immediately and stops active throttling instead of leaving old optimization state hanging. - Reworked
/nlag reloadto stop and restart runtime services cleanly, including CPU monitor, predictive scheduler, web dashboard, backup scheduler, multi-server sync, and monitor tasks. - Multi-server sync now clears stale peers and restarts cleanly on reload.
- Protected-zone mobs are now excluded from smart culling and have
FOLLOW_RANGErestored to defaults when encountered during optimization. - Ongoing
MEDIUMandCRITICALstates now keep reapplying optimization passes on later monitor ticks, so movement into protected zones / hot zones / player zones is handled more consistently. - Stress-test mobs no longer give themselves a custom name, so they are no longer accidentally excluded by the named-mob whitelist.
- Backup system now stores full zip bundles of NeuroLag YAML files instead of only copying
config.yml. - Added restore-by-name support for
/nlag backup restore <file>. - Memory-pressure config now normalizes legacy percentage values above
1.0, and defaults were corrected to ratio format (0.80). - Player-scaling ratio is now clamped to avoid negative threshold offsets when online players are below the configured minimum.
- Predictive scheduler now clears parsed peak-hour ranges on restart/reload to avoid duplicate entries.
- Zone manager now fully resets cached zone and WorldGuard state when the feature is disabled or reloaded.
- Web/API JSON generation now escapes keys/values properly and uses stable decimal formatting.
- Web auth query token parsing is stricter and only logs the fallback warning once.
- CPU monitor now resets stale displayed values when stopped or disabled.
- BossBar dashboard now respects
dashboard.bossbar.nameanddashboard.bossbar.colorfrommonitors.yml. - Metrics API plugin-message registration now reads the correct split config source.
Docs
- Updated README to reflect the real split-config layout.
- Updated README examples for
web-dashboard,multi-server,zone-protection,config-profiles, and backup restore. - Updated language file version headers to
v1.4.0.
- Removed the command-level permission wall in
[1.3.1] — Bug Fix Release
🐛 Fixed
-
[CRITICAL] FOLLOW_RANGE stuck at 0 after mob returns near player Mobs whose
FOLLOW_RANGEwas zeroed by the pathfinding-distance optimiser were never restored when they re-entered a player's chunk radius. They would remain AI-enabled but permanently unable to pathfind, appearing frozen. Fix: restoreFOLLOW_RANGEtodefaultValue × multiplierinside thenearPlayer || hotRegionbranch ofapplyAiBatched(). -
[CRITICAL] ConcurrentModificationException on
tpsHistorybetween main thread and HTTP threadtpsHistorywas anArrayDeque— not thread-safe. The Bukkit main thread writes to it every tick while the Web Dashboard HTTP thread pool iterates it on every/api/statusrequest, causing intermittent exceptions. Fix: replaced withConcurrentLinkedDeque. AddedvolatiletotpsSum,tpsCount,criticalActivations, andmediumActivationsfor JMM visibility. -
[CRITICAL] MySQL connection silently dies after DB restart or idle timeout A single
Connectionwas reused indefinitely. When MySQL restarted or timed out, all subsequent sync calls threwSQLExceptionsilently, leaving multi-server sync permanently broken with no visible warning. Fix: addedensureConnected()that checksisClosed()and reconnects automatically before eachupsertMysql()/readPeersMysql()call. -
[MEDIUM] autoRestoreOnError never works on first plugin startup The backup-restore safety net checked for existing backups before any had been created, so it could never restore on a fresh install. Fix:
doBackup()is now called immediately at startup before the check. -
[MEDIUM] StressTestManager.finish() could run twice, emitting duplicate audit reports If the Bukkit scheduler fired the deferred
finish()in the same tick as an earlystop()call, both executions would complete and emit an audit report. Fix:finish()returns immediately ifrunningis alreadyfalse. -
[MEDIUM] Web API /api/cmd whitelist bypassable via prefix matching
body.startsWith(a)allowed inputs like"reloadEvil"to pass the filter. Fix: the first token is extracted and matched exactly against the allowlist.
🔒 Security
- Web auth token warned when passed via URL query param
?token=xxxleaks into browser history and proxy logs.Authorization: Bearerheader is now the primary path; query-param auth logs a one-time warning.
⚡ Performance
- Redis publisher now uses JedisPool
A fresh TCP connection was opened and closed every 5 seconds. A bounded
JedisPool(max 8 / idle 2) is created at startup and shared by publisher and subscriber, eliminating per-publish connection overhead.
-
[1.3.0] — 2026-03-15
🐛 Bug Fixes (9 fixes)
BUG-A — ZoneManager: world name dropped from cuboid zones (cross-world contamination)
- Root cause:
ZoneManager.initialize()parsed zone entries as"world x1 y1 z1 x2 y2 z2"(7 parts) but stored onlyparts[1]..parts[6]in a rawdouble[], silently discardingparts[0](the world name). - Effect: A zone defined in world
survivalwould also protect mobs at the same coordinates inworld_nether,world_the_end, and any other loaded world. Mobs in unintended worlds were immune to optimization. - Fix: Replaced
List<double[]>withList<CuboidZone>whereCuboidZoneis a JavarecordholdingString world+ 6 coordinates.isProtected()now checksmob.getWorld().getName().equals(z.world())before testing coordinates.
BUG-B — RegionOptimizer: negative chunk coordinates mapped to wrong region
- Root cause: Region index was computed as
chunkX / regionSizeusing Java integer division, which truncates toward zero. Chunk-1 / 16 = 0and chunk1 / 16 = 0, so chunks in the negative quadrant near spawn mapped to the same region keys as their positive counterparts. - Effect: The HOT region around coordinate origin (0,0) was effectively double-sized. Mobs at negative chunk coordinates near spawn were optimized even when a player was present nearby.
- Fix: Replaced
/withMath.floorDiv()in bothrefresh()andisHot().Math.floorDiv(-1, 16) = -1(correct),Math.floorDiv(15, 16) = 0(correct).
BUG-C — DashboardManager:
type: HOLOGRAMsilently did nothing- Root cause:
DashboardManager.start()returned early withif (!dashboardType.equals("BOSSBAR")) return— no log message, no error. Admins who setdashboard.type: HOLOGRAMsaw no dashboard and received no indication why. - Fix: Added an explicit
plugin.getLogger().warning()message when a non-BOSSBAR type is configured, clearly stating that only BOSSBAR is currently supported.
BUG-D — BackupManager:
creationTime()unreliable on Linux (ext4)- Root cause: Backup rotation used
Files.readAttributes(...).creationTime()to sort backups oldest-first. The ext4 filesystem does not store inode creation time — it returnsInstant.EPOCH(1970-01-01) for all files, making sort order undefined. - Effect: On Linux servers, the "oldest" backup was selected randomly. The wrong backup could be deleted or restored.
- Fix: Replaced
creationTime()withFiles.getLastModifiedTime(), which is reliably stored on all filesystems. Also removed the now-unusedBasicFileAttributesimport.
BUG-E — StressTestManager: always spawned at
world[0]spawn, ignoring admin's location- Root cause:
start()hardcodedBukkit.getWorlds().get(0).getSpawnLocation()as the spawn center regardless of where the admin was or which world they were in. - Effect: Running
/nlag stresstestfrom the Nether or End spawned mobs in the Overworld at spawn, making the test meaningless for other worlds. - Fix:
start()now accepts aCommandSenderparameter. If the sender is aPlayer, mobs spawn centered on the player's current location in their current world. Console fallback remainsworld[0]spawn.
BUG-F — WebDashboard: POST
/api/cmdblocked by CORS preflight (OPTIONS)- Root cause: Browsers send an HTTP
OPTIONSpreflight request before a cross-originPOST. The server had no handler forOPTIONSand returned405 Method Not Allowed, causing the browser to abort the actualPOST. - Effect: The "send command" button in external web dashboards or REST clients always failed silently.
- Fix: Added
sendCorsOptions()helper that returns204 No ContentwithAccess-Control-Allow-Methods: GET, POST, OPTIONSandAccess-Control-Allow-Headers: Authorization, Content-Type. Both/api/statusand/api/cmdnow handleOPTIONSbefore auth checks.
BUG-G — AuditManager:
getLivingEntities()/getLoadedChunks()called on main thread- Root cause:
snapshot()iterated all entities and chunks synchronously on the main thread before handing off to async write. - Effect: On servers with many mobs or chunks, this could stall the main thread for several milliseconds during audit generation.
- Mitigation: Added an explicit code comment documenting this limitation and the reason it is required by the Bukkit API. A full async snapshot would require a thread-safe entity iterator not currently available in Paper's public API.
BUG-H — ProfileManager:
clearProfile()required a fullcfg.reload()to restore values- Root cause:
switchProfile()overwrotecfg.tpsCritical,cfg.tpsMedium, andcfg.maxEntitiesdirectly.clearProfile()only setactiveProfile = nulland left a comment saying "caller is responsible for reloading", whichNeuroLag.javaimplemented by callingcfg.reload() + engine.restoreAll() + startMonitor()— a heavy operation that re-read disk and restarted all tasks. - Fix:
ProfileManagernow saves the three base values insaveBaseValues()(called in the constructor and after everycfg.reload()).clearProfile()restores them directly — no reload required./nlag profile clearno longer triggers a full config reload cycle.
BUG-I — LagEngine: "Animation Freezing" comment/name mismatched actual behavior
- Root cause: Feature F4 was named "Animation Freezing" throughout the codebase, but the implementation only called
mob.setVelocity(0,0,0). This stops movement drift but does not freeze animation frames — mobs still visibly idle-animate. - Fix: Renamed the in-code comment to "Velocity Freeze" and added a note explaining that true animation-frame control requires NMS/packet-level access not available through the standard Bukkit API.
🔧 Other Changes
plugin.yml: version bumped to 1.3.0; permission descriptions clarified;neurolag.stresstestdescription now mentions mobs spawn at your locationpom.xml: version bumped to 1.3.0StressTestManager.start()signature changed tostart(int count, int durationMinutes, CommandSender sender)— callers updated inNeuroLag.javaProfileManager.saveBaseValues()is now public soNeuroLag.javacan call it after/nlag reload
- Root cause:
[1.2.0] — 2026-03-14
🎉 All 18 Advertised Features — Now Fully Implemented
Every feature listed in the README and CHANGELOG since v1.1.0 now has real working code.
New Java Classes (15 new files)
Class Feature CpuMonitor.javaF1 — CPU throttling via com.sun.management.OperatingSystemMXBeanRegionOptimizer.javaF2 — 16×16 chunk region grid, HOT/COLD classification MobWeightManager.javaF3 — Per-type weight budget per chunk DashboardManager.javaF6 — Live BossBar (BLUE→YELLOW→RED) for all operators AuditManager.javaF7 — Full HTML audit report (specs, plugins, mobs, chunks) MultiServerSync.javaF8 — Redis Jedis pub/sub + MySQL JDBC upsert WebDashboard.javaF10 — Embedded HTTP server (JDK HttpServer), live JS chart, JSON APIPredictiveScheduler.javaF11 — Per-hour TPS pattern tracking + peak-hour config ZoneManager.javaF12 — Cuboid zone list + WorldGuard region soft-depend ProfileManager.javaF14 — Instant profile switching (critical-tps / medium-tps / max-entities) AlertManager.javaF15 — Sound + particle + chat alerts for CRITICAL enter/leave StressTestManager.javaF16 — Mob spawning stress test with auto-cleanup and report ConfigValidator.javaF17 — Range/sanity checks for all config fields BackupManager.javaF18 — Periodic backup + purge + restore NeuroLagAPI.javaF5 — Static public API + plugin messaging channel neurolag:metricsFeatures Integrated into Existing Classes
Feature Location F4 — Animation Freezing (velocity zeroing for distant AI-disabled mobs) LagEngine.applyAiBatched()F9 — AI Difficulty Scaling ( getDifficulty()→ TPS offset)LagEngine.applyDifficultyScaling()F13 — Smart Group Culling (type-aware, min-count guard, POOF particles) LagEngine.cull()F1 TPS penalty integration LagEngine.tick()F2 region check in optimization path LagEngine.applyAiBatched()F3 weight-sorted culling LagEngine.cull()F7 audit on critical event LagReporter.onCriticalStart()F12 zone protection skip LagEngine.applyAiBatched()F11 predictive penalty LagEngine.tick()F15 alert on state change LagEngine.updateWorld()New Commands
/nlag dashboard [off]— toggle BossBar/nlag audit— generate HTML audit report/nlag zone— show loaded zone count/nlag profile [name|clear]— switch config profile/nlag validate— validate config with detailed errors/warnings/nlag backup [list|restore]— manage backups/nlag stresstest [count] [minutes]— run stress test/nlag sync— show Redis/MySQL peer server states
pom.xml Changes
- Jedis 5.0.0 (Redis) — shaded and relocated
- mysql-connector-j 8.3.0 — shaded and relocated
- WorldGuard 7.0.12 — provided/optional (soft-depend)
- Maven Shade plugin configured with relocation rules
plugin.yml Changes
softdepend: [WorldGuard]added
config.yml Changes
dashboard.enabledanddashboard.update-intervaladdedaudit-reports.generate-on-criticaladdedmulti-server.mysql.*section addedzone-protection.zoneslist addedconfig-profiles.profiles.*.medium-tpskey addedalerts.enabledtop-level flag addedstress-test.auto-generate-reportadded
Language Files
- All 7 language files updated to v1.2.0 header
- New keys:
dashboard-bar,alert-critical,alert-recovery,sync-no-peers,sync-peer
[1.1.0] — 2026-03-14
🎉 Major Release: 18 New Advanced Features!
✨ Added
Feature 1: CPU Throttling Mode
- Monitors server CPU usage (not just TPS)
- Activates automatic optimization when CPU > 80%
- Reduces Bukkit task frequency during critical CPU load
- Disables non-essential block physics updates
- Configuration:
cpu-throttling.enabledandcpu-throttling.cpu-threshold
Feature 2: Region-Based Optimization
- Splits world into 16×16 chunk regions
- Disables pathfinding for mobs in far regions
- Smart regional mob optimization instead of global
- Mobs near players always keep full AI
- Configuration:
region-optimization.enabledandregion-optimization.use-regions
Feature 3: Custom Mob Tier Weights
- Assign different "cost" to different mob types
- Zombies cost 1.0, Endermen cost 2.0, Ender Dragons cost 4.0
- Prevents over-optimization (allows more weak mobs)
- Configuration:
mob-weights.weights.*andmob-weights.max-weight-per-chunk - Result: More realistic mob balance during lag
Feature 4: Animation Freezing
- In CRITICAL state, mobs stop playing animations (head turning, arm swinging)
- Only applies to distant mobs (configurable)
- Reduces visual strangeness of frozen mobs
- Configuration:
animation-freezing.enabledandanimation-freezing.freeze-distance-chunks
Feature 5: Real-Time Metrics API
- Other plugins can query NeuroLag's current state
- Methods:
neurolag.getWorldState(),neurolag.getTPS(),neurolag.getAffectedMobCount() - Enable plugin ecosystem around NeuroLag
- Configuration:
metrics-api.enabledandmetrics-api.expose-via-plugin-message
Feature 6: In-Game Dashboard
- Live server health dashboard (BOSSBAR or HOLOGRAM)
- Changes color: BLUE (normal) → YELLOW (MEDIUM) → RED (CRITICAL)
- Updates every 2 seconds
- Configuration:
dashboard.type,dashboard.bossbar,dashboard.hologram
Feature 7: Detailed Lag Audit Reports
- Generate comprehensive lag analysis reports
- Include: server specs, plugin list, chunk stats, mob breakdown, player behavior, network stats
- Export to HTML for easy reading
- Configuration:
audit-reports.enabledandaudit-reports.include - Result: Deep understanding of what causes lag
Feature 8: Multi-Server Sync (Bungeecord/Velocity)
- Share TPS data across all servers
- Redis or MySQL backend support
- Cascade warnings to all servers if one is in CRITICAL
- Load-balance: suggest players move to less-lagged server
- Configuration:
multi-server.enabled,multi-server.backend,multi-server.sync-tps
Feature 9: AI Difficulty Scaling
- Easy mode = aggressive optimization
- Normal mode = balanced
- Hard mode = minimal optimization (players want challenge)
- Hardcore = zero optimization
- Configuration:
ai-difficulty-scaling.enabledandai-difficulty-scaling.scale-with-difficulty - Result: Respects player expectations
Feature 10: Mobile Web Dashboard
- Access metrics from any browser (phone, tablet, PC)
- Real-time TPS graph, mob count, heap usage
- Send commands remotely (
/nlag reload,/nlag toggle) - Token-based authentication
- Configuration:
web-dashboard.enabled,web-dashboard.port,web-dashboard.auth.token - Result: Monitor and control server on the go 📱
Feature 11: Predictive Lag Prevention
- Learns hourly patterns (6pm = always lag, etc)
- Pre-activates optimization before peak hours hit
- Configuration:
predictive-prevention.enabled,predictive-prevention.peak-hours - Result: Be proactive, not reactive
Feature 12: Custom Zones (WorldGuard Integration)
- Mark important regions as HIGH_PRIORITY via WorldGuard
- Examples: boss arenas, spawn, player shops, farms
- Full mob AI always kept in protected zones
- Aggressive optimization elsewhere
- Configuration:
zone-protection.enabledandzone-protection.integrate-worldguard - Result: Protect what matters most
Feature 13: Entity Grouping & Smart Removal
- Remove mobs intelligently during culling
- Never remove single mob types (won't inactivate farms)
- Remove in groups (visually less obvious)
- Particle effect on removal
- Configuration:
smart-culling.enabled,smart-culling.cull-in-groups,smart-culling.min-type-before-cull
Feature 14: Configuration Profiles
- Create multiple config profiles (survival, minigame, peaceful, etc.)
- Switch instantly with
/nlag profile <n> - Each profile can have different TPS triggers and entity limits
- Configuration:
config-profiles.enabledandconfig-profiles.profiles.* - Result: Perfect for multi-mode servers
Feature 15: Audio & Visual Alerts
- Sound alerts when entering/leaving CRITICAL
- Particle warnings around admin
- Chat notifications to all ops
- Customizable sounds (default: bass drop for CRITICAL, pling for recovery)
- Configuration:
alerts.enable-sound-alerts,alerts.alert-sounds.*,alerts.enable-particle-warnings - Result: Immediate awareness without checking commands
Feature 16: Stress Test Mode
- Simulate heavy server load without real players
- Spawn fake mobs (configurable count)
- Test for X minutes and auto-generate report
- Configuration:
stress-test.enabled,stress-test.spawn-fake-mobs,stress-test.fake-mob-count - Result: Safe testing environment 🧪
Feature 17: Configuration Validator
/nlag validatechecks config syntax and values- Warns about invalid settings
- Suggests optimizations
- Configuration:
config-validator.enabled - Result: Prevent config errors before they cause problems
Feature 18: Automatic Config Backup
- Auto-backup config every X minutes (default: 60)
- Keep last N backups (default: 10)
- Auto-restore if invalid config detected
- Configuration:
auto-backup.enabled,auto-backup.backup-interval-minutes,auto-backup.keep-backups - Result: Never lose your config
🌍 Multilingual Support (Added)
- English (EN) — Default
- Tiếng Việt (VI) — Vietnamese
- Español (ES) — Spanish
- Français (FR) — French
- Deutsch (DE) — German
- 日本語 (JA) — Japanese
- 中文 (ZH) — Chinese (Simplified)
Set language in
config.yml:settings.language: EN📝 Documentation
- Completely rewritten README with all 18 features documented
- Multilingual documentation in README (7 languages)
- Comprehensive CHANGELOG (this file)
- Detailed config.yml with all features documented
🔧 Command Enhancements
New commands added:
/nlag dashboard— Show in-game dashboard/nlag audit— Generate audit report/nlag zone— Zone management/nlag profile <n>— Switch config profiles/nlag validate— Validate configuration/nlag backup— Manage config backups/nlag stresstest— Run stress test
🔐 Permission Enhancements
New permissions added:
neurolag.stresstest— Run stress testsneurolag.dashboard— View dashboardneurolag.audit— View audit reportsneurolag.zone— Manage zonesneurolag.profile— Switch profilesneurolag.validate— Validate configneurolag.backup— Manage backupsneurolag.web— Access web dashboardneurolag.api— Access metrics API
📊 Configuration Changes
- Added 18 new configuration sections (one per feature)
- All features can be individually enabled/disabled
- Backward compatible with v1.0.6 configs
- Old config keys still work (will be migrated automatically)
🎯 Performance Improvements
- CPU throttling reduces unnecessary task execution
- Region-based optimization replaces global optimization
- Smart culling reduces entity processing
- Predictive prevention prevents lag spikes before they happen
🐛 Bug Fixes (from v1.0.6)
- ✅ Tick-rate throttling properly activates in MEDIUM state
- ✅ Manual override (
/nlag toggle) now truly pauses monitoring - ✅ Simulate mode no longer throws errors on invalid input
- ✅ Recovery notifications always fire (not suppressed by cooldown)
- ✅ Stale cooldown timestamps cleared on reload
📈 Version Info
- Version: 1.1.0
- Target: Paper 1.21+, Java 21+
- Release Date: 2026-03-14
- Total Features: 18 (from 16 in v1.0.6)
- Supported Languages: 7
- New Files: None (all backwards compatible)
[1.0.6] — 2025-03-11
Fixed
-
Bug — Tick-Rate Throttling (Feature 2) never activated
InapplyAiBatched,shouldHaveAiwas alwaystruefor MEDIUM state becauseglobalAiOn = !state.equals("CRITICAL")evaluates totrue. The throttle condition!shouldHaveAiwas therefore alwaysfalse, so distant mobs in MEDIUM were silently given full AI instead of being throttled.
Fix: chunk proximity is now evaluated independently first. Near-player mobs always get full AI; distant mobs in MEDIUM state enter the throttle queue; CRITICAL mobs getsetAI(false)as intended. -
Bug —
/nlag toggledid not actually pause monitoring
SettingmanualOverride = truehad no effect ontick()— the scheduler task continued running. Fix:monitorTask.cancel()is now called when pausing;startMonitor()is called when resuming (existing behaviour). -
Bug —
/nlag simulate clearthrewNumberFormatException
Tab-complete suggested"clear"as a valid argument, but the code passed it directly toDouble.parseDouble(), crashing with an unhandled exception.
Fix: an explicitequalsIgnoreCase("clear")check now runs before the parse. -
Minor — Recovery (NORMAL) action bar could be suppressed by cooldown
The 5-second notify cooldown was applied to all state transitions, including CRITICAL → NORMAL recovery. If a CRITICAL message had just been sent, admins would miss the recovery notification entirely.
Fix: cooldown only throttles MEDIUM/CRITICAL spam; NORMAL recovery always fires. -
Minor —
notifyTimesmap not cleared onrestoreAll()
Stale cooldown timestamps persisted across/nlag reloadand plugin restarts, causing the first post-reload notification to be silently dropped.
Fix:notifyTimes.clear()added torestoreAll().
[1.0.5] — 2025-03-10
Added
-
Feature 1 — Chunk-Based AI Throttling
Mobs within a configurable chunk radius of any online player always retain their AI, even in CRITICAL state. Only mobs in truly unobserved chunks are disabled. Controlled bychunk-ai.enabledandchunk-ai.distance-chunks. -
Feature 2 — Tick-Rate Throttling
In MEDIUM state, instead of hard-disabling mob AI, a dedicated per-tick task cycles through distant mobs and enables their AI for exactly 1 tick every N ticks. Mobs appear sluggish rather than completely frozen, which feels far more natural in-game. Controlled bytick-throttle.enabledandtick-throttle.ticks-per-ai-tick. -
Feature 3 — Spawn Rate Suppression
During MEDIUM or CRITICAL lag, world monster and animal spawn caps are temporarily lowered to reduce new mob generation. Limits are fully restored on recovery. Controlled byspawn-suppression.*. -
Feature 4 — Per-Player Action Bar Notification
When a player has affected mobs within a configurable radius, they receive a personal action bar message explaining why nearby mobs seem different. Previously only ops received any notification. Controlled byper-player-notify.*. -
Feature 5 —
/nlag simulate <tps>
Overrides the TPS value used by the engine without affecting the real server. Allows admins to test threshold configurations, Discord alerts, and reports without needing actual server lag. Running/nlag simulatewith no argument clears the override. -
Feature 6 — Auto Lag Reports
After recovering from a CRITICAL event that lasted longer thanmin-duration-seconds, a timestamped report is written toplugins/NeuroLag/lag-reports/. Each report includes world name, duration, lowest TPS reached, recovery TPS, affected mob count, online player count, and JVM heap statistics. -
Feature 7 — Entity Whitelist
SpecificEntityTypenames can be added totargets.whitelist-typesto permanently exempt them from all optimization and culling. Additionally,protect-named-mobsandprotect-tamed-mobsoptions prevent NeuroLag from touching player pets, named mobs, and boss entities. -
Feature 8 — Discord Webhook
Posts a rich Discord embed when a world enters CRITICAL lag and when it recovers. The recovery embed includes total CRITICAL duration and the lowest TPS reached. Uses Java 11+HttpClient— no external library required. Controlled bydiscord.*. -
Feature 9 — Memory Pressure Detection
Reads JVM heap usage ratio at each TPS check. When heap exceedstrigger-percent, an additional offset is subtracted from effective TPS before threshold evaluation, causing NeuroLag to act more aggressively when RAM is nearly exhausted. Controlled bymemory-pressure.*. -
Feature 10 — Player-Count Scaling
TPS thresholds are linearly scaled upward as the number of online players increases betweenmin-playersandmax-players. At maximum players, all thresholds shift up bymax-threshold-offsetTPS. Per-world threshold overrides are scaled the same way. Controlled byplayer-scaling.*. -
/nlag simulatetab-completion — suggests common TPS values (5, 10, 15, 18, 20). -
Heap stats in
/nlaghelp panel and/nlag status— shows used/max MB and percentage. -
World state icons in
/nlag status—●NORMAL,▲MEDIUM,✖CRITICAL. -
/nlag togglenow callsrestoreAll()before resuming the monitor, ensuring any frozen mobs are immediately unfrozen.
-
[1.0.4] — 2025-03-10
Fixed
- Deprecated BungeeCord API removed.
spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(...))was replaced with Paper's native Adventure API:player.sendActionBar(LegacyComponentSerializer.legacyAmpersand().deserialize(...)). The old API is not available on Paper 1.21.3 and would cause a crash or silent failure on action bar notifications. pom.xmlversion mismatch fixed.<version>was1.0.0whileplugin.ymldeclared1.0.3, causing Maven to produceNeuroLag-1.0.0.jarinstead of the expected filename.- Hysteresis buffer is now configurable. The recovery buffer (
0.5) was hardcoded incomputeStatus(). It is now read fromsettings.hysteresis-bufferinconfig.yml. /nlag graphwas undocumented. Added toplugin.ymlusage string and to the help message shown by/nlag.shouldOptimizeexplicit cast removed. The(Mob) entitycast afterinstanceof Mobcheck was unnecessary; replaced with pattern-matchinginstanceof Mob mobat the call site.togglecommand no longer leaves mobs frozen. When manual override is turned off,restoreAllAI()is now called before resuming the monitor task so any frozen mobs are immediately unfrozen.- TPS value capped at 20.0 before storing and displaying, preventing artificially high values (Paper can briefly report >20 TPS) from skewing the graph and average.
logEnablednow logs state transitions, including world name, new state, current TPS, and affected mob count — more useful for diagnosing server lag patterns.onDisablelog message added to confirm AI restoration on server shutdown.
Changed
config.ymlcomments rewritten in English and expanded with usage notes for each option.plugin.ymlusage string updated to list all four subcommands:reload,status,toggle,graph.computeStatusrefactored to useswitchexpression (Java 14+) for readability.drawGraphimproved: empty cells now render as░instead of a space, making the chart easier to read in chat.statuscommand now displays per-world states with a(no data yet)fallback when the monitor hasn't run yet.- Added
README.mdandCHANGELOG.md.
- Deprecated BungeeCord API removed.
fixed
🛠️ Changelog - NeuroLag v1.0.2
All notable changes to the NeuroLag plugin in this version are documented below.
[1.0.2] — 2026-03-07
🚀 Performance Optimizations
- Entity Batch Processing: AI updates are now processed in batches of 50 entities per tick. This eliminates the "main thread spike" previously caused by iterating through hundreds of mobs simultaneously during state changes.
- Improved Loop Efficiency: Refactored entity filtering and collection to be more streamlined and performant.
🛡️ Stability Improvements
- State Hysteresis: Implemented a 0.5 TPS buffer zone for state transitions. This prevents "jitter" and notification spam when the server's TPS fluctuates near the 18.0 (Medium) or 15.0 (Critical) thresholds.
- API Compatibility Fixes: Resolved compilation and runtime issues by ensuring compatibility with the Paper 1.21.1 attribute system, while maintaining safe fallbacks for older server environments.
📊 New Features
- Performance Statistics:
- Session Average TPS: Tracks the overall server performance since the last reload/startup.
- Lag Activation Counters: Tracks the frequency of "Medium" and "Critical" lag events.
- Enhanced
/nlag status: Updated command output to include the new Average TPS and Activation statistics for better server monitoring.
🛠️ Maintenance
- Water Mob Audit: Verified and ensured that
WaterMobentities are correctly handled when thetargets.water-mobsconfiguration is enabled. - Configuration Cleanup: Optimized default configuration comments and structure for better usability.
🚀 Release 1.0.1 - Performance & Stability Update
This update focuses on internal optimization, modernizing the codebase for Paper 1.21.1, and fixing several logic gaps found in the initial release.
🛠 Improvements & Optimization
- Engine Optimization: Switched from a global entity loop to
world.getLivingEntities(), significantly reducing CPU usage on high-population servers. - API Modernization: Fully migrated to the modern
Attribute.FOLLOW_RANGEAPI, ensuring long-term compatibility with Paper 1.21.1 and future versions. - Smart Notification Cooldown: Added a 5-second cooldown to Action Bar alerts to prevent message spam when server TPS fluctuates near trigger thresholds.
- Crash Resilience: Implemented an automatic AI restoration sequence on plugin enable to ensure mobs are never stuck without AI due to improper server shutdowns.
🐞 Bug Fixes
- Water Mobs Support: Fixed a bug where
water-mobsinconfig.ymlwere being ignored. The system now correctly optimizes aquatic entities. - Tab-Completion: Refined command suggestions to be more responsive and accurate.
- Logic Sync: Fixed an issue where manual overrides could sometimes conflict with the automated monitoring task.
📦 Technical Note
- Core: Still powered by Java 21 for peak performance.
- Configuration: No changes needed to your existing
config.yml, but we recommend checking ifwater-mobsis set to your preference.
Optimizing the neural pathways of your server. Developed by Duong2012G.
- Engine Optimization: Switched from a global entity loop to
🚀 Release 1.0.0 - Initial Neural Launch
We are excited to introduce the first official release of NeuroLag, a resource-aware neural optimization system designed specifically for modern Minecraft servers.
🌟 New Features
- Neural AI Scaling: Implemented a dynamic performance monitoring system that scales Mob AI complexity based on real-time server TPS.
- Adaptive Pathfinding: Integrated automatic adjustment of the
GENERIC_FOLLOW_RANGEattribute to reduce CPU overhead during lag spikes. - Multi-Tier Logic: Three distinct optimization states: Normal (Full AI), Medium (Throttled Vision), and Critical (AI Paused).
- Admin Dashboard: Added a suite of commands (
/nlag status,/nlag stats,/nlag toggle) for real-time monitoring and manual overrides. - Notification System: Real-time Action Bar alerts for administrators when the neural system changes states.
🛠 Technical Specifications
- Core Engine: Built on Java 21 for maximum performance and modern standard compliance.
- API Compatibility: Optimized for Paper/Spigot 1.21.1.
- Open Source: Released under the Apache License 2.0.
📦 Installation
Simply drop the
NeuroLag-1.0.0.jarinto your plugins folder and restart your server.
Developed with ❤️ by Duong2012G.
