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

minecraft:behavior.move_around_target

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

概览

minecraft:behavior.move_around_target 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物与目标保持合适距离的 AI 目标:太近时后退,太远时移动到更近的随机位置。

字段

字段类型默认值说明
destination_position_rangeFloatRange{"max":8,"min":4}生物寻找移动位置时离目标的最近和最远距离。
movement_speednumber0.6生物移动到所选位置的速度。
destination_pos_spread_degreesnumber90目标身后所选位置可以变化的角度范围。0 表示正后方。
filtersFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}此目标开始前必须满足的条件。
height_difference_limitnumber10只有与目标的高度差低于此值时,生物才算靠得太近。范围:0 到 …
horizontal_search_distanceinteger5生物在水平方向上寻找远离目标位置的范围(格)。范围:0 到 …
vertical_search_distanceinteger5生物在上下方向上寻找远离目标位置的范围(格)。范围:0 到 …
priorityinteger0数字越小越先执行:两个目标冲突时,priority 更小的那个胜出。范围:0 到 …
control_flagsGoal's control flags[]无此目标接管哪些身体部分(移动、看向、跳跃),占用相同部分的目标不能同时运行。

示例

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

BP/entities/<name>.json
{
  "minecraft:behavior.move_around_target": {
    "destination_position_range": {
      "max": 8,
      "min": 4
    },
    "movement_speed": 0.6,
    "destination_pos_spread_degrees": 90,
    "filters": {
      "AND": null,
      "NOT": null,
      "OR": null,
      "all": null,
      "all_of": null,
      "any": null,
      "any_of": null,
      "none_of": null
    },
    "height_difference_limit": 10,
    "horizontal_search_distance": 5,
    "vertical_search_distance": 5,
    "priority": 0
  }
}

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