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

minecraft:behavior.float_wander

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

概览

minecraft:behavior.float_wander 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物在空中随机飘到各处的 AI 目标,比如恶魂。

字段

字段类型默认值说明
xz_distinteger10下一个位置在水平方向上的最远距离。必须为 1 或更大。
y_distinteger7下一个位置在上下方向上的最远距离。必须为 1 或更大。
y_offsetnumber0在所选位置的高度上增加的格数。
must_reachbooleanfalse为 true 时,只有能到达的位置才会被选中。
random_reselectbooleanfalse为 true 时,生物可能在到达当前位置前改选新位置。
use_home_position_restrictionbooleantrue为 true 时,位置会限制在生物的家园范围内。
float_durationFloatRange{"max":0,"min":0}生物做其他事情之前飘荡的随机秒数范围。
float_wander_has_move_controlbooleantrue为 true 时,此目标会占用移动,因此不能与其他移动生物的目标同时运行。
surface_xz_distinteger8在位置附近水平方向上检查表面的距离。仅与 navigate_around_surface 一起使用。
surface_y_distinteger8在位置附近上下方向上检查表面的距离。仅与 navigate_around_surface 一起使用。
additional_collision_bufferbooleanfalse为 true 时,生物周围会保留额外空间,避免撞上方块。
navigate_around_surfacebooleanfalse为 true 时,生物更喜欢靠近固体方块的位置,而不是空中或液体中。
allow_navigating_through_liquidsbooleanfalse为 true 时,生物途中可以穿过液体。
priorityinteger0数字越小越先执行:两个目标冲突时,priority 更小的那个胜出。范围:0 到 …
control_flagsGoal's control flags[]无此目标接管哪些身体部分(移动、看向、跳跃),占用相同部分的目标不能同时运行。

示例

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

BP/entities/<name>.json
{
  "minecraft:behavior.float_wander": {
    "xz_dist": 10,
    "y_dist": 7,
    "y_offset": 0,
    "must_reach": false,
    "random_reselect": false,
    "use_home_position_restriction": true,
    "float_duration": {
      "max": 0,
      "min": 0
    },
    "float_wander_has_move_control": true
  }
}

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