0x29 S29PacketSoundEffect

Plays a named sound at a world position with volume and pitch.

Clientbound (Server → Client) · PLAY · net/minecraft/network/play/server/S29PacketSoundEffect.java

Published 2026-06-18 · Updated 2026-10-14

soundsworld
Comprehensive 7/8

Fields

FieldTypeDescription
soundNameStringSound resource key (e.g. 'random.explode', 'mob.creeper.primed')
x/y/zfixed-point intPosition × 8
volumefloatVolume 0.0-1.0
pitchbytePitch 0-255, 63=normal

Wire Encoding

FieldTypeNotes
Sound NameStringResource key
XIntx * 8
YInty * 8
ZIntz * 8
Volumefloat0.0-1.0
Pitchunsigned byte63 = normal

MCP References

MCPNetHandlerPlayClient.handleSoundEffect()

Handler Interface

HNDINetHandlerPlayClient

Vanilla Source

S29PacketSoundEffect.java98 lines · MCP 1.8.9Original ↗
1
package net.minecraft.network.play.server;
2
3
import java.io.IOException;
4
import net.minecraft.network.Packet;
5
import net.minecraft.network.PacketBuffer;
6
import net.minecraft.network.play.INetHandlerPlayClient;
7
import net.minecraft.util.MathHelper;
8
import org.apache.commons.lang3.Validate;
9
10
public class S29PacketSoundEffect implements Packet<INetHandlerPlayClient>
11
{
12
    private String soundName;
13
    private int posX;
14
    private int posY = Integer.MAX_VALUE;
15
    private int posZ;
16
    private float soundVolume;
17
    private int soundPitch;
18
19
    public S29PacketSoundEffect()
20
    {
21
    }
22
23
    public S29PacketSoundEffect(String soundNameIn, double soundX, double soundY, double soundZ, float volume, float pitch)
24
    {
25
        Validate.notNull(soundNameIn, "name", new Object[0]);
26
        this.soundName = soundNameIn;
27
        this.posX = (int)(soundX * 8.0D);
28
        this.posY = (int)(soundY * 8.0D);
29
        this.posZ = (int)(soundZ * 8.0D);
30
        this.soundVolume = volume;
31
        this.soundPitch = (int)(pitch * 63.0F);
32
        pitch = MathHelper.clamp_float(pitch, 0.0F, 255.0F);
33
    }
34
35
    /**
36
     * Reads the raw packet data from the data stream.
37
     */
38
    public void readPacketData(PacketBuffer buf) throws IOException
39
    {
40
        this.soundName = buf.readStringFromBuffer(256);
41
        this.posX = buf.readInt();
42
        this.posY = buf.readInt();
43
        this.posZ = buf.readInt();
44
        this.soundVolume = buf.readFloat();
45
        this.soundPitch = buf.readUnsignedByte();
46
    }
47
48
    /**
49
     * Writes the raw packet data to the data stream.
50
     */
51
    public void writePacketData(PacketBuffer buf) throws IOException
52
    {
53
        buf.writeString(this.soundName);
54
        buf.writeInt(this.posX);
55
        buf.writeInt(this.posY);
56
        buf.writeInt(this.posZ);
57
        buf.writeFloat(this.soundVolume);
58
        buf.writeByte(this.soundPitch);
59
    }
60
61
    public String getSoundName()
62
    {
63
        return this.soundName;
64
    }
65
66
    public double getX()
67
    {
68
        return (double)((float)this.posX / 8.0F);
69
    }
70
71
    public double getY()
72
    {
73
        return (double)((float)this.posY / 8.0F);
74
    }
75
76
    public double getZ()
77
    {
78
        return (double)((float)this.posZ / 8.0F);
79
    }
80
81
    public float getVolume()
82
    {
83
        return this.soundVolume;
84
    }
85
86
    public float getPitch()
87
    {
88
        return (float)this.soundPitch / 63.0F;
89
    }
90
91
    /**
92
     * Passes this Packet on to the NetHandler for processing.
93
     */
94
    public void processPacket(INetHandlerPlayClient handler)
95
    {
96
        handler.handleSoundEffect(this);
97
    }
98
}

Deobfuscated MCP 1.8.9 source of S29PacketSoundEffect, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S29PacketSoundEffect.java) at build time and verified present.

Deep Dive

Role in the protocol

Server-to-client broadcast of a named sound at a fixed-point position. The server computes a delivery radius of 16 blocks, scaled by volume when volume exceeds 1.0, and fans the packet out through ConfigurationManager.sendToAllNear. The client handler converts the x8 fixed-point ints back to doubles and hands the call to World.playSound. Because the sound name is an arbitrary server-controlled string, the field is both a gameplay input and a data-injection surface for anything downstream that logs or parses it.

