Defines this entity's inventory properties.

Hierarchy (View Summary)

Constructors

Properties

additionalSlotsPerStrength: number

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

This property can throw when used.

canBeSiphonedFrom: boolean

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

This property can throw when used.

container: Container

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

This property can throw when used.

InvalidEntityError

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.

This property can throw when used.

InvalidEntityError

inventorySize: number

Number of slots the container has.

This property can throw when used.

isValid: boolean

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.

private: boolean

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

This property can throw when used.

restrictToOwner: boolean

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'