1. Wiki
  2. /实体
  3. /minecraft:behavior.timer_flag_3

minecraft:behavior.timer_flag_3

不想手写?在 GodCraft 里打开一个开关,就能帮你设置好 minecraft:behavior.timer_flag_3。Get GodCraft

概览

minecraft:behavior.timer_flag_3 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 通用计时器目标:开始时触发一个事件,运行一段时间后,在结束或被打断时再触发另一个事件。运行期间 query.timer_flag_3 返回 1,可以用来驱动动画。共有三个(timer_flag_1 到 3),可以分别运行独立的计时器。

字段

字段类型默认值说明
duration_rangeFloatRange{"max":0,"min":0}目标运行的随机时长(秒)。
cooldown_rangeFloatRange{"max":0,"min":0}目标再次运行前的随机等待时间(秒)。设置后,第一次运行前也会等待。
on_startActorDefinitionTrigger{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}目标开始时触发的事件。
on_endActorDefinitionTrigger{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}目标结束或被打断时触发的事件。
priorityinteger0多个目标同时想运行时决定谁优先:数字越小越先运行。范围:0 到 …
control_flagsGoal's control flags[]无列出这个目标要控制的身体部分(比如移动、看向或跳跃),这样需要同一部分的目标就不会同时运行。

示例

写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):

BP/entities/<name>.json
{
  "minecraft:behavior.timer_flag_3": {
    "duration_range": {
      "max": 0,
      "min": 0
    },
    "cooldown_range": {
      "max": 0,
      "min": 0
    },
    "on_start": {
      "event": "",
      "filters": {
        "AND": null,
        "NOT": null,
        "OR": null,
        "all": null,
        "all_of": null,
        "any": null,
        "any_of": null,
        "none_of": null
      },
      "target": "self"
    },
    "on_end": {
      "event": "",
      "filters": {
        "AND": null,
        "NOT": null,
        "OR": null,
        "all": null,
        "all_of": null,
        "any": null,
        "any_of": null,
        "none_of": null
      },
      "target": "self"
    },
    "priority": 0,
    "control_flags": []
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more