概览
minecraft:preferred_path 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 给生物一份它喜欢走的方块列表,以及它有多不喜欢其他方块,让它沿着道路和小径走。村民用它沿着土径行走。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
max_fall_blocks | integer | 3 | 生物沿路径行走时愿意往下跳多少格。 |
jump_cost | number | 0 | 向上跳一格额外增加的代价;数值越高,生物越会避免跳跃。 |
default_block_cost | number | 0 | 在不属于偏好列表的方块上行走的代价。 |
preferred_path_blocks | PreferredPath BlockSet[] | 无 | 方块分组以及在每组上行走的代价;代价越低,生物越偏好它。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:preferred_path": {
"max_fall_blocks": 3,
"jump_cost": 0,
"default_block_cost": 0,
"preferred_path_blocks": []
}
}