Player Count

Discussion in 'Spigot Plugin Development' started by Orionweblab, Apr 16, 2017.

  1. How do I modify the player count, I'm making my own plugins and I need a way to take 1 from the player count to make it seem that the player isn't actually there?
    Edit: It's for an invisibility plugin
     
  2. You can modify the ServerListPingEvent with this simple method:

    Code (Text):

    @EventHandler
    public void onServerListPing(ServerListPingEvent event) {
       
        Iterator<Player> online = event.iterator();

       while (online.hasNext()) {
           Player player = online.next();
           if(player.getName().equals("UserName")){
             online.remove();
         }
       }

    }
     
     
    • Agree Agree x 1
    • Informative Informative x 1