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

minecraft:shareables

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

概览

minecraft:shareables 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 列出生物喜欢捡起并与同类分享的物品,就像村民之间互相传递食物。

字段

字段类型默认值说明
all_itemsBoolean"false"为 true 时,生物也想要列表外的所有物品,优先级最低。
all_items_max_amountInteger"-1"这些其他物品最多携带多少。
all_items_surplus_amountInteger"-1"这些物品超过多少算多余,愿意分给别人。
all_items_want_amountInteger"-1"生物想持有多少这些物品。
itemsList无生物在意的物品或物品标签,从上到下检查,第一个匹配的生效。
singular_pickupBoolean"false"为 true 时,已经拥有的物品生物只会再捡一个。

示例

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

BP/entities/<name>.json
{
  "minecraft:shareables": {
    "all_items": "false",
    "all_items_max_amount": "-1",
    "all_items_surplus_amount": "-1",
    "all_items_want_amount": "-1",
    "items": {},
    "singular_pickup": "false"
  }
}

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