Ok scrap that, I'm re-doing it: Could someone tell me the code for being able to make this come up with someone's name (Not Yuzko) when someone checks if they are online (Eg when they message them) -
The class has to implement the Listener interface, in the main class you have to register that event. PHP: public class PlayerJoin implements Listener { //Do the rest } That's what your main class should look like: PHP: public class MainClass extends JavaPlugin { public void onEnable() { getServer().getPluginManager().registerEvents(new PlayerJoin(), this); } //Some other stuff}
Code:java [FONT=Consolas]if(p.hasPlayedBefore()){[/FONT][FONT=Consolas] Bukkit.getServer().broadcastMessage(ChatColor.GRAY + "Welcome " + ChatColor.GOLD + p.getName() + ChatColor.GRAY + " to the server, it's their first time!");[/FONT][FONT=Consolas] }else{[/FONT][FONT=Consolas] p.sendMessage(ChatColor.GRAY + "Welcome back, " + ChatColor.GOLD + p.getName())[/FONT][FONT=Consolas][/FONT] This isn't entirely relevant to your question, but you're saying if they have played before, announce that it's their first time...what's with this weird font?
Edit, copy what is inside your CODE syntax, then click the little {}# code icon and paste in there. This way any external font will be translated to the default.