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

minecraft:behavior.swim_up_for_breath

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

概览

minecraft:behavior.swim_up_for_breath 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 生物快要没气时让它向上游去找空气。需要 minecraft:breathable。海豚和海龟会用到它。

字段

字段类型默认值说明
speed_modnumber1.4这个目标运行时让生物加速或减速:1 为正常速度。
search_radiusinteger4在生物周围多大范围内寻找空气方块。
search_heightinteger16在生物上方多高范围内寻找空气。如果没找到,它会直接向上游这么多格。
material_typestring"water"生物在哪种液体中游动:"water"、"lava" 或 "any"。空气方块必须位于这种液体上方。
priorityinteger0多个目标同时想运行时决定谁优先:数字越小越先运行。范围:0 到 …
control_flagsGoal's control flags[]无列出这个目标要控制的身体部分(比如移动、看向或跳跃),这样需要同一部分的目标就不会同时运行。

示例

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

BP/entities/<name>.json
{
  "minecraft:behavior.swim_up_for_breath": {
    "speed_mod": 1.4,
    "search_radius": 4,
    "search_height": 16,
    "material_type": "water",
    "priority": 0,
    "control_flags": []
  }
}

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