Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- toSpawn.locX = toHide.getLocation().getX();
- toSpawn.locY = toHide.getLocation().getY();
- toSpawn.locZ = toHide.getLocation().getZ();
- try {
- Field a = toSpawn.getClass().getDeclaredField("a");
- a.setAccessible(true);
- a.set(toSpawn, ((CraftPlayer) toHide).getHandle().getUniqueID());
- a.setAccessible(false);
- } catch (NoSuchFieldException | IllegalAccessException e) {
- e.printStackTrace();
- }
- for (Player a : Bukkit.getOnlinePlayers()) {
- if (a.equals(toHide)) {
- continue;
- }
- for (Player b : bypass) {
- if (b.equals(a)) {
- continue;
- }
- }
- ((CraftPlayer) a).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityDestroy(toSpawn.getId()));
- ((CraftPlayer) a).getHandle().playerConnection.sendPacket(new PacketPlayOutSpawnEntity(toSpawn, 0, 0));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement