概览
minecraft:shareables 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 列出生物喜欢捡起并与同类分享的物品,就像村民之间互相传递食物。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
all_items | Boolean | "false" | 为 true 时,生物也想要列表外的所有物品,优先级最低。 |
all_items_max_amount | Integer | "-1" | 这些其他物品最多携带多少。 |
all_items_surplus_amount | Integer | "-1" | 这些物品超过多少算多余,愿意分给别人。 |
all_items_want_amount | Integer | "-1" | 生物想持有多少这些物品。 |
items | List | 无 | 生物在意的物品或物品标签,从上到下检查,第一个匹配的生效。 |
singular_pickup | Boolean | "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"
}
}