Villager Speed

Discussion in 'Plugin Development' started by TomTheDeveloper, Mar 20, 2013.

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

    TomTheDeveloper

    How can i reduce the speed of a Villager?
    Code:java
    1. Villager villagers = (Villager) zombiespawn.getWorld().spawnEntity(zombiespawn, EntityType.VILLAGER);
    2. villagers

    How do i reduce the speed of the villagers?
     
  2. Offline

    Nitnelave

    I don't think you can. What you could do, if it is essential for you, is to subclass the villager class, and everytime a villager is spawned, you replace it with your own villager. And in the custom class, you can probably reduce the speed.
     
  3. Offline

    TomTheDeveloper

    Nitnelave
    It is essential to me, but what do you mean by creating a subclass?
    What for subclass, and how do i code it?
     
  4. Offline

    MCForger

    You would follow a tutorial like this except invoke for a villager and you might need to look up the villager's methods.
    Link to tutorial for Zombies's here.
    From what I remember I believe their is a method to set the speed of your new version of a villager.
     
  5. Offline

    HeyShibby

    You could just add a slowness potion to the village as soon as it spawns?
     
    crushh87 likes this.
  6. Offline

    nisovin

    You don't really need to subclass, you can modify the values on the normal villager objects as they are spawned. Either way, it's well outside of the Bukkit API, so you'll be mostly on your own if you decide to do that. Adding a slowness potion effect would be simpler by far, but obviously has some downsides.
     
Thread Status:
Not open for further replies.

Share This Page