Simple code to make NPCs (which will only be seen be the player who receives the packet)
There are bunch of methods for entityplayer, so it's fairly easy to set its rotation, wether its swimming, etc
Result ^
I’m not a nms expert, so you’re better off asking on Spigot tbh
bai
Code:
PlayerConnection pc = ((CraftPlayer) p).getHandle().playerConnection;
WorldServer world = ((CraftWorld) p.getLocation().getWorld()).getHandle();
MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
EntityPlayer ep = new EntityPlayer(server, world, new GameProfile(p.getUniqueId(), ""), new PlayerInteractManager(world));
ep.world = ((CraftWorld) p.getLocation().getWorld()).getHandle();
ep.setLocation(p.getLocation().getX(), p.getLocation().getY(), p.getLocation().getZ()+2, 20, 0);
pc.sendPacket(new PacketPlayOutNamedEntitySpawn(ep));
Result ^
I’m not a nms expert, so you’re better off asking on Spigot tbh
bai