Plugin HideAllPlayers

Discussion in 'Spigot Plugin Development' started by KazzLutor, May 29, 2016.

  1. Hello very good morning, I would like to know if there is any way to make a plugin that you join a server you hide all your players less, and that the names can not hide the tab ??

    If you know the answer I want you to leave me please, I'm looking for ways to get that plugin but can not find it anywhere and I want to know if any of you know

    Greetings ^^
     
  2. I know a method, where you can hide all players, also in the tab. Maybe it can help you:
    Code (Text):

    for (Player players : Bukkit.getOnlinePlayers()) {
       player.hidePlayer(players);
    }
     
     
  3. No but I do not want the names are hidden in the tab, but quite the opposite, that is all show.

    Know that way too?
     
  4. Sorry, i only know this method.
     
  5. Try using packets.. Here is a code:

    Code (Text):
    ((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(hidden.getName(), true, 10));
     
  6. This small error as I can solve: http://prntscr.com/b9uezn

    I'm just new to the issue of programming and em is costing a lot find this error
     
  7. "Hidden" hasn't been assigned to a variable. Just change it to whatever is cast to your player method.
     
  8. Still struggling with this?
     
  9. You must assign "hidden" to a player variable.

    For example, I will create a method to hide a specific player:


    Code (Text):
    public void hidePlayer(Player hidden) {
        ((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(hidden.getName(), true, 10));
    }
    That must works.

    For execute it:
    hidePlayer(Bukkit.getServer().getOnlinePlayer("ExamplePlayer"));
     
  10. You could try to do something with ProtocolLib and send the players the WrappedGameProfile's for the tab list.

    Or, what also could do is give all the players an invisible potion effect and set te particle flag to false. ;)
     
  11. The potion is an option, but you'll see the foot particles, and you will not see your hand.
     
    • Agree Agree x 1
  12. It's basically a last resort :p
     
    • Like Like x 1