Vanish

Vanish

124k Downloads

How to hide only in tab screen.

ElaxResources opened this issue ยท 1 comments

commented

I am trying to only hide all the connected players from the tab screen.
What part of the code should I modify to achieve this?

commented

You need to send to every player the PlayerListS2CPacket with the action "REMOVE_PLAYER", and a list of players to remove

PlayerManager playerManager = vanish.getServer().getPlayerManager();
playerManager.sendToAll(new PlayerListS2CPacket(PlayerListS2CPacket.Action.REMOVE_PLAYER, playerManager.getPlayerList()));

To reverse it you just have to send the same packet but this time with the action "ADD_PLAYER"

PlayerManager playerManager = vanish.getServer().getPlayerManager();
playerManager.sendToAll(new PlayerListS2CPacket(PlayerListS2CPacket.Action.ADD_PLAYER, playerManager.getPlayerList()));