Advertisement
ZP4RKER

Disguise Player

Feb 23rd, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.98 KB | None | 0 0
  1.         toSpawn.locX = toHide.getLocation().getX();
  2.         toSpawn.locY = toHide.getLocation().getY();
  3.         toSpawn.locZ = toHide.getLocation().getZ();
  4.         try {
  5.             Field a = toSpawn.getClass().getDeclaredField("a");
  6.             a.setAccessible(true);
  7.             a.set(toSpawn, ((CraftPlayer) toHide).getHandle().getUniqueID());
  8.             a.setAccessible(false);
  9.         } catch (NoSuchFieldException | IllegalAccessException e) {
  10.             e.printStackTrace();
  11.         }
  12.         for (Player a : Bukkit.getOnlinePlayers()) {
  13.             if (a.equals(toHide)) {
  14.                 continue;
  15.             }
  16.             for (Player b : bypass) {
  17.                 if (b.equals(a)) {
  18.                     continue;
  19.                 }
  20.             }
  21.             ((CraftPlayer) a).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityDestroy(toSpawn.getId()));
  22.             ((CraftPlayer) a).getHandle().playerConnection.sendPacket(new PacketPlayOutSpawnEntity(toSpawn, 0, 0));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement