Wild command

Trying to use the commandMap in order to create a command without the plugin.yml

unlisted ⁨3⁩ ⁨files⁩ 2024-01-19 13:39:36 UTC

Executioner class

Raw
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

Raw
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

Raw
//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();
    }
}