Sometimes you have to send a long message using Player.sendMessage(). If you do it normally, it would be cut like this: Code: "This is a long message. This is a long message. This is a lo ng message. This is a long message." Nobody wants that, right? To prevent that, you need to wordwrap it. If we do that, it cuts like this: Code: "This is a long message. This is a long message. This is a long message. This is a long message." Much better, right? To do this, I have made a short function for you guys that returns a String array with the lines correctly wrapped. Since sendMessage() also takes a String array, it's as simple as just sending whatever this function returns. So here it is: Code:java public static String[] wordWrap(String s) { return ChatPaginator.wordWrap(s, ChatPaginator.GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH);} Hope you like it!
Oddly, I've never had a problem where Player.sendMessage() split the string in the middle of a word. Still a cool find in case I ever have that problem!