定时关机
一个包含函数的 Minecraft 数据包,用于在指定时间后停止服务器。
重要提示:要使用此数据包,你需要运行专用服务器,并将 server.properties 中的 function-permission-level 设置为 4。此数据包在单人世界中无法正常工作(懂我意思吧?:D)。
重要提示:除了 NO_AUTO_SHUTDOWN.zip 之外,所有版本都会在指定的时间长度后自动关闭服务器。有关这意味什么以及我为何这样设计,请参阅 自动关机。
以下是可用的延迟时间列表。每个选项都会触发下一个选项。(我用一种合理的方式实现了这一点,例如 5 小时会在 4 小时后触发 1 小时,1 小时会在 45 分钟后触发 15 分钟,以此类推。)
- 24 小时
- 12 小时
- 5 小时
- 1 小时
- 15 分钟
- 5 分钟
- 1 分钟
- 5 秒
任何计划的关机操作在服务器启动时都会被取消。
示例
# 在 5 小时后关闭服务器。参见 src/data/schedule_shutdown/functions/delay/* 以获取函数名称。
function schedule_shutdown:delay/five_hours
# 取消已计划的关机操作。
function schedule_shutdown:clear_all
自动关机
我最初制作这个数据包是因为我发现如何在 GitHub Actions 中托管 Minecraft 服务器,但需要服务器在保存服务器状态到仓库之前有足够的时间内自动关闭。这就是为什么有一个 5 小时的版本(GitHub 工作流运行的最大时间为 6 小时)。名称类似 length_of_time.zip 的文件将在服务器加载时自动运行函数 schedule_shutdown:delay/length_of_time(使用 Minecraft 的 load.json)。除非你希望服务器在一段时间后自动关闭,否则请使用 NO_AUTO_SHUTDOWN.zip。
常见问题/故障排除
无法加载函数 schedule_shutdown:shutdown
与 Couldn't load tag schedule_shutdown:all_shutdown as it is missing following references: schedule_shutdown:shutdown 相同。
无法加载标签 schedule_shutdown:all_shutdown,因为它缺少以下引用:schedule_shutdown:shutdown
确保你在 server.properties 中将 function-permission-level 设置为 4,然后尝试重新启动服务器。如果仍然出现此错误,请在 GitHub 仓库中提交问题。
Schedule Shutdown
A Minecraft data pack containing functions that will stop the server after a duration of time.
Important: To use this datapack, you need to be running a dedicated server with function-permission-level in server.properties to 4. This datapack will not function (get it? :D) in a singleplayer world.
Important: Except for NO_AUTO_SHUTDOWN.zip, all versions will automatically shut down the server after the specified length of time. See Auto-Shutdown for an explanation of what this means and why I did it like that.
Below is a list of available delays. Each one triggers the one below it. (I did this in a not dumb way, with 5hrs triggering 1hr after 4hrs, 1hr trigger 15min after 45min, etc.)
- 24hrs
- 12hrs
- 5hrs
- 1hr
- 15min
- 5min
- 1min
- 5sec
Any scheduled shutdowns are cancelled upon starting the server.
Examples
# Shut down the server in 5hrs. See src/data/schedule_shutdown/functions/delay/* for function names.
function schedule_shutdown:delay/five_hours
# Cancel a scheduled shutdown.
function schedule_shutdown:clear_all
Auto-Shutdown
I originally made this datapack because I had figured out how to host a Minecraft server in GitHub Actions, but needed the server to automatically close with enough time left to save the server state to the repo. That's why there is a 5 hour version (max GitHub workflow run time is 6 hours). The files with a name like length_of_time.zip will automatically run the function schedule_shutdown:delay/length_of_time when the server loads (using Minecraft's load.json). Unless you want your server to automatically shut down after a length of time, use NO_AUTO_SHUTDOWN.zip.
FAQ/Troubleshooting
Failed to load function schedule_shutdown:shutdown
Same as Couldn't load tag schedule_shutdown:all_shutdown as it is missing following references: schedule_shutdown:shutdown.
Couldn't load tag schedule_shutdown:all_shutdown as it is missing following references: schedule_shutdown:shutdown
Make sure you set the function-permission-level in server.properties to 4 and try starting the server again. If you still have this error, please open an issue in the GitHub repo.
下载 Schedule Shutdown
下载 Schedule Shutdown
下载 Schedule Shutdown
由 Tostbroti-studios 在 GitHub 上请求/PRed。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
数据包
此数据包添加了属于阿瓦里海盗的独特结构,将他们的独特风格带入你的 Minecraft 世界!兼容性:1.20 至 26.3
数据包
一个 Minecraft 光线投射库,能够精确检测玩家正在查看的方块,包括像台阶和楼梯这样的特殊方块形状。
数据包
此数据包添加了新的“祝福模式”难度。
数据包
允许服务器管理员方便地禁用 Xaero's Map 系列模组中的实体雷达、小地图等功能,使竞技游戏更加公平。
数据包
手持潜影盒时可直接打开,无需将其放置在地面上。只需按住 Shift 并右键点击即可访问你的潜影盒。
数据包
为你的 Minecraft 世界添加了超过 900 个新的进度
评论 0
登录后参与评分
还没有评论,来抢沙发吧