时间(Time)#

#bs.time:help

Access the real-world system time from inside a datapack.

启用命令方块

此模块使用命令方块获取系统时间。为使时间按预期显示,请确保将 command_blocks_worksend_command_feedback 这两个游戏规则均设置为 true

🔧 函数#

你可以在下方找到此模块中的所有可用函数。


系统时间#

#bs.time:get

获取对应于实际小时、分钟和秒的系统时间。

输出:

分数 $time.hours bs.out:系统时间小时。

分数 $time.minutes bs.out:系统时间分钟。

分数 $time.seconds bs.out:系统时间秒。

示例:每个人都畏惧的时刻:

function #bs.time:get

tellraw @a [{"text":"It is "},{"score":{"name":"$time.hours","objective":"bs.out"}},{"text":"h, "},{"score":{"name":"$time.minutes","objective":"bs.out"}},{"text":"m and "},{"score":{"name":"$time.seconds","objective":"bs.out"}},{"text":"s. Time to wake up!"}]

贡献者:Aksiome


💬 这对你有帮助吗?

欢迎在下方留下你的问题和反馈!