Multiple Classes giving no response

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

  1. #1 Hibba, Apr 15, 2017
    Last edited: Apr 15, 2017
  2. You have to add the commands to plugin.yml

    OnEnable should be onEnable()
    OnDisable should be onDisable()

    Case sensitive stuff
     
  3. Sorry i forgot to show you the plugin.yml i think already have added it correct
    https://pastebin.com/pLVaCt7U
     
  4. Wait but i already have onEnable and Disable with the ()
     
  5. Yeah don't change that

    Code (Text):
    package com.hibba.plugin;

    import java.util.logging.Logger;

    import org.bukkit.event.Listener;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.java.JavaPlugin;

    import commands.captcha;
    import commands.spawn;

    public class Plugin extends JavaPlugin implements Listener {

        public void onEnable() {
            this.getCommand("spawn").setExecutor(new spawn());
            this.getCommand("captcha").setExecutor(new captcha());
            //PluginDescriptionFile pdfFile = getDescription();
            //Logger logger = getLogger();

            // No need as spigot/bukkit already does that
            //logger.info(pdfFile.getName() + "Plugin loaded! (Version"
            //        + pdfFile.getVersion() + ")");
        }

        public void onDisable() {
            //PluginDescriptionFile pdfFile = getDescription();
            //Logger logger = getLogger();

            // No need as spigot/bukkit already does that
            //logger.info(pdfFile.getName() + "Plugin Not Loaded! (Version"
            //        + pdfFile.getVersion() + ")");

        }
    }
     
  6. YOURE A GOD WHAT DID YOU CHANGE???? IVE BEEN TRYING TO FIX IT AND IVE BEEN LOOKING FOR 3 HOURS
     
  7. If this was git you would see changes in your main class that would make it have WAYY less lines.

    I took out obsolete logging, changes to method names ("OnEnable" -> "onEnable" and "OnDisable" -> "onDisable")
     
    • Agree Agree x 1
  8. Stick to the java conventions, and add the @Override annotation whenever overriding methods, it'll save you from these kind of issues :p
     
    • Agree Agree x 3