Skip to content
On this page

Common

Item

top.katton.api.registrycommon/src/main/kotlin/top/katton/api/registry/Item.kt
Registers a native Item with hot-reload support.

registerNativeItem

CommonFunction
kotlin
@ApiStatus.Experimental
@ApiStatus.Experimental fun registerNativeItem(id: String, registerMode: RegisterMode = RegisterMode.AUTO, configure: KattonItemProperties.() -> Unit = {}, itemFactory: (KattonItemProperties) -> Item): KattonRegistry.KattonItemEntry

Registers a native Item with hot-reload support.

This is the primary API for registering custom Item subclasses from scripts. The item will be registered in the global Minecraft registry with full hot-reload capability.

Parameters

ParameterDescription
idItem identifier (e.g., "mymod:my_item")
registerModeRegistration mode (GLOBAL, RELOADABLE, or AUTO)
configureConfiguration lambda for item properties
itemFactoryFactory function to create the Item instance

Returns

The registered KattonItemEntry

registerNativeItem

CommonFunction
kotlin
@ApiStatus.Experimental
@ApiStatus.Experimental fun registerNativeItem(id: Identifier, registerMode: RegisterMode = RegisterMode.AUTO, configure: KattonItemProperties.() -> Unit = {}, itemFactory: (KattonItemProperties) -> Item): KattonRegistry.KattonItemEntry

Registers a native Item with hot-reload support.

Parameters

ParameterDescription
idItem identifier
registerModeRegistration mode
configureConfiguration lambda for item properties
itemFactoryFactory function to create the Item instance

Returns

The registered KattonItemEntry

registerNativeItem

CommonFunction
kotlin
@ApiStatus.Experimental
@ApiStatus.Experimental fun registerNativeItem(id: String, properties: KattonItemProperties, registerMode: RegisterMode = RegisterMode.AUTO, itemFactory: (KattonItemProperties) -> Item): KattonRegistry.KattonItemEntry

Registers a native Item with pre-configured properties.

Parameters

ParameterDescription
idItem identifier
propertiesPre-configured item properties
registerModeRegistration mode
itemFactoryFactory function to create the Item instance

Returns

The registered KattonItemEntry