Package net.kyori.adventure.sound
Interface Sound.Builder
- All Superinterfaces:
AbstractBuilder<Sound>
- Enclosing interface:
- Sound
A builder for sound instances.
Type is required, all other options are optional.
- Since:
- 4.12.0
-
Method Summary
Modifier and TypeMethodDescription@NotNull Sound.Builder
pitch
(@org.jetbrains.annotations.Range(from=-1L, to=1L) float pitch) The pitch for this sound, indicating how high or low the sound can be heard.@NotNull Sound.Builder
seed
(long seed) The seed for this sound, used for weighted choices.@NotNull Sound.Builder
seed
(@NotNull OptionalLong seed) The seed for this sound, used for weighted choices.@NotNull Sound.Builder
source
(@NotNull Sound.Source source) ASound.Source
to tell the game where the sound is coming from.@NotNull Sound.Builder
source
(@NotNull Sound.Source.Provider source) ASound.Source
to tell the game where the sound is coming from.@NotNull Sound.Builder
type
(@NotNull Supplier<? extends Sound.Type> typeSupplier) Set the type of this sound.@NotNull Sound.Builder
Set the type of this sound.@NotNull Sound.Builder
type
(@NotNull Sound.Type type) Set the type of this sound.@NotNull Sound.Builder
volume
(@org.jetbrains.annotations.Range(from=0L, to=2147483647L) float volume) The volume for this sound, indicating how far away it can be heard.Methods inherited from interface net.kyori.adventure.builder.AbstractBuilder
build
-
Method Details
-
type
Set the type of this sound.Required.
- Parameters:
type
- resource location of the sound event to play- Returns:
- this builder
- Since:
- 4.12.0
-
type
Set the type of this sound.Required.
- Parameters:
type
- a type of sound to play- Returns:
- this builder
- Since:
- 4.12.0
-
type
Set the type of this sound.Required.
- Parameters:
typeSupplier
- a type of sound to play, evaluated lazily- Returns:
- this builder
- Since:
- 4.12.0
-
source
ASound.Source
to tell the game where the sound is coming from.By default,
Sound.Source.MASTER
is used.- Parameters:
source
- a source- Returns:
- this builder
- Since:
- 4.12.0
-
source
ASound.Source
to tell the game where the sound is coming from.By default,
Sound.Source.MASTER
is used.- Parameters:
source
- a source provider, evaluated eagerly- Returns:
- this builder
- Since:
- 4.12.0
-
volume
@NotNull @NotNull Sound.Builder volume(@org.jetbrains.annotations.Range(from=0L, to=2147483647L) float volume) The volume for this sound, indicating how far away it can be heard.Default value is
1
.- Parameters:
volume
- the sound volume- Returns:
- this builder
- Since:
- 4.12.0
-
pitch
@NotNull @NotNull Sound.Builder pitch(@org.jetbrains.annotations.Range(from=-1L, to=1L) float pitch) The pitch for this sound, indicating how high or low the sound can be heard.Default value is
1
.- Parameters:
pitch
- the sound pitch- Returns:
- this builder
- Since:
- 4.12.0
-
seed
The seed for this sound, used for weighted choices.The default seed is the world seed of the receiver's current world.
- Parameters:
seed
- the seed- Returns:
- this builder
- Since:
- 4.12.0
-
seed
The seed for this sound, used for weighted choices.The default seed is the world seed of the receiver's current world.
- Parameters:
seed
- the seed- Returns:
- this builder
- Since:
- 4.12.0
-