Executioner class
public class WildCommandExecutor implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (sender instanceof Player && command.equals("wild")){
sender.sendMessage("you issues the command wild");
}else {
sender.sendMessage("you dont have permission for this command");
}
return false;
}
}
WildCommand class
public class WildCommand{
public WildCommand(){
WildCommandExecutor wildCommandExecutor = new WildCommandExecutor();
}
public boolean register() {
System.out.println("the register method called");
CommandMap commandMap = getCommandMap();
System.out.println(commandMap);
return true;
}
}
main
//Entry class
public class Main extends JavaPlugin {
@Override
public void onEnable() {
super.onEnable();
System.out.println("paper test plugin intializing");
WildCommand wildCommand = new WildCommand();
wildCommand.register();
}
}