@minecraft/server
    Preparing search index...

    Class SoundInstance

    Represents a handle to a sound that has been played. The handle is required to control the sound while it is playing (for example, to call stop, setVolume, setPitch, fade, or seekTo). Infinitely-looping sounds (started with loop: -1) stop automatically when the last SoundInstance reference is dropped; retain the handle for as long as the sound should keep playing.

    Index

    Properties

    durationInfo?: SoundDurationInfo

    Gets duration and playback information for this sound.

    id: string

    Unique identifier of this sound instance.

    recipient?: Player

    Gets the player this sound was played for.

    soundEventId: string

    Gets the identifier of the sound event this instance was started with.

    Methods

    • Returns void

      Stops this sound instance from playing.

      This function can't be called in restricted-execution mode.