use of net.minecraft.network.protocol.game.PacketPlayOutNamedEntitySpawn in project Nexus by ProjectEdenGG.
the class FakeNPCPacketUtils method spawnFakeNPC.
// NPCs
public static void spawnFakeNPC(HasPlayer hasPlayer, FakeNPC fakeNPC) {
EntityPlayer entityPlayer = fakeNPC.getEntityPlayer();
PacketPlayOutPlayerInfo playerInfoPacket = new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.a, entityPlayer);
PacketPlayOutNamedEntitySpawn spawnPacket = new PacketPlayOutNamedEntitySpawn(entityPlayer);
PacketPlayOutEntityHeadRotation headRotationPacket = new PacketPlayOutEntityHeadRotation(entityPlayer, PacketUtils.encodeAngle(fakeNPC.getLocation().getYaw()));
// untested
DataWatcher dataWatcher = entityPlayer.getDataWatcher();
dataWatcher.set(new DataWatcherObject<>(16, DataWatcherRegistry.a), (byte) 127);
sendPacket(hasPlayer, playerInfoPacket, spawnPacket, headRotationPacket);
spawnHologram(hasPlayer, fakeNPC);
}
Aggregations