Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Feel free to modify and use this filter however you wish. If you don please give credit to Ceandros
- # http://Sethbling.com
- # http://youtube.com/Ceandros
- from pymclevel import TAG_List
- from pymclevel import TAG_Byte
- from pymclevel import TAG_Int
- from pymclevel import TAG_Compound
- displayName = "Delete Specific Entities"
- inputs = (
- ("Action:",("Delete in selection", "Delete in void", "Delete above world", "List coordinates")),
- ("Cattle and Environmental:", False),
- ("Villagers and Golems:", False),
- ("Tamable Mobs:", False),
- ("Monsters and Bosses:", False),
- ("Minecarts and Boats:", False),
- ("Falling Blocks:", False),
- ("Explosives:", False),
- ("Items and orbs:", False),
- ("Projectiles and Fireworks:", False),
- ("Immobile:", False),
- )
- def perform(level, box, options):
- Cattle = options["Cattle and Environmental:"]
- Village = options["Villagers and Golems:"]
- Tamable = options["Tamable Mobs:"]
- Monster = options["Monsters and Bosses:"]
- Transport = options["Minecarts and Boats:"]
- Sand = options["Falling Blocks:"]
- Explo = options["Explosives:"]
- Items = options["Items and orbs:"]
- Project = options["Projectiles and Fireworks:"]
- Paintings = options["Immobile:"]
- entitiesToRemove = []
- for (chunk, slices, point) in level.getChunkSlices(box):
- chunk.dirty = True
- for e in chunk.Entities:
- x = e["Pos"][0].value
- y = e["Pos"][1].value
- z = e["Pos"][2].value
- if x >= (box.minx - 0.5) and x < (box.maxx + 0.5) and z >= (box.minz - 0.5) and z < (box.maxz + 0.5) and ((y >= (box.miny - 0.5) and y < (box.maxy + 0.5)) or y < 0 or y > 256):
- if options["Action:"] is not "List coordinates":
- if y < 0:
- if options["Action:"] is "Delete in void":
- continue
- elif y > 256:
- if options["Action:"] is "Delete above world":
- continue
- else:
- if options["Action:"] is "Delete in selection":
- continue
- i = e["id"].value
- if Cattle:
- if i == "Bat" or i == "Chicken" or i == "Cow" or i == "MushroomCow" or i == "Pig" or i == "Sheep" or i == "Squid":
- entitiesToRemove.append((chunk, e))
- continue
- if Village:
- if i == "Villager" or i == "VillagerGolem" or i == "Snowman":
- entitiesToRemove.append((chunk, e))
- continue
- if Tamable:
- if i == "Wolf" or i == "Ozelot" or i == "eHorse":
- entitiesToRemove.append((chunk, e))
- continue
- if Monster:
- if i == "Blaze" or i == "CaveSpider" or i == "Creeper" or i == "Ghast" or i == "LavaSlime" or i == "Silverfish" or i == "Skeleton" or i == "Slime" or i == "Spider" or i == "Witch" or i == "Zombie" or i == "EnderDragon" or i == "WitherBoss":
- entitiesToRemove.append((chunk, e))
- continue
- if Transport:
- if i == "MinecartRideable" or i == "MinecartFurnace" or i == "MinecartChest" or i == "MinecartHopper" or i == "MinecartSpawner" or i == "Boat":
- entitiesToRemove.append((chunk, e))
- continue
- if Sand:
- if i == "FallingSand":
- entitiesToRemove.append((chunk, e))
- continue
- if Explo:
- if i == "PrimedTnt" or i == "EnderCrystal" or i == "FireworksRockete" or i == "MinecartTNT":
- entitiesToRemove.append((chunk, e))
- continue
- if Items:
- if i == "Item" or i == "XPOrb":
- entitiesToRemove.append((chunk, e))
- continue
- if Project:
- if i == "Arrow" or i == "Snowball" or i == "Fireball" or i == "SmallFireball" or i == "ThrownEnderpearl" or i == "EyeOfEnderSignal" or i == "ThrownPotion" or i == "ThrownExpBottle" or i == "WitherSkull" or i == "FireworksRockete":
- entitiesToRemove.append((chunk, e))
- continue
- if Paintings:
- if i == "LeashKnot" or i == "Painting" or i == "ItemFrame":
- entitiesToRemove.append((chunk, e))
- continue
- if options["Action:"] is "List coordinates":
- for (chunk, e) in entitiesToRemove:
- chunk.Entities.remove(e)
- else:
- for (chunk, e) in entitiesToRemove:
- print "%s, x=%s, y=%s, z=%s." % (e["id"].value, e["Pos"][0].value, e["Pos"][1].value, e["Pos"][2].value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement