Hello, everyone,
I have the following problem. I want to write a command that not everyone can execute. So far that's no problem. However, the command is suggested to every player (TabComplete) even if they don't have the permission.
Example:
Command: /Teamchat
Permission: server.teamchat
If you then "/" tab "Teamchat" will be displayed to each player.
I was able to fix the problem by overwriting the "hasPermission(Invocation invocation)" method. Then only players who didn't have the permission could tab "/Teamchat".
But then there is the problem that for players who do not have permission for the command, the default message from Minecraft comes that the command does not exist ("Unknown command. Type "/help" for help"). For these players, the message should come that they dont have permission for this command.
Also, typing "/Teamchat <something>" gives the error message "Incorrect argument for command at position 9: teamchat <--[HERE]"
Information:
Velocity version: newest
Paper version: 1.18.2 newest
Command used: SimpleCommand
I hope someone can help me.
I have the following problem. I want to write a command that not everyone can execute. So far that's no problem. However, the command is suggested to every player (TabComplete) even if they don't have the permission.
Example:
Command: /Teamchat
Permission: server.teamchat
If you then "/" tab "Teamchat" will be displayed to each player.
I was able to fix the problem by overwriting the "hasPermission(Invocation invocation)" method. Then only players who didn't have the permission could tab "/Teamchat".
But then there is the problem that for players who do not have permission for the command, the default message from Minecraft comes that the command does not exist ("Unknown command. Type "/help" for help"). For these players, the message should come that they dont have permission for this command.
Also, typing "/Teamchat <something>" gives the error message "Incorrect argument for command at position 9: teamchat <--[HERE]"
Information:
Velocity version: newest
Paper version: 1.18.2 newest
Command used: SimpleCommand
I hope someone can help me.
- Version Output
- Velocity 3.1.2-SNAPSHOT (git-74edac96-b153)