@ApiStatus.NonExtendable public interface Sound extends ResourcePackPart, net.kyori.adventure.key.Keyed, net.kyori.examination.Examinable
Texture.| Modifier and Type | Method and Description |
|---|---|
default void |
addTo(@NotNull ResourceContainer resourceContainer)
Adds this sound to the given resource container.
|
@NotNull Writable |
data()
Returns the sound's OGG sound data, as a
Writable object, never null |
@NotNull net.kyori.adventure.key.Key |
key()
Returns this sound's key (location), the key contains
the sound namespace and path, so that the full sound
path is formatted like
assets/<namespace>/sounds/<path> |
static @NotNull Sound |
of(@NotNull net.kyori.adventure.key.Key key,
@NotNull Writable data)
Deprecated.
Use
sound(Key, Writable) instead |
static @NotNull Sound |
sound(@NotNull net.kyori.adventure.key.Key key,
@NotNull Writable data)
Creates a new sound instance with the given key and data.
|
compound, compound@NotNull static @NotNull Sound sound(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull Writable data)
key - The sound keydata - The sound data@Deprecated @ApiStatus.ScheduledForRemoval(inVersion="2.0.0") @NotNull static @NotNull Sound of(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull Writable data)
sound(Key, Writable) insteadkey - The sound keydata - The sound data@NotNull @NotNull net.kyori.adventure.key.Key key()
assets/<namespace>/sounds/<path>
Example key for a sound:
Key key = Key.key("minecraft", "ambient/cave");
Note that the key value must not include the sound extension
key in interface net.kyori.adventure.key.Keyed@NotNull @NotNull Writable data()
Writable object, never nulldefault void addTo(@NotNull
@NotNull ResourceContainer resourceContainer)
addTo in interface ResourcePackPartresourceContainer - The resource container