1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Queryregenerate

Discussion in 'Development' started by LucGamesDE, Mar 23, 2017.

  1. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    How can I set the online player count every second? With the QueryRegenerateEvent I can only refresh it if a player joins.
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Create a repeating task that updates the player count every 20 ticks
     
  3. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    But how can I update it?
     
  4. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    PHP:
    /** @var Player $player */
    Server::getInstance()->updatePlayerListData($player->getUniqueId(), $player->getId(), $player->getDisplayName(), $player->getSkinId(), $player->getSkinData());
     
  5. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    But if no player is online?
     
  6. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    I'm sure there's a way to do it, but I'm just at my school right now so I can't help that much...
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.