if(player.nick.length() > 10){ player.chat = "Nickname is limited to 10 characters!"; player.nick = player.nick.substring(0,10); }