Ok Now this is an actual plugin problem

Discussion in 'Spigot Plugin Development' started by MR_KMG, May 9, 2015.

  1. could you explain your problem?
     
  2. Everything you need to know is documented here.
     
  3. 1. Don't use 'getLogger("Minecraft")', just use 'getLogger()' from JavaPlugin
    2. Check if the sender is a player before casting
    3. Bukkit already does enable and disable messages for you
    4. What's the point for casting your class to static?
    5. Check the length of the args
     
  4. This is the problem sorry
    [20:51:34 ERROR]: Could not load 'plugins/MyFirstPlugin(1).jar' in folder 'plugins'

    org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.ITz_Kmg.MyFirstPlugin'

    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:66) ~[spigot.jar:git-Spigot-2f787bd-ea28011]

    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot.jar:git-Spigot-2f787bd-ea28011]

    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot.jar:git-Spigot-2f787bd-ea28011]

    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot.jar:git-Spigot-2f787bd-ea28011]

    at org.bukkit.craftbukkit.v1_8_R2.CraftServer.loadPlugins(CraftServer.java:291) [spigot.jar:git-Spigot-2f787bd-ea28011]

    at net.minecraft.server.v1_8_R2.DedicatedServer.init(DedicatedServer.java:199) [spigot.jar:git-Spigot-2f787bd-ea28011]

    at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:522) [spigot.jar:git-Spigot-2f787bd-ea28011]

    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_45]

    Caused by: java.lang.ClassNotFoundException: me.ITz_Kmg.MyFirstPlugin

    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_45]

    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot.jar:git-Spigot-2f787bd-ea28011]

    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot.jar:git-Spigot-2f787bd-ea28011]

    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_45]

    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_45]

    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_45]

    at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_45]

    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot.jar:git-Spigot-2f787bd-ea28011]

    ... 7 more
     
  5. Tip: Use pastebin

    Your plugin.yml is incorrent, you need to add the class name to the class path
     
  6. set the main: in your plugin.yml to the class with packagename where extends JavaPlugin is located
     
  7. Can you just tell me the class i need to add with this
    1. name: MyFirstPlugin
    2. main: me.ITz_Kmg.MyFirstPlugin
    3. version: 1.0
    4. description: >
    5. MyFirstPlugin.
    6. commands:
    7. keelan:
    8. description: Keelan Is Too Awesome To Reply To You!
    and this?
     
  8. In src/main/resources... like this:

    [​IMG]
     
  9. Here's how to fix your problem.

    Don't. Watch. Videos.

     
    • Agree Agree x 1
    • Winner Winner x 1
  10. go watch vids of pogo these are better
     
  11. This:
    "package me.ITz_Kmg.MyFirstPlugin;"
    should be:
    "package me.ITz_Kmg;", if you do also .MyFirstPlugin, you will need to put in plugin.yml me.ITz_Kmg.MyFirstPlugin.MyFirstPlugin.
    In the plugin, you don't need to put the name of the plugin on package, because it will be your main class name.
     
  12. Maybe you didn't get what I said.

    Even his videos have mistakes. Bottom line, as I said before...