版本 3.X.X
旧版模组请查阅 wiki。
本模组可自动重启 Minecraft 服务器,或通过外部重启脚本触发。
该模组仅适用于服务端,在客户端无效。
想和朋友一起游玩但需要搭建服务器?不知道如何设置?直接租用一台已配置好的服务器吧!
点击上方的图片,选择一个套餐(建议至少 6 GB),
使用我的代码 agent 首月可享 25% 折扣,与好友尽情畅玩!
支持情况

未发布模组的 Minecraft 版本均不受支持。
文本版列表请见 此处。
功能
- 在指定时间重启服务器
- 若服务器为空,延迟一段时间后重启
- 若 TPS 低于指定阈值并持续相应时长,则重启服务器
服务器配置文件
配置文件位于 "world" 文件夹下的 "serverconfig" 文件夹中,文件名为 "auto_restart-server.toml"。世界文件夹的名称在 "server.properties" 文件中设定。
- restart – 重启选项:
- use_external_restart_script – 是否由外部重启脚本启动服务器?
- restart_command – 服务器停止时执行以重启服务器的脚本路径。仅在 "use_external_restart_script" 为 false 时调用。该值必须仅包含脚本路径,不得包含其他命令或参数(例如应为 "/opt/minecraft/start.sh",而非 "bash start.sh" 或 "start.sh nogui")。
- auto_restart – 自动重启选项:
- enabled – 是否启用服务器自动重启?
- times – 24 小时制格式下服务器将自动重启的时间。示例:"14:00", "16:32"
- on_crash – 服务器崩溃时是否自动重启。仅在使用 "restart_command" 时生效。外部重启脚本会在崩溃后自行重启服务器。
- warning_times – 在自动重启前显示重启警告的时间点。示例:
5s– 在重启前 5 秒发送消息7m– 在重启前 7 分钟发送消息2h– 在重启前 2 小时发送消息
- on_empty_restart – 服务器为空时的重启选项:
- enabled – 若无玩家在线,是否重启服务器?
- delay – 服务器为空后应等待多久再重启。示例:
5s– 延迟 5 秒7m– 延迟 7 分钟2h– 延迟 2 小时
- low_tps_restart – 服务器或其维度 TPS 过低时的重启选项:
- enabled – 若 TPS 低于指定水平并持续相应时长,是否重启服务器?
- minium_tps_level – 当 TPS 低于此水平并持续指定时长时,将触发服务器重启。
- delay – 服务器必须低于定义 TPS 水平的持续时间,才会触发重启。示例:
5s– 延迟 5 秒7m– 延迟 7 分钟2h– 延迟 2 小时
指令
/restart– 重启服务器
如何安装配置模组?
要使用该模组,需要一个或多个 shell (sh 或 Linux) 或批处理 (Windows 下的 bat 或 cmd) 脚本/文件。
请查看 设置指南 以完成所有设置。
如果在使用脚本时遇到问题,请查阅 故障排除 页面。
租赁服务器: 如果您的服务器由服务器面板启动且无法使用自定义脚本,请启用您服务器面板上的“停止/崩溃时重启”选项,并将 "use_external_restart_script" 设置为 true。此时模组仅负责停止服务器,服务器面板会再次将其启动。详情:故障排除。
感谢 Muse31 提供 Logo。
您可以免费在非商业整合包中使用此模组,无需征得同意。
您可以在 CurseForge 或 Modrinth 上找到我制作的其他模组。

Version 3.X.X
For older versions of the mod, check the wiki.
This mod restarts the Minecraft server by itself or with an external restart script.
The mod can only be used on the server side and won't work on the client side.
You need a server to play with friends? You don't know how to set up one? Just rent an already configured server!
Click on the picture above, select a plan (with recommended at least 6 GB),
use my code agent to get 25% off your first month and enjoy playing with your friends!
Support

Minecraft versions, for which the mod is not released, are not supported.
You can find a text version here.
Features
- Restarting the server at specified times
- Restarting the server with a delay, if it is empty
- Restarting the server, if the TPS are below a specified level for a specified time
Server Config
The config file can be found in the "serverconfig" folder in the "world" folder and is named "auto_restart-server.toml". The name of the world folder is set for servers in the "server.properties" file.
- restart – Options for restarting:
- use_external_restart_script – Is the server started by an external restart script?
- restart_command – Path of the script, that is executed on Server stopped to restart the server. Only called if "use_external_restart_script" is false. It must only contain the path of the script, without any other commands or arguments (i.e. "/opt/minecraft/start.sh", not "bash start.sh" or "start.sh nogui").
- auto_restart – Option for auto restarting:
- enabled – Should the Server do automatic restarts?
- times – Times in 24-hour format on which the server will automatically restart. Examples: "14:00", "16:32"
- on_crash – Should the server be automatically restarted when it crashes. Only used with "restart_command". An external restart script restarts the server after a crash anyway.
- warning_times – Times before an auto restart of the server, a restart warning should be shown. Examples:
5s– For a message 5 seconds before a restart7m– For a message 7 minutes before a restart2h– For a message 2 hours before a restart
- on_empty_restart – Options for restart, if the server is empty:
- enabled – Should the server restart, if no players are online?
- delay – Delay after the server should restart, if it is empty. Examples:
5s– For a delay 5 seconds7m– For a delay 7 minutes2h– For a delay 2 hours
- low_tps_restart – Options for restart, if the TPS of server or its dimensions are low:
- enabled – Should the server restart, if it is below a TPS level for a specified time?
- minium_tps_level – TPS level below which the server is restarted, if it lasts for the specified time.
- delay – Delay, that the server must be below the defined TPS level, in order for it to be restarted. Examples:
5s– For a delay 5 seconds7m– For a delay 7 minutes2h– For a delay 2 hours
Commands
/restart– Restarts the server
How to set up the mod?
To use the mod, one or more shell (sh or Linux) or batch (bat or cmd on Windows) scripts/files are needed.
To set up everything to use this mod, please check the Setup Guide.
If you have problems with the scripts, check the Troubleshooting page.
Rented servers: If your server is started by a server panel and you can't use own scripts, enable the restart on stop/crash option of your server panel and set "use_external_restart_script" to true. The mod then only stops the server and the server panel starts it again. Details: Troubleshooting.
Thanks for the logo to Muse31.
You can use this mod in non-commercial modpacks without asking.
You can find more mods from me on CurseForge or Modrinth.

下载 Auto Restart
下载 Auto Restart
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Auto Restart
下载 Auto Restart
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Auto Restart
下载 Auto Restart
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Auto Restart
下载 Auto Restart
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Auto Restart
下载 Auto Restart
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
- 支持 NeoForge 26.3.0.37 及更高版本:服务器配置文件已使用新的配置类型进行注册(Minecraft 26.1 - 26.2 的 jar 包在此版本下会崩溃)
- 已有的世界配置文件
<world>/serverconfig会被复制一次到<world>/syncedconfig,因为 NeoForge 26.3 仅从该位置读取世界配置文件(专用服务器;在单人游戏中请手动移动文件)
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