概览
minecraft:behavior.follow_target_leader 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物走向首领生物并待在它附近的 AI 目标。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
within_radius | number | 0 | 如果首领离开超过这么多格,生物就会放弃。 |
follow_distance | number | 0 | 生物与首领保持的格数。 |
always_look_for_leader | boolean | false | 为 true 时,没有首领或原首领失效时,生物会持续寻找新首领。 |
leader_filters | Filter Group | {"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null} | 生物成为首领必须满足的条件。 |
search_cooldown | integer | 20 | 失去首领或找不到首领后,再次搜索前等待的刻数。 |
speed_multiplier | number | 1 | 跟随首领时的速度倍率。 |
priority | integer | 0 | 数字越小越先执行:两个目标冲突时,priority 更小的那个胜出。范围:0 到 … |
control_flags | Goal's control flags[] | 无 | 此目标接管哪些身体部分(移动、看向、跳跃),占用相同部分的目标不能同时运行。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:behavior.follow_target_leader": {
"within_radius": 0,
"follow_distance": 0,
"always_look_for_leader": false,
"leader_filters": {
"AND": null,
"NOT": null,
"OR": null,
"all": null,
"all_of": null,
"any": null,
"any_of": null,
"none_of": null
},
"search_cooldown": 20,
"speed_multiplier": 1,
"priority": 0,
"control_flags": []
}
}