Reputation: 3
I'm trying to run a simple minecraft plugin I've built through a local spigot server. the plugins is
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
@Override
public void onEnable() {
getLogger().info("onEnable has been invoked!");
// TODO Insert logic to be performed when the plugin is enabled
}
@Override
public void onDisable() {
getLogger().info("onDisable has been invoked!");
// TODO Insert logic to be performed when the plugin is disabled
}
}
name: Kolo
version: 1.0
author: will
commands:
Hello:
Everytime I export the project as a jar to the plugins folder of my server and run my server it gives me this
[20:31:29 INFO]: Set PluginClassLoader as parallel capable
[20:31:29 ERROR]: Could not load 'plugins/Kolo.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.will.Kolo'
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:66) ~[minecraft_server.jar:git-Spigot-db6de12-18fbb24]
Can someone explain this to me? Idk if the info part of the code means anything but I searched it up and couldn't really decipher any instructions on how to go about doing what it says. Im still learning java and I feel like its mostly me forgetting a simple thing but I wanted to check on here to see if maybe one of you could clarify for me so I'll understand better.
Upvotes: 0
Views: 156
Reputation: 829
You're missing the "main" attribute in your plugin.yml file.
In case your folder structure is like "me/will/Kolo/Main.java", it should be like this:
name: Kolo
version: 1.0
author: will
main: me.will.Kolo.Main
commands:
Hello:
Upvotes: 1