[URGENT] Making a NPC Sleep

Discussion in 'Plugin Development' started by ExtendedHorizons, May 29, 2015.

Thread Status:
Not open for further replies.
  1. How could I make an NPC sleep? right now im using this code:
    Code:
    public static void setSleeping(Player c, Location loc) {
    BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());PacketPlayOutBed bedpacket = new PacketPlayOutBed(((CraftPlayer) c).getHandle(), blockPos); for (Player p : Bukkit.getOnlinePlayers()) {
    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bedpacket);}
    }
    
    And now I need to create a NPC with the players skin and make it sleep. The thing is that the PacketPlayOutBed requires a EntityHuman so I dont know how to make a NPC that works/is classified as a EntityHuman.
     
  2. Offline

    mine-care

  3. Offline

    N00BHUN73R

    @mine-care
    Yes, he want's another Human NPC so he can pass it as an argument in the PacketPlayOutBed, but he does not know how to create another fake human entity.
     
  4. Exactly.. Right now im checking ProtocolLib though so.
     
  5. @ExtendedHorizons This doesn't seem urgent. Please don't mark your threads as such, as it's rude to other people.
     
Thread Status:
Not open for further replies.

Share This Page