Skip to content
On this page
Common

SoundEvent

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

registerNativeSoundEvent

registerNativeSoundEventCommonFunction
kotlin
fun registerNativeSoundEvent(id: String, registerMode: RegisterMode = RegisterMode.WORLD, soundEventFactory: () -> SoundEvent): KattonRegistry.KattonSoundEventEntry

Registers a native SoundEvent with hot-reload support.

Parameters

ParameterDescription
idSound identifier (e.g., "mymod:custom_sound")
registerModeRegistration mode (GLOBAL, WORLD, or RELOADABLE)
soundEventFactoryFactory function to create the SoundEvent instance

Returns

The registered KattonSoundEventEntry

registerNativeSoundEvent

registerNativeSoundEventCommonFunction
kotlin
fun registerNativeSoundEvent(id: Identifier, registerMode: RegisterMode = RegisterMode.WORLD, soundEventFactory: () -> SoundEvent): KattonRegistry.KattonSoundEventEntry

Registers a native SoundEvent with hot-reload support.

Parameters

ParameterDescription
idSound identifier
registerModeRegistration mode
soundEventFactoryFactory function to create the SoundEvent instance

Returns

The registered KattonSoundEventEntry

createVariableRangeSoundEvent

createVariableRangeSoundEventCommonFunction
kotlin
fun createVariableRangeSoundEvent(id: String): SoundEvent

Utility factory for quickly creating a variable-range SoundEvent.

Parameters

ParameterDescription
idThe sound identifier

Returns

A new SoundEvent with variable range