mojira.dev
MC-206766

/playsound does not work properly from server console

Issue:

When using the `/playsound` command formatted as `/playsound [sound] master @a` in the server console:

  1. It will only play the sound at the center of the worldspawn, even if `master` and `@a` are selected.

  2. If too far away from the world spawn, the server will say "The sound is too far away to be heard."

When using the `/playsound` command on the client with OP, it works as expected and plays the sound globally to all players.

Expected Result:

`/playsound` should work play sounds in the server console, just like it does locally on the client.

 

Current Workaround:

The current workaround is to do `/execute at @a run playsound [sound] master @a`, though, this shouldn't be necessary.

Comments 2

Try setting the volume in the /playsound command. If you set it really high, you can hear it from very far away.

This works as intended. All commands have a source position. From chat, that's your position. From the server, that's spawn.
No single command can have multiple positions. So if you do /playsound from chat with the default position, only you will hear it, and likewise from spawn via the server.
Therefore, it is not the case that "all players will hear it" when run from chat, as you claim. There is no inconsistency.

Kyle Barr

(Unassigned)

Unconfirmed

(Unassigned)

20w48a

Retrieved