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

minecraft:behavior.share_items

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

概览

minecraft:behavior.share_items 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物把携带的物品扔给其他生物,就像村民之间分享食物。

字段

字段类型默认值说明
entity_typesEntityTypes无生物会和哪些实体分享物品。
speed_multipliernumber1这个目标运行时让生物加速或减速:1 为正常速度。
max_distinteger1生物寻找分享对象的最远距离。
goal_radiusnumber0.5生物需要靠近到多近才算到达。留一点余地可以避免它在原地来回抖动。
priorityinteger0多个目标同时想运行时决定谁优先:数字越小越先运行。范围:0 到 …
control_flagsGoal's control flags[]无列出这个目标要控制的身体部分(比如移动、看向或跳跃),这样需要同一部分的目标就不会同时运行。

示例

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

BP/entities/<name>.json
{
  "minecraft:behavior.share_items": {
    "entity_types": {},
    "speed_multiplier": 1,
    "max_dist": 1,
    "goal_radius": 0.5,
    "priority": 0,
    "control_flags": []
  }
}

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