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

minecraft:behavior.follow_mob

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

概览

minecraft:behavior.follow_mob 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物跟在附近其他生物后面的 AI 目标。

字段

字段类型默认值说明
speed_multipliernumber1跟随时的速度倍率。
stop_distancenumber无此生物在被跟随生物后方多少格处停下。
search_rangeinteger0生物在多少格范围内寻找可跟随的对象。
use_home_position_restrictionbooleanfalse为 true 时,只能跟随此生物家园范围内的生物。
preferred_actor_typestring""优先跟随的生物类型。留空则在附近随机选择一只。
filtersFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}附近哪些生物可以被跟随。留空时使用内置列表,会跳过玩家和其他一些实体。
priorityinteger0数字越小越先执行:两个目标冲突时,priority 更小的那个胜出。范围:0 到 …
control_flagsGoal's control flags[]无此目标接管哪些身体部分(移动、看向、跳跃),占用相同部分的目标不能同时运行。

示例

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

BP/entities/<name>.json
{
  "minecraft:behavior.follow_mob": {
    "speed_multiplier": 1,
    "stop_distance": 1,
    "search_range": 0,
    "use_home_position_restriction": false,
    "preferred_actor_type": "",
    "filters": {
      "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