Spigot Plugin already initialized

Discussion in 'Plugin Help/Development/Requests' started by creppii, Mar 22, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    creppii

    Hey,

    i always get the error message below at enabling...

    here's my code:

    Main Class:
    Code:
    package main;
    
    import org.bukkit.Bukkit;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.plugin.java.JavaPlugin;
    
    import commands.setCommand;
    
    public class main extends JavaPlugin {
    
        private static Plugin plugin;
      
        @Override
        public void onEnable() {
            plugin = this;
            System.out.println("§aSkyCraft Enabled");
          
            // Registering commands
            getCommand("set").setExecutor(new setCommand());
        }
      
        @Override
        public void onDisable() {
            plugin = null;
            System.out.println("§cSkyCraft Disabled");
        }
      
        public static void registerEvents(org.bukkit.plugin.Plugin plugin, Listener... listeners) {
            for (Listener listener : listeners) {
                Bukkit.getServer().getPluginManager().registerEvents(listener, plugin);
            }
        }
      
        public static Plugin getPlugin() {
            return plugin;
        }
      
    }
    
    setCommand Class:

    Code:
    package commands;
    
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class setCommand extends JavaPlugin implements CommandExecutor{
    
    
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
          
            Player p = null;
            if(sender instanceof Player)
            {
                p = (Player)sender;
            }
                if(args.length == 0) {
                    p.sendMessage("§cUngültige Eingabe");
                    p.sendMessage("§a/set teamspawn <color>");
                }
          
            return false;
        }
      
    }
    
    upload_2015-3-22_14-31-12.png
     
    Last edited: Mar 22, 2015
  2. Offline

    bwfcwalshy Retired Staff

    Moved to Bukkit Alternates.
     
Thread Status:
Not open for further replies.

Share This Page