illegal plugin arguement: Plugin Is Already Initialized!

Discussion in 'Spigot Plugin Development' started by Karatechimp29, May 29, 2015.

Thread Status:
Not open for further replies.
  1. Hey guys, i just started another plugin and im getting this very annoying error every time -_-
    Code (Text):
    [20:08:59 ERROR]: Could not load 'plugins\SkidBlock-1.0.jar' in folder 'plugins'

    org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: Pl
    ugin already initialized!
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:133) ~[craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:336) ~[craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:258) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugins(CraftServer.ja
    va:369) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.reload(CraftServer.java:86
    4) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at org.bukkit.Bukkit.reload(Bukkit.java:301) [craftbukkit.jar:git-Spigot
    -1.7.9-R0.2-208-ge0f2e95]
            at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:
    23) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
    1) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServe
    r.java:767) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchServerCommand(Craf
    tServer.java:753) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at net.minecraft.server.v1_7_R4.DedicatedServer.aB(DedicatedServer.java:
    326) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:2
    90) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:5
    84) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java
    :490) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:6
    28) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
    Caused by: java.lang.IllegalArgumentException: Plugin already initialized!
            at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader
    .java:122) ~[craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:66) ~[craftb
    ukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at me.karatechimp29.bukkit.Main.<init>(Main.java:22) ~[?:?]
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    ~[?:1.7.0_71]
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    ~[?:1.7.0_71]
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce) ~[?:1.7.0_71]
            at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.7.0_7
    1]
            at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_71]
            at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:76) ~[craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:129) ~[craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            ... 14 more
    Caused by: java.lang.IllegalStateException: Initial initialization
            at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader
    .java:125) ~[craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:66) ~[craftb
    ukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at me.karatechimp29.bukkit.Main.<init>(Main.java:22) ~[?:?]
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    ~[?:1.7.0_71]
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    ~[?:1.7.0_71]
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce) ~[?:1.7.0_71]
            at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.7.0_7
    1]
            at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_71]
            at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:76) ~[craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:129) ~[craftbukkit.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
            ... 14 more
    Main Class:
    Code (Text):
    package me.karatechimp29.bukkit;

    import me.karatechimp29.bukkit.listeners.SoupListener;

    import org.bukkit.Bukkit;
    import org.bukkit.plugin.java.JavaPlugin;

    public class Main extends JavaPlugin{
       
        @Override
        public void onEnable()
        {
            getLogger().info("Has Been Enabled!");
            Bukkit.getServer().getPluginManager().registerEvents(new SoupListener(), this);
        }

        @Override
        public void onDisable()
        {
            getLogger().info("Has Been Disabled!");
        }
    }
     
    SoupListener Class:
    Code (Text):
    package me.karatechimp29.bukkit.listeners;

    import org.bukkit.Material;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.Action;
    import org.bukkit.event.player.PlayerInteractEvent;

    public class SoupListener implements Listener{
       
        @EventHandler
        public void onItemRightClick(PlayerInteractEvent event)
        {
            Player player = event.getPlayer();
            if(event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)
            {
                if(player.getItemInHand() != null)
                {
                    if(player.getItemInHand().getType() == Material.MUSHROOM_SOUP)
                    {
                        if(player.getHealth() > 13)
                        {
                            player.setHealth(20);
                        }
                        else
                        {
                            player.setHealth(player.getHealth() + 7);
                        }
                        player.getItemInHand().setType(Material.BOWL);
                    }
                }
            }
        }

    }
    what is going on here? apart from breakfast that is...
     
  2. Inkzzz

    Resource Staff

    You've already got a plugin with the same package/main name
     
  3. all i have in my plugin folder is essentials chat, essentials and worldedit -_-
     
  4. jflory7

    jflory7 Retired Moderator
    Retired Benefactor

    Thread locked per request

    Next time, please just use the "Report" button.
     
    • Agree Agree x 2
Thread Status:
Not open for further replies.