Search in sources :

Example 1 with Ambient

use of org.bukkit.entity.Ambient in project TotalFreedomMod by TotalFreedom.

the class Command_mobpurge method purgeMobs.

public static int purgeMobs() {
    int removed = 0;
    for (World world : Bukkit.getWorlds()) {
        for (Entity ent : world.getLivingEntities()) {
            if (ent instanceof Creature || ent instanceof Ghast || ent instanceof Slime || ent instanceof EnderDragon || ent instanceof Ambient) {
                ent.remove();
                removed++;
            }
        }
    }
    return removed;
}
Also used : Entity(org.bukkit.entity.Entity) Creature(org.bukkit.entity.Creature) EnderDragon(org.bukkit.entity.EnderDragon) Ambient(org.bukkit.entity.Ambient) Ghast(org.bukkit.entity.Ghast) World(org.bukkit.World) Slime(org.bukkit.entity.Slime)

Aggregations

World (org.bukkit.World)1 Ambient (org.bukkit.entity.Ambient)1 Creature (org.bukkit.entity.Creature)1 EnderDragon (org.bukkit.entity.EnderDragon)1 Entity (org.bukkit.entity.Entity)1 Ghast (org.bukkit.entity.Ghast)1 Slime (org.bukkit.entity.Slime)1