ItemCustomComponent Interface
Caution
This interface is still in pre-release. Its signature may change or it may be removed in future releases.
Contains a set of events that will be raised for an item. This object must be bound using the ItemComponentRegistry.
Properties
onBeforeDurabilityDamage
onBeforeDurabilityDamage?: (arg: ItemComponentBeforeDurabilityDamageEvent) => void;
This function will be called when an item containing this component is hitting an entity and about to take durability damage.
Type: (arg: ItemComponentBeforeDurabilityDamageEvent) => void
onCompleteUse
onCompleteUse?: (arg: ItemComponentCompleteUseEvent) => void;
This function will be called when an item containing this component's use duration was completed.
Type: (arg: ItemComponentCompleteUseEvent) => void
onConsume
onConsume?: (arg: ItemComponentConsumeEvent) => void;
This function will be called when an item containing this component is eaten by an entity.
Type: (arg: ItemComponentConsumeEvent) => void
onHitEntity
onHitEntity?: (arg: ItemComponentHitEntityEvent) => void;
This function will be called when an item containing this component is used to hit another entity.
Type: (arg: ItemComponentHitEntityEvent) => void
onMineBlock
onMineBlock?: (arg: ItemComponentMineBlockEvent) => void;
This function will be called when an item containing this component is used to mine a block.
Type: (arg: ItemComponentMineBlockEvent) => void
onUse
onUse?: (arg: ItemComponentUseEvent) => void;
This function will be called when an item containing this component is used by a player.
Type: (arg: ItemComponentUseEvent) => void
onUseOn
onUseOn?: (arg: ItemComponentUseOnEvent) => void;
This function will be called when an item containing this component is used on a block.
Type: (arg: ItemComponentUseOnEvent) => void
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for