Interface ISound


  • public interface ISound
    Represents a sound that can be played at a position or attached to an entity, with configurable volume, pitch, repeat behavior, and position.
    • Method Detail

      • setEntity

        void setEntity​(IEntity entity)
        Attaches this sound to an entity. The sound follows the entity.
        Parameters:
        entity - the entity to attach to, or null to detach.
      • getEntity

        IEntity getEntity()
        Returns:
        the entity this sound is attached to, or null.
      • setRepeat

        void setRepeat​(boolean repeat)
        Parameters:
        repeat - true to loop this sound.
      • repeats

        boolean repeats()
        Returns:
        true if this sound loops.
      • setRepeatDelay

        void setRepeatDelay​(int delay)
        Parameters:
        delay - the delay in ticks between repeats.
      • getRepeatDelay

        int getRepeatDelay()
        Returns:
        the delay in ticks between repeats.
      • setVolume

        void setVolume​(float volume)
        Parameters:
        volume - the playback volume (1.0 = normal).
      • getVolume

        float getVolume()
        Returns:
        the playback volume.
      • setPitch

        void setPitch​(float pitch)
        Parameters:
        pitch - the playback pitch (1.0 = normal).
      • getPitch

        float getPitch()
        Returns:
        the playback pitch.
      • setPosition

        void setPosition​(IPos pos)
        Sets the position where this sound plays.
        Parameters:
        pos - the position.
      • setPosition

        void setPosition​(float x,
                         float y,
                         float z)
        Sets the position where this sound plays.
        Parameters:
        x - the x coordinate.
        y - the y coordinate.
        z - the z coordinate.
      • getX

        float getX()
        Returns:
        the x coordinate of the sound position.
      • getY

        float getY()
        Returns:
        the y coordinate of the sound position.
      • getZ

        float getZ()
        Returns:
        the z coordinate of the sound position.