Changing Zombie Movement speed, Health, Attack

Discussion in 'Plugin Development' started by Haxir, Jul 16, 2012.

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


    Just curious, have a plugin in development where this would be necessary. I was reading and know you can't use potion effects on mobs so that knocks out my first idea.

    Say for a special zombie, it would have x4 normal zombie health and walk x2 faster. Can it be done without spout ?
  2. ferrybig likes this.
  3. Offline


    Thank you kind sir :]
  4. that tutorial doesn't actually explain much, nor does it change the mob speed
  5. CorrieKay is our mob expert and she also has answered many threads abhout that, so use the search function.

    BTW: CorrieKay Why don't you answer to my PM? :'(
  6. an not working picture?
  7. i know she is da boss on them mobs. but there is still not to this day, a nice overview on how to change mob speed. there are a thousand threads with a solution in all of them. why not gather at one place?
    i think i almost got it, but the server get some severe errors
  8. what kind of errors, may we see those errors?
  9. yep. tried to make a plugin that changes zombie movement to make them harder. this is the errors:

    15:55:32 [SEVERE] Could not pass event CreatureSpawnEvent to DeadlierZombies
    at org.bukkit.plugin.RegisteredListener.callEvent(
    at org.bukkit.plugin.SimplePluginManager.callEvent(
    at org.bukkit.craftbukkit.event.CraftEventFactory.callCreatureSpawnEvent(CraftEventFactory.j
    at net.minecraft.server.World.addEntity(
    at net.minecraft.server.ItemMonsterEgg.a(
    at net.minecraft.server.ItemMonsterEgg.interactWith(
    at net.minecraft.server.ItemStack.placeItem(
    at net.minecraft.server.ItemInWorldManager.interact(
    at net.minecraft.server.NetServerHandler.a(
    at net.minecraft.server.Packet15Place.handle(SourceFile:39)
    at net.minecraft.server.NetworkManager.b(
    at net.minecraft.server.NetServerHandler.a(
    at net.minecraft.server.NetworkListenThread.a(
    at net.minecraft.server.MinecraftServer.w(
    Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.CraftWorld cannot be cast to net.min
    at deadlierzombies.EntityListener.onCreatureSpawn(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    ... 16 more
    15:55:32 [SEVERE] java.lang.ClassCastException: org.bukkit.craftbukkit.CraftWorld cannot be cast to
    15:55:32 [SEVERE] at deadlierzombies.Zombies.F_(
    15:55:32 [SEVERE] at net.minecraft.server.World.entityJoinedWorld(
    15:55:32 [SEVERE] at net.minecraft.server.WorldServer.entityJoinedWorld(
    15:55:32 [SEVERE] at net.minecraft.server.World.playerJoinedWorld(
    15:55:32 [SEVERE] at net.minecraft.server.World.tickEntities(
    15:55:32 [SEVERE] at net.minecraft.server.MinecraftServer.w(
    15:55:32 [SEVERE] at
    15:55:32 [SEVERE] at
    15:55:32 [SEVERE] Unexpected exception
    java.lang.ClassCastException: org.bukkit.craftbukkit.CraftWorld cannot be cast to org.bukkit.entity.
    at deadlierzombies.Zombies.F_(
    at net.minecraft.server.World.entityJoinedWorld(
    at net.minecraft.server.WorldServer.entityJoinedWorld(
    at net.minecraft.server.World.playerJoinedWorld(
    at net.minecraft.server.World.tickEntities(
    at net.minecraft.server.MinecraftServer.w(
  10. can you give
    15:55:32 [SEVERE] at deadlierzombies.Zombies.F_( line 20
    at deadlierzombies.EntityListener.onCreatureSpawn(
    entitylistener line 155
  11. Code:
        public void F_(){
            Zombie zombie = (Zombie) this.getBukkitEntity().getWorld();
            Location from = new Location(zombie.getWorld(), this.lastX, this.lastY, this.lastZ, this.lastYaw, this.lastPitch);
            Location to = new Location(zombie.getWorld(), this.locX, this.locY, this.locZ, this.yaw, this.pitch);
            EntityCreature ec = ((CraftCreature)zombie).getHandle();
            Navigation nav =;
            ZombieMoveEvent event = new ZombieMoveEvent(zombie, from, to, nav);
            if (event.isCancelled() && zombie.isDead() == false){
    public void onCreatureSpawn (CreatureSpawnEvent event) {
            Location location = event.getLocation();
            Entity entity = event.getEntity();
            EntityType entityType = event.getEntityType();
            //World world = (World) location.getWorld();
            net.minecraft.server.World mcWorld = (World) (event.getLocation().getWorld());
            net.minecraft.server.Entity mcEntity = (((CraftEntity) entity).getHandle());
            if (entityType == EntityType.ZOMBIE && mcEntity instanceof Zombies == false){
                Zombies zombies = new Zombies(mcWorld);
                zombies.setPosition(location.getX(), location.getY(), location.getZ());
                mcWorld.removeEntity((net.minecraft.server.EntityZombie) mcEntity);
                mcWorld.addEntity(zombies, SpawnReason.CUSTOM);
  12. Zombie zombie = (Zombie) this.getBukkitEntity().getWorld();
    how can a world an zombie, I think you mean
    Zombie zombie = (Zombie) this.getBukkitEntity();

    net.minecraft.server.World mcWorld = (World) (event.getLocation().getWorld());
    you cant craft an craftworld to an world, do
    net.minecraft.server.World mcWorld = ((CraftWorld) (event.getLocation().getWorld())).getHandle(); // may forget something here
  13. wow! that helped! it works! eureka! haha.
    i think the problem was the .getWorld(); part, because i had the CraftWorld part in it the first time around.
    Thanks man! i'll post the plugin github link when i get it done, so other can see.
  14. Oh gosh, i wouldnt consider myself an expert on any level with this... If i was i'd be able to answer the other thread @_@

    Um, also, dont worry, ive read it, and im giving it some thought.
  15. Well, you know more about it than the most (if not any) other devs...
    Alright. I was just worried because I saw you online but didn't got any reply. And I would really love it if you would join the team. All that I saw from you is that you have a lot of coding talent. Exactly what we need. :)
  16. Offline


    I'm having trouble with this line:
    ZombieMoveEvent event = new ZombieMoveEvent(zombie, from, to, nav);
    Eclipse reports: ZombieMoveEvent cannot be resolved to a type.

    Which import should be included for this class?
  17. zombie move event is a custom event that you need to throw in your custom zombie class whenever it moves.

    If the event is cancelled, dont do anything.
    V10lator likes this.
Thread Status:
Not open for further replies.

Share This Page