HyperScript
Docs

← All of the Docs What players see

Sounds

effectplay sound <name>since 1.4.0

A Minecraft sound id such as "entity.player.levelup", or a custom one from your resource pack

play sound "ui.toast.challenge_complete" for all players in world "world"
Try it
effectwith pitch <n>since 1.4.0

Optional, 0.5 (low) to 2.0 (high); the default is 1.0

play sound "block.note_block.pling" with pitch 2.0 and volume 0.5 for player
Try it
expressionand volume <n>since 1.4.0

Optional; the default is 1.0. Above 1.0 the sound is not louder but carries further

play sound "block.note_block.pling" with pitch 2.0 and volume 0.5 for player
Try it
expressionat <position>since 1.4.0

Play it in the world: everyone within earshot hears it coming from that spot

play sound "entity.experience_orb.pickup" with pitch 1.8 and volume 1.0 at player's location
Try it
structurefor <who>

Play it to those players only, wherever they are

play sound "ui.toast.challenge_complete" for all players in world "world"
Try it
structurefor all players in world <name>since 1.4.0

To everyone in one world

play sound "ui.toast.challenge_complete" for all players in world "world"
Try it
structurefor players within <n> blocks of <location>since 1.7.45

To everyone that close to a place, each hearing it as if it were beside them

play sound "entity.slime.jump" for players within 10 blocks of player's location
Try it
Guide and examples
play sound "entity.experience_orb.pickup" with pitch 1.8 and volume 1.0 at player's location
play sound "block.note_block.pling" with pitch 2.0 and volume 0.5 for player
play sound "ui.toast.challenge_complete" for all players in world "world"
PartMeaning
play sound <name>A Minecraft sound id such as "entity.player.levelup", or a custom one from your resource pack
with pitch <n>Optional, 0.5 (low) to 2.0 (high); the default is 1.0
and volume <n>Optional; the default is 1.0. Above 1.0 the sound is not louder but carries further
at <position>Play it in the world: everyone within earshot hears it coming from that spot
for <who>Play it to those players only, wherever they are
for all players in world <name>To everyone in one world
for players within <n> blocks of <location>To everyone that close to a place, each hearing it as if it were beside them

Pitch and volume may be given in either order, or one without the other (with volume 0.5). With neither at nor for, the sound is played to the player of the trigger. An unknown sound id plays nothing and is not reported, because the server cannot know which sounds a client's resource pack adds.