SoundList

A list of sounds in a namespace, akin to a sounds.json.

Constructors

Link copied to clipboard
constructor(namespace: String, soundEvents: MutableList<SoundEvent> = mutableListOf())
constructor(soundEvents: MutableList<SoundEvent>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The namespace of this sound list.

Link copied to clipboard

The sound events in this sound list.

Functions

Link copied to clipboard
fun add(key: Key): SoundEvent

Adds a basic sound event to this sound list.

fun add(soundEvent: SoundEvent): SoundEvent

Adds a sound event to this sound list.

fun add(key: Key? = null, block: SoundEvent.() -> Unit): SoundEvent

Builds and adds a sound event to this sound list.

Link copied to clipboard
open override fun save(pack: ResourcePack)

Saves this element to a resource pack.

Link copied to clipboard
open fun validate(pack: ResourcePack): Result<Unit>

Validates this element and returns a Result of type Unit, with an optional exception extending ResourcePackValidationException. This API will probably be improved in the future.