some magic :3

Discussion in 'Plugin Development' started by Roan1, Mar 8, 2012.

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

    Roan1

    Code:
    sender.sendMessage(sender.getName());
    if(sender.getName()=="Roan") sender.sendMessage("you are Roan");
    
    [​IMG]
    but plugin don't write me "you are Roan". So... Who wants to see some magic?
    Help me please ;)

    Ooooh, I found a solution.
    Code:
    Bukkit.getServer().getPlayer("Roan").sendMessage("you are Roan");
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
  2. Offline

    SirTyler

    When using Strings, always do string.eqauls(otherString) or string.eqaulsIgnoreCase(otherString). Never == because you are comparing the object and not that data.
     
Thread Status:
Not open for further replies.

Share This Page