Revisions for ⁨Wild command⁩

View the changes made to this paste.

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

Executioner class

@@ -0,0 +1,15 @@

+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

@@ -0,0 +1,15 @@

+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

@@ -0,0 +1,10 @@

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