跳到主要内容

TIME - 时间设置效果

概述

设置玩家的 Minecraft 时间(游戏内时间)。

技术规格

属性
效果类型TIME
Java 枚举EffectType.TIME
实现类TimeEffect

JSON 格式

{
"eventType": "TIME",
"beat": 4.0,
"properties": {
"time": 18000,
"duration": 5000
}
}

字段说明

字段类型必需默认值说明
eventTypestring-固定为 "TIME"
beatdouble-效果触发的拍数
timelong-Minecraft 时间(0-24000)
durationlong31536000000L持续时间(毫秒)

Minecraft 时间系统

Minecraft 时间使用 0-24000 的数值系统:

时间值游戏时间说明
0日出新的一天开始
6000正午太阳在天空中央
12000日落夜晚开始
13000午夜完全黑暗
18000夜晚中段-
23999即将日出-

工作原理

  • 设置玩家的个人时间(相对时间)
  • 效果结束后自动重置为默认时间

使用示例

设置为正午

{
"eventType": "TIME",
"beat": 4.0,
"properties": {
"time": 6000,
"duration": 10000
}
}

设置为午夜

{
"eventType": "TIME",
"beat": 8.0,
"properties": {
"time": 18000,
"duration": 5000
}
}

设置为日出

{
"eventType": "TIME",
"beat": 12.0,
"properties": {
"time": 0,
"duration": 3000
}
}

持久时间设置

{
"eventType": "TIME",
"beat": 16.0,
"properties": {
"time": 12000,
"duration": 31536000000
}
}

注意事项

  1. 时间范围: 0-24000,超出范围会被 Minecraft 自动处理
  2. 玩家影响: 只影响当前玩家的时间感知,其他玩家不受影响
  3. 持续时间: 设置超长值表示持久效果,直到手动重置
  4. 重置机制: 效果结束后自动调用 resetPlayerTime()
  5. 视觉效果: 时间改变会影响天空颜色、光照等视觉效果

相关效果

相关文档