Error When Startup

Discussion in 'Spigot Plugin Development' started by iMedia, Jul 29, 2018.

  1. iMedia


    [16:06:27 ERROR]: Error occurred while enabling oHub v0.3 (Is it up to date?)
    at me.imedia.ohub.Core.onEnable( ~[?:?]
    at ~[spigot.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
    at [spigot.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin( [spigot.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
    at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugin( [spigot.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
    at org.bukkit.craftbukkit.v1_7_R4.CraftServer.enablePlugins( [spigot.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
    at net.minecraft.server.v1_7_R4.MinecraftServer.n( [spigot.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
    at net.minecraft.server.v1_7_R4.MinecraftServer.g( [spigot.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
    at net.minecraft.server.v1_7_R4.MinecraftServer.a( [spigot.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
    at net.minecraft.server.v1_7_R4.DedicatedServer.init( [spigot.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
    at [spigot.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
    at [spigot.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]

    Please tell me how to fix
  2. We kinda need to see the code to help you fix it. The oHub plugin is causing this error.
  3. iMedia


    I have multiple classes what class do you want to see?
  4. iMedia


    package me.imedia.ohub;
    public class Core extends JavaPlugin {

    public static Core plugin;

    public void onEnable() {
    plugin = this;
    getServer().getPluginManager().registerEvents(new Listeners(this), this);
    getCommand("help").setExecutor(new Commands(this));
    public void registerEvents() {
    new ScoreboardManager(this);
  5. The class that extends the JavaPlugin. On line 13 of the class inside the onEnable() function you should check if that variable or data input is null before trying to work with it.
  6. Your error is on line 13 of the Core class. What's on that line?
  7. iMedia


    getCommand("help").setExecutor(new Commands(this));

    thats line 13
  8. Seems like you haven't registered the command in your plugin.yml, is that right?
  9. Strahan


    ...and use [CODE] tags not spoiler tags for posting code. That way you won't lose indentation.
  10. iMedia


    Code (Text):

    name: oHub
    version: 0.3
    main: me.imedia.ohub.Core
    description: ...
    thats my plugin.yml
  11. The syntax is wrong I think check out the article on it.
  12. I'd recommend you to change the name of your command, as "help" is already a command. The syntax of your plugin.yml looks good, although I am wondering why you have a command named "1".

    Could you correctly paste every Java class in your plugin (spoiler with file name + Java code tag) ?