Affects Version/s: Minecraft 1.6.4, Minecraft 13w43a, Minecraft 15w51b, Minecraft 16w02a, Minecraft 16w33a, Minecraft 1.12.2, Minecraft 17w45b, Minecraft 18w03b, Minecraft 18w08b, Minecraft 1.13.1, Minecraft 19w09a, Minecraft 1.14.4 Pre-Release 5, 1.14.4, 1.15.2, 20w22a, 1.16.2
Fix Version/s: Minecraft 16w35a
The /playsound parameter minVolume is not exactly a minimum volume but rather a default volume.
Basically, if the player is out of range, the sound's origin is centered at the player instead of the entered coordinates.
However if the player moves away from the new position while the sound is still playing, the volume will decrease as if it were played at the player's previous location without the minVolume parameter.
Therefore it is impossible to play a sound globally because even with a minVolume of 1 the volume will decrease as the player moves.
→ Sound is played at the current location with maximum volume
→ Player is out of range, sound isn't played at all
→ Sound is played at the current location with maximum volume, but volume decreases if the player moves
→ Sound is played at the specified location with maximum volume, but at the players location it's barely hearable (volume < minVolume)
→ Player is out of range, sound gets centered at the current location with maximum volume
The problem is not as simple as I first thought.
The minVolume parameter is processed only by the server and never actually sent to the client, so in order to resolve this issue the network protocol would have to be altered.
Instead of simply repositioning the source the client needs to know that the sound is meant to be played with a global minimum volume.
Btw, you are calculating the distance between the audio source and the player twice; once via EntityPlayerMP.getDistance() and once manually (net.minecraft.command.CommandPlaySound.processCommand()).