Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Failure Message Displayed in Console on Paper Servers #496

Closed
learliet opened this issue Oct 7, 2023 · 1 comment
Closed

Incorrect Failure Message Displayed in Console on Paper Servers #496

learliet opened this issue Oct 7, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@learliet
Copy link

learliet commented Oct 7, 2023

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

  1. It's important to note that this issue appears to be specific to Paper, as it was not observed on Spigot.
  2. @willkroboth has already created Exceptions from custom Brigadier commands do not show up in console PaperMC/Paper#9808 to address this problem, which can be referenced for additional details and updates regarding this issue.
@learliet learliet added the bug Something isn't working label Oct 7, 2023
@willkroboth
Copy link
Collaborator

This issue comes from Paper, and has been resolved since PaperMC/Paper#8235 was merged into 1.20.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants