Examples of LivingEntity


Examples of org.bukkit.entity.LivingEntity

    int killCount = 0;
   
    for (Entity entity : entities){
      EntityType eType = entity.getType();
      if (eType.isAlive() && eType.isSpawnable()){
        LivingEntity lEntity = (LivingEntity) entity;
        String typeOfEntity = Utils.typeOfEntity(entity.getType());
        if (typeOfEntity.equalsIgnoreCase(typeToKill) || typeToKill.equalsIgnoreCase("all")
            || eType == ClosestMatches.livingEntity(typeToKill).get(0)){
         
          lEntity.remove();
          killCount++;
         
          if (lightning){
            entity.getWorld().strikeLightningEffect(entity.getLocation());
          }
View Full Code Here

Examples of org.bukkit.entity.LivingEntity

     */
    private final boolean RANDOM = false;
   
    @Override
    public void execute(Arena arena, MABoss boss) {
        LivingEntity target = AbilityUtils.getTarget(arena, boss.getEntity(), RANDOM);
        if (target == null) return;
       
        Location loc = target.getLocation();
        loc.setYaw(loc.getYaw() + 45 + AbilityUtils.random.nextInt(270));
        target.teleport(loc);
    }
View Full Code Here

Examples of org.bukkit.entity.LivingEntity

    private final int AFTERBURN = 40;
   
    @Override
    public void execute(final Arena arena, MABoss boss) {
        // Grab the target, or a random player.
        LivingEntity target = AbilityUtils.getTarget(arena, boss.getEntity(), true);
       
        // We only want players.
        if (target == null || !(target instanceof Player))
            return;
View Full Code Here

Examples of org.bukkit.entity.LivingEntity

     */
    private final int TICKS = 1;
   
    @Override
    public void execute(Arena arena, MABoss boss) {
        final LivingEntity target = AbilityUtils.getTarget(arena, boss.getEntity(), true);
        if (target == null || !(target instanceof Player))
            return;
       
        Player p = (Player) target;
        Location loc = p.getLocation();
View Full Code Here

Examples of org.bukkit.entity.LivingEntity

     */
    private final boolean RANDOM = true;
   
    @Override
    public void execute(Arena arena, MABoss boss) {
        LivingEntity target = AbilityUtils.getTarget(arena, boss.getEntity(), RANDOM);
        if (target == null) return;
       
        target.teleport(boss.getEntity());
    }
View Full Code Here

Examples of org.bukkit.entity.LivingEntity

                // Grab a spawnpoint
                Location spawnpoint = spawnpoints.get(index % totalSpawnpoints);

                // Spawn the monster
                LivingEntity e = entry.getKey().spawn(arena, world, spawnpoint);

                // Add it to the arena.
                monsterManager.addMonster(e);

                // Set the health.
                e.resetMaxHealth(); // Avoid conflicts/enormous multiplications from other plugins handling Mob health
                int health = (int) Math.max(1D, e.getMaxHealth() * mul);
                e.setMaxHealth(health);
                e.setHealth(health);

                // Switch on the type.
                switch (w.getType()){
                    case BOSS:
                        BossWave bw = (BossWave) w;
                        double maxHealth = bw.getMaxHealth(playerCount);
                        MABoss boss = monsterManager.addBoss(e, maxHealth);
                        boss.setReward(bw.getReward());
                        boss.setDrops(bw.getDrops());
                        bw.addMABoss(boss);
                        bw.activateAbilities(arena);
                        if (bw.getBossName() != null) {
                            e.setCustomName(bw.getBossName());
                            e.setCustomNameVisible(true);
                        }
                        break;
                    case SWARM:
                        health = (int) (mul < 1D ? e.getMaxHealth() * mul : 1);
                        health = Math.max(1, health);
                        e.setHealth(Math.min(health, e.getMaxHealth()));
                        break;
                    case SUPPLY:
                        SupplyWave sw = (SupplyWave) w;
                        monsterManager.addSupplier(e, sw.getDropList());
                        break;
View Full Code Here

Examples of org.bukkit.entity.LivingEntity

     */
    private final boolean RANDOM = false;
   
    @Override
    public void execute(Arena arena, MABoss boss) {
        LivingEntity target = AbilityUtils.getTarget(arena, boss.getEntity(), RANDOM);
        if (target == null) return;

        Location bLoc = boss.getEntity().getLocation();
        Location loc  = target.getLocation();
        Vector v      = new Vector(loc.getX() - bLoc.getX(), 0, loc.getZ() - bLoc.getZ());
       
        target.setVelocity(v.normalize().setY(0.8));
    }
View Full Code Here

Examples of org.bukkit.entity.LivingEntity

     */
    private final int TICKS = 10;
   
    @Override
    public void execute(Arena arena, MABoss boss) {
        final LivingEntity target = AbilityUtils.getTarget(arena, boss.getEntity(), true);
        if (target == null || !(target instanceof Player))
            return;
       
        strikeLightning(arena, (Player) target, new ArrayList<Player>());
    }
View Full Code Here

Examples of org.bukkit.entity.LivingEntity

     */
    private final boolean RANDOM = false;
   
    @Override
    public void execute(Arena arena, MABoss boss) {
        LivingEntity target = AbilityUtils.getTarget(arena, boss.getEntity(), RANDOM);
        if (target == null) return;
       
        Location loc  = target.getLocation();
        Location bLoc = boss.getEntity().getLocation();
        Vector v      = new Vector(bLoc.getX() - loc.getX(), 0, bLoc.getZ() - loc.getZ());
       
        double a = Math.abs(bLoc.getX() - loc.getX());
        double b = Math.abs(bLoc.getZ() - loc.getZ());
        double c = Math.sqrt((a*a + b*b));
       
        target.setVelocity(v.normalize().multiply(c*0.3).setY(0.8));
    }
View Full Code Here

Examples of org.bukkit.entity.LivingEntity

    private final int FUSE = 80;
   
    @Override
    public void execute(final Arena arena, MABoss boss) {
        // Grab the target, or a random player.
        LivingEntity target = AbilityUtils.getTarget(arena, boss.getEntity(), true);
       
        final World world = arena.getWorld();
        final Location loc;

        Block b = world.getBlockAt(target.getLocation());
        for (int i = 0; i < 3; i++) {
            if (b.getType() == Material.AIR) {
                break;
            }
            b = b.getRelative(BlockFace.UP);
        }
        loc = b.getLocation();

        if (b.getType() != Material.AIR) {
            Messenger.warning("Failed to place Obsidian Bomb at: " + target.getLocation());
            return;
        }

        b.setType(Material.OBSIDIAN);
        arena.addBlock(b);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.