Skip to content
On this page

Fabric

ItemEvent

top.katton.api.eventfabric/src/main/kotlin/top/katton/api/event/ItemEvent.kt
Item interaction events for Fabric platform.

ItemEvent

FabricObject
kotlin
@Suppress("unused")
object ItemEvent

Item 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

FabricProperty
kotlin
val onUseOn

Event 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

FabricProperty
kotlin
val onUse

Event 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.