Vanilla handling

NetHandlerPlayClient.handleSoundEffect does PacketThreadUtil.func_180031_a (main-thread marshalling) then World.playSound(name, x/8, y/8, z/8, volume, pitch/63, false). The pitch arrives as an unsigned byte with 63 meaning normal pitch; the client divides by 63.0F. Server side the packet is created by WorldManager.playSound and playSoundAtEntity, and by /playsound (CommandPlaySound), which converts double coordinates to the x8 int encoding. Netty reads the name with a 256-char cap via readStringFromBuffer(256).

Why clients touch it

Only two real handlers exist across the 8 clients, and neither is a sound-ESP. Rise 5.99's Disabler, in its HypixelSlime mode, cancels the mob.slime.big sound to strip the Hypixel double-jump slime indicator. Rise 6.1.30 and 6.2.4 route the packet through LoggerRCECheck, a security feature that matches the sound name against a ${...} pattern to catch Log4j RCE attempts (CVE-2021-44228): sound names are logged by the client logger, so a crafted name is an injection vector. No client in the corpus tracks sounds for ESP purposes.

Exploit surface

The sound name string is the interesting field. It passes through String formatting and logger calls on both ends, which is exactly the Log4j RCE chain that LoggerRCECheck defends. Volume has no clamp on the wire, so a malicious server can send volume values far above 1.0 and inflate the client-side audio range beyond the 16-block visibility radius. The pitch byte is unsigned, so values above 127 encode negative pitches when interpreted as signed, a quirk modules rarely bother with.

Server-Side Handling

WorldManager.playSound sends to all players within 16 blocks, or 16*volume when volume > 1.0F, on the same dimension. CommandPlaySound builds the packet from parsed coordinates (x*8, y*8, z*8) and clamps pitch to 0..255 before writing. The client handler marshals to the main thread, then plays the sound with pitch = raw byte / 63.0F. No server-side rate limit exists; sound spam is only bounded by the 256-char name cap and the per-packet cost.

Protocol Analysis

Encoding order: String name (max 256), int x*8, int y*8, int z*8, float volume, unsigned byte pitch. The y field is initialized to Integer.MAX_VALUE in the no-arg constructor as a sentinel for the client-side y-clamping fallback (field_149218_c). In 1.8.9 MCP this packet predates the generic Packet<T> signature, so it implements raw Packet and does a double dispatch through processPacket.

Anti-Cheat Landscape

Anti-cheats do not flag sound packets; they are cosmetic. The abuse surface is the name string, and the relevant defense is client-side: Rise's LoggerRCECheck pattern-matches ${...} in the name to block Log4j RCE payloads that would otherwise execute through the client's logging pipeline. Because the packet is clientbound and server-trusted, there is no bypass trade-off: a compromised server can always send it, so the check is a pure filter.

implementation Implementation Cases

A pure world-effect broadcast: named sound, x8 fixed-point position, volume, pitch byte. The 8 clients barely touch it. The only module-grade hit is Rise 5.99's Disabler cancelling the Hypixel slime jump sound; Rise 6.x handles it as a Log4j RCE scan surface rather than as audio.

Disabler (HypixelSlime sound cancel) (Rise 5.99)

Cancel the mob.slime.big sound on Hypixel so the double-jump slime indicator never plays.

In the HypixelSlime mode branch of the packet receive handler, every S29 is type-checked; if the sound name equals mob.slime.big the event is cancelled. The same mode also cancels SLIME-type S2APacketParticles and S1FPacketSetExperience, so the whole Hypixel double-jump visual cluster is stripped together.

Source: Rise 5.99, dev/rise/module/impl/other/Disabler.java

Vanilla hook: PacketReceiveEvent.
Zero detection risk: cancelling a clientbound sound is invisible to the server. The only observable effect is the missing slime sound on the local client.
Variations: Rise 6.1.30 and 6.2.4 do not carry this mode; their only S29 reference is LoggerRCECheck in the security pipeline.
LoggerRCECheck (security) (Rise 6.2.4, Rise 6.1.30)

Block Log4j RCE payloads carried in the sound name string.

A SecurityFeature registered in Rise's packet security chain. On every packet it checks the S29 sound name against the regex .*\$\{[^}]*}.*. A match returns true, which drops the packet before it reaches the game logic or any logging path. The same check also guards S02PacketChat text. It is a security component, not a toggleable user module.

Source: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/security/impl/LoggerRCECheck.java

