Main class does not extend JavaPlugin

Discussion in 'Plugin Development' started by bossman2001, Jun 7, 2014.

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

    bossman2001

    Hello. I am trying to make my very, very first Bukkit plugin but i have 1 issue.. :/
    When i drag the plugin to the plugins folder on my local server and reload the server it says:

    [13:22:49 ERROR]: Could not load 'plugins\VotePlugin.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: main class `me.Mac.VotePlugin.VotePlug
    in' does not extend JavaPlugin

    Why does this occur. I have public class VotePlugin extends JavaPlugin in my class.
     
  2. Offline

    ZodiacTheories

  3. Offline

    bossman2001

    Code:java
    1. package me.Mac.VotePlugin;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.ChatColor;
    5. import org.bukkit.command.Command;
    6. import org.bukkit.command.CommandSender;
    7. import org.bukkit.plugin.java.JavaPlugin;
    8.  
    9. public class VotePlugin extends JavaPlugin
    10. {
    11. public void onEnable()
    12. {
    13.  
    14. }
    15.  
    16. public void onDisable()
    17. {
    18.  
    19. }
    20.  
    21.  
    22. public boolean onCommand(CommandSender sender, Command cmd, String cL, String[] args)
    23. {
    24. if(cmd.getName().equalsIgnoreCase("enable"))
    25. {
    26. sender.sendMessage(ChatColor.YELLOW + "[Test] " + ChatColor.BLUE + "It works!" );
    27.  
    28. }
    29. return true;
    30. }
    31.  
    32. }
    33.  



    PLUGIN YML:
    name: VotePlugin
    author: MaC
    version: 1
    description: Test plugin
    main: me.Mac.VotePlugin.VotePlugin
    commands:
    enable:
    description: Test command
     
  4. Offline

    ZodiacTheories

    bossman2001

    Cannot put 1 for version put 1.0, and also, please could I see the indentation?
     
  5. Offline

    theguynextdoor

    Note: Java convention says that package names should be all lower case.
     
  6. Offline

    mine-care

    theguynextdoor exactly, unlike classes that should be capital letter on the beginning of the name
     
  7. Offline

    bossman2001

    Should the package name ONLY have lower case letters?
     
  8. Offline

    klosjaarrr


    Yes.
     
  9. Offline

    1Rogue Retired Staff


    Though that would cause this issue

    bossman2001

    Clear out your entire plugin folder, and then put a freshly made jarfile in there. Same result?
     
Thread Status:
Not open for further replies.

Share This Page