1. Wiki
  2. /实体
  3. /minecraft:preferred_path

minecraft:preferred_path

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

概览

minecraft:preferred_path 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 给生物一份它喜欢走的方块列表,以及它有多不喜欢其他方块,让它沿着道路和小径走。村民用它沿着土径行走。

字段

字段类型默认值说明
max_fall_blocksinteger3生物沿路径行走时愿意往下跳多少格。
jump_costnumber0向上跳一格额外增加的代价;数值越高,生物越会避免跳跃。
default_block_costnumber0在不属于偏好列表的方块上行走的代价。
preferred_path_blocksPreferredPath 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": []
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more