概览
minecraft:behavior.find_mount 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物寻找可以爬上去骑乘的其他生物的 AI 目标,比如寻找鸡的小僵尸。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
within_radius | number | 0 | 生物在多少格范围内寻找可骑乘的对象。 |
start_delay | integer | 0 | 生物前往坐骑之前等待的时间。 |
avoid_water | boolean | false | 为 true 时,生物前往坐骑途中会避开水。 |
target_needed | boolean | false | 为 true 时,生物只在有目标时寻找坐骑。 |
mount_distance | number | -1 | 生物需要多近才能爬上去。小于 0 时使用它的攻击距离。 |
max_failed_attempts | integer | 20 | 生物放弃前寻找坐骑可以失败的次数。 |
priority | integer | 0 | 数字越小越先执行:两个目标冲突时,priority 更小的那个胜出。范围:0 到 … |
control_flags | Goal's control flags[] | 无 | 此目标接管哪些身体部分(移动、看向、跳跃),占用相同部分的目标不能同时运行。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:behavior.find_mount": {
"within_radius": 0,
"start_delay": 0,
"avoid_water": false,
"target_needed": false,
"mount_distance": -1,
"max_failed_attempts": 20,
"priority": 0,
"control_flags": []
}
}