Zombie that leaves trial of fire behind

Discussion in 'Plugin Development' started by CraterHater, Jul 14, 2015.

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

    CraterHater

    I want to make a zombie that walks towards the nearest player and leaves a trial of fire blocks where he has walked, the caster of the spell should not be targeted, this is the code that summons him:
    Code:
     @EventHandler
                public void onProjectileHit2(ProjectileHitEvent event) {
                    if (event.getEntity().getType() == EntityType.EGG) {
                        Egg egg = (Egg) event.getEntity();
                        @SuppressWarnings("deprecation")
                        Player player = (Player) egg.getShooter();       
                        int value6 = getConfig().getInt(player.getName() + ".KitValue");
                        if(value6 == 5) {
                            takeKitValue(player, 5);
                        if (player.getItemInHand().getType() == Material.STONE_SWORD){
                            Location loc = egg.getLocation();
                            Entity AS = loc.getWorld().spawnEntity(loc, EntityType.ZOMBIE);
                            
     
  2. Offline

    mkezar

    Here's what you need to do :) it'll make your life MUCH easier. Store the entities previous location in a hashmap, then set a fire block at the zombies previous location! :)
    of course if your using like a Move event or something like that. If not, just create a loop that runs the placing of the fire block at the entities previous location! :)
     
  3. Offline

    CraterHater

  4. Offline

    mkezar

    Well make a hashmap (tutorials are online) then make a BukkitRunnable (tutorials online)
     
Thread Status:
Not open for further replies.

Share This Page