Commands/stopsound

Stops a given sound.

On Bedrock Edition, this can be used on repeating command blocks to stop cave ambience and other sound that might be unwanted (simply use 'stopsound ambient.cave'). However, this is harder on Java.

Syntax

 * Java Edition


 * Bedrock Edition

Arguments
(BE: )
 * Specifies the sound's target. Must be a player name or a target selector.
 * Entities other than players are not allowed.


 * Specifies which category in the Music & Sound options the sound falls under. Must be,  ,  ,  ,  ,  ,  ,  ,  , or.


 * Stop sound of all category.

(BE: )
 * Specifies the sound to stop. Must be a sound event defined in sounds.json $$ or sound_definitions.json $$ (for example, ). If no sound if specified, stops all sounds.

Result
Fails if the arguments are not specified correctly, or if  fails to resolve to one or more online players.

On success, stop the specified sound(s) for the targeted players.