Skip to content
On this page
通用

BasicSoundApi

top.katton.api.audiocommon/src/main/kotlin/top/katton/api/audio/BasicSoundApi.kt
Platform scheduling hook; Paper installs entity-region scheduling.

BasicAudioScheduler ​

BasicAudioScheduler通用对象
kotlin
object BasicAudioScheduler

Platform scheduling hook; Paper installs entity-region scheduling.

playBasicSound ​

playBasicSound通用函数
kotlin
fun playBasicSound(player: ServerPlayer, soundId: String, position: Vec3? = null, category: SoundSource = SoundSource.MUSIC, volume: Float = 1f, pitch: Float = 1f): CompletableFuture<Unit>

三平台均可播放客户端已有的声音;异步完成仅表示已发送。

stopBasicSound ​

stopBasicSound通用函数
kotlin
fun stopBasicSound(player: ServerPlayer, soundId: String? = null, category: SoundSource? = null): CompletableFuture<Unit>

按声音 ID/分类停止,无法区分相同 ID 的多个实例;空筛选匹配所有声音。