So every time a player joins it will notify the console, I know there's a PlayerJoinEvent but how do I stop join/leave messages printing to the console because I have set up a ban system and it prints multiple lines to the clients screen, reason, date, who by, etc.. and on the console it does the same and looks like this: Just a huge bulk of text is printed to the console because of all the new lines, anyway I can stop this from happening?
oh yes you're right. what about inside the PlayerJoinEvent set the join message to null then getConsoleCommandSender then sendMessage(null);
Code (Java): // void PlayerJoinEvent e { // set the join message to null ConsoleCommandSender console = Bukkit.getServer().getConsoleCommandSender(); console.sendMessage(String message);
Code (Text): event.setJoinMessage(null); ConsoleCommandSender console = Bukkit.getServer().getConsoleSender(); console.sendMessage("[Alert] " + player.getName() + " tried to join but is currently banned!"); //player.KickPlayer(msg) Prints both
oh now I know what you're trying to do. first try to check if the player is banned, if so send message to console without setting the join message to null, use e.setCancelled(true); to stop him / her from joining.