Skip to content

@minecraft/server


@minecraft/server / EntityInventoryComponent

Class: EntityInventoryComponent ​

Defined in: @minecraft/server/index.d.ts:10876

Defines this entity's inventory properties.

Extends ​

Properties ​

additionalSlotsPerStrength ​

readonly additionalSlotsPerStrength: number

Defined in: @minecraft/server/index.d.ts:10885

Remarks ​

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

Throws ​

This property can throw when used.


canBeSiphonedFrom ​

readonly canBeSiphonedFrom: boolean

Defined in: @minecraft/server/index.d.ts:10893

Remarks ​

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

Throws ​

This property can throw when used.


container ​

readonly container: Container

Defined in: @minecraft/server/index.d.ts:10903

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.

InvalidEntityError


containerType ​

readonly containerType: string

Defined in: @minecraft/server/index.d.ts:10910

Remarks ​

Type of container this entity has.

Throws ​

This property can throw when used.


entity ​

readonly entity: Entity

Defined in: @minecraft/server/index.d.ts:9981

Remarks ​

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

Throws ​

This property can throw when used.

InvalidEntityError

Inherited from ​

EntityComponent.entity


inventorySize ​

readonly inventorySize: number

Defined in: @minecraft/server/index.d.ts:10917

Remarks ​

Number of slots the container has.

Throws ​

This property can throw when used.


isValid ​

readonly isValid: boolean

Defined in: @minecraft/server/index.d.ts:6234

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.

Inherited from ​

EntityComponent.isValid


private ​

readonly private: boolean

Defined in: @minecraft/server/index.d.ts:10924

Remarks ​

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

Throws ​

This property can throw when used.


restrictToOwner ​

readonly restrictToOwner: boolean

Defined in: @minecraft/server/index.d.ts:10932

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

Defined in: @minecraft/server/index.d.ts:6240

Remarks ​

Identifier of the component.

Inherited from ​

EntityComponent.typeId


componentId ​

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

Defined in: @minecraft/server/index.d.ts:10933