概览
minecraft:behavior.random_stroll 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物无事可做时走到附近的随机地点。几乎所有陆地动物都用它来闲逛。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
speed_multiplier | number | 1 | 这个目标运行时让生物加速或减速:1 为正常速度。 |
xz_dist | integer | 10 | 生物在水平方向上寻找新位置的范围。至少为 1。 |
y_dist | integer | 7 | 生物在上下方向上寻找新位置的范围。至少为 1。 |
interval | integer | 120 | 设置这个目标被选中的频率:每次有 1/interval 的几率。数值越大,生物移动得越少。 |
priority | integer | 0 | 多个目标同时想运行时决定谁优先:数字越小越先运行。范围:0 到 … |
control_flags | Goal's control flags[] | 无 | 列出这个目标要控制的身体部分(比如移动、看向或跳跃),这样需要同一部分的目标就不会同时运行。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:behavior.random_stroll": {
"speed_multiplier": 1,
"xz_dist": 10,
"y_dist": 7,
"interval": 120,
"priority": 0,
"control_flags": []
}
}