Class SoundEventSelection.Builder
java.lang.Object
me.gamercoder215.starcosmetics.api.player.SoundEventSelection.Builder
- Enclosing class:
- SoundEventSelection
Builder class for
SoundEventSelection-
Method Summary
Modifier and TypeMethodDescription@NotNull SoundEventSelectionbuild()Builds the SoundEventSelection.@NotNull SoundEventSelection.BuilderSets the Event that this SoundEventSelection will listen for.@NotNull SoundEventSelection.Builderplayer(@NotNull OfflinePlayer player) Sets the player that this SoundEventSelection will belong to.@NotNull SoundEventSelection.BuilderSets the Sound that this SoundEventSelection will play.
-
Method Details
-
player
@NotNull public @NotNull SoundEventSelection.Builder player(@NotNull @NotNull OfflinePlayer player) throws IllegalArgumentException Sets the player that this SoundEventSelection will belong to.- Parameters:
player- OfflinePlayer- Returns:
- this class, for chaining
- Throws:
IllegalArgumentException- if player is null
-
sound
@NotNull public @NotNull SoundEventSelection.Builder sound(@NotNull @NotNull Sound sound, float volume, float pitch) throws IllegalArgumentException Sets the Sound that this SoundEventSelection will play.- Parameters:
sound- Soundvolume- Volume of Soundpitch- Pitch of Sound- Returns:
- this class, for chaining
- Throws:
IllegalArgumentException- if sound is null
-
event
@NotNull public @NotNull SoundEventSelection.Builder event(@NotNull @NotNull Class<? extends Event> event) throws IllegalArgumentException Sets the Event that this SoundEventSelection will listen for.- Parameters:
event- Class of the Event- Returns:
- this class, for chaining
- Throws:
IllegalArgumentException- if event is null
-
build
Builds the SoundEventSelection.- Returns:
- SoundEventSelection
- Throws:
IllegalStateException- if any of the required fields are null
-