Vanilla hook: Security pipeline handle(Packet) invoked per received packet.
Not anti-cheat related. It defends the client against malicious servers; the cost is a regex match on every S29 and S02, which is negligible at server tick rates.
Variations: Identical file in Rise 6.1.30 (com/alan/clients/security/impl/LoggerRCECheck.java). The packet class is also listed in Rise's NetworkAPI script bridge, which exposes it to JavaScript scripts but adds no game logic.
Both handlers sit on the packet receive path: Rise 5.99 uses PacketReceiveEvent, Rise 6.x uses the security chain that pre-filters every inbound packet before module dispatch.
Rise 5.99 mutates/cancels via event.setCancelled on PacketReceiveEvent. Rise 6.1.30/6.2.4 moved packet filtering into the SecurityFeature abstraction, which returns a boolean from handle(Packet) and lets the pipeline decide whether to drop.

anticheat Anti-Cheat Checks

The named-sound packet is the one sound packet in this family that a major anticheat actively intercepts. NoCheatPlus ships SoundDistance, a ProtocolLib listener on PacketType.Play.Server.NAMED_SOUND_EFFECT that cancels wither, enderdragon and lightning sounds when the player is too far from the sound origin, which removes fake distant-boss audio and reduces client noise. The rest of the corpus is registration plumbing: Artemis maps the packet name to a wrapper interface, and Negativity lists it in its packet-type registry. Bukkit playSound calls in Hydro, TruthfulAC and SafeguardAC are anticheat GUI sounds, not S29 handling.

SoundDistance (NoCheatPlus) (Updated-NoCheatPlus-NoCheatPlus)

Cancel named sound packets for wither, enderdragon and lightning events when the player is beyond the configured audible radius of the sound origin.

A ProtocolLib BaseAdapter registered at ListenerPriority.LOW on PacketType.Play.Server.NAMED_SOUND_EFFECT (S29). It maintains a hardcoded set of boss and weather sound names (pre-1.9 resource keys plus 1.9 and 1.21 enum names), matched against the packet's sound field via getStrings().read(0) on legacy servers or the Bukkit access matchSounds() on modern ones. For a match it computes the squared horizontal distance between the player and the packet's x8 fixed-point position and cancels the packet when that exceeds the configured soundDistanceSq limit, counting each cancel on the packet.sound.cancel counter.

Detects: Server-side sound spoofing where distant boss spawns or weather events are audible to players who should not hear them; the check doubles as client-noise reduction.

Source: Updated-NoCheatPlus-NoCheatPlus, NCPCompatProtocolLib/src/main/java/fr/neatmonster/nocheatplus/checks/net/protocollib/SoundDistance.java

Variations: No other anticheat implements a sound-distance check. Artemis registers the packet family in its repository (PacketPlayServerSoundEffectNamed at SERVER_PLAY + 64, plus custom, entity and stop variants) and Negativity lists NAMED_SOUND_EFFECT in its PacketType registry, but neither reads sound payloads.
Named sound wrapper registration (Artemis) (artemisac-artemis-minecraft-anticheat)

Register the named sound effect packet in Artemis's packet repository so the abstraction layer can dispatch S29 to typed wrapper interfaces.

PacketRepository maps SERVER_PLAY + 64 to PacketPlayServerSoundEffectNamed, a marker interface extending PacketServer. The packet generator's HardcodeMap associates the NMS name PacketPlayOutNamedSoundEffect with the same interface. The interface declares no fields or methods; Artemis only needs the packet to be recognized and routed.

Detects: Nothing. This is packet-library plumbing; no Artemis check consumes the sound name, position, volume or pitch.

Source: artemisac-artemis-minecraft-anticheat, ac.artemis.packet.api/src/main/java/ac/artemis/packet/wrapper/server/PacketPlayServerSoundEffectNamed.java

Variations: Artemis registers the full S29 family: custom, entity, named and stop sound variants. Elikill58-Negativity maps NAMED_SOUND_EFFECT in its universal PacketType enum used by its packet listeners.

Wiki Cross-Reference

Clientbound 0x29: sound name string max 256 chars, position ints at x times 8.

Followed by float volume and unsigned byte pitch where 63 means normal pitch.

Server fans out within 16 blocks, extended by volume above 1.0.

MCP 1.8.9 S29PacketSoundEffect implements Packet dispatching to INetHandlerPlayClient.handleSoundEffect; wire serde is readPacketData/writePacketData via readFloat, readInt, readStringFromBuffer, readUnsignedByte.

1.8.9 callers: CommandPlaySound.? sends new S29PacketSoundEffect (line 118) +2 more: https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/command/CommandPlaySound.java

Cross-checked against minecraft.wiki (CC BY-SA 3.0) for 1.8.9 accuracy.

Vanilla Internals

Full 1.8.9 logic-class sources that send or handle this packet, stored verbatim.