AzLagControl
Minecraft 服务器的专业延迟控制套件 —— 由 AztrixDigitalStudio 开发
AzLagControl 是一个面向 Paper/Spigot 服务器的模块化性能工具包。其核心理念是预防优先,清理为辅:它不仅仅是在损害发生后删除实体,而是主动限制导致延迟的系统(如红石、漏斗、爆炸和怪物过剩),同时提供智能的计划清理、实时性能监控以及当服务器 TPS 崩溃时自动触发的紧急模式。
每个模块完全独立——只需启用你需要的部分。所有配置均可通过 /azlag reload 热重载。
功能特性
| 模块 |
功能说明 |
| 智能清理器 (Smart Cleaner) |
计划性与手动清理掉落的物品、箭矢、投射物,以及可选的怪物/载具。支持倒计时警告、世界过滤和丰富的保护规则(指定名称、驯服、拴绳、乘客、Boss、近期玩家掉落等)。 |
| 智能怪物控制 (Smart Mob Control) |
按类别限制每个区块的怪物数量(动物、怪物、村民、水生生物、环境生物)。对超过限制的区块进行定期溢出清除。支持 Boss 白名单。 |
| 智能物品控制 (Smart Item Control) |
按区块限制地面物品上限,合并附近物品,可配置的消失时间,以及定期物品清理。 |
| 红石控制 (Redstone Control) |
限制每个区块过多的红石状态变化并检测红石时钟。操作选项包括:LOG(记录)、THROTTLE(节流)或 ALERT(通知管理员)。 |
| 漏斗控制 (Hopper Control) |
通过可配置的传输刻速率降低漏斗的 Tick 开销,可选按区块限制漏斗数量,并在 TPS 低于阈值时自动禁用。 |
| 爆炸控制 (Explosion Control) |
限制每 Tick 的爆炸次数、每个区块的 TNT 实体数量和每个区块的苦力怕数量。对于大型 TNT 农场,可选减少方块破坏。 |
| 区块控制 (Chunk Control) |
定期分析区块健康状态,追踪最差的 N 个区块,并在区块实体数超过阈值时通知管理员。 |
| 性能监控 (Performance Monitor) |
实时采样 TPS、MSPT 和内存使用情况,具有滚动历史记录和可配置的警告/严重警报。 |
| 紧急模式 (Emergency Mode) |
在 TPS 严重下降时自动激活。降低视距、停止怪物生成、激进地清除实体、移除 TNT,并可选禁用漏斗——一旦 TPS 恢复则自动停用。 |
| 数据分析 (Analytics) |
保留性能样本的滚动历史记录,并可将快照记录到文件中。 |
依赖要求
- 服务器: Paper 1.20+(全程使用 Spigot 兼容 API;api-version 为
1.20)
- Java: 17 或更高版本
- 可选集成: PlaceholderAPI、spark
该插件无需任何可选依赖即可完全运行。
安装指南
- 从 Modrinth、SpigotMC 或 Releases 页面 下载
AzLagControl-x.y.z.jar。
- 将 jar 文件放入服务器的
plugins/ 文件夹中。
- 重启(或重新加载)服务器。
- 根据需要编辑
plugins/AzLagControl/config.yml,然后运行 /azlag reload。
命令列表
基础命令:/azlagcontrol,别名 /azlag 和 /alc。
| 命令 |
描述 |
/azlag stats |
显示完整服务器统计信息 |
/azlag tps |
显示 TPS(1分钟 / 5分钟 / 15分钟) |
/azlag mspt |
显示每 Tick 毫秒数 |
/azlag memory |
显示 JVM 内存使用情况 |
/azlag entities |
显示各世界的实体数量 |
/azlag chunks [analyze] |
显示区块统计信息 |
/azlag cleanup |
立即触发手动清理 |
/azlag reload |
重新加载配置 |
/azlag emergency <on|off|status> |
管理紧急模式 |
/azlag diagnose |
全面系统诊断 |
/azlag profiler [last N] |
显示性能历史记录 |
/azlag help |
列出可用命令 |
权限节点
| 权限 |
描述 |
默认值 |
azlagcontrol.admin |
完全管理访问权限(授予以下所有权限) |
op |
azlagcontrol.use |
基本命令访问权限(统计、TPS) |
op |
azlagcontrol.reload |
重新加载插件配置 |
op |
azlagcontrol.stats |
查看服务器性能统计信息 |
op |
azlagcontrol.cleanup |
触发手动实体/物品清理 |
op |
azlagcontrol.emergency |
激活/停用紧急模式 |
op |
azlagcontrol.diagnose |
运行服务器诊断 |
op |
azlagcontrol.profiler |
访问性能分析器 |
op |
PlaceholderAPI 支持
安装 PlaceholderAPI 后,azlagcontrol 扩展会自动注册。
| 占位符 |
输出内容 |
%azlagcontrol_tps% |
当前 TPS |
%azlagcontrol_tps_1m% |
TPS — 1 分钟平均值 |
%azlagcontrol_tps_5m% |
TPS — 5 分钟平均值 |
%azlagcontrol_tps_15m% |
TPS — 15 分钟平均值 |
%azlagcontrol_tps_colored% |
TPS,根据健康状况着色 |
%azlagcontrol_mspt% |
每 Tick 毫秒数 |
%azlagcontrol_memory_used% |
已用 JVM 内存 |
%azlagcontrol_memory_max% |
最大 JVM 内存 |
%azlagcontrol_memory_pct% |
内存使用百分比 |
%azlagcontrol_entities% |
实体总数 |
%azlagcontrol_items% |
地面物品数量 |
%azlagcontrol_chunks% |
已加载区块数量 |
%azlagcontrol_emergency% |
紧急模式状态 |
开发者 API
AzLagControl 会触发其他插件可以监听到的 Bukkit 事件:
AzCleanupEvent — 在清理运行时触发。
AzEmergencyModeChangeEvent — 在紧急模式切换时触发。
@EventHandler
public void onEmergency(AzEmergencyModeChangeEvent event) {
// 响应紧急模式的变化
}
配置文件
首次运行时会自动生成带有大量注释的完整 config.yml。重点如下:
core — 调试开关、消息前缀、更新检查。
cleaner — 间隔时间、警告次数、清理对象、保护规则、按世界范围设置。
mob-control — 按区块分类上限、溢出清除、白名单。
item-control — 按区块数量上限、合并半径、自然消失寿命。
redstone — 红石更新上限、时钟检测及处理。
hopper — 刻率、按漏斗上限、TPS 自动禁用。
explosion — 每秒上限、TNT/苦力怕上限、方块伤害减免。
chunk-control — 分析间隔、Top-N 追踪、告警阈值。
monitor — 采样频率、历史记录大小、TPS 告警阈值。
emergency — TSP 自动激活/禁用、操作、消息提示。
analytics — 历史窗口、文件日志记录。
integrations — PlaceholderAPI、spark 开关。
所有相关部分均支持 worlds: [](留空表示所有世界),且每个模块都有独立的 enabled 标志。
从源码构建
git clone https://github.com/Light0mxph/AzLagControl.git
cd AzLagControl
./gradlew build
生成的 shaded jar 包位于 build/libs/AzLagControl-<version>.jar。
许可证
本项目依据 GNU General Public License v3.0 许可。详见 LICENSE。
致谢
由 AztrixDigitalStudio 开发并维护。
AzLagControl
Professional lag control suite for Minecraft servers — by AztrixDigitalStudio
AzLagControl is a modular performance toolkit for Paper/Spigot servers. Its philosophy is Prevention First, Cleanup Second: instead of only deleting entities after the damage is done, it actively throttles the systems that cause lag (redstone, hoppers, explosions, mob overpopulation) while still providing smart scheduled cleanup, live performance monitoring, and an automatic emergency mode that kicks in when your TPS collapses.
Every module is fully independent — enable only what you need. Everything hot-reloads with /azlag reload.
Features
| Module |
What it does |
| Smart Cleaner |
Scheduled + manual cleanup of dropped items, arrows, projectiles, and optionally mobs/vehicles. Countdown warnings, world filtering, and rich protection rules (named, tamed, leashed, passengers, bosses, recent player drops). |
| Smart Mob Control |
Caps mobs per chunk by category (animals, monsters, villagers, water, ambient). Periodic overflow purge for chunks over the limit. Whitelist for bosses. |
| Smart Item Control |
Per-chunk ground-item limits, nearby item merging, configurable despawn lifetime, and periodic item cleanup. |
| Redstone Control |
Throttles excessive redstone state changes per chunk and detects redstone clocks. Actions: LOG, THROTTLE, or ALERT admins. |
| Hopper Control |
Reduces hopper tick overhead via a configurable transfer tick-rate, optional per-chunk hopper caps, and auto-disable below a TPS threshold. |
| Explosion Control |
Caps explosions per tick, TNT entities per chunk, and creepers per chunk. Optional reduced block damage for large TNT farms. |
| Chunk Control |
Periodically analyzes chunk health, tracks the worst N chunks, and alerts admins when a chunk exceeds an entity threshold. |
| Performance Monitor |
Live sampling of TPS, MSPT, and memory with a rolling history and configurable warning/critical alerts. |
| Emergency Mode |
Auto-activates on severe TPS drops. Reduces view distance, halts mob spawning, aggressively purges entities, removes TNT, and optionally disables hoppers — then auto-deactivates once TPS recovers. |
| Analytics |
Keeps a rolling history of performance samples and can log snapshots to file. |
Requirements
- Server: Paper 1.20+ (Spigot-compatible API used throughout; api-version
1.20)
- Java: 17 or newer
- Optional integrations: PlaceholderAPI, spark
The plugin runs fully without any optional dependency.
Installation
- Download
AzLagControl-x.y.z.jar from Modrinth, SpigotMC, or the Releases page.
- Drop the jar into your server's
plugins/ folder.
- Restart (or reload) the server.
- Edit
plugins/AzLagControl/config.yml to taste, then run /azlag reload.
Commands
Base command: /azlagcontrol, aliases /azlag and /alc.
| Command |
Description |
/azlag stats |
Full server stats |
/azlag tps |
Show TPS (1m / 5m / 15m) |
/azlag mspt |
Show milliseconds per tick |
/azlag memory |
Show JVM memory usage |
/azlag entities |
Entity counts per world |
/azlag chunks [analyze] |
Show chunk stats |
/azlag cleanup |
Trigger manual cleanup now |
/azlag reload |
Reload configuration |
/azlag emergency <on|off|status> |
Manage emergency mode |
/azlag diagnose |
Full system diagnostic |
/azlag profiler [last N] |
Show performance history |
/azlag help |
List available commands |
Permissions
| Permission |
Description |
Default |
azlagcontrol.admin |
Full administrative access (grants all below) |
op |
azlagcontrol.use |
Basic command access (stats, tps) |
op |
azlagcontrol.reload |
Reload plugin configuration |
op |
azlagcontrol.stats |
View server performance statistics |
op |
azlagcontrol.cleanup |
Trigger manual entity/item cleanup |
op |
azlagcontrol.emergency |
Activate/deactivate emergency mode |
op |
azlagcontrol.diagnose |
Run server diagnostics |
op |
azlagcontrol.profiler |
Access the performance profiler |
op |
PlaceholderAPI
When PlaceholderAPI is installed, the azlagcontrol expansion is registered automatically.
| Placeholder |
Output |
%azlagcontrol_tps% |
Current TPS |
%azlagcontrol_tps_1m% |
TPS — 1 minute average |
%azlagcontrol_tps_5m% |
TPS — 5 minute average |
%azlagcontrol_tps_15m% |
TPS — 15 minute average |
%azlagcontrol_tps_colored% |
TPS, color-coded by health |
%azlagcontrol_mspt% |
Milliseconds per tick |
%azlagcontrol_memory_used% |
Used JVM memory |
%azlagcontrol_memory_max% |
Max JVM memory |
%azlagcontrol_memory_pct% |
Memory usage percentage |
%azlagcontrol_entities% |
Total entity count |
%azlagcontrol_items% |
Ground item count |
%azlagcontrol_chunks% |
Loaded chunk count |
%azlagcontrol_emergency% |
Emergency mode state |
Developer API
AzLagControl fires Bukkit events other plugins can listen to:
AzCleanupEvent — fired around cleanup runs.
AzEmergencyModeChangeEvent — fired when emergency mode toggles.
@EventHandler
public void onEmergency(AzEmergencyModeChangeEvent event) {
// react to emergency mode changes
}
Configuration
The full, heavily-commented config.yml is generated on first run. Highlights:
core — debug toggle, message prefix, update checks.
cleaner — interval, warn-times, what to remove, protection rules, per-world scope.
mob-control — per-chunk category caps, overflow purge, whitelist.
item-control — per-chunk limit, merge radius, despawn lifetime.
redstone — update caps, clock detection + action.
hopper — tick-rate, per-chunk cap, TPS auto-disable.
explosion — per-tick cap, TNT/creeper caps, block-damage reduction.
chunk-control — analysis interval, top-N tracking, alert threshold.
monitor — sampling, history size, TPS alert thresholds.
emergency — auto-activate/deactivate TPS, actions, messages.
analytics — history window, file logging.
integrations — PlaceholderAPI, spark toggles.
All sections support worlds: [] (empty = all worlds) where applicable, and every module has its own enabled flag.
Building from source
git clone https://github.com/Light0mxph/AzLagControl.git
cd AzLagControl
./gradlew build
The shaded, ready-to-use jar lands in build/libs/AzLagControl-<version>.jar.
License
Licensed under the GNU General Public License v3.0. See LICENSE.
Credits
Developed and maintained by AztrixDigitalStudio.
评论 0
登录后参与评分
还没有评论,来抢沙发吧