Skip to content
On this page
Fabric

ItemComponentEvent

top.katton.api.eventfabric/src/main/kotlin/top/katton/api/event/ItemComponentEvent.kt
Item component and enchantment events for Fabric platform.

ItemComponentEvent ​

ItemComponentEventFabricObject
kotlin
@Suppress("unused")
object ItemComponentEvent

Item component and enchantment events for Fabric platform.

This object provides events related to default item component modification and enchantment handling (allowing/modifying enchantments).

ItemComponentEvent.ModifyComponentArg ​

ItemComponentEvent.ModifyComponentArgFabricData Class
kotlin
data class ModifyComponentArg(val context: DefaultItemComponentEvents.ModifyContext)

Argument class for item component modification events.

Properties ​

PropertyDescription
contextThe modification context containing item and registry information

ItemComponentEvent.onModifyComponent ​

ItemComponentEvent.onModifyComponentFabricProperty
kotlin
val onModifyComponent

Event triggered to modify default item components for items. Use this to add custom components to items during registration.

ItemComponentEvent.onAllowEnchanting ​

ItemComponentEvent.onAllowEnchantingFabricProperty
kotlin
val onAllowEnchanting

Event triggered to allow or deny an enchantment being applied to an item.

Returns ​

indicating whether to allow (TRUE), deny (FALSE), or use default (DEFAULT).

ItemComponentEvent.onModifyEnchantment ​

ItemComponentEvent.onModifyEnchantmentFabricProperty
kotlin
val onModifyEnchantment

Event triggered when an item's enchantment is being modified. Use this to customize enchantment behavior.