? 服务器重启命令
一个轻量级的服务端 Fabric 模组,允许 Minecraft 服务器管理员从游戏内或服务器控制台重启服务器。
无需安装客户端模组。玩家不需要此模组。
✅ 功能说明
Minecraft 服务器在停止后通常无法自行重新启动。
本模组通过在服务器关闭前启动一个小型 Java 重启动器来解决这个问题。
该重动器会等待旧服务器进程完全关闭,然后再次启动服务器。
简单、干净、实用。
? 重启原理
当你运行重启命令时,模组会按以下顺序尝试重启服务器:
- 如果存在
start.bat(Windows)或 start.sh(macOS/Linux),则使用它们。
- 如果配置文件中设置了
launchCommand,则使用它。
- 使用安全的备用命令:
java -Xmx4G -jar fabric-server-launch.jar nogui
⚠️ 备用内存警告
如果模组必须使用备用的 4GB 内存命令,它会在服务器再次启动后向操作员发出警告。
此警告意味着所有者应在配置文件中设置实际的启动命令,以获得更好的重启体验。
? 命令
/restart
/restartserver
/restart <delay_seconds>
/restartserver <delay_seconds>
⏱️ 示例
/restart 60
这将在 60 秒后重启服务器。
? 依赖要求
- Minecraft
26.1、26.1.1、26.1.2 或 26.2
- Fabric Loader
0.19.3 或更高版本
⚙️ 配置文件
config/server-restart-command.properties
?️ 配置示例
launchCommand=java -Xmx12G -jar fabric-server-launch.jar nogui
preferStartScript=true
defaultDelaySeconds=5
permissionLevel=4
defaultRamWarningDelaySeconds=60
? 重要提示
- 本模组仅适用于服务端。
- 玩家无需安装。
- 此操作不会重新加载服务器配置。
- 这意味着它不等同于重新加载数据包。
- 它会完全停止服务器,然后再次启动。
- 默认情况下,操作员可以使用重启命令。
- 为了获得最佳效果,请使用正确的
start.bat、start.sh 或 launchCommand。
? 专为想要简化操作的服务器所有者打造
每次重启服务器时,无需频繁触碰服务器窗口。
? Server Restart Command
A simple server-side Fabric mod that lets Minecraft server owners restart their server from in-game or from the server console.
No client install needed. Players do not need this mod.
✅ What does it do?
Minecraft servers normally cannot start themselves again after they stop.
This mod fixes that by starting a small Java relauncher before the server shuts down.
The relauncher waits for the old server process to fully close, then starts the server again.
Simple. Clean. Useful.
? How restarting works
When you run the restart command, the mod tries to restart the server in this order:
- Uses
start.bat on Windows or start.sh on macOS/Linux, if the file exists.
- Uses
launchCommand from the config file, if it is set.
- Uses a safe fallback command:
java -Xmx4G -jar fabric-server-launch.jar nogui
⚠️ Fallback RAM warning
If the mod has to use the fallback 4 GB RAM command, it will warn operators after the server starts again.
This warning means the owner should set the real launch command in the config file for better restart behavior.
? Commands
/restart
/restartserver
/restart <delay_seconds>
/restartserver <delay_seconds>
⏱️ Example
/restart 60
This restarts the server after 60 seconds.
? Requirements
- Minecraft
26.1, 26.1.1, 26.1.2, or 26.2
- Fabric Loader
0.19.3 or newer
⚙️ Config file
config/server-restart-command.properties
?️ Example config
launchCommand=java -Xmx12G -jar fabric-server-launch.jar nogui
preferStartScript=true
defaultDelaySeconds=5
permissionLevel=4
defaultRamWarningDelaySeconds=60
? Important notes
- This mod is server-side only.
- Players do not need to install it.
- This does not reload the server.
- This means it is not the same as reloading datapacks.
- It fully stops the server, then starts it again.
- Operators can use the restart command by default.
- For best results, use a proper
start.bat, start.sh, or launchCommand.
? Made for server owners who want one simple thing
Restart the server without touching the server window every time.
评论 0
登录后参与评分
还没有评论,来抢沙发吧