1.16.4 - /playsound for everyone, but at a specific player



  • This may seem complicated, but what I am trying to do is that when any player walk on water for a bit, a playsound will be executed at the position of the player that walked on water, but everyone will hear it.

    I already tried these commands:

    /scoreboard objectives add water minecraft.custom:minecraft.walk_on_water_one_cm

    /execute at @a[scores={water=220..}] run playsound minecraft:entity.player.swim master @a ~ ~ ~ 0.3 1 0.3

    /scoreboard players reset @a[scores={water=220..}]

    but this plays the sound at the position of every player, not only at the specific player

    /execute at @a[scores={water=220..}] run playsound minecraft:entity.player.swim master @s ~ ~ ~ 0.3 1 0.3 also doesn't work, because it only plays the sound for the player that walked on water



  • Here I am, answering my own question. I found the source of the problem, and it is exactly what I commented on the other answer: when you use /playsound...@a ~ ~ ~, after the relative coords there are 3 numbers, the 1st being the volume, the 2nd being the pitch, and the 3rd being the minVolume, which I tested and found out that it is the minimum volume that can be heard out of that sound, no matter where you are, so if you set it to 0.5, even if you are 10000+ blocks away, you will hear the sound, but with the volume of 0.5.




Suggested Topics