Class SoundDefinition
java.lang.Object
io.github.vampirestudios.vampirelib.api.SoundDefinition
Contains all the data to completely define a sound event.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConstructs sound files forSoundDefinition.static enumDefines how a sound is interpreted by Minecraft. -
Method Summary
Modifier and TypeMethodDescriptionAdds the specified sound file to this instance.static SoundDefinitiondefinition(String sound) Creates a new sound definition for the specified sound.static SoundDefinitiondefinition(Supplier<net.minecraft.sounds.SoundEvent> sound) Creates a new sound definition for the specified sound event.static SoundDefinitionCreates a new sound definition for the specified sound event.@Nullable Stringstatic SoundDefinition.SoundBuilderCreates a new sound file definition for the specified sound.static SoundDefinition.SoundBuildersound(net.minecraft.resources.ResourceLocation path) Creates a new sound file definition for file at the specified pathSets the subtitle to display when this sound is played.com.google.gson.JsonObjecttoJson()
-
Method Details
-
toJson
public com.google.gson.JsonObject toJson()- Returns:
- A new JSON representing this sound
-
getSoundId
- Returns:
- The id of this sound. The namespace is retrieved from the location of the
sounds.jsonfile
-
getSounds
- Returns:
- All the sound files to associate with this sound instance
-
getSubtitle
- Returns:
- The subtitle to display when this sound is played
-
addSound
Adds the specified sound file to this instance.- Parameters:
sound- The sound to add
-
subtitle
Sets the subtitle to display when this sound is played.- Parameters:
subtitle- The subtitle ornullto remove the text
-
forSound
Creates a new sound definition for the specified sound event. Also adds a sound file to the definition based on the name of the soundNOTE: THE NAMESPACE OF THE SOUND IS IGNORED AND WILL BE ASSIGNED TO THE ONE IN THE
FabricSoundProvider- Parameters:
sound- The sound to create a full definition for
-
definition
Creates a new sound definition for the specified sound event.NOTE: THE NAMESPACE OF THE SOUND IS IGNORED AND WILL BE ASSIGNED TO THE ONE IN THE
FabricSoundProvider- Parameters:
sound- The sound to create a definition for
-
definition
Creates a new sound definition for the specified sound.- Parameters:
sound- The sound to create a definition for
-
sound
Creates a new sound file definition for the specified sound. The file path isnamespace:sounds/id/of/sound.ogg- Parameters:
sound- The sound to get a file for
-
sound
Creates a new sound file definition for file at the specified path- Parameters:
path- The path to the sound file to add, excludingsounds/
-