Bowen Everitt
Bowen Everitt

Reputation: 1

Why won't my plugin load onto my Minecraft spigot server?

so about a week ago I decided I wanted to learn to code minecraft plugins, so I tried to follow this guide:

I loaded my test plugin into my spigot 1.12 server on my pc and I got sooo many errors:

[15:58:22 ERROR]: Could not load 'plugins\TestPluginA3-1.0-SNAPSHOT.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: Cannot find main class `com.gmail.boweneveritt.TestPluginMain' at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:66) ~[latestspigot.jar:git-Spigot-596221b-9a1fc1e] at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) ~[latestspigot.jar:git-Spigot-596221b-9a1fc1e] at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:326) ~[latestspigot.jar:git-Spigot-596221b-9a1fc1e] at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:248) [latestspigot.jar:git-Spigot-596221b-9a1fc1e] at org.bukkit.craftbukkit.v1_12_R1.CraftServer.loadPlugins(CraftServer.java:298) [latestspigot.jar:git-Spigot-596221b-9a1fc1e] at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:205) [latestspigot.jar:git-Spigot-596221b-9a1fc1e] at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:544) [latestspigot.jar:git-Spigot-596221b-9a1fc1e] at java.lang.Thread.run(Unknown Source) [?:1.8.0_191] Caused by: java.lang.ClassNotFoundException: com.gmail.boweneveritt.TestPluginMain at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_191] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[latestspigot.jar:git-Spigot-596221b-9a1fc1e] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[latestspigot.jar:git-Spigot-596221b-9a1fc1e] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_191] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_191] at java.lang.Class.forName0(Native Method) ~[?:1.8.0_191] at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_191] at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:64) ~[latestspigot.jar:git-Spigot-596221b-9a1fc1e] ... 7 more

My libs were: JDK 10, Craft Bukkit 12 and Spigot 1.12

Anything I am doing wrong???

Upvotes: 0

Views: 1113

Answers (2)

TaljaFox
TaljaFox

Reputation: 13

If you have a file in the src file called plugin.yml then add this:

package.package.package.MainClassHere

Basically, you need to supply the plugin.yml with the directory of the main class.

Upvotes: 0

Daniel Juric
Daniel Juric

Reputation: 148

Cannot find main class 

that means you do not have a main class. Write a class and which called like this:

public class Main extends JavaPlugin {

    public void onEnable() {
    }

    public void onDisable() {
    }


    }

Upvotes: 0

Related Questions