Could someone help me with my plugin?

Discussion in 'Archived: Plugin Requests' started by Myklebost, Aug 5, 2011.

  1. Offline


    I don't know what's wrong with the plugin but it is something wrong.
    This is This is the code:

    package Mykle;
    import java.util.logging.Logger;
    import org.bukkit.command.CommandSender;
    import org.bukkit.command.Command;
    public class MyPlugin extends JavaPlugin {
        Logger log = Logger.getLogger("Minecraft");
    public void onEnable() {"MyPlugin is Enabled.");
        public void onDisable(){
  "MyPlugin is Disabled.");
        public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
                return true;
            return false;
    This is the error i get:
    151 recipes
    16 achievements
    15:46:32 [INFO] Starting minecraft server version Beta 1.7.2
    15:46:32 [INFO] Loading properties
    15:46:32 [INFO] Starting Minecraft server on localhost:25565
    15:46:32 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-904-
    g9277096-b953jnks (MC: 1.7.2)
    15:46:32 [SEVERE] Could not load 'plugins\MyPlugin.jar' in folder 'plugins':
    java.lang.ClassNotFoundException: Mykle.MyPlugin
            at$ Source)
            at Method)
            at Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(
            at org.bukkit.craftbukkit.CraftServer.<init>(
            at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigur
            at net.minecraft.server.MinecraftServer.init(
    15:46:32 [INFO] Preparing level "world"
    15:46:32 [INFO] Preparing start region for level 0 (Seed: 2703611272930931585)
    15:46:33 [INFO] Preparing start region for level 1 (Seed: 8046779386260908135)
    15:46:33 [INFO] Preparing spawn area: 48%
    15:46:33 [INFO] Done (0,139s)! For help, type "help" or "?"
    Please Help Me!
  2. Offline


    Maybe you forgot to add the .class files in your plugin .jar file. Could you please attach the .jar file of your plugin?
  3. Offline


    Ok, I have zipped it so just unzip it. Here it is:

    Attached Files:

  4. Offline


    ur package should look similar to this:

    and that should contain your classes... u should also name ur main class MyPlugin if thats the name of ur .jar

    don't forget to edit this line in the plugin.yml
    main: me.Mykle.MyPlugin.MyPlugin
  5. Offline


    I still got the same error. But thanks anyway :)
  6. Offline


    The jar file that you attached loads for me, but to get the command to register, you must declare it in the plugin.yml. Here is a sample plugin.yml with commands defined.
  7. Offline


    Yeah its the plugin.yml to me it looks like the main class location is out of place... Wait why is the class named my plugin but the class file it's found in named AntiOperator? I'd bet that's the error.
  8. Offline


    I get the same error on all of my plugins -.- maby it isn't something with the code?
  9. Offline


    You aren't setting up your packages right or/and aren't using the plugin.yml correctly. Also: is this a block placement notifier?
  10. Offline


    how should the plugin.yml be used? This is how i use it:
    name: Test
    version: 0.1
    main: me.myklebost.test.Test
    authors: [Myklebost]
    The package name is me.myklebost.test
  11. Offline


    If that's ur yml it means that the name of your main class has to be Test...

    If I remember correctly it was named AntiOperator or something like that...

    main: me.myklebost.test.Test <-- name of main class
  12. Offline


    Yeah, That was just an example i made a new plugin but it had exactly the same error.

    Ok so i did a tutorial and did all the same as he did. I downloaded hes .jar file. and it worked. Then i tryed my file. The same error. Maby it is when i am exporting it into the .jar it goes wrong?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 18, 2016

Share This Page