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 TypeMethodDescriptionpitch(@Range(from=-1L,to=1L) float pitch) The pitch for this sound, indicating how high or low the sound can be heard.seed(long seed) The seed for this sound, used for weighted choices.seed(OptionalLong seed) The seed for this sound, used for weighted choices.source(Sound.Source source) ASound.Sourceto tell the game where the sound is coming from.source(Sound.Source.Provider source) ASound.Sourceto tell the game where the sound is coming from.type(Supplier<? extends Sound.Type> typeSupplier) Set the type of this sound.Set the type of this sound.type(Sound.Type type) Set the type of this sound.volume(@Range(from=0L,to=2147483647L) float volume) The volume for this sound, indicating how far away it can be heard.Methods inherited from interface 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.Sourceto tell the game where the sound is coming from.By default,
Sound.Source.MASTERis used.- Parameters:
source- a source- Returns:
- this builder
- Since:
- 4.12.0
-
source
ASound.Sourceto tell the game where the sound is coming from.By default,
Sound.Source.MASTERis used.- Parameters:
source- a source provider, evaluated eagerly- Returns:
- this builder
- Since:
- 4.12.0
-
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
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
-