Package org.bukkit.entity

Examples of org.bukkit.entity.Fireball


    }
   
    Player player = (Player) sender;
    Location eye = player.getEyeLocation().add(0.5, 0.5, 0.5);
    Vector v = eye.getDirection().multiply(2);
    Fireball entity = player.getWorld().spawn(eye.add(v.getX(), v.getY(), v.getZ()), (!smallFireball ? Fireball.class : SmallFireball.class));
    entity.setShooter(player);
    entity.setVelocity(eye.getDirection().multiply(2));
   
    LogHelper.showInfo("fireballSuccess", sender);
    return true;
  }
View Full Code Here


      }
    }
   
    // normal fireball
    if (killer instanceof Fireball){
      Fireball fireball = (Fireball) killer;
      // check if ghast
      if (fireball.getShooter() instanceof Ghast){
        message = replacements(config.getString("deathGhast"), victim);
      }
     
      // check if blaze
      if (fireball.getShooter() instanceof Blaze){
        message = replacements(config.getString("deathBlaze"), victim);
      }
    }
   
    if (message != null){
View Full Code Here

    for (final Object shooter : shooters.getArray(e)) {
      for (final EntityData<?> d : types.getArray(e)) {
        if (shooter instanceof LivingEntity) {
          final Vector vel = dir.getDirection(((LivingEntity) shooter).getLocation()).multiply(v.doubleValue());
          if (Fireball.class.isAssignableFrom(d.getType())) {// fireballs explode in the shooter's face by default
            final Fireball projectile = (Fireball) ((LivingEntity) shooter).getWorld().spawn(((LivingEntity) shooter).getEyeLocation().add(vel.clone().normalize().multiply(0.5)), d.getType());
            ProjectileUtils.setShooter(projectile, shooter);
            projectile.setVelocity(vel);
            lastSpawned = projectile;
          } else if (Projectile.class.isAssignableFrom(d.getType())) {
            final Projectile projectile = ((LivingEntity) shooter).launchProjectile((Class<? extends Projectile>) d.getType());
            set(projectile, d);
            projectile.setVelocity(vel);
            lastSpawned = projectile;
          } else {
            final Location loc = ((LivingEntity) shooter).getLocation();
            loc.setY(loc.getY() + ((LivingEntity) shooter).getEyeHeight() / 2);
            final Entity projectile = d.spawn(loc);
            if (projectile != null)
              projectile.setVelocity(vel);
            lastSpawned = projectile;
          }
        } else {
          final Vector vel = dir.getDirection((Location) shooter).multiply(v.doubleValue());
          final Entity projectile = d.spawn((Location) shooter);
          if (projectile != null)
            projectile.setVelocity(vel);
          lastSpawned = projectile;
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.bukkit.entity.Fireball

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.