Solved Plugin Created Not Showing up in Server

Discussion in 'Plugin Development' started by HexLazer205, Sep 9, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    HexLazer205

    Hi, I created a small plugin called TestPlugin, and I followed the bukkit wiki page to create it. I created a pom.xml and everything worked, I logged my test command properly into the plugin.yml and it even created the plugin without any errors when I ran it as Maven install. I uploaded it to my server, but it won't show up! /plugin says "Plugins (0):" and it was uploaded, I even checked. Can someone please tell me what I'm doing wrong or what I have to do?

    Code:
    package net.hexgalaxymc.testplugin;
     
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.plugin.java.JavaPlugin;
     
    public final class TestPlugin extends JavaPlugin {
     
    @Override
    public void onEnable() {
    getLogger().info("onEnable has been invoked!");
    }
     
    @Override
    public void onDisable() {
    getLogger().info("onDisable has been invoked!");
    }
     
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    if (cmd.getName().equalsIgnoreCase("command")) {
     
    sender.sendMessage("You have run the test command.");
     
    return true;
    }
    return false;
    }
     
    }
    
    And the plugin.yml:
    Code:
    name: TestPlugin
    main: net.hexgalaxymc.testplugin
    version: 1.0.0
    commands:
      command:
          description: This is a test command.
          usage: /<command> [player]
          permission: tp.command
          permission-message: You do not have the required permission <permission>
    Also, I own the domain hexgalaxymc.net, however I did not forward it to any websites, so you won't get anything by entering it in your browser. It shouldn't be the problem, but if it is, let me know, and what I can do to fix it.

    Thanks in advance :)
     
  2. Offline

    Rocoty

    In your plugin.yml you did not put the full path to the main class, so the plugin loader doesn't know which class to set as the main class
     
  3. Offline

    MrSparkzz

    HexLazer205
    as Rocoty stated, you didn't put the full path to your main class, to elaborate on it, here's what you want:
    Code:java
    1. main: net.hexgalaxymc.testplugin
    add ".TestPlugin" to the end of that.
     
  4. Offline

    HexLazer205

    If you re-read the plugin.yml, in the second line, it has the "main: net.hexgalaxymc.testplugin" already. Are you saying I have to have "TestPlugin" instead of "testplugin"? I thought I was mistakenly running it on the wrong version until I switched the version to the correct version. Sadly, the plugin still was not recognized. I am new to Java plugin development, and I am still confused as to what I have done wrong. I followed the wiki.bukkit.org/Plugin-Tutorial thoroughly, and did everything it said to set it up. I have created a test command the way it did, I put it so it outputs "You have run the test command." message to the sender, as you see in the code, and I have done all of this without any errors. No errors showed up in eclipse, it ran the maven install properly, etc., AdamQpzm what do you mean by provide full startup log?
     
  5. Offline

    teej107

    main should have the location of your JavaPlugin extended class. Location being the package it is in and the class name.
    In your case it would be: net.hexgalaxymc.testplugin.TestPlugin
     
  6. Offline

    Rocoty

    teej107 To clarify some terminology, what you refer to as location is called fully qualified name
     
    teej107 likes this.
  7. Offline

    HexLazer205

    WOW!!! Thanks so much you guys! Each of you was very helpful, thanks! I saw your posts and I found out that you meant I need net.hexgalaxymc.testplugin.TestPlugin in plugin.yml. I did that, uploaded the plugin and everything runs just as expected! Without your help, I wouldn't have been able to do this :D Thanks again!
     
Thread Status:
Not open for further replies.

Share This Page