Skip to main content

Interface: ItemCustomComponent

Contains a set of events that will be raised for an item. This object must be bound using the ItemComponentRegistry.

Properties

onBeforeDurabilityDamage()?

optional onBeforeDurabilityDamage: (arg) => void

Parameters

ParameterType
argItemComponentBeforeDurabilityDamageEvent

Returns

void


onCompleteUse()?

optional onCompleteUse: (arg) => void

Parameters

ParameterType
argItemComponentCompleteUseEvent

Returns

void


onConsume()?

optional onConsume: (arg) => void

Parameters

ParameterType
argItemComponentConsumeEvent

Returns

void


onHitEntity()?

optional onHitEntity: (arg) => void

Parameters

ParameterType
argItemComponentHitEntityEvent

Returns

void


onMineBlock()?

optional onMineBlock: (arg) => void

Remarks

This function will be called when an item containing this component is used to mine a block.

Parameters

ParameterType
argItemComponentMineBlockEvent

Returns

void


onUse()?

optional onUse: (arg) => void

Remarks

This function will be called when an item containing this component is used by a player.

Parameters

ParameterType
argItemComponentUseEvent

Returns

void


onUseOn()?

optional onUseOn: (arg) => void

Parameters

ParameterType
argItemComponentUseOnEvent

Returns

void