Skip to main content

Class: EntityInventoryComponent

Defines this entity's inventory properties.

Extends

Constructors

new EntityInventoryComponent()

private new EntityInventoryComponent(): EntityInventoryComponent

Returns

EntityInventoryComponent

Overrides

EntityComponent . constructor

Properties

additionalSlotsPerStrength

readonly additionalSlotsPerStrength: number

Remarks

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

Throws

This property can throw when used.


canBeSiphonedFrom

readonly canBeSiphonedFrom: boolean

Remarks

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

Throws

This property can throw when used.


container?

optional readonly container: Container

Remarks

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

Throws

This property can throw when used.


containerType

readonly containerType: string

Remarks

Type of container this entity has.

Throws

This property can throw when used.


entity

Beta

readonly entity: Entity

Remarks

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

Inherited from

EntityComponent . entity


inventorySize

readonly inventorySize: number

Remarks

Number of slots the container has.

Throws

This property can throw when used.


private

readonly private: boolean

Remarks

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

Throws

This property can throw when used.


restrictToOwner

readonly restrictToOwner: boolean

Remarks

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

Throws

This property can throw when used.


typeId

readonly typeId: string

Remarks

Identifier of the component.

Inherited from

EntityComponent . typeId


componentId

static readonly componentId: "minecraft:inventory" = 'minecraft:inventory'

Methods

isValid()

isValid(): boolean

Returns

boolean

Whether the component is valid.

Inherited from

EntityComponent . isValid

Remarks

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.