kotlin
@Suppress("unused")
object ItemEventItem interaction events for Fabric platform.
This object provides events related to item usage and tossing. Events are triggered when players interact with items in the world.
ItemEvent.onUseOn
kotlin
val onUseOnEvent triggered when an item is used on a block (right-click on block).
Returns
InteractionResult to control the interaction outcome. Return a non-null value to override default behavior.
ItemEvent.onUse
kotlin
val onUseEvent triggered when an item is used (right-click in air or on entity).
Returns
InteractionResult to control the interaction outcome. Return a non-null value to override default behavior.