diff --git a/src/main/java/dev/kske/spawnfly/SpawnCommand.java b/src/main/java/dev/kske/spawnfly/SpawnCommand.java new file mode 100644 index 0000000..6c88927 --- /dev/null +++ b/src/main/java/dev/kske/spawnfly/SpawnCommand.java @@ -0,0 +1,18 @@ +package dev.kske.spawnfly; + +import org.bukkit.command.*; + +public class SpawnCommand implements CommandExecutor { + public SpawnCommand() {} + + @Override + public boolean onCommand(CommandSender sender, org.bukkit.command.Command command, String label, + String[] args) { + if(command.getName().equals("setspawnflyarea")) { + sender.sendMessage("Hello this works!"); + return true; + } + return false; + } + +} diff --git a/src/main/java/dev/kske/spawnfly/SpawnFly.java b/src/main/java/dev/kske/spawnfly/SpawnFly.java index 91f0538..d53da15 100644 --- a/src/main/java/dev/kske/spawnfly/SpawnFly.java +++ b/src/main/java/dev/kske/spawnfly/SpawnFly.java @@ -9,6 +9,7 @@ public final class SpawnFly extends JavaPlugin { public void onEnable() { getLogger().info("onEnable has been invoked!"); Bukkit.getPluginManager().registerEvents(new SpawnListener(), this); + getCommand("setspawnflyarea").setExecutor(new SpawnCommand()); } @Override diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index d65f1c0..c0e979c 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,3 +1,6 @@ -name: spawn-fly +name: spawn-fly main: dev.kske.spawnfly.SpawnFly -version: 0.0.1 \ No newline at end of file +version: 0.0.1 +commands: + setspawnflyarea: + usage: /setspawnflyarea