VexOptimise
全面的 Minecraft 服务器优化与 TPS 保护插件。
专为 Spigot/Paper 1.20+ 服务器(Java 17)设计。
VexOptimise 将每项必要的优化功能整合进一个单一且完全可配置的插件中:禁用村民 AI、实体堆叠、漏斗节流、红石限制、动态视距、智能自动保存、内存管理、以及自动紧急模式——等等更多功能。
特性
村民优化
- 禁用村民 AI - 村民停止寻路和游荡,但交易功能依然完美运行
- 库存刷新计时器 - 交易库存按可配置的时间间隔(秒)进行刷新
- 每区块村民上限 - 当某个区块达到配置的上限值时,阻止新的村民生成
动物与生物优化
- 禁用农场动物 AI - 冻结牛、羊、猪、鸡等(支持完全可配置的类型列表)
- 实体保护 - 命名实体、驯服实体和拴绳实体绝不会受到干扰;幼崽会被保留以便它们正常长大
- 实体堆叠 - 将重叠的同类型实体合并为一个堆叠显示为
x24 cow,并可选提供额外的死亡掉落物,以确保农场收益公平
- 远处生物 AI 挂起 - 远离任何玩家的生物会暂停其 AI,直到有玩家靠近;随着 TPS 下降,该距离会自动缩小,从而在负载下逐步限制寻路行为
- 软性生物上限 - 随着生物密度增加,生成阻挡的概率逐渐上升,使种群保持自然状态,而非简单的硬性开关
- 动态生物上限 - 当 TPS 下降时,自然生物生成上限会自动减半(默认从 70 降至 35)
清理与世界
- 地面物品清理 - 定期清理,并通过聊天栏、动作栏和 Boss 条显示倒计时警告
- 地面物品合并 - 附近同类型的地面物品会物理合并为单个堆叠,大幅减少农场和研磨机周围的实体数量
- 受保护物品 - 安全处理命名物品和经验球(可选)
- 爆炸限制与批处理 - 限制每次爆炸破坏的方块数量,并将破坏效果分散到多个刻中执行,确保大型爆炸不会导致单刻卡顿
- 下落方块限制 - 防止沙子/ gravel 重力农场导致服务器崩溃
- 激进区块卸载 - 可选地在空地区域提前卸载区块以释放 RAM;当玩家使用鞘翅高速飞行时,尾随区块会更早卸载
- 智能自动保存 - 逐个逐步保存世界,避免因全量保存而冻结服务器
红石与漏斗
- 漏斗冷却 - 漏斗按可配置的时间间隔提取物品,而不是每刻都提取;防止大规模自动农场耗尽服务器资源
- 自适应漏斗休眠模式 - 向接近装满的容器输送物品的漏斗会自动进一步减速,避免无效工作
- 红石限制器 - 自动停止每秒脉冲频率超过配置速率的红石时钟电路
- 烟花限制器 - 限制每秒发射的火箭数量,防止鞘翅/烟花延迟机器
- 版本安全实现 - 适用于所有服务器构建版本,无需依赖可取消事件的支持
视距
- 动态视距 - 在出现延迟时,世界视距会逐步降低;一旦性能恢复,则回升至最大值(最小/最大值可配置)
内存管理
- 自动 GC 触发 - 当堆内存使用率超过阈值(默认 85%)或到达强制间隔时,安全地触发垃圾回收
- 内存泄漏检测 - 跨 GC 周期监控 GC 后的堆基线,并在持续上升时发出警报
- 死亡实体清理 - 立即移除死后动画结束后仍滞留在世界中的尸体
诊断工具
- CPU 采样分析器 (
/vexo profile) - Spark 风格的主线程热点分析,无需 NMS:采样栈轨迹并对哪个插件或服务器类消耗最多刻时间进行排名
- 延迟源扫描 (
/vexo lag) - 一目了然地查看最重的世界、最常见的实体类型和最热的区块
生成控制
- 流浪商人阻挡 - 防止商人在房屋之间卡住
- 幻翼阻挡 - 防止幻翼堆积因玩家跳过睡眠而出现
- 传送门 spam 防护 - 对快速的下界传送门过渡设置冷却时间,防止服务器遭受区块加载风暴
数据包 / 视觉节流 (可选,需要 ProtocolLib)
- 粒子速率限制器 - 每个玩家的粒子数据包上限
- 声音剔除 - 每个玩家的音效数据包上限,防止数百只鸡的叫声堵塞通道
- 移动速率限制 - 稳定发送数据包 spam 的客户端;卡顿的玩家会收到友好的动作栏提示
Discord Webhook
- 即时 webhook 集成发送紧急警报,例如:
⚠ [VexOptimise] 服务器 TPS 已降至危险水平!紧急协议已启动。
智能 TPS 保护盾(紧急模式)
当 TPS 在一段时间内低于临界值(默认 14.0)时,VexOptimise 会自动启动其紧急协议:
- 冻结所有生物 AI
- 清除所有地面物品
- 强制设置为最小视距
- 停止所有红石电路
- 向控制台、管理员(
vexoptimise.alerts)、整个服务器(可选)以及 Discord 发送警报
一旦 TPS 恢复到恢复阈值以上(默认 16.5),所有设置将精确恢复到之前的状态。所有阈值和单独的操作均可在配置文件中切换。
命令
| 命令 |
描述 |
/vexo help |
命令列表 |
/vexo info |
实时 RAM、TPS(5秒/30秒/60秒)、CPU、区块/实体/玩家数量、数据包限制器统计信息及运行时间 |
/vexo lag |
卡顿源扫描:一目了然地查看最沉重的世界、最常见的实体类型以及压力最大的区块 |
/vexo profile [seconds] |
采样服务器线程并对 CPU 热点进行排名(哪个插件/类消耗了刻时间) |
/vexo optimize |
手动紧急优化:一次性完成物品清理 + 实体堆叠 + 区块卸载 + GC |
/vexo report |
将详细的性能报告写入 plugins/VexOptimise/reports/ 目录下的文件中 |
/vexo reload |
无需重启即可重新加载配置 |
/vexo update |
检查 Modrinth 上的更新 |
别名:/vexopt
权限
每个子命令都有各自独立的权限节点:
| 权限节点 |
授予内容 |
默认值 |
vexoptimise.admin |
涵盖以下所有内容的父级权限 |
OP |
vexoptimise.command.help |
/vexo help |
所有人 |
vexoptimise.command.info |
/vexo info |
OP |
vexoptimise.command.lag |
/vexo lag |
OP |
vexoptimise.command.optimize |
/vexo optimize |
OP |
vexoptimise.command.report |
/vexo report |
OP |
vexoptimise.command.reload |
/vexo reload |
OP |
vexoptimise.command.update |
/vexo update |
OP |
vexoptimise.command.profile |
/vexo profile |
OP |
vexoptimise.alerts |
接收紧急模式警报 |
OP |
vexoptimise.notify |
接收更新通知 |
OP |
Tab 补全仅建议发送者拥有权限的子命令——非常适合仅给管理员赋予 lag 和 info 权限。
性能日志与报告
所有重要信息都会记录到
plugins/VexOptimise/logs/performance.log 中:TPS 下降、紧急模式激活、GC 回收、削减的爆炸效果、阻止的红石违规、传送门滥用等。当出现问题时,你将知道何时以及何地发生了故障。
更新检查器
VexOptimise 在启动时查询 Modrinth API,并在有新版本可用时向控制台和游戏内管理员发出警告。可在配置文件中完全自定义或禁用。
安装
- 将 jar 文件放入服务器的
plugins/ 文件夹中
- 启动服务器 - 将生成
plugins/VexOptimise/config.yml
- 根据需要调整设置并运行
/vexo reload
可选:安装 ProtocolLib 以解锁粒子/声音/移动数据包节流功能。如果没有它,VexOptimise 仍可正常运行,只是跳过这些模块。
兼容性
- Minecraft 1.20+ 和 Java 17+
- Paper(推荐): 所有模块均可完全使用
- Spigot: 开箱即用。唯一的区别是 动态视距 功能在那里无效,因为
World#setViewDistance 是 Paper 独有的 API —— 其他所有模块在两个平台上的行为均相同。
- Folia: 有限兼容模式 - 基于事件的模块(怪物上限、生成控制、漏斗/红石/烟花限制器)正常运行,而基于调度器的模块会在启动时自动跳过
- ProtocolLib 是可选的;如果没有它,VexOptimise 仍可正常运行,只是跳过热处理数据包的模块
VexOptimise
Comprehensive Minecraft server optimization and TPS protection plugin.
Designed for Spigot/Paper 1.20+ servers (Java 17).
VexOptimise bundles every essential optimization into a single, fully
configurable plugin: villager AI disabling, entity stacking, hopper
throttling, redstone limiting, dynamic view distance, smart autosave,
memory management, an automatic emergency mode - and much more.
Features
Villager Optimization
- Disable Villager AI - villagers stop pathfinding and wandering while trading keeps working perfectly
- Stock Restock Timer - trade stock is refreshed on a configurable timer (in seconds)
- Per-Chunk Villager Limit - blocks new villager spawns once a chunk reaches its configured cap
Animal & Mob Optimization
- Disable Farm Animal AI - freezes cows, sheep, pigs, chickens and more (fully configurable type list)
- Entity Protection - named, tamed and leashed mobs are never touched; babies are left alone so they can grow up
- Entity Stacking - merges overlapping mobs of the same type into a single stack shown as
x24 cow, with optional extra death loot so farms stay fair
- Distant Mob AI Suspension - mobs far away from any player have their AI suspended until someone comes close; the distance shrinks automatically as TPS drops, progressively throttling pathfinding under load
- Soft Mob Cap - spawn blocking ramps up probabilistically as mob density rises, keeping populations natural instead of a hard on/off wall
- Dynamic Mob Cap - when TPS drops, the natural mob spawn cap automatically halves (70 -> 35 by default)
Cleanup & World
- Ground Item Clearing - periodic cleanup with countdown warnings via chat, action bar and bossbar
- Ground Item Merging - nearby same-type ground items physically combine into single stacks, slashing entity counts around farms and grinders
- Protected Items - named items and XP orbs (optional) are handled safely
- Explosion Limiting & Batching - caps the blocks destroyed per explosion and spreads the destruction over multiple ticks so big blasts never stall a tick
- Falling Block Limit - prevents sand/gravel gravity farms from crashing the server
- Aggressive Chunk Unloading - optionally unloads chunks early in empty regions to free RAM; while players fly fast (elytra), trailing chunks unload even sooner
- Smart Autosave - saves worlds gradually one-by-one instead of freezing the server with a full save
Redstone & Hoppers
- Hopper Cooldown - hoppers pull items at a configurable interval instead of every tick; massive auto-farms stop eating your server
- Adaptive Hopper Sleep Mode - hoppers feeding nearly-full containers automatically slow down further, no wasted work
- Redstone Limiter - clock circuits firing faster than the configured rate per second are automatically halted
- Firework Limiter - caps rocket launches per second, stopping elytra/firework lag machines
- Version-safe implementation - works on every server build, no cancellable-event support required
View Distance
- Dynamic View Distance - world view distance steps down gradually under lag and climbs back to maximum once performance recovers (min/max configurable)
Memory Management
- Auto GC Trigger - safely triggers garbage collection when heap usage passes a threshold (default 85%) or on a forced interval
- Memory Leak Detection - watches the post-GC heap baseline across GC cycles and raises an alert when it keeps rising
- Dead Entity Cleanup - instantly removes corpses stuck in the world after their death animation
Diagnostics
- CPU Sampling Profiler (
/vexo profile) - Spark-style main-thread hotspot analysis without NMS: samples stack traces and ranks which plugin or server class burns the most tick time
- Lag Source Scan (
/vexo lag) - heaviest worlds, most common entity types and hottest chunks at a glance
Spawn Control
- Wandering Trader blocking - stop traders from getting stuck between houses
- Phantom blocking - stop phantom piles from sleep-skipping players
- Portal Spam Guard - cooldown on rapid Nether portal transitions protects the server from chunk-load storms
Packet / Visual Throttling (optional, requires ProtocolLib)
- Particle Rate Limiter - per-player particle packet cap
- Sound Culling - per-player sound packet cap stops hundreds of chickens from flooding channels
- Movement Rate Limiting - stabilizes packet-spamming clients; laggy players get a friendly action-bar notice
Discord Webhook
- Fire-and-forget webhook integration sends emergency alerts such as:
⚠ [VexOptimise] Server TPS has dropped to a critical level! Emergency protocol engaged.
Smart TPS Protection Shield (Emergency Mode)
When TPS drops below the critical level (default 14.0) for a sustained
period, VexOptimise automatically engages its emergency protocol:
- Freezes all mob AI
- Clears all ground items
- Forces minimum view distance
- Halts all redstone circuits
- Sends alerts to console, admins (
vexoptimise.alerts), the whole server (optional) and Discord
Once TPS recovers above the recovery threshold (16.5 by default),
everything is restored exactly as it was. All thresholds and individual
actions are toggleable in the config.
Commands
| Command |
Description |
/vexo help |
Command list |
/vexo info |
Live RAM, TPS (5s/30s/60s), CPU, chunk/entity/player counts, packet limiter stats and uptime |
/vexo lag |
Lag source scan: heaviest worlds, most common entity types and hottest chunks at a glance |
/vexo profile [seconds] |
Samples the server thread and ranks CPU hotspots (which plugin/class eats tick time) |
/vexo optimize |
Manual emergency optimization: item clear + entity stacking + chunk unload + GC in one shot |
/vexo report |
Writes a detailed performance report to a file in plugins/VexOptimise/reports/ |
/vexo reload |
Reloads the configuration without restarting |
/vexo update |
Checks for updates against Modrinth |
Alias: /vexopt
Permissions
Every subcommand has its own permission node:
| Permission |
Grants |
Default |
vexoptimise.admin |
Parent permission covering all of the below |
OP |
vexoptimise.command.help |
/vexo help |
Everyone |
vexoptimise.command.info |
/vexo info |
OP |
vexoptimise.command.lag |
/vexo lag |
OP |
vexoptimise.command.optimize |
/vexo optimize |
OP |
vexoptimise.command.report |
/vexo report |
OP |
vexoptimise.command.reload |
/vexo reload |
OP |
vexoptimise.command.update |
/vexo update |
OP |
vexoptimise.command.profile |
/vexo profile |
OP |
vexoptimise.alerts |
Receives emergency mode alerts |
OP |
vexoptimise.notify |
Receives update notifications |
OP |
Tab completion only suggests subcommands the sender has permission for -
perfect for giving moderators just lag and info.
Performance Logging & Reports
Everything important gets recorded to
plugins/VexOptimise/logs/performance.log: TPS dips, emergency mode
activations, GC reclaims, trimmed explosions, blocked redstone violations,
portal spam and more. When something goes wrong you will know when and
where.
Update Checker
VexOptimise queries the Modrinth API on startup and warns the console and
in-game admins when a new version is available. Fully configurable or
disablable in the config.
Installation
- Drop the jar into your server's
plugins/ folder
- Start the server -
plugins/VexOptimise/config.yml is generated
- Tune the settings to your liking and run
/vexo reload
Optional: install ProtocolLib to
unlock particle/sound/movement packet throttling. Without it, VexOptimise
runs normally and simply skips those modules.
Compatibility
- Minecraft 1.20+ and Java 17+
- Paper (recommended): every module works fully
- Spigot: works out of the box as well. The only difference is that the
dynamic view distance feature has no effect there, because
World#setViewDistance is a Paper-only API - every other module behaves
identically on both platforms.
- Folia: limited compatibility mode - event-driven modules (mob caps,
spawn control, hopper/redstone/firework limiters) run normally while
scheduler-based modules are skipped automatically at startup
- ProtocolLib is optional; without it VexOptimise runs normally and simply
skips the packet-throttling modules
评论 0
登录后参与评分
还没有评论,来抢沙发吧