Errors in if queries?

ma
- in Plugins
9

I'm currently programming some plugins for my own Minecraft server.

One thing has tormented me for hours!

Every time I:

if (args.length == 0) {
p.sendMessage ( "dummy");
}
else if (args.length == 1) {
// Command functions
}

do and just call the command / test in the game without a second argument, this message comes: An internal error occurred while attempting to perform this command.

The thing is: With all other commands in this project, this query has always worked, only somehow not for a few hours. Where is the mistake?

Fa

Doesn't an opening bracket have to follow the else?

Ke

Invite the whole class
https://hastebin.com/...tebin.com/" class="text-primary">https://hastebin.com/...tebin.com/
high

And also upload the error message (if there's one) from the console:
https://hastebin.com/

ma
ro

The semicolon is just right

Ge

The way it is there's already correct.

Fa

Please write the opening brackets under the if and not directly after it.

Bu

The brackets are correct and do not need to be changed. As in Java, they are set according to the K&R style.

Fa

Yes, just don't feel like counting them, but ok.

Bu

An internal error occurred while attempting to perform this command.

This is still rather unspecific or does not really help with troubleshooting, even if the source of the error could be narrowed down a bit based on the time when the error message follows.

It would be ideal if you could run through your code at runtime https://www.spigotmc.org/...ur-plugin/. At least I would take a look at the server's log files instead.