Skip to content

API reference / @jsprismarine/prismarine / editions/java/javaSounds

editions/java/javaSounds ​

Interfaces ​

JavaPlayedSound ​

Defined in: packages/prismarine/src/editions/java/javaSounds.ts:20

A sound as a Java client is sent it.

Properties ​

id ​

readonly id: string

Defined in: packages/prismarine/src/editions/java/javaSounds.ts:22

The sound event, such as minecraft:entity.zombie.hurt.

pitch ​

readonly pitch: number

Defined in: packages/prismarine/src/editions/java/javaSounds.ts:26

source ​

readonly source: "ambient" | "block" | "player" | "music" | "weather" | "hostile" | "master" | "neutral" | "record" | "ui" | "voice"

Defined in: packages/prismarine/src/editions/java/javaSounds.ts:24

The category whose volume setting it plays at.

volume ​

readonly volume: number

Defined in: packages/prismarine/src/editions/java/javaSounds.ts:25


JavaSoundTranslations ​

Defined in: packages/prismarine/src/editions/java/javaSounds.ts:30

What the resolver needs of the client's translations.

Properties ​

blockOf ​

readonly blockOf: (runtimeId) => string | undefined

Defined in: packages/prismarine/src/editions/java/javaSounds.ts:34

The Java block a Bedrock runtime id shows as, such as minecraft:stone, or undefined.

Parameters ​
runtimeId ​

number

Returns ​

string | undefined

entityTypeOf ​

readonly entityTypeOf: (bedrockType) => string | undefined

Defined in: packages/prismarine/src/editions/java/javaSounds.ts:32

The Java entity type a Bedrock one shows as, such as minecraft:zombie, or undefined.

Parameters ​
bedrockType ​

string

Returns ​

string | undefined

Functions ​

javaSoundOf() ​

javaSoundOf(sound, translations, random?): JavaPlayedSound | undefined

Defined in: packages/prismarine/src/editions/java/javaSounds.ts:182

The sound a Java client is sent for one the world makes.

Parameters ​

sound ​

ShownSound

The sound.

translations ​

JavaSoundTranslations

How the client's edition shows Bedrock's entity types and blocks.

random? ​

() => number

A float from 0 up to 1, which picks the pitch of a sound whose pitch varies.

Returns ​

JavaPlayedSound | undefined

The sound, or undefined when Java has none for it.