1. Wiki
  2. /实体
  3. /minecraft:behavior.harvest_farm_block

minecraft:behavior.harvest_farm_block

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

概览

minecraft:behavior.harvest_farm_block 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物收获成熟作物,并在空耕地上种下物品栏中种子的 AI 目标,比如农民村民。需要 minecraft:inventory 和导航组件。

字段

字段类型默认值说明
max_seconds_before_searchnumber1第一次寻找耕地前最长的随机等待秒数。
search_cooldown_max_secondsnumber8一无所获后再次搜索前最长的随机等待秒数。
seconds_until_new_tasknumber0.5收获或种植后休息多少秒,此目标才能再次开始。
search_rangeinteger16生物在水平方向上寻找耕地的范围(格)。
search_heightinteger1生物在上下方向上寻找耕地的范围(格)。
goal_radiusnumber1.5生物需要离耕地多近才算到达。
search_countinteger0每刻随机检查的方块数量。0 表示检查范围内的所有方块。范围:0 到 …
speed_multipliernumber0.5走向耕地时的速度倍率。范围:0 到 …
priorityinteger0数字越小越先执行:两个目标冲突时,priority 更小的那个胜出。范围:0 到 …
control_flagsGoal's control flags[]无此目标接管哪些身体部分(移动、看向、跳跃),占用相同部分的目标不能同时运行。

示例

写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):

BP/entities/<name>.json
{
  "minecraft:behavior.harvest_farm_block": {
    "max_seconds_before_search": 1,
    "search_cooldown_max_seconds": 8,
    "seconds_until_new_task": 0.5,
    "search_range": 16,
    "search_height": 1,
    "goal_radius": 1.5,
    "search_count": 0,
    "speed_multiplier": 0.5
  }
}

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