Skip to content

API reference Obsidian.API.Client

IClientSounds interface

Local sound playback for a mod, obtained from IClientRegistry.Sounds and usable in screens and client ticks. Calls may come from any thread: playback is queued onto the game thread, and OpenAL runs on its audio worker. Returns false when this mod is inactive or audio is unavailable. Missing assets are silently ignored. Queued requests and this facade stop working when the mod unloads; obtain a new facade on reload.

public interface IClientSounds

In Obsidian.API.Client.

Methods

Play(SoundEvent, VectorD, SoundCategory, float, float)

bool Play(SoundEvent sound, VectorD position, SoundCategory category = 0, float volume = 1f, float pitch = 1f);

Queues a positional sound; category volume settings and resource-pack sound variants apply.

PlayUi(SoundEvent, float, float)

bool PlayUi(SoundEvent sound, float volume = 1f, float pitch = 1f);

Queues UI audio, also without a server connected. It plays while menus pause the world.

On this page