API reference / @jsprismarine/java-packs / sounds
sounds
Interfaces
ConvertedSoundDefinitions
Defined in: sounds.ts:33
What one definition file gives: its events, the files they play, and what it left out.
Properties
events
readonlyevents:ReadonlyMap<string,JavaSoundEvent>
Defined in: sounds.ts:35
By Java event path, which is also its name under the converted namespace.
files
readonlyfiles: readonlySoundFile[]
Defined in: sounds.ts:36
lossy
readonlylossy: readonlystring[]
Defined in: sounds.ts:38
Fields Java has no counterpart for, by event, such as min_distance.
JavaSound
Defined in: sounds.ts:9
One sound file a Java event plays, as sounds.json writes it.
Properties
attenuation_distance?
readonlyoptionalattenuation_distance?:number
Defined in: sounds.ts:16
name
readonlyname:string
Defined in: sounds.ts:11
The file, bedrock:<path>, under assets/bedrock/sounds/ without .ogg.
pitch?
readonlyoptionalpitch?:number
Defined in: sounds.ts:13
stream?
readonlyoptionalstream?:boolean
Defined in: sounds.ts:15
volume?
readonlyoptionalvolume?:number
Defined in: sounds.ts:12
weight?
readonlyoptionalweight?:number
Defined in: sounds.ts:14
JavaSoundEvent
Defined in: sounds.ts:20
One Java sound event.
Properties
sounds
readonlysounds: readonlyJavaSound[]
Defined in: sounds.ts:21
SoundFile
Defined in: sounds.ts:25
A Bedrock sound file a definition names, and the Java file name it plays as.
Properties
bedrock
readonlybedrock:string
Defined in: sounds.ts:27
The Bedrock path without an extension, such as sounds/mob/cow/say1.
java
readonlyjava:string
Defined in: sounds.ts:29
The path under assets/bedrock/sounds/, without .ogg.
Functions
convertSoundDefinitions()
convertSoundDefinitions(
value):ConvertedSoundDefinitions
Defined in: sounds.ts:52
Reads a decoded sound_definitions.json, the current shape with sound_definitions inside or the older one of events at its root. A sound entry is a path or an object with name, volume, pitch, weight, stream and is3D; an event's max_distance becomes each of its sounds' attenuation_distance, Java's one distance, and min_distance and category are dropped.
Parameters
value
unknown
Returns
javaSoundPath()
javaSoundPath(
bedrock):string
Defined in: sounds.ts:42
The Java sound file a Bedrock path plays as: sounds/mob/cow/say1 is mob/cow/say1.
Parameters
bedrock
string
Returns
string