Solved help!

Discussion in 'Plugin Development' started by StihlBlade86, Jun 26, 2015.

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

    StihlBlade86

    how would i make it so the player can do the command but not the console?



    Code:
      if (sender instanceof Player) {
           sender.sendMessage(ChatColor.RED + "This command can only be used by a Player!");
           return true;
     
  2. Offline

    Gotten

    In java you use ! which basically means 'not'
    Code:
    if (!(sender instanceof Player)) {
    sender.sendMessage(ChatColor.RED + "This command can only be used by a Player!");
    return true;
    }
    So now it says if the sender is not an instance of a player, do yo thang. lol
     
  3. Offline

    StihlBlade86

    lol @Gotten i literally just figured that out xD

    thx tho!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 12, 2016
  4. Offline

    Zekrom2802

    Please mark the thread as solved.
     
Thread Status:
Not open for further replies.

Share This Page