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.
@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.
@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.
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 ?
@mc_myster You will need to register the class. Add this to your onEnable() Code: Bukkit.getServer().getPluginManager().registerEvents(this, this);
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!"); }
@mc_myster No.....you need to know Java before you can write plugins for Bukkit. http://docs.oracle.com/javase/tutorial/ Learn what a method is.
@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.
@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/
@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. }