Invalid sound category (source) in playsound command kicks player from server
When typing a non-exist sound category (source) in /playsound, the client losts connection to the server. Happens only when playing on a server.
a screenshot of the error code is attached.
Environment
Windows 10, Java 8 Update 71/73, minecraft_server.jar
Linked Issues
is duplicated by6
Created Issue:
Wrong syntax of /playsound cuses a crash
When typing a non-exist sound category (source) in /playsound, the client losts connection to the server. Happens only when playing on a server.
a screenshot of the error code is attached.Environment
Windows 10, Java 8 Update 71, minecraft_server.16w03a.jar
is duplicated by
Wrong syntax of /playsound causes a crash
Wrong syntax of /playsound causes a crashInvalid sound category (source) in playsound command kicks player from server
is duplicated by
is duplicated by
Windows 10, Java 8 Update 71, minecraft_server.
16w03a.jar
Windows 10, Java 8 Update 71/73, minecraft_server.jar
is duplicated by
is duplicated by
When typing a non-exist sound category (source) in /playsound, the client losts connection to the server. Happens only when playing on a server.
a screenshot of the error code is attached.
is duplicated by
relates to

what is the exact command you used?
Well, when it first happened, it was a quiet complex command. Anyway, I discovered so it happens also with a simple playsound command, like this one:
/playsound minecraft:entity.player.levelup [any word that isn't a vaild sound source] @p
It happens with any vaild sound name and selector.
Confirmed for
Could you please change the title to for example "Invalid sound category (source) in playsound command kicks player from server"
Based on a decompiled version of 16w05b I would say the reason is that the sound category is received using the public static nh a(String ?) method of the nh class. This method however simply uses the V get(Object key) of the java.util.Map class. This itself is not a problem, but all methods and classes using this method should test if the returned value is null, which the method parsing the /playsound command currently does not.
Can someone remove the Issue link to
MC-96788please? It's not a duplicate of this.how is it not a duplicate, the report states a invalid value in the source paramater
Sorry, my fault. I didn't realized this was the idea.
Confirmed in 1.9
Please link to this comment in the description
The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.
What I said earlier is indeed the case. The public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException method of the net.minecraft.command.CommandPlaySound class does not test if the parsed net.minecraft.util.SoundCategory is null.
Fixed in 1.10