Redfr3sh Posted July 15, 2017 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
Team Cape Posted July 15, 2017 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