Force pathfind a living entity to a location

Discussion in 'Plugin Development' started by orange451, Sep 12, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    orange451

    How would I go about force path-finding a living entity to a location? Say I have a cow, and I want to path-find to a location behind a wall in front of it.

    I've seen this in CraftBukkit:
    EntityLiving.getNavigation();

    and I think it could be of some use, however, I do not know how to properly use it.
     
  2. Offline

    SirTyler

    You may have to override its navigation class, I don't know if that's the only way though.
     
  3. Offline

    orange451

    Any more help would be greatly appreciated :)

    Bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  4. Offline

    stirante

    Try this:
    Code:
    (((CraftCow)cow).getHandle()).pathEntity = ((CraftWorld)cow.getWorld()).getHandle().findPath(cow, player, 16.0F, true, false, false, false);
     
  5. Offline

    orange451

    Let's pretend the cow in the original post isn't a cow, but a fake player from my npc spawning library, and the EntityPlayer class doesn't have a pathEntity variable
    D:
     
  6. Offline

    devilquak

    I'd like to know this too, it'd be fun to do stuff like this with various mobs.
     
  7. Offline

    orange451

  8. Offline

    orange451

    Bump
    Any help would be greatly appreciated.

    Again, I would really love some help.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
Thread Status:
Not open for further replies.

Share This Page