diff --git a/pom.xml b/pom.xml
index a8717f8..88ee780 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,7 +2,7 @@
4.0.0
giants
giants
- 22.2.0
+ 22.2.1
1.8
diff --git a/src/main/java/pl/minecon724/giants/Main.java b/src/main/java/pl/minecon724/giants/Main.java
index 16a065b..f770319 100644
--- a/src/main/java/pl/minecon724/giants/Main.java
+++ b/src/main/java/pl/minecon724/giants/Main.java
@@ -14,6 +14,9 @@ import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Entity;
@@ -32,7 +35,7 @@ import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.scheduler.BukkitRunnable;
-public class Main extends JavaPlugin implements Listener {
+public class Main extends JavaPlugin implements Listener, CommandExecutor {
File configFile = new File(getDataFolder(), "config.yml");
FileConfiguration config;
@@ -107,6 +110,7 @@ public class Main extends JavaPlugin implements Listener {
}
}
getServer().getPluginManager().registerEvents(this, this);
+ getCommand("spawngiant").setExecutor(this);
new BukkitRunnable() {
@Override
public void run() {
@@ -137,6 +141,12 @@ public class Main extends JavaPlugin implements Listener {
}
}
+ public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
+ if (!(sender instanceof Player)) return true;
+ spawnGiant(true, ((Player) sender).getLocation());
+ return true;
+ }
+
@EventHandler
public void entitySpawn(EntitySpawnEvent e) {
if (e.getEntityType() == EntityType.ZOMBIE) {
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 17e9e49..5c46ffe 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -2,4 +2,14 @@ name: Giants
version: ${project.version}
api-version: 1.18
main: pl.minecon724.giants.Main
-author: Minecon724
\ No newline at end of file
+author: Minecon724
+website: https://www.spigotmc.org/resources/giants.99600/
+commands:
+ spawngiant:
+ description: Spawns a giant at players location.
+ permission: giants.spawngiant
+ permission-message: You do not have permission to use this command.
+permissions:
+ giants.spawngiant:
+ description: Allows to use /spawngiant
+ default: op
\ No newline at end of file