Skip to content

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 ​

readonly events: ReadonlyMap<string, JavaSoundEvent>

Defined in: sounds.ts:35

By Java event path, which is also its name under the converted namespace.

files ​

readonly files: readonly SoundFile[]

Defined in: sounds.ts:36

lossy ​

readonly lossy: readonly string[]

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? ​

readonly optional attenuation_distance?: number

Defined in: sounds.ts:16

name ​

readonly name: string

Defined in: sounds.ts:11

The file, bedrock:<path>, under assets/bedrock/sounds/ without .ogg.

pitch? ​

readonly optional pitch?: number

Defined in: sounds.ts:13

stream? ​

readonly optional stream?: boolean

Defined in: sounds.ts:15

volume? ​

readonly optional volume?: number

Defined in: sounds.ts:12

weight? ​

readonly optional weight?: number

Defined in: sounds.ts:14


JavaSoundEvent ​

Defined in: sounds.ts:20

One Java sound event.

Properties ​

sounds ​

readonly sounds: readonly JavaSound[]

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 ​

readonly bedrock: string

Defined in: sounds.ts:27

The Bedrock path without an extension, such as sounds/mob/cow/say1.

java ​

readonly java: 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 ​

ConvertedSoundDefinitions


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