Vanish Plugin Help

Discussion in 'Plugin Development' started by LokaToka, May 5, 2015.

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

    LokaToka

    Code:
        int[] ids = new int[1];
        ids[0] = p.getEntityId();
     
        PacketPlayOutEntityDestroy pack = new PacketPlayOutEntityDestroy(ids);
    
        for (Player pp : Bukkit.getServer().getOnlinePlayers())
        {
            if (! pp.equals(p))
            {
                ((CraftPlayer) pp).getHandle().playerConnection.sendPacket(pack);
            }
    
        }             
     
    
                    }
    Okay, so far I have it so that the player goes completely invisible; working fine (shown above).

    Basically, my above code is kind of useless to you guys, that is just me showing how I make the player disappear, what I need to know is the packet that makes the player(s) "reappear" if you will.

    Any help will be appreciated.
     
  2. Offline

    mine-care

    @LokaToka hmm may I ask why you are using a packet for that? You can simply use the bukkit's hidePlayer and showPlayer methods found in Player interface and further more in CraftPlayer (the implementation)
     
  3. Offline

    Garnetty

    Do what mine care said or throw in a PacketPlayOutNamedEntitySpawn
     
  4. Offline

    567legodude

    @LokaToka If you decide to use the hidePlayer() method, remember, that only hides one player from another player. So to hide that player from everyone, you need to loop through the players on the server and them for everyone. Also note that you need to hide the player when someone joins the server.
     
Thread Status:
Not open for further replies.

Share This Page