移除银鱼(Silverfish)的 AI,同时保留其物理效果。专为带有“被侵染”(Infested)效果的犰狳农场设计:银鱼数量不变,但大幅降低卡顿。
适用对象
希望尽可能保持原版体验,同时允许玩家建造犰狳农场的服务器。没有生成上限、生物限制或农场削弱:农场产出的银鱼数量和掉落物与原版一致,只是服务器为每个银鱼执行的工作量更少。
背景原因
带有“被侵染”效果的犰狳农场会产生大量银鱼,而每一只银鱼在每个刻(tick)都会运行其 AI:寻找玩家、路径搜索、躲入方块、唤醒其他银鱼。当有成百上千只时,TPS 会下降。
常见的修复方法(限制生成、实体上限、杀死生物)会改变游戏机制并破坏农场。此插件在保持农场原版特性的同时,改为让每只银鱼的计算成本更低。
功能说明
进入世界的每只银鱼都会关闭其 AI(Mob#setAware(false))。冻结后的银鱼不再追逐或攻击玩家、四处走动、躲入方块或唤醒其他银鱼。
以下行为仍如常运作:
- 重力和被水流推动
- 击退
- 伤害,包括横扫之刃(Sweeping Edge)
- 玩家击杀后获得的经验值
因此农场运作方式不变:银鱼依然会掉落、沿水流移动并在杀戮室中死亡。它们只是停止思考了。
有两项原本由 AI 处理的行为现在由插件接管:
- 溺水: 冻结的银鱼不会向上游泳,因此取消它们的溺水伤害。
- 营火: 冻结的银鱼不会主动离开营火,因此插件会给它们一个向开放侧的小推力。
仅影响银鱼。犰狳和其他所有生物不受影响。
性能表现
在测试服务器上使用 Paper 的 /mspt 命令测量,与普通银鱼对比:
| 银鱼数量(陆地上) |
AI 开启 |
AI 关闭(默认) |
AI 关闭,无碰撞 |
| 500 |
~5.0 ms |
~3.8 ms |
~3.2 ms |
| 1000 |
~9.7 ms |
~6.5 ms |
~5.4 ms |
| 2000 |
~22 ms |
~15.7 ms |
~10 ms |
使用默认配置可减少约 20–35% 的计算量,同时关闭碰撞检测可减少 35–57%。在该插件专为优化而设计的服务器上,最大的犰狳农场曾导致 TPS 降至约 14。使用该插件后,TPS 大部分时间保持在 20。
完整的基准测试方法及限制详见 GitHub README。
配置
plugins/FrozenSilverfish/config.yml,使用 /fsf reload 重载:
enabled: true
disable-collisions: false # 节省更多资源,但没有限制银鱼堆积的数量
prevent-drowning: true
push-off-campfires: true
worlds: [] # 空列表 = 所有世界
插件会冻结活跃世界中所有的银鱼,包括要塞和刷怪笼。如果你的农场位于独立的世界中,请仅列出该世界。
指令
权限 frozensilverfish.admin(管理员默认拥有)。
/fsf reload: 重载配置并应用到已加载的银鱼
/fsf status: 显示设置及当前冻结的银鱼数量
卸载
AI 标志保存在实体数据中,因此直接删除 jar 文件会使银鱼保持冻结状态。若要干净地移除,请将 enabled: false,运行 /fsf reload,保留插件一段时间以恢复未加载区块的状态,然后再移除它。
要求
若你使用 WildStacker 堆叠犰狳,它与 StackedArmadillos 配合良好。
源代码、问题反馈及完整文档:github.com/ghiacciolodev/FrozenSilverfish
Removes the AI from silverfish while keeping their physics. Made for armadillo farms with the Infested effect: same number of silverfish, much less lag.
Who it's for
Servers that want to stay as close to vanilla as possible and still let players build armadillo farms. No spawn caps, no mob limits, no farm nerfs: the farm produces the same silverfish and the same drops as in vanilla, the server just does less work for each one.
Why
Armadillo farms with Infested produce a lot of silverfish, and every one of them runs its AI every tick: looking for players, pathfinding, hiding in blocks, waking up other silverfish. With hundreds or thousands of them, TPS drops.
The usual fixes (limiting spawns, capping entities, killing mobs) change the game and break the farm. This plugin keeps the farm vanilla and makes each silverfish cheaper instead.
What it does
Every silverfish that enters a world gets its AI turned off (Mob#setAware(false)). A frozen silverfish no longer chases or attacks players, walks around, hides in blocks or wakes up other silverfish.
These keep working as before:
- gravity and being pushed by water streams
- knockback
- damage, including Sweeping Edge
- XP when a player kills it
So the farm works the same: silverfish still fall, still travel along the water and still die in the killing chamber. They just stop thinking.
Two things they can't do anymore are handled by the plugin:
- Drowning: frozen silverfish don't swim up, so drowning damage is cancelled for them.
- Campfires: frozen silverfish don't walk off a campfire, so the plugin gives them a small push towards an open side.
Only silverfish are touched. Armadillos and every other mob are left alone.
Performance
Measured on a test server with Paper's /mspt, compared with normal silverfish:
| Silverfish (on land) |
AI on |
AI off (default) |
AI off, no collisions |
| 500 |
~5.0 ms |
~3.8 ms |
~3.2 ms |
| 1000 |
~9.7 ms |
~6.5 ms |
~5.4 ms |
| 2000 |
~22 ms |
~15.7 ms |
~10 ms |
Roughly 20–35% less with the default config, 35–57% less with collisions off too. On the server the plugin was made for, the biggest armadillo farm used to drop it to about 14 TPS. With the plugin it stays at 20 most of the time.
The full benchmark, with method and limits, is in the README on GitHub.
Configuration
plugins/FrozenSilverfish/config.yml, reload with /fsf reload:
enabled: true
disable-collisions: false # bigger saving, but nothing limits how many silverfish pile up
prevent-drowning: true
push-off-campfires: true
worlds: [] # empty = all worlds
The plugin freezes every silverfish in an active world, including strongholds and spawners. If your farm is in a separate world, list only that one.
Commands
Permission frozensilverfish.admin (ops by default).
/fsf reload: reloads the config and applies it to loaded silverfish
/fsf status: shows the settings and how many silverfish are frozen
Uninstalling
The AI flag is saved on the entity, so removing the jar leaves silverfish frozen. To remove it cleanly, set enabled: false, run /fsf reload, leave the plugin installed for a while so unloaded chunks are restored too, then remove it.
Requirements
- Paper 26.2
- Java 25
- No other dependencies
Works well together with StackedArmadillos if you stack armadillos with WildStacker.
Source code, issues and full docs: github.com/ghiacciolodev/FrozenSilverfish
评论 0
登录后参与评分
还没有评论,来抢沙发吧