Solved [Zombie Navigator Methods] .a(...) is returning false.

Discussion in 'Plugin Development' started by gcflames5, Mar 28, 2013.

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

    gcflames5

    Code:java
    1. Zombie s = (Zombie) e;
    2. EntityCreature ec = ((CraftZombie) e).getHandle();
    3. Block to = target.getLocation().getBlock();
    4. PathEntity pf = ((CraftWorld) to.getWorld()).getHandle().a(ec, to.getX(), to.getY(), to.getZ(), 16.0F, true, false, false, true);
    5. Navigation nav = ec.getNavigation();
    6. //nav.a(pf, speed);
    7. //Boolean a = nav.a(pf, speed);
    8. ec.setPathEntity(pf);
    9. ec.setGoalTarget((EntityLiving) target);
    10. //Bukkit.getLogger().info(a.toString());


    At first, I tried the commented out code. The line: Boolean a = nav.a(pf, speed); kept returning false, indicating that the navigator rejected it. ec.setPathEntity(pf) and ec.setGoalTarget don't seem to work either. The target is not null, and when this code runs, the zombies wander around like they normally would. Any help would be appreciated!

    (I am certain this code runs by the way)
    (I am running 1.5.1 R0.1 Latest as of this post)
     
  2. Offline

    skipperguy12

    Hmmmm...this is confusing...i'm thinking...
     
  3. Offline

    dillyg10

    From hours of painfullness, what your trying to do won't work.

    I would cut your losses, and look at API's such as RemoteEntties and MobAPI, they have exactly what your looking for ;).
     
  4. Offline

    gcflames5

    Ok, I'll take a look. This works perfectly with villagers though!

    Naviagtion .a() seems to work in a 20 block radius, otherwise, the navigator rejects it.

    Got it! The navigator won't accept paths over a certain distance, so I created method that creates "checkpoints" along a path to a end location, so that I can use the new Bukkit AI.

    Thanks for you help guys!

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

    dillyg10

    Mind sharing the code you have? Been trying to get a similar problem solved, and your code might just do the trick.
     
    unforgiven5232 likes this.
Thread Status:
Not open for further replies.

Share This Page