Setting a LivingEntity's walking path

Discussion in 'Plugin Development' started by Rprrr, Feb 7, 2013.

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

    Rprrr

    Hi,

    I'm trying to set the path a spider. I want to have him walk towards a location.

    I've searched a bit, and found this little snippet:
    Code:
        public void creatureMoveTo(LivingEntity e, Location l) {
            //Speed is 0.3F.
            ((org.bukkit.craftbukkit.v1_4_R1.entity.CraftLivingEntity)e).getHandle().getNavigation().a(l.getX(), l.getY(), l.getZ(), 0.3f);
        }
    So I'm using that. But it does not seem to work: the spider simply doesn't react, the path of the spider doesn't change and the spider doesn't move any different than a spider would normally.

    So I would like to know if there's any way you can actually do this... :)

    Thanks in advance!

    Alright, so I've tested this a bit with the same code: it works with a cow, but it does not work with a spider... Any idea why? Is the mob's behaviour different? Thanks!

    Anyone? Thanks!

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

Share This Page