public void registerCommands(@NotNull Plugin plugin, @NotNull String packageName) { for(Class clazz : new Reflections(packageName + ".commands").getSubTypesOf(Commands.class)) { try { Commands commands = clazz.getDeclaredConstructor().newInstance(plugin); //TODO: register the command getCommand(pluginCommand.getCommandInfo().name()).setExecutor(commands) } catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException e) { e.printStackTrace(); } } }