Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CustomNpc {
- private EntityPlayer npc;
- protected CustomNpc() {
- MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
- WorldServer world = ((CraftWorld) Bukkit.getServer().getWorlds().get(0)).getHandle();
- npc = new EntityPlayer(server, world, new GameProfile(UUID.randomUUID(), ChatColor.AQUA + "Я мразь"), new PlayerInteractManager(world));
- }
- protected void teleport(Location loc, Player p) {
- npc.teleportTo(loc, false);
- PlayerConnection connection = ((CraftPlayer)p).getHandle().playerConnection;
- connection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, npc));
- connection.sendPacket(new PacketPlayOutNamedEntitySpawn(npc));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement