Plays a specified sound at a player, in a location, and in a specific volume and pitch.
- Java Edition
playsound <sound> <source> <targets> [<pos>] [<volume>] [<pitch>] [<minVolume>]
- Bedrock Edition
playsound <sound: string> [player: target] [position: x y z] [volume: float] [pitch: float] [minimumVolume: float]
- Specifies the sound to play. Must be a sound event defined in sounds.json in Java Edition or sound_definitions.json in Bedrock Edition (for example,
- A sound event may be affiliated with multiple sounds, and the sound that is actually produced is chosen at random from them, modified by their "weight", just as the game normally would. For example, the
entity.pig.ambientsound event plays one of several pig sounds at random, because the event has multiple sounds associated with it.
- Resource packs may add their own events to sounds.json; the command successfully plays these. File names are not used by this command; it strictly uses the events defined in sounds.json (which may not even be similar to the original file names and paths), and thus a resource pack adding new sound files must define events for them (this is not necessary when replacing old sounds already defined in events).
<source>[Java Edition only]
- Specifies the music category and options the sound falls under. Must be
- Specifies the sound's target. Must be a player name or a target selector.
- Entities other than players are not allowed.
position: x y z)
- Specifies the position to play the sounds from. May use tilde notation to specify a position relative to the execution.
- Specifies the distance that the sound can be heard. Must be at least 0. For values less than 1, the volume diminishes and the sound has a smaller sphere in which it may be heard. For values greater than 1, the sound does not actually grow louder, but its audible range (a 16-block radius at 1) is multiplied by volume. There is always a gradual falloff to silence based on distance from the center of the sphere.
- Specifies the pitch of the sound. In Java Edition, it must be from 0 to 2, and values less than 0.5 are equivalent to 0.5. Values lower than 1 lower the pitch and increase the duration; values greater than 1 raise the pitch and reduce the duration. The pitch value is a multiplier applied to the frequency, so if a value from 0.5 to 1 is doubled, the pitch goes an octave higher. (See Note block § Usage for converting other intervals to pitch values, but be aware that 1 isn't F♯ for all sound effects.) In Bedrock Edition, only values between 0 and 256 work. Values above 256 are equivalent to the default value; values less than or equal to 0 makes the sound inaudible.[more information needed] If not specified, defaults to 1.
- Specifies the volume for targets outside the sound's normal audible sphere. If a target is outside the normal sphere, the sound is instead centered some short distance from the target (less than four blocks away), and minimumVolume determines its volume. Must be from 0 to 1.
Fails if the arguments are not specified correctly, if player fails to resolve to one or more online players, or if the targets are unable to hear the sound from where it is played.
On success, plays a sound for the targeted players.
|1.0.5||alpha 126.96.36.199||Added |
/stopsound— Stops a sound.