Plugin HELP

Discussion in 'Plugin Development' started by mc_myster, Dec 31, 2014.

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

    mc_myster

    I am new to coding and i have pretty much got it, and i have been testing things such as doing commands which says something in chat such as
    /fversion
    "Frens version 1.0 by mc_myster"
    and i have just made a anti-cursing plugin but i want to know how to put them together. this is my Frens plugin code: http://pastebin.com/iNeqFzDD and this is my anti-curse code: http://pastebin.com/CRUDMqjQ so how can i put them together?
    THX allot for helping me, i am really new.
     
  2. Offline

    Gamesareme

    @mc_myster What do you mean, you can not put them together? Lets put the two together in the Frens Code. So make that code "implements Listener". That way, we can not have events in the chat code. Then in Frens Code onEnable() make so it registers the class. Then just copy in the @EventHandler and function, into the Frens Code. Done, they are not combined.
     
  3. Offline

    mc_myster

    Could you give me a example ? i dont really understand
     
  4. Offline

    teej107

    @mc_myster Move all your classes into the combined project, but merge all your code in your JavaPlugin extended classes together since there can only be one JavaPlugin extended class that can be in use.
     
  5. Offline

    mc_myster

    Im really new but i gave it a go, this is what i changed it to: http://pastebin.com/mcmyq5MW but only the commands worked, not the anti swear, what am i doing wrong ?
     
  6. Offline

    Gamesareme

    @mc_myster You will need to register the class. Add this to your onEnable()
    Code:
    Bukkit.getServer().getPluginManager().registerEvents(this, this);
     
  7. Offline

    mc_myster

    K, so does it go like this ? but what do i put in the "this, this" ?
    public void onEnable() Bukkit.getServer().getPluginManager().registerEvents(this, this); {
    logger.info("Frens plugin enabled!");
    }
     
  8. Offline

    mythbusterma

  9. Offline

    mc_myster

  10. Offline

    Jaaakee224

    @mc_myster
    You must learn Java before even attempting to do Bukkit. It's not impossible, but it will be really hard for you to use the Bukkit API on a programming language you don't even understand.
     
  11. Offline

    mc_myster

    ok, you teach me java then
     
  12. Offline

    Dragonphase

    @mc_myster

    We don't teach Java here. It's in your best interest to learn yourself.
     
  13. Offline

    mc_myster

    ok, how do i learn ? what do i search ?
     
  14. Offline

    teej107

    @mc_myster I will advise that you should not use YouTube. There are some channels out there that are just terrible and are quite popular among these forums unfortunately. This is a good site to start: http://docs.oracle.com/javase/tutorial/
     
  15. Offline

    Gamesareme

    @mc_myster I agree with the other, you do need to learn Java. Just to show you how to get your plugin to work, this is what I meant.
    Code:
    public void onEnable()  {
    logger.info("Frens plugin enabled!");
    Bukkit.getServer().getPluginManager().registerEvents(this, this);//Not how this is inside the method.
    }
     
  16. Offline

    mc_myster

    thx and i am learning java now, thx guys
     
Thread Status:
Not open for further replies.

Share This Page