AntiCrashy
一个用于 Minecraft 1.21.1(以及 1.20+ - 1.21.1+ 的其他版本)的服务端模组,当模组行为异常时,它能帮助保持你的服务器在线。
什么是 AntiCrashy?
Minecraft 服务器的崩溃并不总是由灾难性故障引起的。有时,仅仅是一个有缺陷的模组在错误的位置抛出了一个异常就足以导致崩溃。AntiCrashy 在这些故障和你的服务器之间充当了一层安全屏障,在它们导致整个服务中断之前捕获常见的崩溃场景。
与其醒来发现因为某个模组试图加载仅客户端类或在实体刻处理期间失败而导致服务器崩溃,AntiCrashy 会记录问题、收集诊断信息,并在可能的情况下让服务器继续运行。
它不会奇迹般地修复损坏的模组,但它可以防止许多模组让你的服务器离线。
功能
事件异常保护
拦截 NeoForge 的 EventBus 中由模组事件处理器抛出的异常,防止它们变成致命的服务器崩溃。
这特别有助于解决以下问题:
- 在专用服务器上加载仅客户端类
- RuntimeDistCleaner 异常
- 通常会导致服务器终止的事件处理器故障
实体刻保护
将实体刻包装在一层安全机制中,这样单个损坏的实体或模组化的刻处理器无法立即导致整个服务器崩溃。
Watchdog 挂起检测
监控服务器刻时间,并在原版 watchdog 介入之前检测挂起情况。
当检测到挂起时,AntiCrashy 会:
- 跟踪逐渐升级的警告级别
- 自动捕获线程转储
- 记录诊断信息以供后续分析
线程干预
如果服务器陷入停滞,AntiCrashy 会尝试识别阻塞线程并采取纠正措施。
根据配置,它可以:
- 中断有问题的线程
- 延长 watchdog 超时时间
- 尝试恢复程序
- 如果无法恢复,则触发受控重启
高级诊断
AntiCrashy 生成详细的故障排除数据,远远超出标准的 Minecraft 崩溃报告。
诊断信息包括:
- 完整的线程转储
- 内存使用统计
- 挂起分析报告
- 锁争用信息
- 疑似模组参与评分
所有报告均写入:
logs/anticrashy/
玩家通知
可选地,当服务器遇到严重延迟或正在执行恢复操作时,通知在线玩家。
自动重启支持
包含一个可选的 JVM 关闭钩子,可以在任何关闭后自动重新启动服务器,有助于减少停机时间。
为什么存在这个模组
某些模组组合可能会触发 Minecraft 和 NeoForge 处理不当的崩溃。一个常见的例子是模组试图在专用服务器上访问仅客户端类,导致 NeoForge 的 RuntimeDistCleaner 抛出异常。该异常通过 EventBus 传播并最终导致服务器崩溃。
AntiCrashy 在这些故障发生的地方运行,使其能够在它们变得致命之前捕获并抑制许多非关键异常。
目标不是隐藏模组错误——而是让你的服务器运行足够长的时间,以便你识别并修复它们。
安装
- 下载 AntiCrashy jar 文件。
- 将其放入服务器的
mods/文件夹中。 - 启动服务器。
不需要客户端安装。
要求
- NeoForge 1.21.1(其他版本目前正在开发中!)
- Java 21
配置
AntiCrashy 使用标准的 NeoForge 配置系统。
你可以自定义:
- 挂起检测阈值
- Watchdog 响应行为
- 玩家警告消息
- 诊断保留限制
- 自动重启设置
- 单个保护功能
兼容性
AntiCrashy 完全是服务端的。
玩家可以加入而无需安装此模组。
日志与诊断
当 AntiCrashy 检测到崩溃、挂起或恢复事件时,诊断信息将写入:
logs/anticrashy/
如果你正在排查问题,这应该是你首先查看的地方。生成的报告通常比 Minecraft 默认的崩溃报告更容易让你识别导致问题的模组、线程或系统资源。
命令
AntiCrashy 包含几个管理命令,用于实时监控服务器健康状况、收集诊断信息以及在实时管理中恢复操作。
| 命令 | 描述 |
|---|---|
/anticrashy status |
显示实时服务器状态,包括内存使用情况、线程计数、watchdog 状态和活动的缓解措施。 |
/anticrashy dump |
捕获完整的诊断报告,包括线程转储、内存统计和服务器状态信息。 |
/anticrashy interrupt <thread> |
按名称中断特定线程。在处理服务器挂起期间的阻塞或失控线程时很有用。 |
/anticrashy config <key> <value> |
更新配置值,无需重启服务器。 |
/anticrashy restart [delay] |
计划安全的服务器重启。可以指定可选的延迟(以秒为单位)。 |
/anticrashy cancel |
取消任何待处理的 AntiCrashy 操作,包括计划的重启和自动化恢复操作。 |
权限
默认情况下,所有 AntiCrashy 命令都需要操作员权限(OP 等级 4),并且旨在供服务器管理员使用。
(附言:感谢 Gattonori 给了我制作这个模组的想法 <3)
AntiCrashy
A server-side mod for Minecraft 1.21.1 (and other versions from 1.20+ - 1.21.1+) that helps keep your server online when mods misbehave.
What is AntiCrashy?
Minecraft servers don't always crash because of catastrophic failures. Sometimes all it takes is a single buggy mod throwing an exception in the wrong place. AntiCrashy acts as a safety layer between those failures and your server, catching common crash scenarios before they bring everything down.
Instead of waking up to a crashed server because one mod tried to load a client-only class or failed during an entity tick, AntiCrashy logs the problem, gathers diagnostic information, and lets the server continue running whenever possible.
It won't magically fix broken mods, but it can prevent many of them from taking your server offline.
Features
Event Exception Protection
Intercepts exceptions thrown by mod event handlers inside NeoForge's EventBus before they become fatal server crashes.
This specifically helps with issues such as:
- Client-only classes being loaded on dedicated servers
- RuntimeDistCleaner exceptions
- Event handler failures that would normally terminate the server
Entity Tick Protection
Wraps entity ticking in a safety layer so a single broken entity or modded tick handler can't immediately crash the entire server.
Watchdog Hang Detection
Monitors server tick times and detects hangs before the vanilla watchdog intervenes.
When a hang is detected, AntiCrashy:
- Tracks escalating warning levels
- Captures thread dumps automatically
- Records diagnostic information for later analysis
Thread Intervention
If the server becomes stuck, AntiCrashy attempts to identify blocking threads and take corrective action.
Depending on configuration, it can:
- Interrupt problematic threads
- Extend watchdog timeouts
- Attempt recovery procedures
- Trigger a controlled restart if recovery isn't possible
Advanced Diagnostics
AntiCrashy generates detailed troubleshooting data that goes far beyond standard Minecraft crash reports.
Diagnostics include:
- Full thread dumps
- Memory usage statistics
- Hang analysis reports
- Lock contention information
- Suspected mod involvement scoring
All reports are written to:
logs/anticrashy/
Player Notifications
Optionally notifies online players when the server is experiencing severe lag or recovery actions are being performed.
Automatic Restart Support
Includes an optional JVM shutdown hook that can automatically relaunch the server after any shutdown, helping reduce downtime.
Why This Exists
Certain mod combinations can trigger crashes that Minecraft and NeoForge handle poorly. A common example is a mod attempting to access a client-only class on a dedicated server, causing NeoForge's RuntimeDistCleaner to throw an exception. That exception propagates through the EventBus and ultimately crashes the server.
AntiCrashy operates at the point where these failures occur, allowing it to catch and suppress many non-critical exceptions before they become fatal.
The goal isn't to hide mod bugs—it's to keep your server running long enough for you to identify and fix them.
Installation
- Download the AntiCrashy jar.
- Place it in your server's
mods/folder. - Start the server.
No client installation is required.
Requirements
- NeoForge 1.21.1 (Other versions are currently in development!)
- Java 21
Configuration
AntiCrashy uses the standard NeoForge configuration system.
You can customize:
- Hang detection thresholds
- Watchdog response behavior
- Player warning messages
- Diagnostic retention limits
- Automatic restart settings
- Individual protection features
Compatibility
AntiCrashy is completely server-side.
Players can join without installing the mod.
Logs and Diagnostics
When AntiCrashy detects a crash, hang, or recovery event, diagnostic information is written to:
logs/anticrashy/
If you're troubleshooting a problem, this should be the first place you look. The generated reports often make it much easier to identify the mod, thread, or system resource responsible for the issue than Minecraft's default crash reports.
Commands
AntiCrashy includes several administrative commands for monitoring server health, collecting diagnostics, and managing recovery actions in real time.
| Command | Description |
|---|---|
/anticrashy status |
Displays live server status, including memory usage, thread counts, watchdog state, and active mitigation measures. |
/anticrashy dump |
Captures a complete diagnostic report, including thread dumps, memory statistics, and server state information. |
/anticrashy interrupt <thread> |
Interrupts a specific thread by name. Useful for dealing with blocked or runaway threads during server hangs. |
/anticrashy config <key> <value> |
Updates a configuration value without requiring a server restart. |
/anticrashy restart [delay] |
Schedules a safe server restart. An optional delay (in seconds) may be specified. |
/anticrashy cancel |
Cancels any pending AntiCrashy actions, including scheduled restarts and automated recovery operations. |
Permissions
All AntiCrashy commands require operator privileges (OP level 4) by default and are intended for server administrators.
(P.S: Thanks to Gattonori for giving me the idea to even make this mod <3)
下载 Anticrashy
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Anticrashy
下载 Anticrashy
下载 Anticrashy
下载 Anticrashy
下载 Anticrashy
下载 Anticrashy
下载 Anticrashy
下载 Anticrashy
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Anticrashy
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
暂无更新日志
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
缓冲的原始输入和线程化的事件轮询
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
原版世界生成优化模组
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
评论 0
登录后参与评分
还没有评论,来抢沙发吧