Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to find if player is Online?

Comments in 'Plugin Development' started by Hittmana, Feb 9, 2016.

  1. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Depends on what you need it for. getPlayerExact() won't help at auto completing a name(for example for a /msg command), which I actually was thinking of. Tho, edited my post:)
    HotFireyDeath likes this.
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    That's why I asked him what "the player" meant ;)
  3. Hittmana
    Offline

    Hittmana Active Member

    Joined:
    Jul 26, 2015
    Posts:
    224
    Minecraft User:
    move_it
    Player is the person in game who uses the command
  4. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    If he uses the command, he should be online, shouldn't he?
    HotFireyDeath and PEMapModder like this.
  5. Hittmana
    Offline

    Hittmana Active Member

    Joined:
    Jul 26, 2015
    Posts:
    224
    Minecraft User:
    move_it
    Whoops i mean the player he's sending the challenge to. If the other player isn't online it sends an error and crashes the server so i need to know if the other person is online
  6. Bluplayz
    Offline

    Bluplayz Active Member

    Joined:
    Aug 20, 2015
    Posts:
    74
    Minecraft User:
    Bluplayz
    PHP:
    if($player instanceof Player){//if online do szuff here}

Share This Page

Advertisement