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

minecraft:behavior.nap

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

概览

minecraft:behavior.nap 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物时不时躺下打个盹,就像狐狸在白天睡觉一样。特定生物靠近时它会醒来。

字段

字段类型默认值说明
cooldown_minnumber0生物再次打盹前的最短等待时间(秒)。
cooldown_maxnumber0生物再次打盹前的最长等待时间(秒)。
mob_detect_distnumber6生物在水平方向上检测附近可能吵醒它的生物的范围。
mob_detect_heightnumber6生物在上下方向上检测附近可能吵醒它的生物的范围。
can_nap_filtersFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}生物入睡必须满足的条件。
wake_mob_exceptionsFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}符合这些过滤器的生物不会吵醒它。
priorityinteger0多个目标同时想运行时决定谁优先:数字越小越先运行。范围:0 到 …
control_flagsGoal's control flags[]无列出这个目标要控制的身体部分(比如移动、看向或跳跃),这样需要同一部分的目标就不会同时运行。

示例

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

BP/entities/<name>.json
{
  "minecraft:behavior.nap": {
    "cooldown_min": 0,
    "cooldown_max": 0,
    "mob_detect_dist": 6,
    "mob_detect_height": 6,
    "can_nap_filters": {
      "AND": null,
      "NOT": null,
      "OR": null,
      "all": null,
      "all_of": null,
      "any": null,
      "any_of": null,
      "none_of": null
    },
    "wake_mob_exceptions": {
      "AND": null,
      "NOT": null,
      "OR": null,
      "all": null,
      "all_of": null,
      "any": null,
      "any_of": null,
      "none_of": null
    },
    "priority": 0,
    "control_flags": []
  }
}

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