Jump to content

How to check if chat says "word"


Recommended Posts

Posted

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...