It wasn't listed in the official changelog, but a new command was added that allows you to stop a sound that is currently playing for the targeted player(s):
/stopsound < player> [source] [sound]
For example, the following stops all sounds that are playing for the player:
/stopsound @p
The following stops all sounds in the "music" category (using "master" here will not stop all sounds and would instead just stop sounds specifically set to play in the "master" category):
/stopsound @p music
And the following stops a specific sound that is currently playing:
/stopsound @p hostile minecraft:entity.ghast.hurt
An example application of this is to play custom music when the player enters an area and then to stop that music playing if they leave, to prevent overlapping music.
Previously a method of this would be to overload the player's sound manager by playing a large number of sounds at the same time (the number of which varied depending on the player's computer, so could not reliably be used).
It wasn't listed in the official changelog, but a new command was added that allows you to stop a sound that is currently playing for the targeted player(s):
For example, the following stops all sounds that are playing for the player:
The following stops all sounds in the "music" category (using "master" here will not stop all sounds and would instead just stop sounds specifically set to play in the "master" category):
And the following stops a specific sound that is currently playing:
An example application of this is to play custom music when the player enters an area and then to stop that music playing if they leave, to prevent overlapping music.
Previously a method of this would be to overload the player's sound manager by playing a large number of sounds at the same time (the number of which varied depending on the player's computer, so could not reliably be used).
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
cool!! that should be usefull
I've been needing this so bad! Thanks for posting this, it helped a lot!
*sarcastic comment*
*disapproving look*