Package net.kyori.adventure.sound
Interface Sound
- All Superinterfaces:
net.kyori.examination.Examinable
@NonExtendable
public interface Sound
extends net.kyori.examination.Examinable
Represents an in-game sound which can be played to the client.
A sound consists of:
- key/type
- the resource location of this sound (e.g minecraft:ambient.cave or my_plugin:custom_sound
- source
- a
Sound.Sourcetelling the game where the sound is coming from - volume
- a number in the range [0,∞) representing how loud the sound should be played. Increasing volume does not actually play the sound louder, but increases the radius of where it can be heard
- pitch
- a number in the range [0,2] representing which pitch the sound should be played at
- Since:
- 4.0.0
- See Also:
SoundStop
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSound.EmitterAn emitter of sounds.static classSound.SourceThe sound source.static interfaceSound.TypeA sound type. -
Method Summary
Modifier and Type Method Description @NotNull SoundStopasStop()Gets theSoundStopthat will stop this specific sound.@NotNull net.kyori.adventure.key.Keyname()Gets the name.floatpitch()Gets the pitch.static @NotNull Soundsound(@NotNull Supplier<? extends Sound.Type> type, @NotNull Sound.Source.Provider source, float volume, float pitch)Creates a new sound.static @NotNull Soundsound(@NotNull Supplier<? extends Sound.Type> type, @NotNull Sound.Source source, float volume, float pitch)Creates a new sound.static @NotNull Soundsound(@NotNull net.kyori.adventure.key.Key name, @NotNull Sound.Source.Provider source, float volume, float pitch)Creates a new sound.static @NotNull Soundsound(@NotNull net.kyori.adventure.key.Key name, @NotNull Sound.Source source, float volume, float pitch)Creates a new sound.static @NotNull Soundsound(@NotNull Sound.Type type, @NotNull Sound.Source.Provider source, float volume, float pitch)Creates a new sound.static @NotNull Soundsound(@NotNull Sound.Type type, @NotNull Sound.Source source, float volume, float pitch)Creates a new sound.@NotNull Sound.Sourcesource()Gets the source.floatvolume()Gets the volume.Methods inherited from interface net.kyori.examination.Examinable
examinableName, examinableProperties, examine
-
Method Details
-
sound
@NotNull static @NotNull Sound sound(@NotNull @NotNull net.kyori.adventure.key.Key name, @NotNull @NotNull Sound.Source source, float volume, float pitch)Creates a new sound.- Parameters:
name- the namesource- the sourcevolume- the volumepitch- the pitch- Returns:
- the sound
- Since:
- 4.0.0
-
sound
@NotNull static @NotNull Sound sound(@NotNull @NotNull Sound.Type type, @NotNull @NotNull Sound.Source source, float volume, float pitch)Creates a new sound.- Parameters:
type- the typesource- the sourcevolume- the volumepitch- the pitch- Returns:
- the sound
- Since:
- 4.0.0
-
sound
@NotNull static @NotNull Sound sound(@NotNull @NotNull Supplier<? extends Sound.Type> type, @NotNull @NotNull Sound.Source source, float volume, float pitch)Creates a new sound.- Parameters:
type- the typesource- the sourcevolume- the volumepitch- the pitch- Returns:
- the sound
- Since:
- 4.0.0
-
sound
@NotNull static @NotNull Sound sound(@NotNull @NotNull net.kyori.adventure.key.Key name, @NotNull Sound.Source.Provider source, float volume, float pitch)Creates a new sound.- Parameters:
name- the namesource- the sourcevolume- the volumepitch- the pitch- Returns:
- the sound
- Since:
- 4.8.0
-
sound
@NotNull static @NotNull Sound sound(@NotNull @NotNull Sound.Type type, @NotNull Sound.Source.Provider source, float volume, float pitch)Creates a new sound.- Parameters:
type- the typesource- the sourcevolume- the volumepitch- the pitch- Returns:
- the sound
- Since:
- 4.8.0
-
sound
@NotNull static @NotNull Sound sound(@NotNull @NotNull Supplier<? extends Sound.Type> type, @NotNull Sound.Source.Provider source, float volume, float pitch)Creates a new sound.- Parameters:
type- the typesource- the sourcevolume- the volumepitch- the pitch- Returns:
- the sound
- Since:
- 4.8.0
-
name
@NotNull @NotNull net.kyori.adventure.key.Key name()Gets the name.- Returns:
- the name
- Since:
- 4.0.0
-
source
Gets the source.- Returns:
- the source
- Since:
- 4.0.0
-
volume
float volume()Gets the volume.- Returns:
- the volume
- Since:
- 4.0.0
-
pitch
float pitch()Gets the pitch.- Returns:
- the pitch
- Since:
- 4.0.0
-
asStop
Gets theSoundStopthat will stop this specific sound.- Returns:
- the sound stop
- Since:
- 4.8.0
-