类 EntityInventoryComponent实验性

表示一个实体的物品栏属性。

Defines this entity's inventory properties.

层级 (查看完整内容)

属性

additionalSlotsPerStrength: number

表示实体每层强度(实体组件 minecraft:strength)可以获得的额外槽数。

Number of slots that this entity can gain per extra strength.

This property can throw when used.

canBeSiphonedFrom: boolean

若为 true,则表示实体物品栏中的物品可被漏斗或漏斗矿车转移走。

If true, the contents of this inventory can be removed by a hopper.

This property can throw when used.

container?: Container

表示实体的容器。若实体已被移除则为 undefined

Defines the container for this entity. The container will be undefined if the entity has been removed.

This property can throw when used.

containerType: string

表示实体容器的种类。

Type of container this entity has.

This property can throw when used.

entity: Entity

The entity that owns this component. The entity will be undefined if it has been removed.

inventorySize: number

表示实体容器的槽位数量。

Number of slots the container has.

This property can throw when used.

private: boolean

若为 true,则表示实体死亡不会掉落物品栏的物品。

If true, the entity will not drop it's inventory on death.

This property can throw when used.

restrictToOwner: boolean

若为 true,则表示实体物品栏仅能被其主人或实体自己访问和操作。

If true, the entity's inventory can only be accessed by its owner or itself.

This property can throw when used.

typeId: string

Identifier of the component.

componentId: "minecraft:inventory" = 'minecraft:inventory'

方法

  • 实验性

    返回 boolean

    Whether the component is valid.

    Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component.