Class SoundEvent.SoundSourceEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.sound.SoundEvent
net.neoforged.neoforge.client.event.sound.SoundEvent.SoundSourceEvent
Direct Known Subclasses:
PlaySoundSourceEvent, PlayStreamingSourceEvent
Enclosing class:
SoundEvent

public abstract static class SoundEvent.SoundSourceEvent extends SoundEvent
Superclass for when a sound has started to play on an audio channel.

These events are fired on the main Forge event bus, only on the logical client.

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.neoforged.neoforge.client.event.sound.SoundEvent

    SoundEvent.SoundSourceEvent
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final com.mojang.blaze3d.audio.Channel
     
    private final String
     
    private final net.minecraft.client.resources.sounds.SoundInstance
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    SoundSourceEvent(net.minecraft.client.sounds.SoundEngine engine, net.minecraft.client.resources.sounds.SoundInstance sound, com.mojang.blaze3d.audio.Channel channel)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.mojang.blaze3d.audio.Channel
    Returns the audio channel on which the sound is playing on.
    Returns the name of the sound being played.
    net.minecraft.client.resources.sounds.SoundInstance
    Returns the sound being played.

    Methods inherited from class net.neoforged.neoforge.client.event.sound.SoundEvent

    getEngine

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • sound

      private final net.minecraft.client.resources.sounds.SoundInstance sound
    • channel

      private final com.mojang.blaze3d.audio.Channel channel
    • name

      private final String name
  • Constructor Details

    • SoundSourceEvent

      @Internal protected SoundSourceEvent(net.minecraft.client.sounds.SoundEngine engine, net.minecraft.client.resources.sounds.SoundInstance sound, com.mojang.blaze3d.audio.Channel channel)
  • Method Details

    • getSound

      public net.minecraft.client.resources.sounds.SoundInstance getSound()
      Returns the sound being played.
      Returns:
      the sound being played
    • getChannel

      public com.mojang.blaze3d.audio.Channel getChannel()
      Returns the audio channel on which the sound is playing on.
      Returns:
      the audio channel on which the sound is playing on
    • getName

      public String getName()
      Returns the name of the sound being played. This is equivalent to the path of the location of the original sound.
      Returns:
      the name of the sound being played