Running the Plugin

Discussion in 'Plugin Development' started by Phishy, Nov 26, 2014.

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

    Phishy

    So I'm new to plugin making, and I've made a basic plugin with a basic command, I exported the plugin the way the guide says to, I've put it into my plugins folder and run the server, however for some reason the command doesn't work ingame, and it's as if the plugin isnt there?

    Anybody know the issue?

    Feel free to ask more information,


    Thanks.
     
  2. Online

    timtower Administrator Administrator Moderator

  3. Offline

    Dragonphase

    Phishy

    When you say you're new to plugin making, does that also include "new to Java" or "new to Programming"?
     
    teej107 likes this.
  4. Offline

    Skionz

    Phishy You should get a stack-trace in the console when the server starts up saying that your plugin could not be enabled for whatever reason. My guess is something is wrong with your plugin.yml but we won't know for sure until we see the log.
     
  5. Offline

    Phishy

  6. Online

    timtower Administrator Administrator Moderator

    Phishy Did you export it to the right location?
     
  7. Offline

    Phishy

    timtower What do you mean by the right location?
     
  8. Offline

    JordyPwner

    Phishy can you post our full classes?
     
  9. Online

    timtower Administrator Administrator Moderator

    Phishy Did you export it to the plugins folder?
     
  10. Offline

    Skionz

    Phishy No plugins are being enabled in that log so you probably did not export it correctly.
     
  11. Offline

    Phishy

    timtower Skionz

    Tim, yes I did

    Skionz, any idea what I might be doing wrong?
     
  12. Online

    timtower Administrator Administrator Moderator

    Phishy Post a screenshot of your plugins folder please.
     
  13. Offline

    Phishy

  14. Offline

    jthort

    *Cough*

    [​IMG]
     
  15. Offline

    Gater12

    Phishy
    Did you compile to a JAR file format?
     
  16. Online

    timtower Administrator Administrator Moderator

  17. Offline

    jthort

  18. Offline

    Phishy

    Gater12

    No, I did what the video did

    timtower

    When I export it says *.Jar;*.Zip
     
  19. Online

    timtower Administrator Administrator Moderator

    jthort i have my reasons about it. Last thing that I say about it here.
    Phishy Please upload the file to dropbox and post a link here, then we can check it.
     
  20. Offline

    Phishy

    Last edited by a moderator: Jun 29, 2016
  21. Offline

    Gater12

    Phishy
    It's not a JAR file.
     
  22. Offline

    JordyPwner

    Phishy Normally i do not spoonfeed but cause im happy today :p

    Here you go:
    Show Spoiler

    Code:java
    1. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
    2.  
    3. if(!(sender instanceof Player)){
    4. sender.sendMessage("Only Players can do this!");
    5. }
    6. if(cmd.getName().equalsIgnoreCase("Hello")){
    7. sender.sendMessage("Hello " + sender.getName() + "!");
    8. }
    9. return false;
    10.  
    11.  
    12. }


    And on enable put this:
    Show Spoiler
    Code:java
    1. getCommand("Hello").setExecutor(this);

    And register the Command in the plugin.yml
     
  23. Offline

    Phishy

    Gater12 How do I make it into a jar file?


    JordyPwner Thanks, I did all that, and it still doesn't work, I have a feeling its something to do with exporting, any ideas?
     
  24. Offline

    Gater12

    Phishy
    Did you choose to compile to a JAR file at the beginning of the Export process?
     
  25. Online

    timtower Administrator Administrator Moderator

    Phishy You change the file extension when exporting it.
     
  26. Offline

    mythbusterma

  27. Online

    timtower Administrator Administrator Moderator

    JordyPwner The executor line isn't even needed. Only when the executor is a different class.
     
  28. Offline

    JordyPwner

    my bad :p
     
  29. Offline

    Phishy

    Gater12

    Yes I did.

    timtower

    I don't get that option? or am I missing something?
     
  30. Online

    timtower Administrator Administrator Moderator

    Phishy You can pick the file for the name yourself, you probably have .zip at the end
     
Thread Status:
Not open for further replies.

Share This Page