Uhmm... I went into this with the whole NMS on different versions without Reflection but my friend tells me my class is reflection. Now I am just confused. Can someone please verify? Code (Java): public class FakePlayer_v1_11_R1 { public void spawnFakePlayer(Player player, Location location) { MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer(); WorldServer world = ((CraftWorld) Bukkit.getWorlds().get(0)).getHandle(); EntityPlayer npc = new EntityPlayer(server, world, new GameProfile(player.getUniqueId(), player.getDisplayName()), new PlayerInteractManager(world)); npc.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); ItemStack feet = CraftItemStack.asNMSCopy(player.getInventory().getBoots()); ItemStack legs = CraftItemStack.asNMSCopy(player.getInventory().getLeggings()); ItemStack chest = CraftItemStack.asNMSCopy(player.getInventory().getChestplate()); ItemStack head = CraftItemStack.asNMSCopy(player.getInventory().getHelmet()); ItemStack mainHand = CraftItemStack.asNMSCopy(player.getInventory().getItemInMainHand()); ItemStack offHand = CraftItemStack.asNMSCopy(player.getInventory().getItemInOffHand()); npc.setEquipment(EnumItemSlot.FEET, feet); npc.setEquipment(EnumItemSlot.LEGS, legs); npc.setEquipment(EnumItemSlot.CHEST, chest); npc.setEquipment(EnumItemSlot.HEAD, head); npc.setEquipment(EnumItemSlot.MAINHAND, mainHand); npc.setEquipment(EnumItemSlot.OFFHAND, offHand); for(Player p : Bukkit.getOnlinePlayers()){ PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection; connection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, npc)); connection.sendPacket(new PacketPlayOutNamedEntitySpawn(npc)); } } }
NMS stands for net.minecraft.server This is typically followed by a version number. This means that using that class will only work if the server is that exact version. If you have any imports using Java.lang.reflect Then you're using reflection methods Sent from my iPhone using Tapatalk
See that's what I thought. I thought reflection was an actual package and methods. Yeah no reflection import. Nothing from Java packages. Thanks guys. Lol wow.