Help with Navigation

Discussion in 'Plugin Development' started by Saith1998, Oct 9, 2015.

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

    Saith1998

    Is it possible to set the Navigation of an enderdragon or a bat.
    Because this code
    Code:
    EntityInsentient ce =(EntityInsentient)((CraftEntity) e).getHandle();
           
               
             Navigation nav = ce.getNavigation();
             nav.a(endloc.getX(), endloc.getY(), endloc.getZ(), 1.5f);
    doesnt work
     
  2. Offline

    Halmerson

    @Saith1998
    Have you tried it? xD

    My bad, I didn't read where it said, "doesnt work"
     
    Last edited: Oct 9, 2015
  3. @Halmerson
    Well, he did say that it doesn't work, so I'm assuming he has tried it.

    @Saith1998
    I'm not sure about bats, but enderdragons are very complex entities so they probably can't be moved using this method. I've never used it before so this may not be true.
     
  4. Offline

    Scimiguy

    I feel like you'd have to invoke a method to set that navigation into the entity
    @Saith1998
     
  5. @Scimiguy
    That's what the "a" method does.
     
  6. Offline

    Scimiguy

    @Assist
    My apologies, confused this thread with another

    Anyway..

    @Saith1998
    What if you skip the entityInsentient cast and go straight with the handle? I've known that to work in the past
    Code:
    Object e = ((CraftEntity) e).getHandle();
    e.getNavigation().a(endloc.getX(), endloc.getY(), endloc.getZ(), 1.5f);
     
  7. Offline

    Scimiguy

    I'm aware Object doesn't, I couldn't remember exactly what getHandle() returns.
    My example is an example, not copy-paste code (It never should be)

    And I'm not sure, since I've used that exact code before, and it's been fine.
    @Assist
     
Thread Status:
Not open for further replies.

Share This Page