Skip to content
mc-protocol
Esc
↑↓navigate↵open⌘Jpreview
On this page

Sound

Play 0x75, server → client.

play · 0x75 · clientbound (server → client)

Plays a sound at a fixed position. The server sends it for most world sounds. Coordinates are fixed-point (multiplied by 8); seed selects the sound variant.

Sent by the server, read by the client. Listen for it with client.on("Sound", (data) => …) on the receiving side.

Fields

Field Type Notes
sound ItemSoundHolder
soundCategory soundSource
x Int
y Int
z Int
volume Float
pitch Float
seed Long

Send it

// Named sound at block (0, 65, 0). Coordinates are fixed-point: multiply by 8.
await client.sendPacket("Sound", {
  sound: { soundName: "minecraft:entity.experience_orb.pickup", fixedRange: null },
  soundCategory: "player",
  x: 0 * 8,
  y: 65 * 8,
  z: 0 * 8,
  volume: 1,
  pitch: 1,
  seed: 0n,
});

sound is a registry holder: an object with soundName (and optional fixedRange) for any sound, or a number for a vanilla sound registry ID. soundCategory takes the name (master, music, record, weather, block, hostile, neutral, player, ambient, voice, ui) or its index. x, y, z are fixed-point with 3 fraction bits, so pass the block coordinate times 8. seed picks the variant for sounds with several files.

Field aliases listed under Notes are accepted as alternative keys when writing.

Source: src/Core/Versions/776/Packets/play/clientbound/Sound.ts

Was this page helpful?