Skip to content
On this page
Common

EntityType

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

registerNativeEntityType

registerNativeEntityTypeCommonFunction
kotlin
fun registerNativeEntityType(id: String, registerMode: RegisterMode = RegisterMode.WORLD, entityTypeFactory: () -> EntityType<*>): KattonRegistry.KattonEntityTypeEntry

Registers a native EntityType with hot-reload support.

This is a lower-level API that only registers the EntityType itself. For complete entity registration (including attributes, spawn egg, and spawn placement), use [registerNativeEntity] instead.

Parameters

ParameterDescription
idEntity identifier (e.g., "mymod:custom_entity")
registerModeRegistration mode (GLOBAL, WORLD, or RELOADABLE)
entityTypeFactoryFactory function to create the EntityType instance

Returns

The registered KattonEntityTypeEntry

registerNativeEntityType

registerNativeEntityTypeCommonFunction
kotlin
fun registerNativeEntityType(id: Identifier, registerMode: RegisterMode = RegisterMode.WORLD, entityTypeFactory: () -> EntityType<*>): KattonRegistry.KattonEntityTypeEntry

Registers a native EntityType with hot-reload support (Identifier overload).

Parameters

ParameterDescription
idEntity identifier
registerModeRegistration mode
entityTypeFactoryFactory function to create the EntityType instance

Returns

The registered KattonEntityTypeEntry