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

minecraft:inventory

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

概览

minecraft:inventory 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 给实体一个可以存放物品的物品栏,就像驴身上的箱子或运输矿车。

字段

字段类型默认值说明
additional_slots_per_strengthInteger"0"每点强度额外增加的栏位数。
can_be_siphoned_fromBoolean"false"允许漏斗从中抽取物品。
container_typeString"none"容器界面的类型,比如 horse、inventory、container 或 hopper。
inventory_sizeInteger"5"栏位数量。
privateBoolean"false"为 true 时,实体死亡时不会掉落物品。
restrict_to_ownerBoolean"false"只有主人可以打开物品栏。

示例

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

BP/entities/<name>.json
{
  "minecraft:inventory": {
    "additional_slots_per_strength": "0",
    "can_be_siphoned_from": "false",
    "container_type": "none",
    "inventory_size": "5",
    "private": "false",
    "restrict_to_owner": "false"
  }
}

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