AFK Sleep
需要 Detect AFK Players。
允许玩家在服务器上有挂机玩家时也能睡觉,并尊重你原有的 playersSleepingPercentage 设置。如果有玩家加入后立刻离开去洗澡,现在这不会阻止你跳过夜晚。
功能
- 可配置的百分比 - 像平常一样修改该游戏内规则
- 高度优化 - 除非必要否则不运行命令,不使用 NBT 数据,不进行每刻检查
- 响应变化 - 离开、加入、改变挂机状态、改变维度等
- 正确工作 - 其他数据包不考虑维度或状态变化

详情
当首次安装 AFK Sleep 时,它会使用你设置的 playersSleepingPercentage 作为主世界中非挂机玩家必须睡觉才能跳过夜晚的百分比。下表解释了这一点:
| 玩家数 |
非挂机数 |
playersSleepingPercentage |
需要睡觉的玩家数 |
| 3 |
3 |
100% |
3(所有三个玩家都必须睡觉) |
| 3 |
2 |
100% |
2(只有两个非挂机的玩家需要睡觉) |
| 3 |
2 |
50% |
1(只有半数的非挂机玩家需要睡觉) |
要更改需要睡觉的“活跃”玩家百分比,只需像平常那样通过 /gamerule playersSleepingPercentage NUMBER 修改该游戏内规则即可。此游戏内规则由数据包自动管理,因此如果其值不符合你的预期也不必担心。
1.3 版本之前:如何更改 playersSleepingPercentage
由于此数据包覆盖了 playersSleepingPercentage 游戏内规则,你必须修改记分板数值来改变其计算方式。将数字 '50' 替换为你想要设置的百分比。
/scoreboard players set .relativePercentage afk_sleep.dummy 50
如果你想卸载此数据包,请运行 /function afk_sleep:uninstall 以删除后台记分板并自动重置 playersSleepingPercentage。
AFK Sleep
Requires Detect AFK Players.
Allows players to sleep even when there are players AFK on the server, and respects your original playersSleepingPercentage. If you've got someone that joins then immediately leaves to take a shower, now that won't stop you from being able to skip the night.
Features
- Configurable percentage - Change the gamerule like you would normally
- Highly optimized - No commands run unless necessary, no NBT usage, no checks every tick
- Reacts to changes - Leaving, joining, changing AFK state, changing dimension, etc
- Works correctly - Other data packs don't consider dimensions or state changes

Details
When AFK Sleep is first installed, it uses the playersSleepingPercentage you've set as the percentage of non-AFK players in the overworld that have to be sleeping to skip the night. The table below explains it:
| Players |
Not AFK |
playersSleepingPercentage |
Players required to sleep |
| 3 |
3 |
100% |
3 (all three players have to sleep) |
| 3 |
2 |
100% |
2 (only the two non-afk players have to sleep) |
| 3 |
2 |
50% |
1 (only half of the non-afk players have to sleep) |
To change the percentage of "active" players that need to sleep, just change the gamerule like you normally would, with /gamerule playersSleepingPercentage NUMBER. This gamerule is managed for you, so don't worry if it isn't set to the value you expect.
Before version 1.3: How to change playersSleepingPercentage
Because this datapack overrides the playersSleepingPercentage gamerule, you have to modify a scoreboard value to change its calculations. Replace the number '50' with the percentage you want to set.
/scoreboard players set .relativePercentage afk_sleep.dummy 50
If you want to uninstall the datapack, run /function afk_sleep:uninstall to delete the backing scoreboards and reset the playersSleepingPercentage automatically.
评论 0
登录后参与评分
还没有评论,来抢沙发吧