Question How to get the plugin a command is executed by?

iJustLeyxo

New member
Apr 26, 2022
3
0
1
I am coding a permission plugin and need to get the plugin instance from which a command is managed (and has the executor registered). Would be very glad about any help or suggestions how to approach the problem differently!
 

Tacklezaza

New member
Aug 14, 2022
15
0
1
So, you want to check who execute the command and you too lazy to check instanceof? Like...

Java:
boolean hasPermission = false;
if(sender instanceOf Player){
    Player player = (Player)sender;
    if(player.isOp()){
        hasPermission = true;
    }
}
else if(sender instanceOf ConsoleCommandExecutor){
    hasPermission = true;
}

Or what?