Solved Why can't I execute plugin commands on the spigot side

qscbm187531

New member
Jul 22, 2023
1
0
1
Solved
---------------------------------------
The plugin commands I wrote can only be used in the console, the player cannot execute them, and the commands of other plugins are all fine.
CommandMeta meta = server.getCommandManager().metaBuilder("mycommand").aliases("mycmd").plugin(this).build();
server.getCommandManager().register(meta,new MyCommand());
public class MyCommand implements SimpleCommand {
@Override
public void execute(Invocation invocation) {
String[] args = invocation.arguments();
if (args.length == 0 || args.length>3 || args.length == 2) {
sendHelp(invocation);
return;
}
// execute
}

@Override
public boolean hasPermission(Invocation invocation) {
return invocation.source().hasPermission("permission");
}
 
Last edited: