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

minecraft:behavior.stay_near_noteblock

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

概览

minecraft:behavior.stay_near_noteblock 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物待在最近被演奏过的音符盒附近,并把手中的物品扔向它。悦灵用它在音符盒旁放下物品。

字段

字段类型默认值说明
speednumber1走向音符盒时的速度。
start_distancenumber10只有生物离音符盒至少这么远时,目标才会开始。
stop_distancenumber2生物尽量靠近音符盒的距离。
listen_timeinteger30听到音符盒后,生物在它附近停留的时间。
priorityinteger0多个目标同时想运行时决定谁优先:数字越小越先运行。范围:0 到 …
control_flagsGoal's control flags[]无列出这个目标要控制的身体部分(比如移动、看向或跳跃),这样需要同一部分的目标就不会同时运行。

示例

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

BP/entities/<name>.json
{
  "minecraft:behavior.stay_near_noteblock": {
    "speed": 1,
    "start_distance": 10,
    "stop_distance": 2,
    "listen_time": 30,
    "priority": 0,
    "control_flags": []
  }
}

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