Hide player without hidding from player list?

Discussion in 'Plugin Development' started by GaaTavares, May 3, 2014.

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

    GaaTavares

    I'm almost 100% sure this is possible (with packets, for sure) but how would I do that? Can I unvanish them again? I'm really bad with packets so any help would be appreciated.
     
  2. Offline

    xTrollxDudex

    GaaTavares
    Well, remove player and add name in player list :p
     
  3. Offline

    GaaTavares

    what do you mean by 'remove'? hide by using p.hidePlayer() then somehow update the player list?
     
  4. Offline

    xTrollxDudex

    GaaTavares
    Correct. Actually, you can take a look at the source for CraftPlayer#hidePlayer(Player) here:
    PHP:
        public void hidePlayer(Player player) {
            
    Validate.notNull(player"hidden player cannot be null");
            if (
    getHandle().playerConnection == null) return;
            if (
    equals(player)) return;
            if (
    hiddenPlayers.contains(player.getUniqueId())) return;
            
    hiddenPlayers.add(player.getUniqueId());

            
    //remove this player from the hidden player's EntityTrackerEntry
            
    EntityTracker tracker = ((WorldServerentity.world).tracker;
            
    EntityPlayer other = ((CraftPlayerplayer).getHandle();
            
    EntityTrackerEntry entry = (EntityTrackerEntrytracker.trackedEntities.get(other.getId());
            if (
    entry != null) {
                
    entry.clear(getHandle());
            }

            
    // REMOVE THIS LINE :) - xTrollxDudex
            //remove the hidden player from this player user list
            
    getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(player.getPlayerListName(), false9999));
        }
     
  5. Offline

    GaaTavares

    so I can create my own hidePlayer method, just removing the packet? would that work?
     
  6. Offline

    xTrollxDudex

Thread Status:
Not open for further replies.

Share This Page