@ApiStatus.NonExtendable public interface SoundEvent extends ResourcePackPart, net.kyori.adventure.sound.Sound.Type, net.kyori.examination.Examinable
SoundEntry
instances| Modifier and Type | Interface and Description |
|---|---|
static interface |
SoundEvent.Builder
Builder implementation for ease the
construction of
SoundEvent
instances |
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_REPLACE |
| Modifier and Type | Method and Description |
|---|---|
default void |
addTo(@NotNull ResourceContainer resourceContainer)
Adds this sound event to the given resource container.
|
static @NotNull SoundEvent.Builder |
builder()
Deprecated.
Use
soundEvent() instead |
@NotNull net.kyori.adventure.key.Key |
key()
Returns this sound event's key.
|
static @NotNull SoundEvent |
of(@NotNull net.kyori.adventure.key.Key key,
boolean replace,
@Nullable java.lang.String subtitle,
@NotNull java.util.List<SoundEntry> sounds)
Deprecated.
Use
soundEvent(Key, boolean, String, List) instead |
boolean |
replace()
Returns true if the sounds listed in
sounds()
should replace the sounds listed in the default
sounds.json for this sound event. |
static @NotNull SoundEvent.Builder |
soundEvent()
Creates a new
SoundEvent.Builder instance,
it eases the creation of SoundEvent
objects |
static @NotNull SoundEvent |
soundEvent(@NotNull net.kyori.adventure.key.Key key,
boolean replace,
@Nullable java.lang.String subtitle,
@NotNull java.util.List<SoundEntry> sounds)
Creates a new
SoundEvent from the
given values |
@Unmodifiable @NotNull java.util.List<SoundEntry> |
sounds()
The sounds this sound event uses, one of the listed sounds
is randomly selected to play when this sound event is triggered
|
@Nullable java.lang.String |
subtitle()
Returns the sound event subtitle, which is translated as the
subtitle of the sound if "Show Subtitles" is enabled in-game
|
@NotNull SoundEvent.Builder |
toBuilder()
Converts this sound event instance to its builder type,
with all the properties already set
|
compound, compoundstatic final boolean DEFAULT_REPLACE
@NotNull static @NotNull SoundEvent soundEvent(@NotNull @NotNull net.kyori.adventure.key.Key key, boolean replace, @Nullable @Nullable java.lang.String subtitle, @NotNull @NotNull java.util.List<SoundEntry> sounds)
SoundEvent from the
given valueskey - The sound event's keyreplace - True to replace default soundssubtitle - The sound event subtitlesounds - The sound event soundsSoundEvent instance@NotNull static @NotNull SoundEvent.Builder soundEvent()
SoundEvent.Builder instance,
it eases the creation of SoundEvent
objectsSoundEvent.Builder instance@Deprecated @ApiStatus.ScheduledForRemoval(inVersion="2.0.0") @NotNull static @NotNull SoundEvent of(@NotNull @NotNull net.kyori.adventure.key.Key key, boolean replace, @Nullable @Nullable java.lang.String subtitle, @NotNull @NotNull java.util.List<SoundEntry> sounds)
soundEvent(Key, boolean, String, List) insteadSoundEvent from the
given valueskey - The sound event's keyreplace - True to replace default soundssubtitle - The sound event subtitlesounds - The sound event soundsSoundEvent instance@Deprecated @ApiStatus.ScheduledForRemoval(inVersion="2.0.0") @NotNull static @NotNull SoundEvent.Builder builder()
soundEvent() insteadSoundEvent.Builder instance,
it eases the creation of SoundEvent
objectsSoundEvent.Builder instance@NotNull @NotNull net.kyori.adventure.key.Key key()
key in interface net.kyori.adventure.key.Keyedkey in interface net.kyori.adventure.sound.Sound.Typeboolean replace()
sounds()
should replace the sounds listed in the default
sounds.json for this sound event. False if the
sounds listed should be added to the list of
default sounds@Nullable @Nullable java.lang.String subtitle()
@NotNull @Unmodifiable @NotNull java.util.List<SoundEntry> sounds()
default void addTo(@NotNull
@NotNull ResourceContainer resourceContainer)
addTo in interface ResourcePackPartresourceContainer - The resource container@Contract(value="-> new") @NotNull @NotNull SoundEvent.Builder toBuilder()