mojira.dev
MC-164535

/playsound uses wrong feedback message for multiple targets

The bug

The /playsound command should use different feedback messages depending on whether one or multiple players are targeted:

commands.playsound.success.single
commands.playsound.success.multiple

However, currently the code always uses commands.playsound.success.single:

net.minecraft.server.commands.PlaySoundCommand#playSound

if (collection.size() == 1) {
    cn2.sendSuccess(new TranslatableComponent("commands.playsound.success.single", sj2, collection.iterator().next().getDisplayName()), true);
} else {
    cn2.sendSuccess(new TranslatableComponent("commands.playsound.success.single", sj2, collection.iterator().next().getDisplayName()), true);
}

Linked issues

Comments 1

In 19w46a it now uses the correct message, but apparently still uses as second argument the name of the first player instead of the number of players:

collection.iterator().next().getDisplayName()

Translation

"commands.playsound.success.multiple": "Played sound %s to %s players"

marcono1234

slicedlime

Confirmed

Low

Commands

/playsound

19w42a, 19w46a

19w46a, 1.15 Pre-release 1

Retrieved