Playsound doesn't work with relative coords
I can't do something like
/playsound random.explode @a ~ ~ ~ it will just play the sound to everyone, no matter how far away they are.
But when I use a command like
/playsound random.explode @a 10 25 -4 it will play the sound coming from the coords specified.
Please note: I do not know how many versions of Minecraft this concerns, but I discovered it in 14w11b. Also, I do not know if this is a bug or if it is just not implemented. If it is not a bug, I would appreciate it if this was added to the game.
Created Issue:
Playsound doesn't work with relative coords
I can't do something like
/playsound random.explode @a ~ ~ ~ it will just play the sound to everyone, no matter how far away they are.But when I use a command like
/playsound random.explode @a 10 25 -4 it will play the sound coming from the coords specified.Please note: I do not know how many versions of Minecraft this concerns, but I discovered it in 14w11b. Also, I do not know if this is a bug or if it is just not implemented. If it is not a bug, I would appreciate it if this was added to the game.
Ya this is actually working as intended now to fix bug MC-51788. If you ran playsound before, relative coords used to work relative to the player it was played to, but now it works relative to the command block. You just use execute now to accomplish this.
execute @a ~ ~ ~ playsound random.explode @p ~ ~ ~
But now you can do neat tricks with it like playing it from a player's relative position TO everyone else in earshot of it!
Ya this is actually working as intended now to fix bug MC-51788. If you ran playsound before, relative coords used to work relative to the player it was played to, but now it works relative to the command block. You just use execute now to accomplish this.
execute @a ~ ~ ~ playsound random.explode @p
But now you can do neat tricks with it like playing it from a player's relative position TO everyone else in earshot of it!
Ya this is actually working as intended now to fix bug MC-51788. If you ran playsound before, relative coords used to work relative to the player it was played to, but now it works relative to the command block. You just use execute now to accomplish this.
execute @a ~ ~ ~ playsound random.explode @p
But now you can do neat tricks with it like playing it from a player's relative position TO everyone else in earshot of it!
Consider the command you are typing in.
@a ~ ~ ~
Play to everyone relative to their coordinates. So it will play everywhere there is a player.
@a x y z
Play to everyone at these specific coordinates. If too far away you won't hear.
Try either @p to specify a specific player or use /execute @p ~ ~ ~ /playsound @a[r=50] to execute the command at a player's location limiting to a radius of 50 in this case.