Redfr3sh Posted July 15, 2017 Share Posted July 15, 2017 Right now i am using this to detect if player says number if (player != null && m.getUsername().equalsIgnoreCase(player.getName())) { log("player has spoken"); if (m.getMessage().matches(".*\\d+.*")) { hasSpoken = true; } but when i change (".*\\d+.*") to "certain word" it doesn't detect it how to i get this to work Quote Link to comment Share on other sites More sharing options...
Team Cape Posted July 15, 2017 Share Posted July 15, 2017 (edited) Use contains if you want to check for the word anywhere in what they said or use equals if you want an exact match m.getMessage().contains("doge"); Edited July 15, 2017 by Imateamcape Quote Link to comment Share on other sites More sharing options...
Alek Posted July 18, 2017 Share Posted July 18, 2017 Chatbox getMessages(Chatbox.MessageType messageType) Quote Link to comment Share on other sites More sharing options...