Solved org.bukkit.plugin.InvalidDescriptionException: main is not defined

Discussion in 'Spigot Plugin Development' started by nktfh100, Apr 15, 2017.

Thread Status:
Not open for further replies.
  1. * im new at java*
    so i made my first plugin (very simple) and i got this error:
    Code (Text):
    org.bukkit.plugin.InvalidDescriptionException: main is not defined
            at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:917) ~[spigot-1.11.2-R0.1-SNAPSHOT.jar:git-Spigot-54ec0b8-ac405c3]
            at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:232) ~[spigot-1.11.2-R0.1-SNAPSHOT.jar:git-Spigot-54ec0b8-ac405c3]
            at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:157) ~[spigot-1.11.2-R0.1-SNAPSHOT.jar:git-Spigot-54ec0b8-ac405c3]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [spigot-1.11.2-R0.1-SNAPSHOT.jar:git-Spigot-54ec0b8-ac405c3]
            at org.bukkit.craftbukkit.v1_11_R1.CraftServer.loadPlugins(CraftServer.java:301) [spigot-1.11.2-R0.1-SNAPSHOT.jar:git-Spigot-54ec0b8-ac405c3]
            at net.minecraft.server.v1_11_R1.DedicatedServer.init(DedicatedServer.java:204) [spigot-1.11.2-R0.1-SNAPSHOT.jar:git-Spigot-54ec0b8-ac405c3]
            at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:544) [spigot-1.11.2-R0.1-SNAPSHOT.jar:git-Spigot-54ec0b8-ac405c3]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
    Caused by: java.lang.NullPointerException
            at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:912) ~[spigot-1.11.2-R0.1-SNAPSHOT.jar:git-Spigot-54ec0b8-ac405c3]
            ... 7 more


    the code:

    Code (Text):

    package com.nktfh100.wow;

    import org.bukkit.plugin.java.JavaPlugin;
    public class Main extends JavaPlugin {
        public void onEnable() {
            System.out.print("[test] Starting!");
        }
        public void onDisable() {
            System.out.print("[test] Stopping!");
        }
    }

    plugin.yml:
    Code (Text):
    name: wow
    Main: com.nktfh100.wow.Main
    version: 1.0
     

    image:

    [​IMG]


    what i have done wrong??
    please help me
    btw my english is bad so..
     
    #1 nktfh100, Apr 15, 2017
    Last edited: Apr 17, 2017
  2. Code (Text):
    Main: com.nktfh100.wow.Main
    should be
    Code (Text):
    main: com.nktfh100.wow.Main
    with a lowercase m
     
    • Agree Agree x 1
  3. omfg bro thanks!!!!!!!!
    you are the best! :D
     
    • Funny Funny x 1
  4. just sayin you should mark this as solved ;)
     
    • Agree Agree x 2
  5. Also, take a look at http://bukkit.gamepedia.com/Plugin_YAML , it could be useful to you in the future. Remember ALWAYS that
    Code (Text):
    public static Integer playerAmount = 0;
    is not the same as
    Code (Text):
    public static Integer playeramount = 0
    and the second one disrespects the Java naming conventions.

    Java is case-sensitive.
     
  6. but in the video i saw he made it Main..
    but thanks anyway
     
Thread Status:
Not open for further replies.