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

minecraft:behavior.tempt

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

概览

minecraft:behavior.tempt 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物跟随手持它喜欢物品的玩家,比如牛喜欢小麦。很适合把动物引回家。

字段

字段类型默认值说明
can_get_scaredBoolean"false"设为 true 时,玩家在它附近移动太快会让生物停止跟随。
can_tempt_verticallyBoolean"false"设为 true 时,判断玩家距离时也会计算高度差。
can_tempt_while_riddenBoolean"false"设为 true 时,即使有人骑在生物身上,它也能被吸引。
itemsArray"[]"生物会跟随哪些物品。
sound_intervalRange [a, b]"[0.0, 0.0]"两次被吸引音效之间的随机等待时间(刻)。
speed_multiplierDecimal"1.0"这个目标运行时让生物加速或减速:1 为正常速度。
stop_distanceDecimal"1.5"生物靠近玩家到多近时停止移动。
tempt_soundString无生物被吸引时发出的声音。
within_radiusDecimal"0.0"玩家要离多近,物品才能吸引生物。

示例

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

BP/entities/<name>.json
{
  "minecraft:behavior.tempt": {
    "can_get_scared": "false",
    "can_tempt_vertically": "false",
    "can_tempt_while_ridden": "false",
    "items": "[]",
    "sound_interval": "[0.0, 0.0]",
    "speed_multiplier": "1.0",
    "stop_distance": "1.5",
    "tempt_sound": ""
  }
}

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