Incorrect Failure Message Displayed in Console on Paper Servers
learliet opened this issue · comments
CommandAPI version
9.2.0
Minecraft version
1.20.1
Are you shading the CommandAPI?
Yes
What I did
I attempted to run the following command on a Paper server using the latest version:
val myCommand = CommandAPICommand("myCommand")
.withArguments(EntitySelectorArgument.ManyPlayers("players"))
.executes(CommandExecutor { sender, args ->
val players = args[0] as List<Player>
if(players.isEmpty()){
throw CommandAPIBukkit.failWithAdventureComponent(
Component.translatable("argument.entity.notfound.player")
)
}
sender.sendMessage("Success")
})
What actually happened
When I executed the command and it failed (e.g., by providing a player selector that results in an empty list), I observed that the console displayed an incorrect error message. Instead of showing the custom failure message specified in the executor, it displayed "Unknown command. Type "/help" for help."
What should have happened
The console should have displayed the custom failure message specified in the executor when the command failed.
Server logs and CommandAPI config
No response
Other
- It's important to note that this issue appears to be specific to Paper, as it was not observed on Spigot.
- @willkroboth has already created PaperMC/Paper#9808 to address this problem, which can be referenced for additional details and updates regarding this issue.