Whitelisted players

Discussion in 'Plugin Development' started by RikiMaus, Jul 1, 2024.

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

    RikiMaus

    How to check if player in whitelist was on a server?
     
  2. Offline

    timtower Administrator Administrator Moderator

    @RikiMaus They can't be on the server if they are not whitelisted...
     
  3. Offline

    RikiMaus

    If I write command /whitelist add Test10109292992 I add this player to whitelist, but it has never been on a server
     
  4. Offline

    timtower Administrator Administrator Moderator

    See if somebody in the offline players has that name.
    That list does not update when the user updates their username though.
     
  5. Offline

    RikiMaus

    Like:

    List<OfflinePlayers> offlinePlayers = new ArrayList<>(getServer.getWhitelistedPlayers());
    List<OfflinePlayers> players = new ArrayList<>();

    for (OfflinePlayer offlinePlayer : offlinePlayers) {

    if (offlinePlayer.hasPlayedBefore() {

    players.add(offlinePlayer);

    }
    }

    ?
     
  6. Offline

    timtower Administrator Administrator Moderator

    @RikiMaus Could be, but I don't know what your usecase is for this.
     
  7. Offline

    RikiMaus

    Thank you it's working
     
Thread Status:
Not open for further replies.

Share This Page