Basic command structure for setspawnflyarea command

This commit is contained in:
Maximilian P. Käfer 2020-11-17 17:35:01 +01:00
parent 938a176a9f
commit 808ff6c84e
3 changed files with 24 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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

View File

@ -1,3 +1,6 @@
name: spawn-fly
name: spawn-fly
main: dev.kske.spawnfly.SpawnFly
version: 0.0.1
commands:
setspawnflyarea:
usage: /setspawnflyarea