how to do something if a specified player logs in

Discussion in 'Plugin Development' started by chriztopia, Feb 3, 2012.

Thread Status:
Not open for further replies.
  1. Offline


    I would like to be able to automaticly set some things but I cant get the plugin to recognize that I have logged on. the IF Command doesnt work. and everything else for this class works except this so I know its registered correctly.

    String username = event.getPlayer().getName();
            if (username == "chriztopia") {
                p1.sendMessage("Hello Chris, I am Setting the time and weather for you. I have also given you OP Status.");
  2. Offline


    Don't use == when comparing strings. Use username.equalsIgnoreCase("someone's name");
    dannycrafts likes this.
Thread Status:
Not open for further replies.

Share This Page