def lavaDispenser(x, y, z): trap = TAG_Compound() trap["id"] = TAG_String(u'Trap') items = TAG_List() item = TAG_Compound() item["id"] = TAG_Short(327) item["Damage"] = TAG_Short(0) item["Count"] = TAG_Byte(1) item["Slot"] = TAG_Byte(4) items.append(item) trap["Items"] = items trap["x"] = TAG_Int(x) trap["y"] = TAG_Int(y) trap["z"] = TAG_Int(z) return trap
def makeBookNBT(texts): book = TAG_Compound() book["id"] = TAG_String("minecraft:writable_book") book["Count"] = TAG_Byte(1) book["Damage"] = TAG_Short(0) tag = TAG_Compound() pages = TAG_List() LIMIT = 150 discarded = False for page in texts: if len(pages) < LIMIT: pages.append(TAG_String(page)) else: discarded = True if discarded == True: print "WARNING: Book length exceeded " + str( LIMIT) + " pages. Truncated!" book["tag"] = tag tag["pages"] = pages return book
def placeChestWithItems(level, things, x, y, z): CHUNKSIZE = 16 CHEST = 54 if level.blockAt( x, y, z ) != CHEST: # Don't try to create a duplicate set of NBT - it confuses the game. level.setBlockAt(x, y, z, CHEST) level.setBlockDataAt(x, y, z, randint(2, 5)) control = TAG_Compound() control["x"] = TAG_Int(x) control["y"] = TAG_Int(y) control["z"] = TAG_Int(z) control["id"] = TAG_String("minecraft:chest") control["Lock"] = TAG_String("") items = TAG_List() control["Items"] = items slot = 0 print things for thing in things: # if thing["id"].value != "minecraft:Nothing": # Handle empty slots if True: item = TAG_Compound() items.append(item) item["Slot"] = TAG_Byte(slot) slot += 1 for key in thing.keys(): item[key] = thing[key] try: chunka = level.getChunk((int)(x / CHUNKSIZE), (int)(z / CHUNKSIZE)) chunka.TileEntities.append(control) chunka.dirty = True except ChunkNotPresent: print "ChunkNotPresent", (int)(x / CHUNKSIZE), (int)(z / CHUNKSIZE)
def makeMobSpawnerNBT(type): obj = TAG_Compound() obj["id"] = TAG_String("minecraft:mob_spawner") obj["MaxNearbyEntities"] = TAG_Short(6) obj["RequiredPlayerRange"] = TAG_Short(8) obj["SpawnCount"] = TAG_Short(1) obj["MaxSpawnDelay"] = TAG_Short(800) obj["Delay"] = TAG_Short(371) obj["SpawnRange"] = TAG_Short(4) obj["MinSpawnDelay"] = TAG_Short(200) spawnData = TAG_Compound() obj["SpawnData"] = spawnData spawnData["id"] = TAG_String(type) spawnPotentials = TAG_List() obj["SpawnPotentials"] = spawnPotentials entity = TAG_Compound() spawnPotentials.append(entity) entity["Entity"] = TAG_Compound() entity["Entity"]["id"] = TAG_String(type) entity["Weight"] = TAG_Int(1) return obj
def createChestBlockData(x, y, z, options, seedtag, ItemsSmokeBox): foo = ['nether_bridge', 'village_blacksmith', 'stronghold_crossing', 'spawn_bonus_chest', 'jungle_temple', 'simple_dungeon', 'igloo_chest','end_city_treasure' , 'desert_pyramid', 'abandoned_mineshaft'] chest = TAG_Compound() chest["y"] = TAG_Int(y) if options["(1.11+)"]: chest["id"] = TAG_String("chest") else: chest["id"] = TAG_String("Chest") chest["x"] = TAG_Int(x) chest["z"] = TAG_Int(z) items = TAG_List() minecraftchest = TAG_Compound() minecraftchest["id"] = TAG_String(u'minecraft:chest') minecraftchest["Damage"] = TAG_Short(0) minecraftchest["Count"] = TAG_Byte(64) tag = TAG_Compound() blockEntityTag = TAG_Compound() blockEntityTag["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag["LootTableSeed"] = TAG_Long(int(seedtag)) tag["BlockEntityTag"] = blockEntityTag display = TAG_Compound() display["Name"] = TAG_String(u'Lucky Crate') tag["display"] = display minecraftchest["tag"] = tag minecraftchest["Slot"] = TAG_Byte(0) items.append(minecraftchest) minecraftchest2 = TAG_Compound() minecraftchest2["id"] = TAG_String(u'minecraft:chest') minecraftchest2["Damage"] = TAG_Short(0) minecraftchest2["Count"] = TAG_Byte(64) tag2 = TAG_Compound() blockEntityTag2 = TAG_Compound() blockEntityTag2["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag2["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag2["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag2["LootTableSeed"] = TAG_Long(int(seedtag)) tag2["BlockEntityTag"] = blockEntityTag2 display2 = TAG_Compound() display2["Name"] = TAG_String(u'Lucky Crate') tag2["display"] = display2 minecraftchest2["tag"] = tag2 minecraftchest2["Slot"] = TAG_Byte(1) items.append(minecraftchest2) minecraftchest3 = TAG_Compound() minecraftchest3["id"] = TAG_String(u'minecraft:chest') minecraftchest3["Damage"] = TAG_Short(0) minecraftchest3["Count"] = TAG_Byte(64) tag3 = TAG_Compound() blockEntityTag3 = TAG_Compound() blockEntityTag3["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag3["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag3["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag3["LootTableSeed"] = TAG_Long(int(seedtag)) tag3["BlockEntityTag"] = blockEntityTag3 display3 = TAG_Compound() display3["Name"] = TAG_String(u'Lucky Crate') tag3["display"] = display3 minecraftchest3["tag"] = tag3 minecraftchest3["Slot"] = TAG_Byte(2) items.append(minecraftchest3) minecraftchest4 = TAG_Compound() minecraftchest4["id"] = TAG_String(u'minecraft:chest') minecraftchest4["Damage"] = TAG_Short(0) minecraftchest4["Count"] = TAG_Byte(64) tag4 = TAG_Compound() blockEntityTag4 = TAG_Compound() blockEntityTag4["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag4["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag4["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag4["LootTableSeed"] = TAG_Long(int(seedtag)) tag4["BlockEntityTag"] = blockEntityTag4 display4 = TAG_Compound() display4["Name"] = TAG_String(u'Lucky Crate') tag4["display"] = display4 minecraftchest4["tag"] = tag4 minecraftchest4["Slot"] = TAG_Byte(3) items.append(minecraftchest4) minecraftchest5 = TAG_Compound() minecraftchest5["id"] = TAG_String(u'minecraft:chest') minecraftchest5["Damage"] = TAG_Short(0) minecraftchest5["Count"] = TAG_Byte(64) tag5 = TAG_Compound() blockEntityTag5 = TAG_Compound() blockEntityTag5["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag5["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag5["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag5["LootTableSeed"] = TAG_Long(int(seedtag)) tag5["BlockEntityTag"] = blockEntityTag5 display5 = TAG_Compound() display5["Name"] = TAG_String(u'Lucky Crate') tag5["display"] = display5 minecraftchest5["tag"] = tag5 minecraftchest5["Slot"] = TAG_Byte(4) items.append(minecraftchest5) minecraftchest6 = TAG_Compound() minecraftchest6["id"] = TAG_String(u'minecraft:chest') minecraftchest6["Damage"] = TAG_Short(0) minecraftchest6["Count"] = TAG_Byte(64) tag6 = TAG_Compound() blockEntityTag6 = TAG_Compound() blockEntityTag6["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag6["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag6["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag6["LootTableSeed"] = TAG_Long(int(seedtag)) tag6["BlockEntityTag"] = blockEntityTag6 display6 = TAG_Compound() display6["Name"] = TAG_String(u'Lucky Crate') tag6["display"] = display6 minecraftchest6["tag"] = tag6 minecraftchest6["Slot"] = TAG_Byte(5) items.append(minecraftchest6) minecraftchest7 = TAG_Compound() minecraftchest7["id"] = TAG_String(u'minecraft:chest') minecraftchest7["Damage"] = TAG_Short(0) minecraftchest7["Count"] = TAG_Byte(64) tag7 = TAG_Compound() blockEntityTag7 = TAG_Compound() blockEntityTag7["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag7["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag7["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag7["LootTableSeed"] = TAG_Long(int(seedtag)) tag7["BlockEntityTag"] = blockEntityTag7 display7 = TAG_Compound() display7["Name"] = TAG_String(u'Lucky Crate') tag7["display"] = display7 minecraftchest7["tag"] = tag7 minecraftchest7["Slot"] = TAG_Byte(6) items.append(minecraftchest7) minecraftchest8 = TAG_Compound() minecraftchest8["id"] = TAG_String(u'minecraft:chest') minecraftchest8["Damage"] = TAG_Short(0) minecraftchest8["Count"] = TAG_Byte(64) tag8 = TAG_Compound() blockEntityTag8 = TAG_Compound() blockEntityTag8["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag8["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag8["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag8["LootTableSeed"] = TAG_Long(int(seedtag)) tag8["BlockEntityTag"] = blockEntityTag8 display8 = TAG_Compound() display8["Name"] = TAG_String(u'Lucky Crate') tag8["display"] = display8 minecraftchest8["tag"] = tag8 minecraftchest8["Slot"] = TAG_Byte(7) items.append(minecraftchest8) minecraftchest9 = TAG_Compound() minecraftchest9["id"] = TAG_String(u'minecraft:chest') minecraftchest9["Damage"] = TAG_Short(0) minecraftchest9["Count"] = TAG_Byte(64) tag9 = TAG_Compound() blockEntityTag9 = TAG_Compound() blockEntityTag9["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag9["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag9["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag9["LootTableSeed"] = TAG_Long(int(seedtag)) tag9["BlockEntityTag"] = blockEntityTag9 display9 = TAG_Compound() display9["Name"] = TAG_String(u'Lucky Crate') tag9["display"] = display9 minecraftchest9["tag"] = tag9 minecraftchest9["Slot"] = TAG_Byte(8) items.append(minecraftchest9) minecraftchest10 = TAG_Compound() minecraftchest10["id"] = TAG_String(u'minecraft:chest') minecraftchest10["Damage"] = TAG_Short(0) minecraftchest10["Count"] = TAG_Byte(64) tag10 = TAG_Compound() blockEntityTag10 = TAG_Compound() blockEntityTag10["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag10["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag10["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag10["LootTableSeed"] = TAG_Long(int(seedtag)) tag10["BlockEntityTag"] = blockEntityTag10 display10 = TAG_Compound() display10["Name"] = TAG_String(u'Lucky Crate') tag10["display"] = display10 minecraftchest10["tag"] = tag10 minecraftchest10["Slot"] = TAG_Byte(9) items.append(minecraftchest10) minecraftchest11 = TAG_Compound() minecraftchest11["id"] = TAG_String(u'minecraft:chest') minecraftchest11["Damage"] = TAG_Short(0) minecraftchest11["Count"] = TAG_Byte(64) tag11 = TAG_Compound() blockEntityTag11 = TAG_Compound() blockEntityTag11["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag11["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag11["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag11["LootTableSeed"] = TAG_Long(int(seedtag)) tag11["BlockEntityTag"] = blockEntityTag11 display11 = TAG_Compound() display11["Name"] = TAG_String(u'Lucky Crate') tag11["display"] = display11 minecraftchest11["tag"] = tag11 minecraftchest11["Slot"] = TAG_Byte(10) items.append(minecraftchest11) minecraftchest12 = TAG_Compound() minecraftchest12["id"] = TAG_String(u'minecraft:chest') minecraftchest12["Damage"] = TAG_Short(0) minecraftchest12["Count"] = TAG_Byte(64) tag12 = TAG_Compound() blockEntityTag12 = TAG_Compound() blockEntityTag12["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag12["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag12["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag12["LootTableSeed"] = TAG_Long(int(seedtag)) tag12["BlockEntityTag"] = blockEntityTag12 display12 = TAG_Compound() display12["Name"] = TAG_String(u'Lucky Crate') tag12["display"] = display12 minecraftchest12["tag"] = tag12 minecraftchest12["Slot"] = TAG_Byte(10) items.append(minecraftchest12) minecraftchest13 = TAG_Compound() minecraftchest13["id"] = TAG_String(u'minecraft:chest') minecraftchest13["Damage"] = TAG_Short(0) minecraftchest13["Count"] = TAG_Byte(64) tag13 = TAG_Compound() blockEntityTag13 = TAG_Compound() blockEntityTag13["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag13["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag13["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag13["LootTableSeed"] = TAG_Long(int(seedtag)) tag13["BlockEntityTag"] = blockEntityTag13 display13 = TAG_Compound() display13["Name"] = TAG_String(u'Lucky Crate') tag13["display"] = display13 minecraftchest13["tag"] = tag13 minecraftchest13["Slot"] = TAG_Byte(11) items.append(minecraftchest13) minecraftchest14 = TAG_Compound() minecraftchest14["id"] = TAG_String(u'minecraft:chest') minecraftchest14["Damage"] = TAG_Short(0) minecraftchest14["Count"] = TAG_Byte(64) tag14 = TAG_Compound() blockEntityTag14 = TAG_Compound() blockEntityTag14["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag14["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag14["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag14["LootTableSeed"] = TAG_Long(int(seedtag)) tag14["BlockEntityTag"] = blockEntityTag14 display14 = TAG_Compound() display14["Name"] = TAG_String(u'Lucky Crate') tag14["display"] = display14 minecraftchest14["tag"] = tag14 minecraftchest14["Slot"] = TAG_Byte(12) items.append(minecraftchest14) minecraftchest15 = TAG_Compound() minecraftchest15["id"] = TAG_String(u'minecraft:chest') minecraftchest15["Damage"] = TAG_Short(0) minecraftchest15["Count"] = TAG_Byte(64) tag15 = TAG_Compound() blockEntityTag15 = TAG_Compound() blockEntityTag15["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag15["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag15["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag15["LootTableSeed"] = TAG_Long(int(seedtag)) tag15["BlockEntityTag"] = blockEntityTag15 display15 = TAG_Compound() display15["Name"] = TAG_String(u'Lucky Crate') tag15["display"] = display15 minecraftchest15["tag"] = tag15 minecraftchest15["Slot"] = TAG_Byte(13) items.append(minecraftchest15) minecraftchest16 = TAG_Compound() minecraftchest16["id"] = TAG_String(u'minecraft:chest') minecraftchest16["Damage"] = TAG_Short(0) minecraftchest16["Count"] = TAG_Byte(64) tag16 = TAG_Compound() blockEntityTag16 = TAG_Compound() blockEntityTag16["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag16["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag16["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag16["LootTableSeed"] = TAG_Long(int(seedtag)) tag16["BlockEntityTag"] = blockEntityTag16 display16 = TAG_Compound() display16["Name"] = TAG_String(u'Lucky Crate') tag16["display"] = display16 minecraftchest16["tag"] = tag16 minecraftchest16["Slot"] = TAG_Byte(14) items.append(minecraftchest16) minecraftchest17 = TAG_Compound() minecraftchest17["id"] = TAG_String(u'minecraft:chest') minecraftchest17["Damage"] = TAG_Short(0) minecraftchest17["Count"] = TAG_Byte(64) tag17 = TAG_Compound() blockEntityTag17 = TAG_Compound() blockEntityTag17["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag17["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag17["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag17["LootTableSeed"] = TAG_Long(int(seedtag)) tag17["BlockEntityTag"] = blockEntityTag17 display17 = TAG_Compound() display17["Name"] = TAG_String(u'Lucky Crate') tag17["display"] = display17 minecraftchest17["tag"] = tag17 minecraftchest17["Slot"] = TAG_Byte(15) items.append(minecraftchest17) minecraftchest18 = TAG_Compound() minecraftchest18["id"] = TAG_String(u'minecraft:chest') minecraftchest18["Damage"] = TAG_Short(0) minecraftchest18["Count"] = TAG_Byte(64) tag18 = TAG_Compound() blockEntityTag18 = TAG_Compound() blockEntityTag18["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag18["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag18["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag18["LootTableSeed"] = TAG_Long(int(seedtag)) tag18["BlockEntityTag"] = blockEntityTag18 display18 = TAG_Compound() display18["Name"] = TAG_String(u'Lucky Crate') tag18["display"] = display18 minecraftchest18["tag"] = tag18 minecraftchest18["Slot"] = TAG_Byte(16) items.append(minecraftchest18) minecraftchest19 = TAG_Compound() minecraftchest19["id"] = TAG_String(u'minecraft:chest') minecraftchest19["Damage"] = TAG_Short(0) minecraftchest19["Count"] = TAG_Byte(64) tag19 = TAG_Compound() blockEntityTag19 = TAG_Compound() blockEntityTag19["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag19["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag19["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag19["LootTableSeed"] = TAG_Long(int(seedtag)) tag19["BlockEntityTag"] = blockEntityTag19 display19 = TAG_Compound() display19["Name"] = TAG_String(u'Lucky Crate') tag19["display"] = display19 minecraftchest19["tag"] = tag19 minecraftchest19["Slot"] = TAG_Byte(17) items.append(minecraftchest19) minecraftchest20 = TAG_Compound() minecraftchest20["id"] = TAG_String(u'minecraft:chest') minecraftchest20["Damage"] = TAG_Short(0) minecraftchest20["Count"] = TAG_Byte(64) tag20 = TAG_Compound() blockEntityTag20 = TAG_Compound() blockEntityTag20["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag20["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag20["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag20["LootTableSeed"] = TAG_Long(int(seedtag)) tag20["BlockEntityTag"] = blockEntityTag20 display20 = TAG_Compound() display20["Name"] = TAG_String(u'Lucky Crate') tag20["display"] = display20 minecraftchest20["tag"] = tag20 minecraftchest20["Slot"] = TAG_Byte(18) items.append(minecraftchest20) minecraftchest21 = TAG_Compound() minecraftchest21["id"] = TAG_String(u'minecraft:chest') minecraftchest21["Damage"] = TAG_Short(0) minecraftchest21["Count"] = TAG_Byte(64) tag21 = TAG_Compound() blockEntityTag21 = TAG_Compound() blockEntityTag21["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag21["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag21["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag21["LootTableSeed"] = TAG_Long(int(seedtag)) tag21["BlockEntityTag"] = blockEntityTag21 display21 = TAG_Compound() display21["Name"] = TAG_String(u'Lucky Crate') tag21["display"] = display21 minecraftchest21["tag"] = tag21 minecraftchest21["Slot"] = TAG_Byte(19) items.append(minecraftchest21) minecraftchest22 = TAG_Compound() minecraftchest22["id"] = TAG_String(u'minecraft:chest') minecraftchest22["Damage"] = TAG_Short(0) minecraftchest22["Count"] = TAG_Byte(64) tag22 = TAG_Compound() blockEntityTag22 = TAG_Compound() blockEntityTag22["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag22["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag22["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag22["LootTableSeed"] = TAG_Long(int(seedtag)) tag22["BlockEntityTag"] = blockEntityTag22 display22 = TAG_Compound() display22["Name"] = TAG_String(u'Lucky Crate') tag22["display"] = display22 minecraftchest22["tag"] = tag22 minecraftchest22["Slot"] = TAG_Byte(20) items.append(minecraftchest22) minecraftchest23 = TAG_Compound() minecraftchest23["id"] = TAG_String(u'minecraft:chest') minecraftchest23["Damage"] = TAG_Short(0) minecraftchest23["Count"] = TAG_Byte(64) tag23 = TAG_Compound() blockEntityTag23 = TAG_Compound() blockEntityTag23["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag23["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag23["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag23["LootTableSeed"] = TAG_Long(int(seedtag)) tag23["BlockEntityTag"] = blockEntityTag23 display23 = TAG_Compound() display23["Name"] = TAG_String(u'Lucky Crate') tag23["display"] = display23 minecraftchest23["tag"] = tag23 minecraftchest23["Slot"] = TAG_Byte(21) items.append(minecraftchest23) minecraftchest24 = TAG_Compound() minecraftchest24["id"] = TAG_String(u'minecraft:chest') minecraftchest24["Damage"] = TAG_Short(0) minecraftchest24["Count"] = TAG_Byte(64) tag24 = TAG_Compound() blockEntityTag24 = TAG_Compound() blockEntityTag24["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag24["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag24["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag24["LootTableSeed"] = TAG_Long(int(seedtag)) tag24["BlockEntityTag"] = blockEntityTag24 display24 = TAG_Compound() display24["Name"] = TAG_String(u'Lucky Crate') tag24["display"] = display24 minecraftchest24["tag"] = tag24 minecraftchest24["Slot"] = TAG_Byte(22) items.append(minecraftchest24) minecraftchest25 = TAG_Compound() minecraftchest25["id"] = TAG_String(u'minecraft:chest') minecraftchest25["Damage"] = TAG_Short(0) minecraftchest25["Count"] = TAG_Byte(64) tag25 = TAG_Compound() blockEntityTag25 = TAG_Compound() blockEntityTag25["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag25["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag25["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag25["LootTableSeed"] = TAG_Long(int(seedtag)) tag25["BlockEntityTag"] = blockEntityTag25 display25 = TAG_Compound() display25["Name"] = TAG_String(u'Lucky Crate') tag25["display"] = display25 minecraftchest25["tag"] = tag25 minecraftchest25["Slot"] = TAG_Byte(23) items.append(minecraftchest25) minecraftchest26 = TAG_Compound() minecraftchest26["id"] = TAG_String(u'minecraft:chest') minecraftchest26["Damage"] = TAG_Short(0) minecraftchest26["Count"] = TAG_Byte(64) tag26 = TAG_Compound() blockEntityTag26 = TAG_Compound() blockEntityTag26["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag26["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag26["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag26["LootTableSeed"] = TAG_Long(int(seedtag)) tag26["BlockEntityTag"] = blockEntityTag26 display26 = TAG_Compound() display26["Name"] = TAG_String(u'Lucky Crate') tag26["display"] = display26 minecraftchest26["tag"] = tag26 minecraftchest26["Slot"] = TAG_Byte(25) items.append(minecraftchest26) minecraftchest27 = TAG_Compound() minecraftchest27["id"] = TAG_String(u'minecraft:chest') minecraftchest27["Damage"] = TAG_Short(0) minecraftchest27["Count"] = TAG_Byte(64) tag27 = TAG_Compound() blockEntityTag27 = TAG_Compound() blockEntityTag27["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag27["LootTable"] = TAG_String("minecraft:chests/"+ random.choice(foo)) else: blockEntityTag27["LootTable"] = TAG_String("minecraft:chests/"+ str(ItemsSmokeBox)) blockEntityTag27["LootTableSeed"] = TAG_Long(int(seedtag)) tag27["BlockEntityTag"] = blockEntityTag27 display27 = TAG_Compound() display27["Name"] = TAG_String(u'Lucky Crate') tag27["display"] = display27 minecraftchest27["tag"] = tag27 minecraftchest27["Slot"] = TAG_Byte(27) items.append(minecraftchest27) chest["Items"] = items return chest
def makeItemFrameEntity(x, y, z, facing, itemtag=None, itemRotation=0): itemFrame = TAG_Compound() itemFrame["id"] = TAG_String(u'ItemFrame') pos = TAG_List() pos.append(TAG_Double(x + 0.5 + 0.4375*[0, 1, 0, -1][facing])) pos.append(TAG_Double(y + 0.5)) pos.append(TAG_Double(z + 0.5 + 0.4375*[-1, 0, 1, 0][facing])) itemFrame["Pos"] = pos motion = TAG_List() motion.append(TAG_Double(0.0)) motion.append(TAG_Double(0.0)) motion.append(TAG_Double(0.0)) itemFrame["Motion"] = motion rotation = TAG_List() rotation.append(TAG_Float(0.0)) rotation.append(TAG_Float(0.0)) itemFrame["Rotation"] = rotation itemFrame["FallDistance"] = TAG_Float(0.0) itemFrame["Fire"] = TAG_Short(0) itemFrame["Air"] = TAG_Short(300) itemFrame["OnGround"] = TAG_Byte(0) itemFrame["Dimension"] = TAG_Int(0) itemFrame["Invulnerable"] = TAG_Byte(0) itemFrame["PortalCooldown"] = TAG_Int(0) itemFrame["UUIDLeast"] = TAG_Long(0) itemFrame["UUIDMost"] = TAG_Long(0) itemFrame["TileX"] = TAG_Int(x + [0, 1, 0, -1][facing]) itemFrame["TileY"] = TAG_Int(y) itemFrame["TileZ"] = TAG_Int(z + [-1, 0, 1, 0][facing]) itemFrame["Direction"] = TAG_Byte(facing) if itemtag: itemFrame["Item"] = itemtag itemFrame["ItemDropChance"] = TAG_Float(1) itemFrame["ItemRotation"] = TAG_Byte(itemRotation) return itemFrame
def perform(level, box, options): for x in xrange(box.minx, box.maxx): for y in xrange(box.miny, box.maxy): for z in xrange(box.minz, box.maxz): block = level.blockAt(x, y, z) data = level.blockDataAt(x, y, z) extrab = options["Use Slime Blocks"] ItemsSmokeBox2 = Smokeboxs2[options["Minecraft Type"]] chunk = level.getChunk(x / 16, z / 16) areaEffectCloud = TAG_Compound() if options["1.11+ or 1.11.2+"]: areaEffectCloud["id"] = TAG_String(u'area_effect_cloud') if options["1.11+ or 1.11.2+"] != True: areaEffectCloud["id"] = TAG_String(u'AreaEffectCloud') areaEffectCloud["ownerUUID"] = TAG_String(u'') areaEffectCloud["OnGround"] = TAG_Byte(0) areaEffectCloud["Dimension"] = TAG_Int(0) areaEffectCloud["Air"] = TAG_Short(300) areaEffectCloud["ParticleParam2"] = TAG_Int(0) areaEffectCloud["ParticleParam1"] = TAG_Int(0) if ItemsSmokeBox2 == "PC": areaEffectCloud["Particle"] = TAG_String(u"take") if ItemsSmokeBox2 != "PC": areaEffectCloud["Particle"] = TAG_Int(0) areaEffectCloud["ReapplicationDelay"] = TAG_Int(0) rotation = TAG_List() rotation.append(TAG_Float(0.0)) rotation.append(TAG_Float(0.0)) areaEffectCloud["Rotation"] = rotation areaEffectCloud["FallDistance"] = TAG_Float(0.0) effects = TAG_List() effect = TAG_Compound() effect["Amplifier"] = TAG_Byte(15) effect["Id"] = TAG_Byte(25) effect["Duration"] = TAG_Int(10) effect["Ambient"] = TAG_Byte(0) effect["ShowParticles"] = TAG_Byte(0) effects.append(effect) effect2 = TAG_Compound() effect2["Amplifier"] = TAG_Byte(100) effect2["Id"] = TAG_Byte(11) effect2["Duration"] = TAG_Int(100) effect2["Ambient"] = TAG_Byte(0) effect2["ShowParticles"] = TAG_Byte(0) effects.append(effect2) effect3 = TAG_Compound() effect3["Amplifier"] = TAG_Byte(20) effect3["Id"] = TAG_Byte(8) effect3["Duration"] = TAG_Int(40) effect3["Ambient"] = TAG_Byte(0) effect3["ShowParticles"] = TAG_Byte(0) effects.append(effect3) areaEffectCloud["Effects"] = effects areaEffectCloud["Fire"] = TAG_Short(0) areaEffectCloud["Invulnerable"] = TAG_Byte(0) areaEffectCloud["PortalCooldown"] = TAG_Int(0) areaEffectCloud["CustomName"] = TAG_String(u'') areaEffectCloud["createdOnHost"] = TAG_Byte(0) areaEffectCloud["Silent"] = TAG_Byte(1) areaEffectCloud["NoGravity"] = TAG_Byte(1) areaEffectCloud["Glowing"] = TAG_Byte(0) areaEffectCloud["Age"] = TAG_Int(1) areaEffectCloud["RadiusOnUse"] = TAG_Float(0.0) areaEffectCloud["Duration"] = TAG_Int(2147483647) areaEffectCloud["DurationOnUse"] = TAG_Int(0) areaEffectCloud["WaitTime"] = TAG_Int(0) areaEffectCloud["RadiusPerTick"] = TAG_Float(0.0) areaEffectCloud["Radius"] = TAG_Float(2.5) areaEffectCloud["Color"] = TAG_Int(0) areaEffectCloud["Potion"] = TAG_String(u'minecraft:leaping') pos = TAG_List() pos.append(TAG_Double(x + 0.5)) pos.append(TAG_Double(y + 5)) pos.append(TAG_Double(z + 0.5)) areaEffectCloud["Pos"] = pos motion = TAG_List() motion.append(TAG_Double(0.0)) motion.append(TAG_Double(0.0)) motion.append(TAG_Double(0.0)) areaEffectCloud["Motion"] = motion areaEffectCloud2 = TAG_Compound() if options["1.11+ or 1.11.2+"]: areaEffectCloud2["id"] = TAG_String(u'area_effect_cloud') if options["1.11+ or 1.11.2+"] != True: areaEffectCloud2["id"] = TAG_String(u'AreaEffectCloud') areaEffectCloud2["ownerUUID"] = TAG_String(u'') areaEffectCloud2["OnGround"] = TAG_Byte(0) areaEffectCloud2["Dimension"] = TAG_Int(0) areaEffectCloud2["Air"] = TAG_Short(300) areaEffectCloud2["ParticleParam2"] = TAG_Int(0) areaEffectCloud2["ParticleParam1"] = TAG_Int(0) if ItemsSmokeBox2 == "PC": areaEffectCloud2["Particle"] = TAG_String(u"take") if ItemsSmokeBox2 != "PC": areaEffectCloud2["Particle"] = TAG_Int(0) areaEffectCloud2["ReapplicationDelay"] = TAG_Int(0) rotation2 = TAG_List() rotation2.append(TAG_Float(0.0)) rotation2.append(TAG_Float(0.0)) areaEffectCloud2["Rotation"] = rotation2 areaEffectCloud2["FallDistance"] = TAG_Float(0.0) effects2 = TAG_List() effect4 = TAG_Compound() effect4["Amplifier"] = TAG_Byte(15) effect4["Id"] = TAG_Byte(25) effect4["Duration"] = TAG_Int(10) effect4["Ambient"] = TAG_Byte(0) effect4["ShowParticles"] = TAG_Byte(0) effects2.append(effect4) effect5 = TAG_Compound() effect5["Amplifier"] = TAG_Byte(100) effect5["Id"] = TAG_Byte(11) effect5["Duration"] = TAG_Int(100) effect5["Ambient"] = TAG_Byte(0) effect5["ShowParticles"] = TAG_Byte(0) effects2.append(effect5) effect6 = TAG_Compound() effect6["Amplifier"] = TAG_Byte(20) effect6["Id"] = TAG_Byte(8) effect6["Duration"] = TAG_Int(40) effect6["Ambient"] = TAG_Byte(0) effect6["ShowParticles"] = TAG_Byte(0) effects2.append(effect6) areaEffectCloud2["Effects"] = effects2 areaEffectCloud2["Fire"] = TAG_Short(0) areaEffectCloud2["Invulnerable"] = TAG_Byte(0) areaEffectCloud2["PortalCooldown"] = TAG_Int(0) areaEffectCloud2["CustomName"] = TAG_String(u'') areaEffectCloud2["createdOnHost"] = TAG_Byte(0) areaEffectCloud2["Silent"] = TAG_Byte(1) areaEffectCloud2["NoGravity"] = TAG_Byte(1) areaEffectCloud2["Glowing"] = TAG_Byte(0) areaEffectCloud2["Age"] = TAG_Int(1) areaEffectCloud2["RadiusOnUse"] = TAG_Float(0.0) areaEffectCloud2["Duration"] = TAG_Int(2147483647) areaEffectCloud2["DurationOnUse"] = TAG_Int(0) areaEffectCloud2["WaitTime"] = TAG_Int(0) areaEffectCloud2["RadiusPerTick"] = TAG_Float(0.0) areaEffectCloud2["Radius"] = TAG_Float(2.5) areaEffectCloud2["Color"] = TAG_Int(0) areaEffectCloud2["Potion"] = TAG_String(u'minecraft:leaping') pos2 = TAG_List() pos2.append(TAG_Double(x + 0.5)) pos2.append(TAG_Double(y + 1.1)) pos2.append(TAG_Double(z + 0.5)) areaEffectCloud2["Pos"] = pos2 motion2 = TAG_List() motion2.append(TAG_Double(0.0)) motion2.append(TAG_Double(0.0)) motion2.append(TAG_Double(0.0)) areaEffectCloud2["Motion"] = motion2 chunk.Entities.append(areaEffectCloud2) chunk.Entities.append(areaEffectCloud) print "Created Trampoline! Successfully" chunk.dirty = True #Blackwool #3x3 level.setBlockAt(x, y + 1, z, 171) level.setBlockDataAt(x, y + 1, z, 15) level.setBlockAt(x + 1, y + 1, z, 171) level.setBlockDataAt(x + 1, y + 1, z, 15) level.setBlockAt(x, y + 1, z + 1, 171) level.setBlockDataAt(x, y + 1, z + 1, 15) level.setBlockAt(x + 1, y + 1, z + 1, 171) level.setBlockDataAt(x + 1, y + 1, z + 1, 15) level.setBlockAt(x, y + 1, z - 1, 171) level.setBlockDataAt(x, y + 1, z - 1, 15) level.setBlockAt(x - 1, y + 1, z, 171) level.setBlockDataAt(x - 1, y + 1, z, 15) level.setBlockAt(x - 1, y + 1, z - 1, 171) level.setBlockDataAt(x - 1, y + 1, z - 1, 15) level.setBlockAt(x + 1, y + 1, z - 1, 171) level.setBlockDataAt(x + 1, y + 1, z - 1, 15) level.setBlockAt(x - 1, y + 1, z + 1, 171) level.setBlockDataAt(x - 1, y + 1, z + 1, 15) #Blackwool #2 3x3 Empty Circle level.setBlockAt(x + 2, y + 1, z, 171) level.setBlockDataAt(x + 2, y + 1, z, 15) level.setBlockAt(x - 2, y + 1, z, 171) level.setBlockDataAt(x - 2, y + 1, z, 15) level.setBlockAt(x, y + 1, z + 2, 171) level.setBlockDataAt(x, y + 1, z + 2, 15) level.setBlockAt(x, y + 1, z - 2, 171) level.setBlockDataAt(x, y + 1, z - 2, 15) level.setBlockAt(x + 2, y + 1, z - 1, 171) level.setBlockDataAt(x + 2, y + 1, z - 1, 15) level.setBlockAt(x - 1, y + 1, z + 2, 171) level.setBlockDataAt(x - 1, y + 1, z + 2, 15) level.setBlockAt(x + 1, y + 1, z + 2, 171) level.setBlockDataAt(x + 1, y + 1, z + 2, 15) level.setBlockAt(x + 2, y + 1, z + 1, 171) level.setBlockDataAt(x + 2, y + 1, z + 1, 15) level.setBlockAt(x + 1, y + 1, z + -2, 171) level.setBlockDataAt(x + 1, y + 1, z - 2, 15) level.setBlockAt(x - 2, y + 1, z + 1, 171) level.setBlockDataAt(x - 2, y + 1, z + 1, 15) level.setBlockAt(x - 2, y + 1, z - 1, 171) level.setBlockDataAt(x - 2, y + 1, z - 1, 15) level.setBlockAt(x - 1, y + 1, z - 2, 171) level.setBlockDataAt(x - 1, y + 1, z - 2, 15) #Blue Wool 5x5 / 3x3 level.setBlockAt(x + 3, y + 1, z, 171) level.setBlockDataAt(x + 3, y + 1, z, 11) level.setBlockAt(x - 3, y + 1, z, 171) level.setBlockDataAt(x - 3, y + 1, z, 11) level.setBlockAt(x, y + 1, z + 3, 171) level.setBlockDataAt(x, y + 1, z + 3, 11) level.setBlockAt(x, y + 1, z - 3, 171) level.setBlockDataAt(x, y + 1, z - 3, 11) level.setBlockAt(x + 1, y + 1, z - 3, 171) level.setBlockDataAt(x + 1, y + 1, z - 3, 11) level.setBlockAt(x - 1, y + 1, z - 3, 171) level.setBlockDataAt(x - 1, y + 1, z - 3, 11) level.setBlockAt(x + 3, y + 1, z - 1, 171) level.setBlockDataAt(x + 3, y + 1, z - 1, 11) level.setBlockAt(x - 3, y + 1, z - 1, 171) level.setBlockDataAt(x - 3, y + 1, z - 1, 11) level.setBlockAt(x + 3, y + 1, z + 1, 171) level.setBlockDataAt(x + 3, y + 1, z + 1, 11) level.setBlockAt(x - 3, y + 1, z + 1, 171) level.setBlockDataAt(x - 3, y + 1, z + 1, 11) level.setBlockAt(x + 1, y + 1, z + 3, 171) level.setBlockDataAt(x + 1, y + 1, z + 3, 11) level.setBlockAt(x - 1, y + 1, z + 3, 171) level.setBlockDataAt(x - 1, y + 1, z + 3, 11) # level.setBlockAt(x - 2, y + 1, z + 2, 171) level.setBlockDataAt(x - 2, y + 1, z + 2, 11) level.setBlockAt(x + 2, y + 1, z - 2, 171) level.setBlockDataAt(x + 2, y + 1, z - 2, 11) level.setBlockAt(x + 2, y + 1, z + 2, 171) level.setBlockDataAt(x + 2, y + 1, z + 2, 11) level.setBlockAt(x + 2, y + 1, z - 2, 171) level.setBlockDataAt(x + 2, y + 1, z - 2, 11) level.setBlockAt(x - 2, y + 1, z - 2, 171) level.setBlockDataAt(x - 2, y + 1, z - 2, 11) if extrab == True: #Slime Block #3x3 level.setBlockAt(x, y, z, 165) level.setBlockDataAt(x, y, z, 0) level.setBlockAt(x + 1, y, z, 165) level.setBlockDataAt(x + 1, y, z, 0) level.setBlockAt(x, y, z + 1, 165) level.setBlockDataAt(x, y, z + 1, 0) level.setBlockAt(x + 1, y, z + 1, 165) level.setBlockDataAt(x + 1, y, z + 1, 0) level.setBlockAt(x, y, z - 1, 165) level.setBlockDataAt(x, y, z - 1, 0) level.setBlockAt(x - 1, y, z, 165) level.setBlockDataAt(x - 1, y, z, 0) level.setBlockAt(x - 1, y, z - 1, 165) level.setBlockDataAt(x - 1, y, z - 1, 0) level.setBlockAt(x + 1, y, z - 1, 165) level.setBlockDataAt(x + 1, y, z - 1, 0) level.setBlockAt(x - 1, y, z + 1, 165) level.setBlockDataAt(x - 1, y, z + 1, 0) #Part 2 Slime 3x3 Empty Circle level.setBlockAt(x + 2, y, z, 165) level.setBlockDataAt(x + 2, y, z, 0) level.setBlockAt(x - 2, y, z, 165) level.setBlockDataAt(x - 2, y, z, 0) level.setBlockAt(x, y, z + 2, 165) level.setBlockDataAt(x, y, z + 2, 0) level.setBlockAt(x, y, z - 2, 165) level.setBlockDataAt(x, y, z - 2, 0) level.setBlockAt(x + 2, y, z - 1, 165) level.setBlockDataAt(x + 2, y, z - 1, 0) level.setBlockAt(x - 1, y, z + 2, 165) level.setBlockDataAt(x - 1, y, z + 2, 0) level.setBlockAt(x + 1, y, z + 2, 165) level.setBlockDataAt(x + 1, y, z + 2, 0) level.setBlockAt(x + 2, y, z + 1, 165) level.setBlockDataAt(x + 2, y, z + 1, 0) level.setBlockAt(x + 1, y, z + -2, 165) level.setBlockDataAt(x + 1, y, z - 2, 0) level.setBlockAt(x - 2, y, z + 1, 165) level.setBlockDataAt(x - 2, y, z + 1, 0) level.setBlockAt(x - 2, y, z - 1, 165) level.setBlockDataAt(x - 2, y, z - 1, 0) level.setBlockAt(x - 1, y, z - 2, 165) level.setBlockDataAt(x - 1, y, z - 2, 0) #Part 3 Slime Outer Ring level.setBlockAt(x + 3, y, z, 165) level.setBlockDataAt(x + 3, y, z, 0) level.setBlockAt(x - 3, y, z, 165) level.setBlockDataAt(x - 3, y, z, 0) level.setBlockAt(x, y, z + 3, 165) level.setBlockDataAt(x, y, z + 3, 0) level.setBlockAt(x, y, z - 3, 165) level.setBlockDataAt(x, y, z - 3, 0) level.setBlockAt(x + 1, y, z - 3, 165) level.setBlockDataAt(x + 1, y, z - 3, 0) level.setBlockAt(x - 1, y, z - 3, 165) level.setBlockDataAt(x - 1, y, z - 3, 0) level.setBlockAt(x + 3, y, z - 1, 165) level.setBlockDataAt(x + 3, y, z - 1, 0) level.setBlockAt(x - 3, y, z - 1, 165) level.setBlockDataAt(x - 3, y, z - 1, 0) level.setBlockAt(x + 3, y, z + 1, 165) level.setBlockDataAt(x + 3, y, z + 1, 0) level.setBlockAt(x - 3, y, z + 1, 165) level.setBlockDataAt(x - 3, y, z + 1, 0) level.setBlockAt(x + 1, y, z + 3, 165) level.setBlockDataAt(x + 1, y, z + 3, 0) level.setBlockAt(x - 1, y, z + 3, 165) level.setBlockDataAt(x - 1, y, z + 3, 0) level.setBlockAt(x - 2, y, z + 2, 165) level.setBlockDataAt(x - 2, y, z + 2, 0) level.setBlockAt(x + 2, y, z - 2, 165) level.setBlockDataAt(x + 2, y, z - 2, 0) level.setBlockAt(x + 2, y, z + 2, 165) level.setBlockDataAt(x + 2, y, z + 2, 0) level.setBlockAt(x + 2, y, z - 2, 165) level.setBlockDataAt(x + 2, y, z - 2, 0) level.setBlockAt(x - 2, y, z - 2, 165) level.setBlockDataAt(x - 2, y, z - 2, 0) else: #String Middle Block #3x3 level.setBlockAt(x, y, z, 166) level.setBlockDataAt(x, y, z, 0) level.setBlockAt(x + 1, y, z, 166) level.setBlockDataAt(x + 1, y, z, 0) level.setBlockAt(x, y, z + 1, 166) level.setBlockDataAt(x, y, z + 1, 0) level.setBlockAt(x + 1, y, z + 1, 166) level.setBlockDataAt(x + 1, y, z + 1, 0) level.setBlockAt(x, y, z - 1, 166) level.setBlockDataAt(x, y, z - 1, 0) level.setBlockAt(x - 1, y, z, 166) level.setBlockDataAt(x - 1, y, z, 0) level.setBlockAt(x - 1, y, z - 1, 166) level.setBlockDataAt(x - 1, y, z - 1, 0) level.setBlockAt(x + 1, y, z - 1, 166) level.setBlockDataAt(x + 1, y, z - 1, 0) level.setBlockAt(x - 1, y, z + 1, 166) level.setBlockDataAt(x - 1, y, z + 1, 0) #String Block Inner #3x3 level.setBlockAt(x + 2, y, z, 166) level.setBlockDataAt(x + 2, y, z, 0) level.setBlockAt(x - 2, y, z, 166) level.setBlockDataAt(x - 2, y, z, 0) level.setBlockAt(x, y, z + 2, 166) level.setBlockDataAt(x, y, z + 2, 0) level.setBlockAt(x, y, z - 2, 166) level.setBlockDataAt(x, y, z - 2, 0) level.setBlockAt(x + 2, y, z - 1, 166) level.setBlockDataAt(x + 2, y, z - 1, 0) level.setBlockAt(x - 1, y, z + 2, 166) level.setBlockDataAt(x - 1, y, z + 2, 0) level.setBlockAt(x + 1, y, z + 2, 166) level.setBlockDataAt(x + 1, y, z + 2, 0) level.setBlockAt(x + 2, y, z + 1, 166) level.setBlockDataAt(x + 2, y, z + 1, 0) level.setBlockAt(x + 1, y, z + -2, 166) level.setBlockDataAt(x + 1, y, z - 2, 0) level.setBlockAt(x - 2, y, z + 1, 166) level.setBlockDataAt(x - 2, y, z + 1, 0) level.setBlockAt(x - 2, y, z - 1, 166) level.setBlockDataAt(x - 2, y, z - 1, 0) level.setBlockAt(x - 1, y, z - 2, 166) level.setBlockDataAt(x - 1, y, z - 2, 0) #Iron Fence Block #3x3 Outer level.setBlockAt(x + 3, y, z, 101) level.setBlockDataAt(x + 3, y, z, 0) level.setBlockAt(x - 3, y, z, 101) level.setBlockDataAt(x - 3, y, z, 0) level.setBlockAt(x, y, z + 3, 101) level.setBlockDataAt(x, y, z + 3, 0) level.setBlockAt(x, y, z - 3, 101) level.setBlockDataAt(x, y, z - 3, 0) level.setBlockAt(x + 1, y, z - 3, 101) level.setBlockDataAt(x + 1, y, z - 3, 0) level.setBlockAt(x - 1, y, z - 3, 101) level.setBlockDataAt(x - 1, y, z - 3, 0) level.setBlockAt(x + 3, y, z - 1, 101) level.setBlockDataAt(x + 3, y, z - 1, 0) level.setBlockAt(x - 3, y, z - 1, 101) level.setBlockDataAt(x - 3, y, z - 1, 0) level.setBlockAt(x + 3, y, z + 1, 101) level.setBlockDataAt(x + 3, y, z + 1, 0) level.setBlockAt(x - 3, y, z + 1, 101) level.setBlockDataAt(x - 3, y, z + 1, 0) level.setBlockAt(x + 1, y, z + 3, 101) level.setBlockDataAt(x + 1, y, z + 3, 0) level.setBlockAt(x - 1, y, z + 3, 101) level.setBlockDataAt(x - 1, y, z + 3, 0) level.setBlockAt(x - 2, y, z + 2, 101) level.setBlockDataAt(x - 2, y, z + 2, 0) level.setBlockAt(x + 2, y, z - 2, 101) level.setBlockDataAt(x + 2, y, z - 2, 0) level.setBlockAt(x + 2, y, z + 2, 101) level.setBlockDataAt(x + 2, y, z + 2, 0) level.setBlockAt(x + 2, y, z - 2, 101) level.setBlockDataAt(x + 2, y, z - 2, 0) level.setBlockAt(x - 2, y, z - 2, 101) level.setBlockDataAt(x - 2, y, z - 2, 0)
def perform(level, box, options): #**************# #Define Options# #**************# ItemsSmokeBox = Smokeboxs[options["Particle"]] colorvalue = dict([(trn._(a), b) for a, b in Smokeboxs2.items()])[options["ColorValue"]] #****************# #Define Selection# #****************# for x in xrange(box.minx, box.maxx): for z in xrange(box.minz, box.maxz): for y in xrange(box.miny, box.maxy): #********************************# #Checks If Console Edtion Is True# #********************************# chunk = level.getChunk(x/16, z/16) #*******************************# #Define & Create AreaEffectCloud# #*******************************# areaEffectCloud = TAG_Compound() areaEffectCloud["Radius"] = TAG_Float(options["Radius"]) areaEffectCloud["DurationOnUse"] = TAG_Int(0) areaEffectCloud["Invulnerable"] = TAG_Byte(options["Invulnerable"]) areaEffectCloud["PortalCooldown"] = TAG_Int(0) #*********************************************************************# #Checks If Console Edtion Is True And Converts Particle Ids To Console# #*********************************************************************# if options["Console Edtition"] and ItemsSmokeBox == "take": areaEffectCloud["Particle"] = TAG_Int(0) if options["Console Edtition"] != True and ItemsSmokeBox == "take": areaEffectCloud["Particle"] = TAG_String("take") if options["Console Edtition"] and ItemsSmokeBox == "note": areaEffectCloud["Particle"] = TAG_Int(2) if options["Console Edtition"] != True and ItemsSmokeBox == "note": areaEffectCloud["Particle"] = TAG_String("note") if options["Console Edtition"] and ItemsSmokeBox == "portal": areaEffectCloud["Particle"] = TAG_Int(3) if options["Console Edtition"] != True and ItemsSmokeBox == "portal": areaEffectCloud["Particle"] = TAG_String("portal") if options["Console Edtition"] and ItemsSmokeBox == "explode": areaEffectCloud["Particle"] = TAG_Int(5) if options["Console Edtition"] != True and ItemsSmokeBox == "explode": areaEffectCloud["Particle"] = TAG_String("explode") if options["Console Edtition"] and ItemsSmokeBox == "flame": areaEffectCloud["Particle"] = TAG_Int(6) if options["Console Edtition"] != True and ItemsSmokeBox == "flame": areaEffectCloud["Particle"] = TAG_String("flame") if options["Console Edtition"] and ItemsSmokeBox == "lava": areaEffectCloud["Particle"] = TAG_Int(7) if options["Console Edtition"] != True and ItemsSmokeBox == "lava": areaEffectCloud["Particle"] = TAG_String("lava") if options["Console Edtition"] and ItemsSmokeBox == "footstep": areaEffectCloud["Particle"] = TAG_Int(8) if options["Console Edtition"] != True and ItemsSmokeBox == "footstep": areaEffectCloud["Particle"] = TAG_String("footstep") if options["Console Edtition"] and ItemsSmokeBox == "droplet": areaEffectCloud["Particle"] = TAG_Int(9) if options["Console Edtition"] != True and ItemsSmokeBox == "droplet": areaEffectCloud["Particle"] = TAG_String("droplet") if options["Console Edtition"] and ItemsSmokeBox == "largesmoke": areaEffectCloud["Particle"] = TAG_Int(10) if options["Console Edtition"] != True and ItemsSmokeBox == "largesmoke": areaEffectCloud["Particle"] = TAG_String("largesmoke") if options["Console Edtition"] and ItemsSmokeBox == "reddust": areaEffectCloud["Particle"] = TAG_Int(11) if options["Console Edtition"] != True and ItemsSmokeBox == "reddust": areaEffectCloud["Particle"] = TAG_String("reddust") if options["Console Edtition"] and ItemsSmokeBox == "snowballpoof": areaEffectCloud["Particle"] = TAG_Int(12) if options["Console Edtition"] != True and ItemsSmokeBox == "snowballpoof": areaEffectCloud["Particle"] = TAG_String("snowballpoof") if options["Console Edtition"] and ItemsSmokeBox == "snowshovel": areaEffectCloud["Particle"] = TAG_Int(13) if options["Console Edtition"] != True and ItemsSmokeBox == "snowshovel": areaEffectCloud["Particle"] = TAG_String("snowshovel") if options["Console Edtition"] and ItemsSmokeBox == "slime": areaEffectCloud["Particle"] = TAG_Int(14) if options["Console Edtition"] != True and ItemsSmokeBox == "slime": areaEffectCloud["Particle"] = TAG_String("slime") if options["Console Edtition"] and ItemsSmokeBox == "heart": areaEffectCloud["Particle"] = TAG_Int(15) if options["Console Edtition"] != True and ItemsSmokeBox == "heart": areaEffectCloud["Particle"] = TAG_String("heart") if options["Console Edtition"] and ItemsSmokeBox == "depthsuspend": areaEffectCloud["Particle"] = TAG_Int(17) if options["Console Edtition"] != True and ItemsSmokeBox == "depthsuspend": areaEffectCloud["Particle"] = TAG_String("depthsuspend") if options["Console Edtition"] and ItemsSmokeBox == "crit": areaEffectCloud["Particle"] = TAG_Int(18) if options["Console Edtition"] != True and ItemsSmokeBox == "crit": areaEffectCloud["Particle"] = TAG_String("crit") if options["Console Edtition"] and ItemsSmokeBox == "hugeexplosion": areaEffectCloud["Particle"] = TAG_Int(19) if options["Console Edtition"] != True and ItemsSmokeBox == "hugeexplosion": areaEffectCloud["Particle"] = TAG_String("hugeexplosion") if options["Console Edtition"] and ItemsSmokeBox == "largeexplode": areaEffectCloud["Particle"] = TAG_Int(20) if options["Console Edtition"] != True and ItemsSmokeBox == "largeexplode": areaEffectCloud["Particle"] = TAG_String("largeexplode") if options["Console Edtition"] and ItemsSmokeBox == "spell": areaEffectCloud["Particle"] = TAG_Int(22) if options["Console Edtition"] != True and ItemsSmokeBox == "spell": areaEffectCloud["Particle"] = TAG_String("spell") if options["Console Edtition"] and ItemsSmokeBox == "witchMagic": areaEffectCloud["Particle"] = TAG_Int(23) if options["Console Edtition"] != True and ItemsSmokeBox == "witchMagic": areaEffectCloud["Particle"] = TAG_String("witchMagic") if options["Console Edtition"] and ItemsSmokeBox == "mobSpell": areaEffectCloud["Particle"] = TAG_Int(24) if options["Console Edtition"] != True and ItemsSmokeBox == "mobSpell": areaEffectCloud["Particle"] = TAG_String("mobSpell") if options["Console Edtition"] and ItemsSmokeBox == "mobSpellAmbient": areaEffectCloud["Particle"] = TAG_Int(25) if options["Console Edtition"] != True and ItemsSmokeBox == "mobSpellAmbient": areaEffectCloud["Particle"] = TAG_String("mobSpellAmbient") if options["Console Edtition"] and ItemsSmokeBox == "suspended": areaEffectCloud["Particle"] = TAG_Int(27) if options["Console Edtition"] != True and ItemsSmokeBox == "suspended": areaEffectCloud["Particle"] = TAG_String("suspended") if options["Console Edtition"] and ItemsSmokeBox == "fallingdust": areaEffectCloud["Particle"] = TAG_Int(28) if options["Console Edtition"] != True and ItemsSmokeBox == "fallingdust": areaEffectCloud["Particle"] = TAG_String("fallingdust") if options["Console Edtition"] and ItemsSmokeBox == "enchantmenttable": areaEffectCloud["Particle"] = TAG_Int(29) if options["Console Edtition"] != True and ItemsSmokeBox == "enchantmenttable": areaEffectCloud["Particle"] = TAG_String("enchantmenttable") if options["Console Edtition"] and ItemsSmokeBox == "angryVillager": areaEffectCloud["Particle"] = TAG_Int(31) if options["Console Edtition"] != True and ItemsSmokeBox == "angryVillager": areaEffectCloud["Particle"] = TAG_String("angryVillager") if options["Console Edtition"] and ItemsSmokeBox == "happyVillager": areaEffectCloud["Particle"] = TAG_Int(32) if options["Console Edtition"] != True and ItemsSmokeBox == "happyVillager": areaEffectCloud["Particle"] = TAG_String("happyVillager") if options["Console Edtition"] and ItemsSmokeBox == "fireworksSpark": areaEffectCloud["Particle"] = TAG_Int(33) if options["Console Edtition"] != True and ItemsSmokeBox == "fireworksSpark": areaEffectCloud["Particle"] = TAG_String("fireworksSpark") if options["Console Edtition"] and ItemsSmokeBox == "splash": areaEffectCloud["Particle"] = TAG_Int(34) if options["Console Edtition"] != True and ItemsSmokeBox == "splash": areaEffectCloud["Particle"] = TAG_String("splash") if options["Console Edtition"] and ItemsSmokeBox == "magicCrit": areaEffectCloud["Particle"] = TAG_Int(35) if options["Console Edtition"] != True and ItemsSmokeBox == "magicCrit": areaEffectCloud["Particle"] = TAG_String("magicCrit") if options["Console Edtition"] and ItemsSmokeBox == "cloud": areaEffectCloud["Particle"] = TAG_Int(37) if options["Console Edtition"] != True and ItemsSmokeBox == "cloud": areaEffectCloud["Particle"] = TAG_String("cloud") if options["Console Edtition"] and ItemsSmokeBox == "barrier": areaEffectCloud["Particle"] = TAG_Int(38) if options["Console Edtition"] != True and ItemsSmokeBox == "barrier": areaEffectCloud["Particle"] = TAG_String("barrier") if options["Console Edtition"] and ItemsSmokeBox == "iconcrack": areaEffectCloud["Particle"] = TAG_Int(39) if options["Console Edtition"] != True and ItemsSmokeBox == "iconcrack": areaEffectCloud["Particle"] = TAG_String("iconcrack") if options["Console Edtition"] and ItemsSmokeBox == "blockcrack": areaEffectCloud["Particle"] = TAG_Int(40) if options["Console Edtition"] != True and ItemsSmokeBox == "blockcrack": areaEffectCloud["Particle"] = TAG_String("blockcrack") if options["Console Edtition"] and ItemsSmokeBox == "Invisible": areaEffectCloud["Particle"] = TAG_Int(43) if options["Console Edtition"] != True and ItemsSmokeBox == "Invisible": areaEffectCloud["Particle"] = TAG_String("Invisible") if options["Console Edtition"] and ItemsSmokeBox == "dragonbreath": areaEffectCloud["Particle"] = TAG_Int(44) if options["Console Edtition"] != True and ItemsSmokeBox == "dragonbreath": areaEffectCloud["Particle"] = TAG_String("dragonbreath") if options["Console Edtition"] and ItemsSmokeBox == "endRod": areaEffectCloud["Particle"] = TAG_Int(45) if options["Console Edtition"] != True and ItemsSmokeBox == "endRod": areaEffectCloud["Particle"] = TAG_String("endRod") if options["Console Edtition"] and ItemsSmokeBox == "damageIndicator": areaEffectCloud["Particle"] = TAG_Int(46) if options["Console Edtition"] != True and ItemsSmokeBox == "damageIndicator": areaEffectCloud["Particle"] = TAG_String("damageIndicator") customPotionEffects = TAG_List() customPotionEffect = TAG_Compound() customPotionEffect["ShowParticles"] = TAG_Byte(options["ShowParticles"]) customPotionEffect["Duration"] = TAG_Int(options["Effect Duration"]) customPotionEffect["Id"] = TAG_Int(options["Effect ID"]) customPotionEffect["Amplifier"] = TAG_Int(options["Effect Amplifier"]) customPotionEffects.append(customPotionEffect) areaEffectCloud["Effects"] = customPotionEffects areaEffectCloud["FallDistance"] = TAG_Float(0.0) #**************************************# #1.11+ Support Changes ID To New Format# #**************************************# if options["1.11-1.12+Plus"]: AreaEffectCloud["id"] = TAG_String(u'area_effect_cloud') else: areaEffectCloud["id"] = TAG_String(u'AreaEffectCloud') areaEffectCloud["ParticleParam1"] = TAG_Int(options["ParticleParam1"]) areaEffectCloud["ParticleParam2"] = TAG_Int(options["ParticleParam2"]) areaEffectCloud["Age"] = TAG_Int(options["Age"]) #********************************************# #Custom ColorValue Option Aplies To Particles# #********************************************# if options["Custom ColorValue"]: areaEffectCloud["Color"] = TAG_Int(colorvalue) else: areaEffectCloud["Color"] = TAG_Int(0) motion = TAG_List() motion.append(TAG_Double(0)) motion.append(TAG_Double(0)) motion.append(TAG_Double(0)) areaEffectCloud["Motion"] = motion areaEffectCloud["ReapplicationDelay"] = TAG_Int(options["ReapplicationDelay"]) areaEffectCloud["Potion"] = TAG_String("minecraft:potion") #********************************************# #Changes Durantion To The Max Value When True# #********************************************# if options["Last-Forever/No-Despawn"]: areaEffectCloud["Duration"] = TAG_Int(2147483647) else: areaEffectCloud["Duration"] = TAG_Int(options["Duration"]) areaEffectCloud["Air"] = TAG_Short(300) areaEffectCloud["OnGround"] = TAG_Byte(0) areaEffectCloud["Dimension"] = TAG_Int(0) rotation = TAG_List() rotation.append(TAG_Float(0.0)) rotation.append(TAG_Float(0.0)) areaEffectCloud["Rotation"] = rotation areaEffectCloud["RadiusPerTick"] = TAG_Float(options["RadiusPerTick"]) pos = TAG_List() pos.append(TAG_Double(x+0.5)) pos.append(TAG_Double(y)) pos.append(TAG_Double(z+0.5)) areaEffectCloud["Pos"] = pos areaEffectCloud["Fire"] = TAG_Short(0) areaEffectCloud["RadiusOnUse"] = TAG_Float(options["RadiusOnUse"]) areaEffectCloud["WaitTime"] = TAG_Int(options["WaitTime"]) chunk.Entities.append(areaEffectCloud) #********************************************# #Marks The Chunks As Dirty/ReLights Selection# #********************************************# chunk.dirty = True #********************************************************# #Prints Out Particle ID & Coordinates That Were Generated# #********************************************************# print "Created AreaEffectCloud " + str(ItemsSmokeBox) + " At X:" + str(x) + " Y:" + str(y) + " Z:" + str(z) #***************************************# #Prints Out Completed Generation Message# #***************************************# print "Completed Generation"
def createArmorStand(level, x, y, z, customName, Invisible, CustomNameVisible, Invulnerable, Marker, NoGravity, MotionX, MotionY, MotionZ, RotationX, RotationY, Small,ShowArms,NoBasePlate,HandItem1,HandItem2,ArmorItem1,ArmorItem2,ArmorItem3,ArmorItem4,ArmorItem4Data,PoseBodyX,PoseBodyY,PoseBodyZ,PoseHeadX,PoseHeadY,PoseHeadZ,PoseRightArmX,PoseRightArmY,PoseRightArmZ,PoseLeftArmX,PoseLeftArmY,PoseLeftArmZ,PoseRightLegX,PoseRightLegY,PoseRightLegZ,PoseLeftLegX,PoseLeftLegY,PoseLeftLegZ): # After @Sethbling print("New ArmorStand named "+customName+" at "+str(x)+","+str(y)+","+str(z)) mob = TAG_Compound() mob["CustomName"] = TAG_String(customName) mob["Invisible"] = TAG_Byte(Invisible) mob["Small"] = TAG_Byte(Small) mob["ShowArms"] = TAG_Byte(ShowArms) mob["NoBasePlate"] = TAG_Byte(NoBasePlate) mob["CustomNameVisible"] = TAG_Byte(CustomNameVisible) mob["Invulnerable"] = TAG_Byte(Invulnerable) mob["Marker"] = TAG_Byte(Marker) mob["NoGravity"] = TAG_Byte(NoGravity) mob["OnGround"] = TAG_Byte(1) mob["Air"] = TAG_Short(300) mob["DeathTime"] = TAG_Short(0) mob["Fire"] = TAG_Short(-1) mob["Health"] = TAG_Short(20) mob["HurtTime"] = TAG_Short(0) mob["Age"] = TAG_Int(0) mob["FallDistance"] = TAG_Float(0) mob["Motion"] = TAG_List() mob["Motion"].append(TAG_Double(MotionX)) mob["Motion"].append(TAG_Double(MotionY)) mob["Motion"].append(TAG_Double(MotionZ)) mob["Pos"] = TAG_List() mob["Pos"].append(TAG_Double(x + 0.5)) mob["Pos"].append(TAG_Double(y)) mob["Pos"].append(TAG_Double(z + 0.5)) mob["Rotation"] = TAG_List() mob["Rotation"].append(TAG_Float(RotationX)) mob["Rotation"].append(TAG_Float(RotationY)) tl_AI = TAG_List() tc_AI1 = TAG_Compound() tc_AI1["Count"] = TAG_Byte(1) tc_AI1["id"] = TAG_String(HandItem1) tl_AI.append(tc_AI1) tc_AI1 = TAG_Compound() tc_AI1["Count"] = TAG_Byte(1) tc_AI1["id"] = TAG_String(HandItem2) tl_AI.append(tc_AI1) mob["HandItems"] = tl_AI tl_AI = TAG_List() tc_AI1 = TAG_Compound() tc_AI1["Count"] = TAG_Byte(1) tc_AI1["id"] = TAG_String(ArmorItem1) tl_AI.append(tc_AI1) tc_AI1 = TAG_Compound() tc_AI1["Count"] = TAG_Byte(1) tc_AI1["id"] = TAG_String(ArmorItem2) tl_AI.append(tc_AI1) tc_AI1 = TAG_Compound() tc_AI1["Count"] = TAG_Byte(1) tc_AI1["id"] = TAG_String(ArmorItem3) tl_AI.append(tc_AI1) tc_AI1 = TAG_Compound() tc_AI1["Count"] = TAG_Byte(1) tc_AI1["id"] = TAG_String(ArmorItem4) tc_AI1["Damage"] = TAG_Short(ArmorItem4Data) tl_AI.append(tc_AI1) mob["ArmorItems"] = tl_AI tc_Pose = TAG_Compound() tl_Pose = TAG_List() tl_Pose.append(TAG_Float(PoseBodyX)) tl_Pose.append(TAG_Float(PoseBodyY)) tl_Pose.append(TAG_Float(PoseBodyZ)) tc_Pose["Body"] = tl_Pose tl_Pose = TAG_List() tl_Pose.append(TAG_Float(PoseHeadX)) tl_Pose.append(TAG_Float(PoseHeadY)) tl_Pose.append(TAG_Float(PoseHeadZ)) tc_Pose["Head"] = tl_Pose tl_Pose = TAG_List() tl_Pose.append(TAG_Float(PoseRightArmX)) tl_Pose.append(TAG_Float(PoseRightArmY)) tl_Pose.append(TAG_Float(PoseRightArmZ)) tc_Pose["RightArm"] = tl_Pose tl_Pose = TAG_List() tl_Pose.append(TAG_Float(PoseLeftArmX)) tl_Pose.append(TAG_Float(PoseLeftArmY)) tl_Pose.append(TAG_Float(PoseLeftArmZ)) tc_Pose["LeftArm"] = tl_Pose tl_Pose = TAG_List() tl_Pose.append(TAG_Float(PoseRightLegX)) tl_Pose.append(TAG_Float(PoseRightLegY)) tl_Pose.append(TAG_Float(PoseRightLegZ)) tc_Pose["RightLeg"] = tl_Pose tl_Pose = TAG_List() tl_Pose.append(TAG_Float(PoseLeftLegX)) tl_Pose.append(TAG_Float(PoseLeftLegY)) tl_Pose.append(TAG_Float(PoseLeftLegZ)) tc_Pose["LeftLeg"] = tl_Pose mob["Pose"] = tc_Pose mob["id"] = TAG_String("ArmorStand") chunk = level.getChunk(int(x) / CHUNKSIZE, int(z) / CHUNKSIZE) chunk.Entities.append(mob) chunk.dirty = True
mobSpawner["MaxNearbyEntities"] = TAG_Short(maxEntities) mobSpawner["SpawnRange"] = TAG_Short(spawnRange) mobSpawner["SpawnData"] = entity mobSpawner["EntityId"] = TAG_String(u'MinecartSpawner') mobSpawner["x"] = TAG_Int(x) mobSpawner["y"] = TAG_Int(y) mobSpawner["z"] = TAG_Int(z) return mobSpawner def minecartSpawner((cx, cy, cz), spawn1, spawn2, initialDelay=True): spawnerCart = TAG_Compound() spawnerCart["id"] = TAG_String(u'MinecartSpawner') spawnerCart["Items"] = TAG_List() motion = TAG_List() motion.append(TAG_Double(0.0)) motion.append(TAG_Double(0.0)) motion.append(TAG_Double(0.0)) spawnerCart["Motion"] = motion spawnerCart["OnGround"] = TAG_Byte(0) spawnerCart["Type"] = TAG_Int(0) if initialDelay: # 1 tick delay before first spawn, 1 tick before second spawnerCart["MinSpawnDelay"] = TAG_Short(1) spawnerCart["MaxSpawnDelay"] = TAG_Short(1) spawnerCart["Delay"] = TAG_Short(2) else: # instantaneous first spawn, 2 ticks before second spawnerCart["MinSpawnDelay"] = TAG_Short(2) spawnerCart["MaxSpawnDelay"] = TAG_Short(2)
def perform(level, box, options): #**************# #Define Options# #**************# ItemsSmokeBox = Smokeboxs[options["Particle"]] colorvalue = dict([(trn._(a), b) for a, b in Smokeboxs2.items()])[options["ColorValue"]] #****************# #Define Selection# #****************# for x in xrange(box.minx, box.maxx): for z in xrange(box.minz, box.maxz): for y in xrange(box.miny, box.maxy): #********************************# #Checks If Console Edtion Is True# #********************************# chunk = level.getChunk(x / 16, z / 16) #*******************************# #Define & Create AreaEffectCloud# #*******************************# areaEffectCloud = TAG_Compound() areaEffectCloud["Radius"] = TAG_Float(options["Radius"]) areaEffectCloud["DurationOnUse"] = TAG_Int(0) areaEffectCloud["Invulnerable"] = TAG_Byte( options["Invulnerable"]) areaEffectCloud["PortalCooldown"] = TAG_Int(0) #*********************************************************************# #Checks If Console Edtion Is True And Converts Particle Ids To Console# #*********************************************************************# if options["Console Edtition"] and ItemsSmokeBox == "take": areaEffectCloud["Particle"] = TAG_Int(0) if options[ "Console Edtition"] != True and ItemsSmokeBox == "take": areaEffectCloud["Particle"] = TAG_String("take") if options["Console Edtition"] and ItemsSmokeBox == "note": areaEffectCloud["Particle"] = TAG_Int(2) if options[ "Console Edtition"] != True and ItemsSmokeBox == "note": areaEffectCloud["Particle"] = TAG_String("note") if options["Console Edtition"] and ItemsSmokeBox == "portal": areaEffectCloud["Particle"] = TAG_Int(3) if options[ "Console Edtition"] != True and ItemsSmokeBox == "portal": areaEffectCloud["Particle"] = TAG_String("portal") if options["Console Edtition"] and ItemsSmokeBox == "explode": areaEffectCloud["Particle"] = TAG_Int(5) if options[ "Console Edtition"] != True and ItemsSmokeBox == "explode": areaEffectCloud["Particle"] = TAG_String("explode") if options["Console Edtition"] and ItemsSmokeBox == "flame": areaEffectCloud["Particle"] = TAG_Int(6) if options[ "Console Edtition"] != True and ItemsSmokeBox == "flame": areaEffectCloud["Particle"] = TAG_String("flame") if options["Console Edtition"] and ItemsSmokeBox == "lava": areaEffectCloud["Particle"] = TAG_Int(7) if options[ "Console Edtition"] != True and ItemsSmokeBox == "lava": areaEffectCloud["Particle"] = TAG_String("lava") if options["Console Edtition"] and ItemsSmokeBox == "footstep": areaEffectCloud["Particle"] = TAG_Int(8) if options[ "Console Edtition"] != True and ItemsSmokeBox == "footstep": areaEffectCloud["Particle"] = TAG_String("footstep") if options["Console Edtition"] and ItemsSmokeBox == "droplet": areaEffectCloud["Particle"] = TAG_Int(9) if options[ "Console Edtition"] != True and ItemsSmokeBox == "droplet": areaEffectCloud["Particle"] = TAG_String("droplet") if options[ "Console Edtition"] and ItemsSmokeBox == "largesmoke": areaEffectCloud["Particle"] = TAG_Int(10) if options[ "Console Edtition"] != True and ItemsSmokeBox == "largesmoke": areaEffectCloud["Particle"] = TAG_String("largesmoke") if options["Console Edtition"] and ItemsSmokeBox == "reddust": areaEffectCloud["Particle"] = TAG_Int(11) if options[ "Console Edtition"] != True and ItemsSmokeBox == "reddust": areaEffectCloud["Particle"] = TAG_String("reddust") if options[ "Console Edtition"] and ItemsSmokeBox == "snowballpoof": areaEffectCloud["Particle"] = TAG_Int(12) if options[ "Console Edtition"] != True and ItemsSmokeBox == "snowballpoof": areaEffectCloud["Particle"] = TAG_String("snowballpoof") if options[ "Console Edtition"] and ItemsSmokeBox == "snowshovel": areaEffectCloud["Particle"] = TAG_Int(13) if options[ "Console Edtition"] != True and ItemsSmokeBox == "snowshovel": areaEffectCloud["Particle"] = TAG_String("snowshovel") if options["Console Edtition"] and ItemsSmokeBox == "slime": areaEffectCloud["Particle"] = TAG_Int(14) if options[ "Console Edtition"] != True and ItemsSmokeBox == "slime": areaEffectCloud["Particle"] = TAG_String("slime") if options["Console Edtition"] and ItemsSmokeBox == "heart": areaEffectCloud["Particle"] = TAG_Int(15) if options[ "Console Edtition"] != True and ItemsSmokeBox == "heart": areaEffectCloud["Particle"] = TAG_String("heart") if options[ "Console Edtition"] and ItemsSmokeBox == "depthsuspend": areaEffectCloud["Particle"] = TAG_Int(17) if options[ "Console Edtition"] != True and ItemsSmokeBox == "depthsuspend": areaEffectCloud["Particle"] = TAG_String("depthsuspend") if options["Console Edtition"] and ItemsSmokeBox == "crit": areaEffectCloud["Particle"] = TAG_Int(18) if options[ "Console Edtition"] != True and ItemsSmokeBox == "crit": areaEffectCloud["Particle"] = TAG_String("crit") if options[ "Console Edtition"] and ItemsSmokeBox == "hugeexplosion": areaEffectCloud["Particle"] = TAG_Int(19) if options[ "Console Edtition"] != True and ItemsSmokeBox == "hugeexplosion": areaEffectCloud["Particle"] = TAG_String("hugeexplosion") if options[ "Console Edtition"] and ItemsSmokeBox == "largeexplode": areaEffectCloud["Particle"] = TAG_Int(20) if options[ "Console Edtition"] != True and ItemsSmokeBox == "largeexplode": areaEffectCloud["Particle"] = TAG_String("largeexplode") if options["Console Edtition"] and ItemsSmokeBox == "spell": areaEffectCloud["Particle"] = TAG_Int(22) if options[ "Console Edtition"] != True and ItemsSmokeBox == "spell": areaEffectCloud["Particle"] = TAG_String("spell") if options[ "Console Edtition"] and ItemsSmokeBox == "witchMagic": areaEffectCloud["Particle"] = TAG_Int(23) if options[ "Console Edtition"] != True and ItemsSmokeBox == "witchMagic": areaEffectCloud["Particle"] = TAG_String("witchMagic") if options["Console Edtition"] and ItemsSmokeBox == "mobSpell": areaEffectCloud["Particle"] = TAG_Int(24) if options[ "Console Edtition"] != True and ItemsSmokeBox == "mobSpell": areaEffectCloud["Particle"] = TAG_String("mobSpell") if options[ "Console Edtition"] and ItemsSmokeBox == "mobSpellAmbient": areaEffectCloud["Particle"] = TAG_Int(25) if options[ "Console Edtition"] != True and ItemsSmokeBox == "mobSpellAmbient": areaEffectCloud["Particle"] = TAG_String("mobSpellAmbient") if options["Console Edtition"] and ItemsSmokeBox == "suspended": areaEffectCloud["Particle"] = TAG_Int(27) if options[ "Console Edtition"] != True and ItemsSmokeBox == "suspended": areaEffectCloud["Particle"] = TAG_String("suspended") if options[ "Console Edtition"] and ItemsSmokeBox == "fallingdust": areaEffectCloud["Particle"] = TAG_Int(28) if options[ "Console Edtition"] != True and ItemsSmokeBox == "fallingdust": areaEffectCloud["Particle"] = TAG_String("fallingdust") if options[ "Console Edtition"] and ItemsSmokeBox == "enchantmenttable": areaEffectCloud["Particle"] = TAG_Int(29) if options[ "Console Edtition"] != True and ItemsSmokeBox == "enchantmenttable": areaEffectCloud["Particle"] = TAG_String( "enchantmenttable") if options[ "Console Edtition"] and ItemsSmokeBox == "angryVillager": areaEffectCloud["Particle"] = TAG_Int(31) if options[ "Console Edtition"] != True and ItemsSmokeBox == "angryVillager": areaEffectCloud["Particle"] = TAG_String("angryVillager") if options[ "Console Edtition"] and ItemsSmokeBox == "happyVillager": areaEffectCloud["Particle"] = TAG_Int(32) if options[ "Console Edtition"] != True and ItemsSmokeBox == "happyVillager": areaEffectCloud["Particle"] = TAG_String("happyVillager") if options[ "Console Edtition"] and ItemsSmokeBox == "fireworksSpark": areaEffectCloud["Particle"] = TAG_Int(33) if options[ "Console Edtition"] != True and ItemsSmokeBox == "fireworksSpark": areaEffectCloud["Particle"] = TAG_String("fireworksSpark") if options["Console Edtition"] and ItemsSmokeBox == "splash": areaEffectCloud["Particle"] = TAG_Int(34) if options[ "Console Edtition"] != True and ItemsSmokeBox == "splash": areaEffectCloud["Particle"] = TAG_String("splash") if options["Console Edtition"] and ItemsSmokeBox == "magicCrit": areaEffectCloud["Particle"] = TAG_Int(35) if options[ "Console Edtition"] != True and ItemsSmokeBox == "magicCrit": areaEffectCloud["Particle"] = TAG_String("magicCrit") if options["Console Edtition"] and ItemsSmokeBox == "cloud": areaEffectCloud["Particle"] = TAG_Int(37) if options[ "Console Edtition"] != True and ItemsSmokeBox == "cloud": areaEffectCloud["Particle"] = TAG_String("cloud") if options["Console Edtition"] and ItemsSmokeBox == "barrier": areaEffectCloud["Particle"] = TAG_Int(38) if options[ "Console Edtition"] != True and ItemsSmokeBox == "barrier": areaEffectCloud["Particle"] = TAG_String("barrier") if options["Console Edtition"] and ItemsSmokeBox == "iconcrack": areaEffectCloud["Particle"] = TAG_Int(39) if options[ "Console Edtition"] != True and ItemsSmokeBox == "iconcrack": areaEffectCloud["Particle"] = TAG_String("iconcrack") if options[ "Console Edtition"] and ItemsSmokeBox == "blockcrack": areaEffectCloud["Particle"] = TAG_Int(40) if options[ "Console Edtition"] != True and ItemsSmokeBox == "blockcrack": areaEffectCloud["Particle"] = TAG_String("blockcrack") if options["Console Edtition"] and ItemsSmokeBox == "Invisible": areaEffectCloud["Particle"] = TAG_Int(43) if options[ "Console Edtition"] != True and ItemsSmokeBox == "Invisible": areaEffectCloud["Particle"] = TAG_String("Invisible") if options[ "Console Edtition"] and ItemsSmokeBox == "dragonbreath": areaEffectCloud["Particle"] = TAG_Int(44) if options[ "Console Edtition"] != True and ItemsSmokeBox == "dragonbreath": areaEffectCloud["Particle"] = TAG_String("dragonbreath") if options["Console Edtition"] and ItemsSmokeBox == "endRod": areaEffectCloud["Particle"] = TAG_Int(45) if options[ "Console Edtition"] != True and ItemsSmokeBox == "endRod": areaEffectCloud["Particle"] = TAG_String("endRod") if options[ "Console Edtition"] and ItemsSmokeBox == "damageIndicator": areaEffectCloud["Particle"] = TAG_Int(46) if options[ "Console Edtition"] != True and ItemsSmokeBox == "damageIndicator": areaEffectCloud["Particle"] = TAG_String("damageIndicator") customPotionEffects = TAG_List() customPotionEffect = TAG_Compound() customPotionEffect["ShowParticles"] = TAG_Byte( options["ShowParticles"]) customPotionEffect["Duration"] = TAG_Int( options["Effect Duration"]) customPotionEffect["Id"] = TAG_Int(options["Effect ID"]) customPotionEffect["Amplifier"] = TAG_Int( options["Effect Amplifier"]) customPotionEffects.append(customPotionEffect) areaEffectCloud["Effects"] = customPotionEffects areaEffectCloud["FallDistance"] = TAG_Float(0.0) #**************************************# #1.11+ Support Changes ID To New Format# #**************************************# if options["1.11-1.12+Plus"]: AreaEffectCloud["id"] = TAG_String(u'area_effect_cloud') else: areaEffectCloud["id"] = TAG_String(u'AreaEffectCloud') areaEffectCloud["ParticleParam1"] = TAG_Int( options["ParticleParam1"]) areaEffectCloud["ParticleParam2"] = TAG_Int( options["ParticleParam2"]) areaEffectCloud["Age"] = TAG_Int(options["Age"]) #********************************************# #Custom ColorValue Option Aplies To Particles# #********************************************# if options["Custom ColorValue"]: areaEffectCloud["Color"] = TAG_Int(colorvalue) else: areaEffectCloud["Color"] = TAG_Int(0) motion = TAG_List() motion.append(TAG_Double(0)) motion.append(TAG_Double(0)) motion.append(TAG_Double(0)) areaEffectCloud["Motion"] = motion areaEffectCloud["ReapplicationDelay"] = TAG_Int( options["ReapplicationDelay"]) areaEffectCloud["Potion"] = TAG_String("minecraft:potion") #********************************************# #Changes Durantion To The Max Value When True# #********************************************# if options["Last-Forever/No-Despawn"]: areaEffectCloud["Duration"] = TAG_Int(2147483647) else: areaEffectCloud["Duration"] = TAG_Int(options["Duration"]) areaEffectCloud["Air"] = TAG_Short(300) areaEffectCloud["OnGround"] = TAG_Byte(0) areaEffectCloud["Dimension"] = TAG_Int(0) rotation = TAG_List() rotation.append(TAG_Float(0.0)) rotation.append(TAG_Float(0.0)) areaEffectCloud["Rotation"] = rotation areaEffectCloud["RadiusPerTick"] = TAG_Float( options["RadiusPerTick"]) pos = TAG_List() pos.append(TAG_Double(x + 0.5)) pos.append(TAG_Double(y)) pos.append(TAG_Double(z + 0.5)) areaEffectCloud["Pos"] = pos areaEffectCloud["Fire"] = TAG_Short(0) areaEffectCloud["RadiusOnUse"] = TAG_Float( options["RadiusOnUse"]) areaEffectCloud["WaitTime"] = TAG_Int(options["WaitTime"]) chunk.Entities.append(areaEffectCloud) #********************************************# #Marks The Chunks As Dirty/ReLights Selection# #********************************************# chunk.dirty = True #********************************************************# #Prints Out Particle ID & Coordinates That Were Generated# #********************************************************# print "Created AreaEffectCloud " + str( ItemsSmokeBox) + " At X:" + str(x) + " Y:" + str( y) + " Z:" + str(z) #***************************************# #Prints Out Completed Generation Message# #***************************************# print "Completed Generation"
spawner["Delay"] = TAG_Short(delay) spawner["MinSpawnDelay"] = TAG_Short(loopTicks) spawner["MaxSpawnDelay"] = TAG_Short(loopTicks) spawner["SpawnCount"] = TAG_Short(1) spawner["MaxNearbyEntities"] = TAG_Short(10000) spawner["RequiredPlayerRange"] = TAG_Short(range) # Creates a spawner with certain aspects return spawner def createPotion((x, y, z), (vx, vy, vz), effect, duration, amp, potionId): thrownPotion = TAG_Compound() thrownPotion["yTile"] = TAG_Short(-1) motion = TAG_List() motion.append(TAG_Double(vx)) motion.append(TAG_Double(vy)) motion.append(TAG_Double(vz)) thrownPotion["Motion"] = motion thrownPotion["OnGround"] = TAG_Byte(0) thrownPotion["inGround"] = TAG_Byte(0) thrownPotion["shake"] = TAG_Byte(0) thrownPotion["Dimension"] = TAG_Int(0) thrownPotion["inTile"] = TAG_Byte(0) thrownPotion["Air"] = TAG_Short(300) thrownPotion["id"] = TAG_String(u'ThrownPotion') pos = TAG_List() pos.append(TAG_Double(x)) pos.append(TAG_Double(y))
def perform(level, box, options): print "Follow Me On Twitter At @RedstonerLabs" for x in xrange(box.minx, box.maxx): for z in xrange(box.minz, box.maxz): for y in xrange(box.miny, box.maxy): invun = options["Invuneable"] float = options["NoGravity"] silent = options["Silent"] ROTX = options["Rotation"] Text2 = options["CustomName"] glowing = options["Glowing"] fire = options["Fire"] off1 = options["Offset X"] off2 = options["Offset Y"] off3 = options["Offset Z"] vis = options["CustomNameVisible"] ItemsSmokeBox = Smokeboxs[options["Boat Type"]] ItemsSmokeBox2 = Smokeboxs2[options["Minecraft Type"]] chunk = level.getChunk(x/16, z/16) Boat = TAG_Compound() if options["(1.11)(1.11.2)(1.11.2+)"]: Boat["id"] = TAG_String(u'boat') else: Boat["id"] = TAG_String(u'Boat') pos = TAG_List() pos.append(TAG_Double(x+off1)) pos.append(TAG_Double(y+off2)) pos.append(TAG_Double(z+off3)) Boat["Pos"] = pos Boat["OnGround"] = TAG_Byte(0) Boat["NoGravity"] = TAG_Byte(float) Boat["Silent"] = TAG_Byte(silent) motion = TAG_List() motion.append(TAG_Double(0.0)) motion.append(TAG_Double(0.0)) motion.append(TAG_Double(0.0)) Boat["Motion"] = motion Boat["Dimension"] = TAG_Int(0) Boat["Air"] = TAG_Short(300) rotation = TAG_List() rotation.append(TAG_Float(ROTX)) rotation.append(TAG_Float(0.0)) Boat["Rotation"] = rotation Boat["FallDistance"] = TAG_Float(0.0) Boat["Invulnerable"] = TAG_Byte(invun) Boat["PortalCooldown"] = TAG_Int(0) Boat["Glowing"] = TAG_Byte(glowing) Boat["CustomNameVisible"] = TAG_Byte(vis) Boat["CustomName"] = TAG_String(Text2) Boat["Fire"] = TAG_Short(fire) if ItemsSmokeBox == "oak" and ItemsSmokeBox2 == "CONSOLE": Boat["Type"] = TAG_Int(0) if ItemsSmokeBox == "birch" and ItemsSmokeBox2 == "CONSOLE": Boat["Type"] = TAG_Int(1) if ItemsSmokeBox == "spruce" and ItemsSmokeBox2 == "CONSOLE": Boat["Type"] = TAG_Int(2) if ItemsSmokeBox == "jungle" and ItemsSmokeBox2 == "CONSOLE": Boat["Type"] = TAG_Int(3) if ItemsSmokeBox == "acaica" and ItemsSmokeBox2 == "CONSOLE": Boat["Type"] = TAG_Int(4) if ItemsSmokeBox == "dark_oak" and ItemsSmokeBox2 == "CONSOLE": Boat["Type"] = TAG_Int(5) if ItemsSmokeBox == "glitched" and ItemsSmokeBox2 == "CONSOLE": Boat["Type"] = TAG_Int(-1) if ItemsSmokeBox2 == "PC": Boat["Type"] = TAG_String(ItemsSmokeBox) chunk.Entities.append(Boat) print "Completed Work"
def perform(level, box, options): print "Follow Me On Twitter At @RedstonerLabs" ShowBottoms = options["ShowBottom"] Invun = options["Invulnerable"] target1 = options["Y"] target2 = options["X"] target3 = options["Z"] for x in xrange(box.minx, box.maxx): for y in xrange(box.miny, box.maxy): for z in xrange(box.minz, box.maxz): chunk = level.getChunk(x/16, z/16) enderCrystal = TAG_Compound() pos = TAG_List() pos.append(TAG_Double(x+0.5)) pos.append(TAG_Double(y)) pos.append(TAG_Double(z+0.5)) enderCrystal["Pos"] = pos if options["1.11-1.12+Worlds"]: enderCrystal["id"] = TAG_String(u'ender_crystal') else: enderCrystal["id"] = TAG_String(u'EnderCrystal') if options["Offset X,Y,Z Coordinates"]: beamTarget = TAG_Compound() beamTarget["X"] = TAG_Int(x+target2) beamTarget["Y"] = TAG_Int(y+target1) beamTarget["Z"] = TAG_Int(z+target3) enderCrystal["BeamTarget"] = beamTarget else: beamTarget = TAG_Compound() beamTarget["X"] = TAG_Int(target2) beamTarget["Y"] = TAG_Int(target1) beamTarget["Z"] = TAG_Int(target3) enderCrystal["BeamTarget"] = beamTarget enderCrystal["OnGround"] = TAG_Byte(0) motion = TAG_List() motion.append(TAG_Double(0.0)) motion.append(TAG_Double(0.0)) motion.append(TAG_Double(0.0)) enderCrystal["Motion"] = motion enderCrystal["Dimension"] = TAG_Int(0) enderCrystal["Air"] = TAG_Short(300) rotation = TAG_List() rotation.append(TAG_Float(0.0)) rotation.append(TAG_Float(0.0)) enderCrystal["Rotation"] = rotation enderCrystal["FallDistance"] = TAG_Float(0.0) enderCrystal["Fire"] = TAG_Short(0) enderCrystal["Invulnerable"] = TAG_Byte(Invun) enderCrystal["PortalCooldown"] = TAG_Int(0) enderCrystal["Glowing"] = TAG_Byte(0) enderCrystal["ShowBottom"] = TAG_Byte(ShowBottoms) chunk.Entities.append(enderCrystal)
def perform(level, box, options): start = time.time() print(start) file_name = options["Export File Name:"] if file_name == "": file_name = "translate-java-2-bedrock.txt" if file_name.find(".txt") < 0: file_name += ".txt" output_text = '' contents = '' if options["Prepare for Bedrock:"]: tileEntitiesToReplace = [] tileEntitiesToRemove = [] entitiesToRemove = [] entitiesToUpdate = [] tileEntityContainer = [] entityContainer = [] for (chunk, slices, point) in level.getChunkSlices(box): # get list of all entities in selection for t in chunk.TileEntities: x = t["x"].value y = t["y"].value z = t["z"].value coords = str(x) +","+ str(y) +","+str(z) id = fixID(t["id"].value) if (coords) not in tileEntityContainer: tileEntityContainer.append(coords) if (x,y,z) in box: if id in removeTileEntities: # tile entities that need to be removed tileEntitiesToRemove.append((chunk, t)) else: # tile entities that need to be translated tileEntitiesToReplace.append((chunk, t)) # get all entities in selection for e in chunk.Entities: x = e["Pos"][0].value y = e["Pos"][1].value z = e["Pos"][2].value id = fixID(e["id"].value) coords = str(x) +","+ str(y) +","+str(z) if (coords) not in entityContainer: entityContainer.append(coords) if (x,y,z) in box: # delete tile entity entitiesToRemove.append((chunk, e)) # removed replacement code until entities can be translated #if (id in removeEntities): #entitiesToRemove.append((chunk, e)) #else: #entitiesToUpdate.append((chunk, e)) if tileEntitiesToReplace: for (chunk, t) in tileEntitiesToReplace: iIgnore = 0 x = t["x"].value y = t["y"].value z = t["z"].value id = fixID(t["id"].value) # check to see if the ID needs to be translated if id in tileEntityNameReplacements: id = tileEntityNameReplacements[id] blockid = level.blockAt(x,y,z) contents += "----"+id+" "+str(x)+","+str(y)+","+str(z)+"\n" contents += str(chunk)+"\n"+ str(t) + "\n\n" chunk.TileEntities.remove(t) newte = TileEntity.Create(id) TileEntity.setpos(newte, (x, y, z)) # rewrite spawner data - no features carried over as bedrock doesn't support # SpawnData or SpawnPotentials # adding MinSpawnDelay, MaxSpawnDelay, MaxNearbyEntities, etc is a good idea if ("Banner" in id): newte = t del newte["Patterns"] if ("Skull" in id): newte = t newte["MouthMoving"] = TAG_Byte(0) newte["MouthTickCount"] = TAG_Int(0) if ("MobSpawner" in id): try: entityName = t["SpawnData"]["id"].value.replace("minecraft:","") except KeyError: entityName = t["EntityId"].value if not str(entityName).isdigit(): entityName = fixID(entityName) print(entityName) if (entityName in idMappings["entities"]): newte = t if "SpawnData" in newte: del newte["SpawnData"] if "SpawnPotentials" in newte: del newte["SpawnPotentials"] if entityName.isdigit(): entityId = entityName else: entityId = idMappings["entities"][entityName] newte["EntityId"] = TAG_Int(int(entityId)) else: print("ENTITY NOT FOUND REPLACED WITH ZOMBIE: "+str(entityName)+" "+str(x)+","+str(y)+","+str(z)) contents += "ENTITY NOT FOUND REPLACED WITH ZOMBIE: "+str(entityName)+" "+str(x)+","+str(y)+","+str(z)+"\n" newte = t if "SpawnData" in newte: del newte["SpawnData"] if "SpawnPotentials" in newte: del newte["SpawnPotentials"] newte["EntityId"] = TAG_Int(32) # MCEdit doesn't add all the needed tags when creating a new tile entity if ("Items" in t) and (not "Items" in newte): newte["Items"]=TAG_List() # if the tile entity has an inventory, convert the inventory if ("Items" in t) and ("Items" in newte): for i in t["Items"]: if not str(i["id"].value).isdigit(): itemNew = stripID(i["id"].value) if itemNew in idMappings["items"]: idItems = idMappings["items"][itemNew] elif itemNew in idMappings: idItems = idMappings[itemNew]["id"] else: idItems = 248 print("ITEM NOT FOUND: "+str(i["id"].value)+" "+str(x)+","+str(y)+","+str(z)) contents += "ITEM NOT FOUND: "+str(i["id"].value)+" "+str(x)+","+str(y)+","+str(z)+"\n" else: idItems = i["id"].value idItems = int(idItems) item = TAG_Compound() item["id"] = TAG_Short(idItems) if stripID(i["id"].value) == "lava_bucket": item["Damage"] = TAG_Short(10) elif stripID(i["id"].value) == "water_bucket": item["Damage"] = TAG_Short(8) elif stripID(i["id"].value) == "milk_bucket": item["Damage"] = TAG_Short(1) else: item["Damage"] = TAG_Short(i["Damage"].value) item["Count"] = TAG_Byte(i["Count"].value) item["Slot"] = TAG_Byte(i["Slot"].value) if "tag" in i: pset=0 item["tag"] = TAG_Compound(i["tag"].value) if ("Potion" in item["tag"]) and (not itemNew in idMappings): potion = stripID(item["tag"]["Potion"].value) if potion in idMappings["potions"]: item["Damage"] = TAG_Short(int(idMappings["potions"][potion])) elif ("Potion" in item["tag"]) and (itemNew in idMappings): potion = stripID(item["tag"]["Potion"].value) item["Damage"] = TAG_Short(int(idMappings[itemNew][potion])) del item["tag"]["Potion"] if ("ench" in i["tag"]): enchHolder = TAG_List() for e in i["tag"]["ench"]: ench = TAG_Compound() enchId = e["id"].value enchLvl = e["lvl"].value if str(enchId) in idMappings["enchantments"]: enchId = int(idMappings["enchantments"][str(enchId)]) ench["lvl"] = TAG_Short(enchLvl) ench["id"] = TAG_Short(enchId) enchHolder.append(ench) item["tag"]["ench"] = enchHolder if "StoredEnchantments" in i["tag"]: enchHolder = TAG_List() for e in i["tag"]["StoredEnchantments"]: ench = TAG_Compound() enchId = e["id"].value enchLvl = e["lvl"].value if str(enchId) in idMappings["enchantments"]: enchId = int(idMappings["enchantments"][str(enchId)]) ench["lvl"] = TAG_Short(enchLvl) ench["id"] = TAG_Short(enchId) enchHolder.append(ench) item["tag"]["ench"] = enchHolder del item["tag"]["StoredEnchantments"] if "CanPlaceOn" in i["tag"]: canPlaceOn = TAG_List() for p in i["tag"]["CanPlaceOn"]: canPlaceOn.append(TAG_String(p.value.replace("minecraft:",""))) del item["tag"]["CanPlaceOn"] item["CanPlaceOn"] = canPlaceOn if "CanDestroy" in i["tag"]: canDestroy = TAG_List() for p in i["tag"]["CanDestroy"]: canDestroy.append(TAG_String(p.value.replace("minecraft:",""))) del item["tag"]["CanDestroy"] item["CanDestroy"] = canDestroy newte["Items"].append(item) # convert command block data after fixing the ID earlier if id == "CommandBlock": newte = t if "UpdateLastExecution" in newte: del newte["UpdateLastExecution"] if "auto" not in newte: newte["auto"] = TAG_Byte(0) if "powered" not in newte: newte["powered"] = TAG_Byte(0) if "SuccessCount" not in newte: newte["SuccessCount"] = TAG_Int(0) if "conditionMet" not in newte: newte["conditionMet"] = TAG_Byte(0) if "TrackOutput" not in newte: newte["TrackOutput"] = TAG_Byte(0) if ("CustomName" not in newte) or newte["CustomName"] == TAG_String(u'@'): newte["CustomName"] = TAG_String('') # my attempt at converting signs with or without json data # still probably breaks some (most?) signs that are json formatted if id == "Sign": if "Text1" in t: if t["Text1"].value.find('"text":') > 0: text1 = t["Text1"].value text1 = json.loads(text1) text1 = text1["text"] newte["Text1"] = TAG_String(text1) else: text1 = t["Text1"].value if not text1 == "": if (text1[0] == '"' and text1[:1] == '"'): text1 = text1[:-1] text1 = text1[1:] newte["Text1"] = TAG_String(text1) if "Text2" in t: if t["Text2"].value.find('"text":') > 0: text2 = t["Text2"].value text2 = json.loads(text2) text2 = text2["text"] newte["Text2"] = TAG_String(text2) else: text2 = t["Text2"].value if not text2 == "": if (text2[0] == '"' and text2[:1] == '"'): text2 = text2[:-1] text2 = text2[1:] newte["Text2"] = TAG_String(text2) if "Text3" in t: if t["Text3"].value.find('"text":') > 0: text3 = t["Text3"].value text3 = json.loads(text3) text3 = text3["text"] newte["Text3"] = TAG_String(text3) else: text3 = t["Text3"].value if not text3 == "": if (text3[0] == '"' and text3[:1] == '"'): text3 = text3[:-1] text3 = text3[1:] newte["Text3"] = TAG_String(text3) if "Text4" in t: if t["Text4"].value.find('"text":') > 0: text4 = t["Text4"].value text4 = json.loads(text4) text4 = text4["text"] newte["Text4"] = TAG_String(text4) else: text4 = t["Text4"].value if not text4 == "": if (text4[0] == '"' and text4[:1] == '"'): text4 = text4[:-1] text4 = text4[1:] newte["Text4"] = TAG_String(text4) # convert new style brewing stands (with blaze powder) to old style # will need to be reverted for 1.2 (which uses blaze powder) # also translates some tags if id == "BrewingStand": itemHolder = TAG_List() if "BrewTime" in t: newte["CookTime"] = t["BrewTime"] else: newte["CookTime"] = t["CookTime"] for i in t["Items"]: item = TAG_Compound() if i["Slot"].value == 3: slotID = stripID(i["id"].value) slotID = idMappings['items'][slotID] item["Slot"] = TAG_Byte(0) item["id"] = TAG_Short(int(slotID)) item["Damage"] = i["Damage"] item["Count"] = i["Count"] elif i["Slot"].value == 0: slotID = stripID(i["id"].value) slotID = idMappings['items'][slotID] item["Slot"] = TAG_Byte(1) item["Count"] = i["Count"] item["id"] = TAG_Short(int(slotID)) if "tag" in i: potionType = stripID(i["tag"]["Potion"].value) item["Damage"] = TAG_Short(int(idMappings['potions'][potionType])) else: potionType = i["Damage"].value item["Damage"] = TAG_Short(int(idMappings['potions'][potionType])) elif i["Slot"].value == 1: slotID = stripID(i["id"].value) slotID = idMappings['items'][slotID] item["Slot"] = TAG_Byte(2) item["Count"] = i["Count"] item["id"] = TAG_Short(int(slotID)) if "tag" in i: potionType = stripID(i["tag"]["Potion"].value) item["Damage"] = TAG_Short(int(idMappings['potions'][potionType])) else: potionType = i["Damage"].value item["Damage"] = TAG_Short(int(idMappings['potions'][potionType])) elif i["Slot"].value == 2: slotID = stripID(i["id"].value) slotID = idMappings['items'][slotID] item["Slot"] = TAG_Byte(3) item["Count"] = i["Count"] item["id"] = TAG_Short(int(slotID)) if "tag" in i: potionType = stripID(i["tag"]["Potion"].value) item["Damage"] = TAG_Short(int(idMappings['potions'][potionType])) else: potionType = i["Damage"].value item["Damage"] = TAG_Short(int(idMappings['potions'][potionType])) itemHolder.append(item) newte["Items"] = itemHolder newte["id"] = TAG_String(str(id)) chunk.TileEntities.append(newte) # playing around with java mode. If enabled it removes the block be keeps # the tile entity data. usecase would be to copy the tile entity data over # a world converted with a different tool if options["Java Mode:"]: level.setBlockAt(x, y, z, 0) else: level.setBlockAt(x, y, z, blockid) if tileEntitiesToRemove: for (chunk, t) in tileEntitiesToRemove: x = t["x"].value y = t["y"].value z = t["z"].value id = fixID(t["id"].value) contents += "----"+id+" "+str(x)+","+str(y)+","+str(z)+"\n" contents += str(chunk)+"\n"+ str(t) + "\n\n" chunk.TileEntities.remove(t) level.setBlockAt(x, y, z, 0) if entitiesToRemove: for (chunk, e) in entitiesToRemove: x = e["Pos"][0].value y = e["Pos"][1].value z = e["Pos"][2].value id = fixID(e["id"].value) contents += "----"+id+" "+str(x)+","+str(y)+","+str(z)+"\n" contents += str(chunk)+"\n"+ str(e) + "\n\n" chunk.Entities.remove(e) # beginning of translate entity data # not currently used if entitiesToUpdate: for (chunk, e) in entitiesToUpdate: x = e["Pos"][0].value y = e["Pos"][1].value z = e["Pos"][2].value id = fixID(e["id"].value) newEntity = e newEntity["id"] = TAG_String(id) contents += "----"+id+" "+str(x)+","+str(y)+","+str(z)+"\n" contents += str(chunk)+"\n"+ str(e) + "\n\n" chunk.Entities.remove(e) chunk.Entities.append(newEntity) output_text += contents chunk.dirty = True output_text = output_text.encode('utf-8') with open(file_name, "w") as text_file: text_file.write(output_text) end = time.time() finalTime = end - start print(end) print("It took " + str(finalTime) + " seconds to complete the requested operation")
def perform(level, box, options): for x in xrange(box.minx, box.maxx): for y in xrange(box.miny, box.maxy): for z in xrange(box.minz, box.maxz): block = level.blockAt(x, y, z) data = level.blockDataAt(x, y, z) extrab = options["Use Slime Blocks"] ItemsSmokeBox2 = Smokeboxs2[options["Minecraft Type"]] chunk = level.getChunk(x / 16, z / 16) areaEffectCloud = TAG_Compound() if options["1.11+ or 1.11.2+"]: areaEffectCloud["id"] = TAG_String(u'area_effect_cloud') if options["1.11+ or 1.11.2+"] != True: areaEffectCloud["id"] = TAG_String(u'AreaEffectCloud') areaEffectCloud["ownerUUID"] = TAG_String(u'') areaEffectCloud["OnGround"] = TAG_Byte(0) areaEffectCloud["Dimension"] = TAG_Int(0) areaEffectCloud["Air"] = TAG_Short(300) areaEffectCloud["ParticleParam2"] = TAG_Int(0) areaEffectCloud["ParticleParam1"] = TAG_Int(0) if ItemsSmokeBox2 == "PC": areaEffectCloud["Particle"] = TAG_String(u"take") if ItemsSmokeBox2 != "PC": areaEffectCloud["Particle"] = TAG_Int(0) areaEffectCloud["ReapplicationDelay"] = TAG_Int(0) rotation = TAG_List() rotation.append(TAG_Float(0.0)) rotation.append(TAG_Float(0.0)) areaEffectCloud["Rotation"] = rotation areaEffectCloud["FallDistance"] = TAG_Float(0.0) effects = TAG_List() effect = TAG_Compound() effect["Amplifier"] = TAG_Byte(15) effect["Id"] = TAG_Byte(25) effect["Duration"] = TAG_Int(10) effect["Ambient"] = TAG_Byte(0) effect["ShowParticles"] = TAG_Byte(0) effects.append(effect) effect2 = TAG_Compound() effect2["Amplifier"] = TAG_Byte(100) effect2["Id"] = TAG_Byte(11) effect2["Duration"] = TAG_Int(100) effect2["Ambient"] = TAG_Byte(0) effect2["ShowParticles"] = TAG_Byte(0) effects.append(effect2) effect3 = TAG_Compound() effect3["Amplifier"] = TAG_Byte(20) effect3["Id"] = TAG_Byte(8) effect3["Duration"] = TAG_Int(40) effect3["Ambient"] = TAG_Byte(0) effect3["ShowParticles"] = TAG_Byte(0) effects.append(effect3) areaEffectCloud["Effects"] = effects areaEffectCloud["Fire"] = TAG_Short(0) areaEffectCloud["Invulnerable"] = TAG_Byte(0) areaEffectCloud["PortalCooldown"] = TAG_Int(0) areaEffectCloud["CustomName"] = TAG_String(u'') areaEffectCloud["createdOnHost"] = TAG_Byte(0) areaEffectCloud["Silent"] = TAG_Byte(1) areaEffectCloud["NoGravity"] = TAG_Byte(1) areaEffectCloud["Glowing"] = TAG_Byte(0) areaEffectCloud["Age"] = TAG_Int(1) areaEffectCloud["RadiusOnUse"] = TAG_Float(0.0) areaEffectCloud["Duration"] = TAG_Int(2147483647) areaEffectCloud["DurationOnUse"] = TAG_Int(0) areaEffectCloud["WaitTime"] = TAG_Int(0) areaEffectCloud["RadiusPerTick"] = TAG_Float(0.0) areaEffectCloud["Radius"] = TAG_Float(2.5) areaEffectCloud["Color"] = TAG_Int(0) areaEffectCloud["Potion"] = TAG_String(u'minecraft:leaping') pos = TAG_List() pos.append(TAG_Double(x+0.5)) pos.append(TAG_Double(y+5)) pos.append(TAG_Double(z+0.5)) areaEffectCloud["Pos"] = pos motion = TAG_List() motion.append(TAG_Double(0.0)) motion.append(TAG_Double(0.0)) motion.append(TAG_Double(0.0)) areaEffectCloud["Motion"] = motion areaEffectCloud2 = TAG_Compound() if options["1.11+ or 1.11.2+"]: areaEffectCloud2["id"] = TAG_String(u'area_effect_cloud') if options["1.11+ or 1.11.2+"] != True: areaEffectCloud2["id"] = TAG_String(u'AreaEffectCloud') areaEffectCloud2["ownerUUID"] = TAG_String(u'') areaEffectCloud2["OnGround"] = TAG_Byte(0) areaEffectCloud2["Dimension"] = TAG_Int(0) areaEffectCloud2["Air"] = TAG_Short(300) areaEffectCloud2["ParticleParam2"] = TAG_Int(0) areaEffectCloud2["ParticleParam1"] = TAG_Int(0) if ItemsSmokeBox2 == "PC": areaEffectCloud2["Particle"] = TAG_String(u"take") if ItemsSmokeBox2 != "PC": areaEffectCloud2["Particle"] = TAG_Int(0) areaEffectCloud2["ReapplicationDelay"] = TAG_Int(0) rotation2 = TAG_List() rotation2.append(TAG_Float(0.0)) rotation2.append(TAG_Float(0.0)) areaEffectCloud2["Rotation"] = rotation2 areaEffectCloud2["FallDistance"] = TAG_Float(0.0) effects2 = TAG_List() effect4 = TAG_Compound() effect4["Amplifier"] = TAG_Byte(15) effect4["Id"] = TAG_Byte(25) effect4["Duration"] = TAG_Int(10) effect4["Ambient"] = TAG_Byte(0) effect4["ShowParticles"] = TAG_Byte(0) effects2.append(effect4) effect5 = TAG_Compound() effect5["Amplifier"] = TAG_Byte(100) effect5["Id"] = TAG_Byte(11) effect5["Duration"] = TAG_Int(100) effect5["Ambient"] = TAG_Byte(0) effect5["ShowParticles"] = TAG_Byte(0) effects2.append(effect5) effect6 = TAG_Compound() effect6["Amplifier"] = TAG_Byte(20) effect6["Id"] = TAG_Byte(8) effect6["Duration"] = TAG_Int(40) effect6["Ambient"] = TAG_Byte(0) effect6["ShowParticles"] = TAG_Byte(0) effects2.append(effect6) areaEffectCloud2["Effects"] = effects2 areaEffectCloud2["Fire"] = TAG_Short(0) areaEffectCloud2["Invulnerable"] = TAG_Byte(0) areaEffectCloud2["PortalCooldown"] = TAG_Int(0) areaEffectCloud2["CustomName"] = TAG_String(u'') areaEffectCloud2["createdOnHost"] = TAG_Byte(0) areaEffectCloud2["Silent"] = TAG_Byte(1) areaEffectCloud2["NoGravity"] = TAG_Byte(1) areaEffectCloud2["Glowing"] = TAG_Byte(0) areaEffectCloud2["Age"] = TAG_Int(1) areaEffectCloud2["RadiusOnUse"] = TAG_Float(0.0) areaEffectCloud2["Duration"] = TAG_Int(2147483647) areaEffectCloud2["DurationOnUse"] = TAG_Int(0) areaEffectCloud2["WaitTime"] = TAG_Int(0) areaEffectCloud2["RadiusPerTick"] = TAG_Float(0.0) areaEffectCloud2["Radius"] = TAG_Float(2.5) areaEffectCloud2["Color"] = TAG_Int(0) areaEffectCloud2["Potion"] = TAG_String(u'minecraft:leaping') pos2 = TAG_List() pos2.append(TAG_Double(x+0.5)) pos2.append(TAG_Double(y+1.1)) pos2.append(TAG_Double(z+0.5)) areaEffectCloud2["Pos"] = pos2 motion2 = TAG_List() motion2.append(TAG_Double(0.0)) motion2.append(TAG_Double(0.0)) motion2.append(TAG_Double(0.0)) areaEffectCloud2["Motion"] = motion2 chunk.Entities.append(areaEffectCloud2) chunk.Entities.append(areaEffectCloud) print "Created Trampoline! Successfully" chunk.dirty = True #Blackwool #3x3 level.setBlockAt(x, y+1, z, 171) level.setBlockDataAt(x, y+1, z, 15) level.setBlockAt(x+1, y+1, z, 171) level.setBlockDataAt(x+1, y+1, z, 15) level.setBlockAt(x, y+1, z+1, 171) level.setBlockDataAt(x, y+1, z+1, 15) level.setBlockAt(x+1, y+1, z+1, 171) level.setBlockDataAt(x+1, y+1, z+1, 15) level.setBlockAt(x, y+1, z-1, 171) level.setBlockDataAt(x, y+1, z-1, 15) level.setBlockAt(x-1, y+1, z, 171) level.setBlockDataAt(x-1, y+1, z, 15) level.setBlockAt(x-1, y+1, z-1, 171) level.setBlockDataAt(x-1, y+1, z-1, 15) level.setBlockAt(x+1, y+1, z-1, 171) level.setBlockDataAt(x+1, y+1, z-1, 15) level.setBlockAt(x-1, y+1, z+1, 171) level.setBlockDataAt(x-1, y+1, z+1, 15) #Blackwool #2 3x3 Empty Circle level.setBlockAt(x+2, y+1, z, 171) level.setBlockDataAt(x+2, y+1, z, 15) level.setBlockAt(x-2, y+1, z, 171) level.setBlockDataAt(x-2, y+1, z, 15) level.setBlockAt(x, y+1, z+2, 171) level.setBlockDataAt(x, y+1, z+2, 15) level.setBlockAt(x, y+1, z-2, 171) level.setBlockDataAt(x, y+1, z-2, 15) level.setBlockAt(x+2, y+1, z-1, 171) level.setBlockDataAt(x+2, y+1, z-1, 15) level.setBlockAt(x-1, y+1, z+2, 171) level.setBlockDataAt(x-1, y+1, z+2, 15) level.setBlockAt(x+1, y+1, z+2, 171) level.setBlockDataAt(x+1, y+1, z+2, 15) level.setBlockAt(x+2, y+1, z+1, 171) level.setBlockDataAt(x+2, y+1, z+1, 15) level.setBlockAt(x+1, y+1, z+-2, 171) level.setBlockDataAt(x+1, y+1, z-2, 15) level.setBlockAt(x-2, y+1, z+1, 171) level.setBlockDataAt(x-2, y+1, z+1, 15) level.setBlockAt(x-2, y+1, z-1, 171) level.setBlockDataAt(x-2, y+1, z-1, 15) level.setBlockAt(x-1, y+1, z-2, 171) level.setBlockDataAt(x-1, y+1, z-2, 15) #Blue Wool 5x5 / 3x3 level.setBlockAt(x+3, y+1, z, 171) level.setBlockDataAt(x+3, y+1, z, 11) level.setBlockAt(x-3, y+1, z, 171) level.setBlockDataAt(x-3, y+1, z, 11) level.setBlockAt(x, y+1, z+3, 171) level.setBlockDataAt(x, y+1, z+3, 11) level.setBlockAt(x, y+1, z-3, 171) level.setBlockDataAt(x, y+1, z-3, 11) level.setBlockAt(x+1, y+1, z-3, 171) level.setBlockDataAt(x+1, y+1, z-3, 11) level.setBlockAt(x-1, y+1, z-3, 171) level.setBlockDataAt(x-1, y+1, z-3, 11) level.setBlockAt(x+3, y+1, z-1, 171) level.setBlockDataAt(x+3, y+1, z-1, 11) level.setBlockAt(x-3, y+1, z-1, 171) level.setBlockDataAt(x-3, y+1, z-1, 11) level.setBlockAt(x+3, y+1, z+1, 171) level.setBlockDataAt(x+3, y+1, z+1, 11) level.setBlockAt(x-3, y+1, z+1, 171) level.setBlockDataAt(x-3, y+1, z+1, 11) level.setBlockAt(x+1, y+1, z+3, 171) level.setBlockDataAt(x+1, y+1, z+3, 11) level.setBlockAt(x-1, y+1, z+3, 171) level.setBlockDataAt(x-1, y+1, z+3, 11) # level.setBlockAt(x-2, y+1, z+2, 171) level.setBlockDataAt(x-2, y+1, z+2, 11) level.setBlockAt(x+2, y+1, z-2, 171) level.setBlockDataAt(x+2, y+1, z-2, 11) level.setBlockAt(x+2, y+1, z+2, 171) level.setBlockDataAt(x+2, y+1, z+2, 11) level.setBlockAt(x+2, y+1, z-2, 171) level.setBlockDataAt(x+2, y+1, z-2, 11) level.setBlockAt(x-2, y+1, z-2, 171) level.setBlockDataAt(x-2, y+1, z-2, 11) if extrab == True: #Slime Block #3x3 level.setBlockAt(x, y, z, 165) level.setBlockDataAt(x, y, z, 0) level.setBlockAt(x+1, y, z, 165) level.setBlockDataAt(x+1, y, z, 0) level.setBlockAt(x, y, z+1, 165) level.setBlockDataAt(x, y, z+1, 0) level.setBlockAt(x+1, y, z+1, 165) level.setBlockDataAt(x+1, y, z+1, 0) level.setBlockAt(x, y, z-1, 165) level.setBlockDataAt(x, y, z-1, 0) level.setBlockAt(x-1, y, z, 165) level.setBlockDataAt(x-1, y, z, 0) level.setBlockAt(x-1, y, z-1, 165) level.setBlockDataAt(x-1, y, z-1, 0) level.setBlockAt(x+1, y, z-1, 165) level.setBlockDataAt(x+1, y, z-1, 0) level.setBlockAt(x-1, y, z+1, 165) level.setBlockDataAt(x-1, y, z+1, 0) #Part 2 Slime 3x3 Empty Circle level.setBlockAt(x+2, y, z, 165) level.setBlockDataAt(x+2, y, z, 0) level.setBlockAt(x-2, y, z, 165) level.setBlockDataAt(x-2, y, z, 0) level.setBlockAt(x, y, z+2, 165) level.setBlockDataAt(x, y, z+2, 0) level.setBlockAt(x, y, z-2, 165) level.setBlockDataAt(x, y, z-2, 0) level.setBlockAt(x+2, y, z-1, 165) level.setBlockDataAt(x+2, y, z-1, 0) level.setBlockAt(x-1, y, z+2, 165) level.setBlockDataAt(x-1, y, z+2, 0) level.setBlockAt(x+1, y, z+2, 165) level.setBlockDataAt(x+1, y, z+2, 0) level.setBlockAt(x+2, y, z+1, 165) level.setBlockDataAt(x+2, y, z+1, 0) level.setBlockAt(x+1, y, z+-2, 165) level.setBlockDataAt(x+1, y, z-2, 0) level.setBlockAt(x-2, y, z+1, 165) level.setBlockDataAt(x-2, y, z+1, 0) level.setBlockAt(x-2, y, z-1, 165) level.setBlockDataAt(x-2, y, z-1, 0) level.setBlockAt(x-1, y, z-2, 165) level.setBlockDataAt(x-1, y, z-2, 0) #Part 3 Slime Outer Ring level.setBlockAt(x+3, y, z, 165) level.setBlockDataAt(x+3, y, z, 0) level.setBlockAt(x-3, y, z, 165) level.setBlockDataAt(x-3, y, z, 0) level.setBlockAt(x, y, z+3, 165) level.setBlockDataAt(x, y, z+3, 0) level.setBlockAt(x, y, z-3, 165) level.setBlockDataAt(x, y, z-3, 0) level.setBlockAt(x+1, y, z-3, 165) level.setBlockDataAt(x+1, y, z-3, 0) level.setBlockAt(x-1, y, z-3, 165) level.setBlockDataAt(x-1, y, z-3, 0) level.setBlockAt(x+3, y, z-1, 165) level.setBlockDataAt(x+3, y, z-1, 0) level.setBlockAt(x-3, y, z-1, 165) level.setBlockDataAt(x-3, y, z-1, 0) level.setBlockAt(x+3, y, z+1, 165) level.setBlockDataAt(x+3, y, z+1, 0) level.setBlockAt(x-3, y, z+1, 165) level.setBlockDataAt(x-3, y, z+1, 0) level.setBlockAt(x+1, y, z+3, 165) level.setBlockDataAt(x+1, y, z+3, 0) level.setBlockAt(x-1, y, z+3, 165) level.setBlockDataAt(x-1, y, z+3, 0) level.setBlockAt(x-2, y, z+2, 165) level.setBlockDataAt(x-2, y, z+2, 0) level.setBlockAt(x+2, y, z-2, 165) level.setBlockDataAt(x+2, y, z-2, 0) level.setBlockAt(x+2, y, z+2, 165) level.setBlockDataAt(x+2, y, z+2, 0) level.setBlockAt(x+2, y, z-2, 165) level.setBlockDataAt(x+2, y, z-2, 0) level.setBlockAt(x-2, y, z-2, 165) level.setBlockDataAt(x-2, y, z-2, 0) else: #String Middle Block #3x3 level.setBlockAt(x, y, z, 166) level.setBlockDataAt(x, y, z, 0) level.setBlockAt(x+1, y, z, 166) level.setBlockDataAt(x+1, y, z, 0) level.setBlockAt(x, y, z+1, 166) level.setBlockDataAt(x, y, z+1, 0) level.setBlockAt(x+1, y, z+1, 166) level.setBlockDataAt(x+1, y, z+1, 0) level.setBlockAt(x, y, z-1, 166) level.setBlockDataAt(x, y, z-1, 0) level.setBlockAt(x-1, y, z, 166) level.setBlockDataAt(x-1, y, z, 0) level.setBlockAt(x-1, y, z-1, 166) level.setBlockDataAt(x-1, y, z-1, 0) level.setBlockAt(x+1, y, z-1, 166) level.setBlockDataAt(x+1, y, z-1, 0) level.setBlockAt(x-1, y, z+1, 166) level.setBlockDataAt(x-1, y, z+1, 0) #String Block Inner #3x3 level.setBlockAt(x+2, y, z, 166) level.setBlockDataAt(x+2, y, z, 0) level.setBlockAt(x-2, y, z, 166) level.setBlockDataAt(x-2, y, z, 0) level.setBlockAt(x, y, z+2, 166) level.setBlockDataAt(x, y, z+2, 0) level.setBlockAt(x, y, z-2, 166) level.setBlockDataAt(x, y, z-2, 0) level.setBlockAt(x+2, y, z-1, 166) level.setBlockDataAt(x+2, y, z-1, 0) level.setBlockAt(x-1, y, z+2, 166) level.setBlockDataAt(x-1, y, z+2, 0) level.setBlockAt(x+1, y, z+2, 166) level.setBlockDataAt(x+1, y, z+2, 0) level.setBlockAt(x+2, y, z+1, 166) level.setBlockDataAt(x+2, y, z+1, 0) level.setBlockAt(x+1, y, z+-2, 166) level.setBlockDataAt(x+1, y, z-2, 0) level.setBlockAt(x-2, y, z+1, 166) level.setBlockDataAt(x-2, y, z+1, 0) level.setBlockAt(x-2, y, z-1, 166) level.setBlockDataAt(x-2, y, z-1, 0) level.setBlockAt(x-1, y, z-2, 166) level.setBlockDataAt(x-1, y, z-2, 0) #Iron Fence Block #3x3 Outer level.setBlockAt(x+3, y, z, 101) level.setBlockDataAt(x+3, y, z, 0) level.setBlockAt(x-3, y, z, 101) level.setBlockDataAt(x-3, y, z, 0) level.setBlockAt(x, y, z+3, 101) level.setBlockDataAt(x, y, z+3, 0) level.setBlockAt(x, y, z-3, 101) level.setBlockDataAt(x, y, z-3, 0) level.setBlockAt(x+1, y, z-3, 101) level.setBlockDataAt(x+1, y, z-3, 0) level.setBlockAt(x-1, y, z-3, 101) level.setBlockDataAt(x-1, y, z-3, 0) level.setBlockAt(x+3, y, z-1, 101) level.setBlockDataAt(x+3, y, z-1, 0) level.setBlockAt(x-3, y, z-1, 101) level.setBlockDataAt(x-3, y, z-1, 0) level.setBlockAt(x+3, y, z+1, 101) level.setBlockDataAt(x+3, y, z+1, 0) level.setBlockAt(x-3, y, z+1, 101) level.setBlockDataAt(x-3, y, z+1, 0) level.setBlockAt(x+1, y, z+3, 101) level.setBlockDataAt(x+1, y, z+3, 0) level.setBlockAt(x-1, y, z+3, 101) level.setBlockDataAt(x-1, y, z+3, 0) level.setBlockAt(x-2, y, z+2, 101) level.setBlockDataAt(x-2, y, z+2, 0) level.setBlockAt(x+2, y, z-2, 101) level.setBlockDataAt(x+2, y, z-2, 0) level.setBlockAt(x+2, y, z+2, 101) level.setBlockDataAt(x+2, y, z+2, 0) level.setBlockAt(x+2, y, z-2, 101) level.setBlockDataAt(x+2, y, z-2, 0) level.setBlockAt(x-2, y, z-2, 101) level.setBlockDataAt(x-2, y, z-2, 0)
def bogusSpawn(cx, cz): properties = TAG_Compound() properties["id"] = TAG_String(u'Item') properties["Age"] = TAG_Short(19) motion = TAG_List() motion.append(TAG_Double(0)) motion.append(TAG_Double(0)) motion.append(TAG_Double(0)) properties["Motion"] = motion properties["OnGround"] = TAG_Byte(1) properties["Health"] = TAG_Short(5) properties["Dimension"] = TAG_Int(0) properties["Air"] = TAG_Short(300) pos = TAG_List() pos.append(TAG_Double(cx)) pos.append(TAG_Double(-100)) pos.append(TAG_Double(cz)) properties["Pos"] = pos properties["PortalCooldown"] = TAG_Int(0) item = TAG_Compound() item["id"] = TAG_Short(24) item["Damage"] = TAG_Short(0) item["Count"] = TAG_Byte(1) properties["Item"] = item properties["Fire"] = TAG_Short(-1) properties["FallDistance"] = TAG_Float(0.0) rotation = TAG_List() rotation.append(TAG_Float(0)) rotation.append(TAG_Float(0)) properties["Rotation"] = rotation properties["Invulnerable"] = TAG_Byte(0) return properties
def createXeno(level, x, y, z, customName, Invisible, CustomNameVisible, Invulnerable, Marker, NoGravity, MotionX, MotionY, MotionZ, RotationX, RotationY, Small,ShowArms,NoBasePlate,HandItem1,HandItem2,ArmorItem1,ArmorItem2,ArmorItem3,ArmorItem4,ArmorItem4Data,PoseBodyX,PoseBodyY,PoseBodyZ,PoseHeadX,PoseHeadY,PoseHeadZ,PoseRightArmX,PoseRightArmY,PoseRightArmZ,PoseLeftArmX,PoseLeftArmY,PoseLeftArmZ,PoseRightLegX,PoseRightLegY,PoseRightLegZ,PoseLeftLegX,PoseLeftLegY,PoseLeftLegZ): # After @Sethbling print("New Xeno named "+customName+" at "+str(x)+","+str(y)+","+str(z)) mob = TAG_Compound() mob["NoAI"] = TAG_Byte(1) mob["LeftHanded"] = TAG_Byte(1) mob["PersistenceRequired"] = TAG_Byte(1) mob["CustomName"] = TAG_String(customName) mob["Invisible"] = TAG_Byte(Invisible) mob["Small"] = TAG_Byte(Small) # mob["ShowArms"] = TAG_Byte(ShowArms) # mob["NoBasePlate"] = TAG_Byte(NoBasePlate) mob["CustomNameVisible"] = TAG_Byte(CustomNameVisible) mob["Invulnerable"] = TAG_Byte(Invulnerable) # mob["Marker"] = TAG_Byte(Marker) mob["NoGravity"] = TAG_Byte(NoGravity) mob["OnGround"] = TAG_Byte(1) mob["Air"] = TAG_Short(300) mob["DeathTime"] = TAG_Short(0) mob["Fire"] = TAG_Short(-1) mob["Health"] = TAG_Short(40) mob["HurtTime"] = TAG_Short(0) mob["Age"] = TAG_Int(0) mob["FallDistance"] = TAG_Float(0) mob["Motion"] = TAG_List() mob["Motion"].append(TAG_Double(MotionX)) mob["Motion"].append(TAG_Double(MotionY)) mob["Motion"].append(TAG_Double(MotionZ)) mob["Pos"] = TAG_List() mob["Pos"].append(TAG_Double(x + 0.5)) mob["Pos"].append(TAG_Double(y)) mob["Pos"].append(TAG_Double(z + 0.5)) mob["Rotation"] = TAG_List() mob["Rotation"].append(TAG_Float(RotationX)) mob["Rotation"].append(TAG_Float(RotationY)) tl_AI = TAG_List() tc_AI1 = TAG_Compound() tc_AI1["Count"] = TAG_Byte(1) tc_AI1["id"] = TAG_String(HandItem1) tl_AI.append(tc_AI1) tc_AI1 = TAG_Compound() tc_AI1["Count"] = TAG_Byte(1) tc_AI1["id"] = TAG_String(HandItem2) tl_AI.append(tc_AI1) mob["HandItems"] = tl_AI tl_AI = TAG_List() tc_AI1 = TAG_Compound() tc_AI1["Count"] = TAG_Byte(1) tc_AI1["id"] = TAG_String(ArmorItem1) tl_AI.append(tc_AI1) tc_AI1 = TAG_Compound() tc_AI1["Count"] = TAG_Byte(1) tc_AI1["id"] = TAG_String(ArmorItem2) tl_AI.append(tc_AI1) tc_AI1 = TAG_Compound() tc_AI1["Count"] = TAG_Byte(1) tc_AI1["id"] = TAG_String(ArmorItem3) tl_AI.append(tc_AI1) tc_AI1 = TAG_Compound() tc_AI1["Count"] = TAG_Byte(1) tc_AI1["id"] = TAG_String(ArmorItem4) tc_AI1["Damage"] = TAG_Short(ArmorItem4Data) tl_AI.append(tc_AI1) mob["ArmorItems"] = tl_AI # Cave Spider head tl_Pass = TAG_List() tc_Pass1 = TAG_Compound() tc_Pass1["id"] = TAG_String("CaveSpider") tc_Pass1["NoAI"] = TAG_Byte(1) tc_Pass1["PersistenceRequired"] = TAG_Byte(1) tc_Pass1["CustomName"] = TAG_String(customName) tc_Pass1["Invisible"] = TAG_Byte(Invisible) tc_Pass1["Small"] = TAG_Byte(Small) tc_Pass1["CustomNameVisible"] = TAG_Byte(CustomNameVisible) tc_Pass1["Invulnerable"] = TAG_Byte(Invulnerable) tc_Pass1["NoGravity"] = TAG_Byte(NoGravity) tc_Pass1["OnGround"] = TAG_Byte(1) tc_Pass1["Air"] = TAG_Short(300) tc_Pass1["DeathTime"] = TAG_Short(0) tc_Pass1["Fire"] = TAG_Short(-1) tc_Pass1["Health"] = TAG_Short(12) tc_Pass1["HurtTime"] = TAG_Short(0) tc_Pass1["Age"] = TAG_Int(0) tc_Pass1["FallDistance"] = TAG_Float(0) tc_Pass1["Motion"] = TAG_List() tc_Pass1["Motion"].append(TAG_Double(MotionX)) tc_Pass1["Motion"].append(TAG_Double(MotionY)) tc_Pass1["Motion"].append(TAG_Double(MotionZ)) tc_Pass1["Pos"] = TAG_List() tc_Pass1["Pos"].append(TAG_Double(x + 0.5)) tc_Pass1["Pos"].append(TAG_Double(y)) tc_Pass1["Pos"].append(TAG_Double(z + 0.5)) tc_Pass1["Rotation"] = TAG_List() tc_Pass1["Rotation"].append(TAG_Float(RotationX)) tc_Pass1["Rotation"].append(TAG_Float(RotationY)) tl_Pass.append(tc_Pass1) mob["Passengers"] = tl_Pass # End Cave Spider head mob["id"] = TAG_String("Enderman") chunk = level.getChunk(int(x) / CHUNKSIZE, int(z) / CHUNKSIZE) chunk.Entities.append(mob) chunk.dirty = True
def createChestBlockData(x, y, z, options, seedtag, ItemsSmokeBox): foo = [ 'nether_bridge', 'village_blacksmith', 'stronghold_crossing', 'spawn_bonus_chest', 'jungle_temple', 'simple_dungeon', 'igloo_chest', 'end_city_treasure', 'desert_pyramid', 'abandoned_mineshaft' ] chest = TAG_Compound() chest["y"] = TAG_Int(y) if options["(1.11+)"]: chest["id"] = TAG_String("chest") else: chest["id"] = TAG_String("Chest") chest["x"] = TAG_Int(x) chest["z"] = TAG_Int(z) items = TAG_List() minecraftchest = TAG_Compound() minecraftchest["id"] = TAG_String(u'minecraft:chest') minecraftchest["Damage"] = TAG_Short(0) minecraftchest["Count"] = TAG_Byte(64) tag = TAG_Compound() blockEntityTag = TAG_Compound() blockEntityTag["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag["LootTableSeed"] = TAG_Long(int(seedtag)) tag["BlockEntityTag"] = blockEntityTag display = TAG_Compound() display["Name"] = TAG_String(u'Lucky Crate') tag["display"] = display minecraftchest["tag"] = tag minecraftchest["Slot"] = TAG_Byte(0) items.append(minecraftchest) minecraftchest2 = TAG_Compound() minecraftchest2["id"] = TAG_String(u'minecraft:chest') minecraftchest2["Damage"] = TAG_Short(0) minecraftchest2["Count"] = TAG_Byte(64) tag2 = TAG_Compound() blockEntityTag2 = TAG_Compound() blockEntityTag2["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag2["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag2["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag2["LootTableSeed"] = TAG_Long(int(seedtag)) tag2["BlockEntityTag"] = blockEntityTag2 display2 = TAG_Compound() display2["Name"] = TAG_String(u'Lucky Crate') tag2["display"] = display2 minecraftchest2["tag"] = tag2 minecraftchest2["Slot"] = TAG_Byte(1) items.append(minecraftchest2) minecraftchest3 = TAG_Compound() minecraftchest3["id"] = TAG_String(u'minecraft:chest') minecraftchest3["Damage"] = TAG_Short(0) minecraftchest3["Count"] = TAG_Byte(64) tag3 = TAG_Compound() blockEntityTag3 = TAG_Compound() blockEntityTag3["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag3["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag3["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag3["LootTableSeed"] = TAG_Long(int(seedtag)) tag3["BlockEntityTag"] = blockEntityTag3 display3 = TAG_Compound() display3["Name"] = TAG_String(u'Lucky Crate') tag3["display"] = display3 minecraftchest3["tag"] = tag3 minecraftchest3["Slot"] = TAG_Byte(2) items.append(minecraftchest3) minecraftchest4 = TAG_Compound() minecraftchest4["id"] = TAG_String(u'minecraft:chest') minecraftchest4["Damage"] = TAG_Short(0) minecraftchest4["Count"] = TAG_Byte(64) tag4 = TAG_Compound() blockEntityTag4 = TAG_Compound() blockEntityTag4["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag4["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag4["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag4["LootTableSeed"] = TAG_Long(int(seedtag)) tag4["BlockEntityTag"] = blockEntityTag4 display4 = TAG_Compound() display4["Name"] = TAG_String(u'Lucky Crate') tag4["display"] = display4 minecraftchest4["tag"] = tag4 minecraftchest4["Slot"] = TAG_Byte(3) items.append(minecraftchest4) minecraftchest5 = TAG_Compound() minecraftchest5["id"] = TAG_String(u'minecraft:chest') minecraftchest5["Damage"] = TAG_Short(0) minecraftchest5["Count"] = TAG_Byte(64) tag5 = TAG_Compound() blockEntityTag5 = TAG_Compound() blockEntityTag5["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag5["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag5["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag5["LootTableSeed"] = TAG_Long(int(seedtag)) tag5["BlockEntityTag"] = blockEntityTag5 display5 = TAG_Compound() display5["Name"] = TAG_String(u'Lucky Crate') tag5["display"] = display5 minecraftchest5["tag"] = tag5 minecraftchest5["Slot"] = TAG_Byte(4) items.append(minecraftchest5) minecraftchest6 = TAG_Compound() minecraftchest6["id"] = TAG_String(u'minecraft:chest') minecraftchest6["Damage"] = TAG_Short(0) minecraftchest6["Count"] = TAG_Byte(64) tag6 = TAG_Compound() blockEntityTag6 = TAG_Compound() blockEntityTag6["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag6["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag6["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag6["LootTableSeed"] = TAG_Long(int(seedtag)) tag6["BlockEntityTag"] = blockEntityTag6 display6 = TAG_Compound() display6["Name"] = TAG_String(u'Lucky Crate') tag6["display"] = display6 minecraftchest6["tag"] = tag6 minecraftchest6["Slot"] = TAG_Byte(5) items.append(minecraftchest6) minecraftchest7 = TAG_Compound() minecraftchest7["id"] = TAG_String(u'minecraft:chest') minecraftchest7["Damage"] = TAG_Short(0) minecraftchest7["Count"] = TAG_Byte(64) tag7 = TAG_Compound() blockEntityTag7 = TAG_Compound() blockEntityTag7["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag7["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag7["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag7["LootTableSeed"] = TAG_Long(int(seedtag)) tag7["BlockEntityTag"] = blockEntityTag7 display7 = TAG_Compound() display7["Name"] = TAG_String(u'Lucky Crate') tag7["display"] = display7 minecraftchest7["tag"] = tag7 minecraftchest7["Slot"] = TAG_Byte(6) items.append(minecraftchest7) minecraftchest8 = TAG_Compound() minecraftchest8["id"] = TAG_String(u'minecraft:chest') minecraftchest8["Damage"] = TAG_Short(0) minecraftchest8["Count"] = TAG_Byte(64) tag8 = TAG_Compound() blockEntityTag8 = TAG_Compound() blockEntityTag8["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag8["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag8["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag8["LootTableSeed"] = TAG_Long(int(seedtag)) tag8["BlockEntityTag"] = blockEntityTag8 display8 = TAG_Compound() display8["Name"] = TAG_String(u'Lucky Crate') tag8["display"] = display8 minecraftchest8["tag"] = tag8 minecraftchest8["Slot"] = TAG_Byte(7) items.append(minecraftchest8) minecraftchest9 = TAG_Compound() minecraftchest9["id"] = TAG_String(u'minecraft:chest') minecraftchest9["Damage"] = TAG_Short(0) minecraftchest9["Count"] = TAG_Byte(64) tag9 = TAG_Compound() blockEntityTag9 = TAG_Compound() blockEntityTag9["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag9["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag9["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag9["LootTableSeed"] = TAG_Long(int(seedtag)) tag9["BlockEntityTag"] = blockEntityTag9 display9 = TAG_Compound() display9["Name"] = TAG_String(u'Lucky Crate') tag9["display"] = display9 minecraftchest9["tag"] = tag9 minecraftchest9["Slot"] = TAG_Byte(8) items.append(minecraftchest9) minecraftchest10 = TAG_Compound() minecraftchest10["id"] = TAG_String(u'minecraft:chest') minecraftchest10["Damage"] = TAG_Short(0) minecraftchest10["Count"] = TAG_Byte(64) tag10 = TAG_Compound() blockEntityTag10 = TAG_Compound() blockEntityTag10["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag10["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag10["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag10["LootTableSeed"] = TAG_Long(int(seedtag)) tag10["BlockEntityTag"] = blockEntityTag10 display10 = TAG_Compound() display10["Name"] = TAG_String(u'Lucky Crate') tag10["display"] = display10 minecraftchest10["tag"] = tag10 minecraftchest10["Slot"] = TAG_Byte(9) items.append(minecraftchest10) minecraftchest11 = TAG_Compound() minecraftchest11["id"] = TAG_String(u'minecraft:chest') minecraftchest11["Damage"] = TAG_Short(0) minecraftchest11["Count"] = TAG_Byte(64) tag11 = TAG_Compound() blockEntityTag11 = TAG_Compound() blockEntityTag11["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag11["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag11["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag11["LootTableSeed"] = TAG_Long(int(seedtag)) tag11["BlockEntityTag"] = blockEntityTag11 display11 = TAG_Compound() display11["Name"] = TAG_String(u'Lucky Crate') tag11["display"] = display11 minecraftchest11["tag"] = tag11 minecraftchest11["Slot"] = TAG_Byte(10) items.append(minecraftchest11) minecraftchest12 = TAG_Compound() minecraftchest12["id"] = TAG_String(u'minecraft:chest') minecraftchest12["Damage"] = TAG_Short(0) minecraftchest12["Count"] = TAG_Byte(64) tag12 = TAG_Compound() blockEntityTag12 = TAG_Compound() blockEntityTag12["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag12["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag12["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag12["LootTableSeed"] = TAG_Long(int(seedtag)) tag12["BlockEntityTag"] = blockEntityTag12 display12 = TAG_Compound() display12["Name"] = TAG_String(u'Lucky Crate') tag12["display"] = display12 minecraftchest12["tag"] = tag12 minecraftchest12["Slot"] = TAG_Byte(10) items.append(minecraftchest12) minecraftchest13 = TAG_Compound() minecraftchest13["id"] = TAG_String(u'minecraft:chest') minecraftchest13["Damage"] = TAG_Short(0) minecraftchest13["Count"] = TAG_Byte(64) tag13 = TAG_Compound() blockEntityTag13 = TAG_Compound() blockEntityTag13["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag13["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag13["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag13["LootTableSeed"] = TAG_Long(int(seedtag)) tag13["BlockEntityTag"] = blockEntityTag13 display13 = TAG_Compound() display13["Name"] = TAG_String(u'Lucky Crate') tag13["display"] = display13 minecraftchest13["tag"] = tag13 minecraftchest13["Slot"] = TAG_Byte(11) items.append(minecraftchest13) minecraftchest14 = TAG_Compound() minecraftchest14["id"] = TAG_String(u'minecraft:chest') minecraftchest14["Damage"] = TAG_Short(0) minecraftchest14["Count"] = TAG_Byte(64) tag14 = TAG_Compound() blockEntityTag14 = TAG_Compound() blockEntityTag14["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag14["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag14["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag14["LootTableSeed"] = TAG_Long(int(seedtag)) tag14["BlockEntityTag"] = blockEntityTag14 display14 = TAG_Compound() display14["Name"] = TAG_String(u'Lucky Crate') tag14["display"] = display14 minecraftchest14["tag"] = tag14 minecraftchest14["Slot"] = TAG_Byte(12) items.append(minecraftchest14) minecraftchest15 = TAG_Compound() minecraftchest15["id"] = TAG_String(u'minecraft:chest') minecraftchest15["Damage"] = TAG_Short(0) minecraftchest15["Count"] = TAG_Byte(64) tag15 = TAG_Compound() blockEntityTag15 = TAG_Compound() blockEntityTag15["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag15["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag15["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag15["LootTableSeed"] = TAG_Long(int(seedtag)) tag15["BlockEntityTag"] = blockEntityTag15 display15 = TAG_Compound() display15["Name"] = TAG_String(u'Lucky Crate') tag15["display"] = display15 minecraftchest15["tag"] = tag15 minecraftchest15["Slot"] = TAG_Byte(13) items.append(minecraftchest15) minecraftchest16 = TAG_Compound() minecraftchest16["id"] = TAG_String(u'minecraft:chest') minecraftchest16["Damage"] = TAG_Short(0) minecraftchest16["Count"] = TAG_Byte(64) tag16 = TAG_Compound() blockEntityTag16 = TAG_Compound() blockEntityTag16["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag16["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag16["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag16["LootTableSeed"] = TAG_Long(int(seedtag)) tag16["BlockEntityTag"] = blockEntityTag16 display16 = TAG_Compound() display16["Name"] = TAG_String(u'Lucky Crate') tag16["display"] = display16 minecraftchest16["tag"] = tag16 minecraftchest16["Slot"] = TAG_Byte(14) items.append(minecraftchest16) minecraftchest17 = TAG_Compound() minecraftchest17["id"] = TAG_String(u'minecraft:chest') minecraftchest17["Damage"] = TAG_Short(0) minecraftchest17["Count"] = TAG_Byte(64) tag17 = TAG_Compound() blockEntityTag17 = TAG_Compound() blockEntityTag17["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag17["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag17["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag17["LootTableSeed"] = TAG_Long(int(seedtag)) tag17["BlockEntityTag"] = blockEntityTag17 display17 = TAG_Compound() display17["Name"] = TAG_String(u'Lucky Crate') tag17["display"] = display17 minecraftchest17["tag"] = tag17 minecraftchest17["Slot"] = TAG_Byte(15) items.append(minecraftchest17) minecraftchest18 = TAG_Compound() minecraftchest18["id"] = TAG_String(u'minecraft:chest') minecraftchest18["Damage"] = TAG_Short(0) minecraftchest18["Count"] = TAG_Byte(64) tag18 = TAG_Compound() blockEntityTag18 = TAG_Compound() blockEntityTag18["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag18["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag18["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag18["LootTableSeed"] = TAG_Long(int(seedtag)) tag18["BlockEntityTag"] = blockEntityTag18 display18 = TAG_Compound() display18["Name"] = TAG_String(u'Lucky Crate') tag18["display"] = display18 minecraftchest18["tag"] = tag18 minecraftchest18["Slot"] = TAG_Byte(16) items.append(minecraftchest18) minecraftchest19 = TAG_Compound() minecraftchest19["id"] = TAG_String(u'minecraft:chest') minecraftchest19["Damage"] = TAG_Short(0) minecraftchest19["Count"] = TAG_Byte(64) tag19 = TAG_Compound() blockEntityTag19 = TAG_Compound() blockEntityTag19["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag19["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag19["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag19["LootTableSeed"] = TAG_Long(int(seedtag)) tag19["BlockEntityTag"] = blockEntityTag19 display19 = TAG_Compound() display19["Name"] = TAG_String(u'Lucky Crate') tag19["display"] = display19 minecraftchest19["tag"] = tag19 minecraftchest19["Slot"] = TAG_Byte(17) items.append(minecraftchest19) minecraftchest20 = TAG_Compound() minecraftchest20["id"] = TAG_String(u'minecraft:chest') minecraftchest20["Damage"] = TAG_Short(0) minecraftchest20["Count"] = TAG_Byte(64) tag20 = TAG_Compound() blockEntityTag20 = TAG_Compound() blockEntityTag20["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag20["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag20["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag20["LootTableSeed"] = TAG_Long(int(seedtag)) tag20["BlockEntityTag"] = blockEntityTag20 display20 = TAG_Compound() display20["Name"] = TAG_String(u'Lucky Crate') tag20["display"] = display20 minecraftchest20["tag"] = tag20 minecraftchest20["Slot"] = TAG_Byte(18) items.append(minecraftchest20) minecraftchest21 = TAG_Compound() minecraftchest21["id"] = TAG_String(u'minecraft:chest') minecraftchest21["Damage"] = TAG_Short(0) minecraftchest21["Count"] = TAG_Byte(64) tag21 = TAG_Compound() blockEntityTag21 = TAG_Compound() blockEntityTag21["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag21["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag21["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag21["LootTableSeed"] = TAG_Long(int(seedtag)) tag21["BlockEntityTag"] = blockEntityTag21 display21 = TAG_Compound() display21["Name"] = TAG_String(u'Lucky Crate') tag21["display"] = display21 minecraftchest21["tag"] = tag21 minecraftchest21["Slot"] = TAG_Byte(19) items.append(minecraftchest21) minecraftchest22 = TAG_Compound() minecraftchest22["id"] = TAG_String(u'minecraft:chest') minecraftchest22["Damage"] = TAG_Short(0) minecraftchest22["Count"] = TAG_Byte(64) tag22 = TAG_Compound() blockEntityTag22 = TAG_Compound() blockEntityTag22["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag22["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag22["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag22["LootTableSeed"] = TAG_Long(int(seedtag)) tag22["BlockEntityTag"] = blockEntityTag22 display22 = TAG_Compound() display22["Name"] = TAG_String(u'Lucky Crate') tag22["display"] = display22 minecraftchest22["tag"] = tag22 minecraftchest22["Slot"] = TAG_Byte(20) items.append(minecraftchest22) minecraftchest23 = TAG_Compound() minecraftchest23["id"] = TAG_String(u'minecraft:chest') minecraftchest23["Damage"] = TAG_Short(0) minecraftchest23["Count"] = TAG_Byte(64) tag23 = TAG_Compound() blockEntityTag23 = TAG_Compound() blockEntityTag23["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag23["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag23["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag23["LootTableSeed"] = TAG_Long(int(seedtag)) tag23["BlockEntityTag"] = blockEntityTag23 display23 = TAG_Compound() display23["Name"] = TAG_String(u'Lucky Crate') tag23["display"] = display23 minecraftchest23["tag"] = tag23 minecraftchest23["Slot"] = TAG_Byte(21) items.append(minecraftchest23) minecraftchest24 = TAG_Compound() minecraftchest24["id"] = TAG_String(u'minecraft:chest') minecraftchest24["Damage"] = TAG_Short(0) minecraftchest24["Count"] = TAG_Byte(64) tag24 = TAG_Compound() blockEntityTag24 = TAG_Compound() blockEntityTag24["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag24["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag24["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag24["LootTableSeed"] = TAG_Long(int(seedtag)) tag24["BlockEntityTag"] = blockEntityTag24 display24 = TAG_Compound() display24["Name"] = TAG_String(u'Lucky Crate') tag24["display"] = display24 minecraftchest24["tag"] = tag24 minecraftchest24["Slot"] = TAG_Byte(22) items.append(minecraftchest24) minecraftchest25 = TAG_Compound() minecraftchest25["id"] = TAG_String(u'minecraft:chest') minecraftchest25["Damage"] = TAG_Short(0) minecraftchest25["Count"] = TAG_Byte(64) tag25 = TAG_Compound() blockEntityTag25 = TAG_Compound() blockEntityTag25["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag25["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag25["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag25["LootTableSeed"] = TAG_Long(int(seedtag)) tag25["BlockEntityTag"] = blockEntityTag25 display25 = TAG_Compound() display25["Name"] = TAG_String(u'Lucky Crate') tag25["display"] = display25 minecraftchest25["tag"] = tag25 minecraftchest25["Slot"] = TAG_Byte(23) items.append(minecraftchest25) minecraftchest26 = TAG_Compound() minecraftchest26["id"] = TAG_String(u'minecraft:chest') minecraftchest26["Damage"] = TAG_Short(0) minecraftchest26["Count"] = TAG_Byte(64) tag26 = TAG_Compound() blockEntityTag26 = TAG_Compound() blockEntityTag26["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag26["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag26["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag26["LootTableSeed"] = TAG_Long(int(seedtag)) tag26["BlockEntityTag"] = blockEntityTag26 display26 = TAG_Compound() display26["Name"] = TAG_String(u'Lucky Crate') tag26["display"] = display26 minecraftchest26["tag"] = tag26 minecraftchest26["Slot"] = TAG_Byte(25) items.append(minecraftchest26) minecraftchest27 = TAG_Compound() minecraftchest27["id"] = TAG_String(u'minecraft:chest') minecraftchest27["Damage"] = TAG_Short(0) minecraftchest27["Count"] = TAG_Byte(64) tag27 = TAG_Compound() blockEntityTag27 = TAG_Compound() blockEntityTag27["CustomName"] = TAG_String(u'Lucky Crate') if options["(Random Loot ID)"]: blockEntityTag27["LootTable"] = TAG_String("minecraft:chests/" + random.choice(foo)) else: blockEntityTag27["LootTable"] = TAG_String("minecraft:chests/" + str(ItemsSmokeBox)) blockEntityTag27["LootTableSeed"] = TAG_Long(int(seedtag)) tag27["BlockEntityTag"] = blockEntityTag27 display27 = TAG_Compound() display27["Name"] = TAG_String(u'Lucky Crate') tag27["display"] = display27 minecraftchest27["tag"] = tag27 minecraftchest27["Slot"] = TAG_Byte(27) items.append(minecraftchest27) chest["Items"] = items return chest
def perform(level, box, options): print "Follow Me On Twitter At @RedstonerLabs" ShowBottoms = options["ShowBottom"] Invun = options["Invulnerable"] target1 = options["Y"] target2 = options["X"] target3 = options["Z"] for x in xrange(box.minx, box.maxx): for y in xrange(box.miny, box.maxy): for z in xrange(box.minz, box.maxz): chunk = level.getChunk(x / 16, z / 16) enderCrystal = TAG_Compound() pos = TAG_List() pos.append(TAG_Double(x + 0.5)) pos.append(TAG_Double(y)) pos.append(TAG_Double(z + 0.5)) enderCrystal["Pos"] = pos if options["1.11-1.12+Worlds"]: enderCrystal["id"] = TAG_String(u'ender_crystal') else: enderCrystal["id"] = TAG_String(u'EnderCrystal') if options["Offset X,Y,Z Coordinates"]: beamTarget = TAG_Compound() beamTarget["X"] = TAG_Int(x + target2) beamTarget["Y"] = TAG_Int(y + target1) beamTarget["Z"] = TAG_Int(z + target3) enderCrystal["BeamTarget"] = beamTarget else: beamTarget = TAG_Compound() beamTarget["X"] = TAG_Int(target2) beamTarget["Y"] = TAG_Int(target1) beamTarget["Z"] = TAG_Int(target3) enderCrystal["BeamTarget"] = beamTarget enderCrystal["OnGround"] = TAG_Byte(0) motion = TAG_List() motion.append(TAG_Double(0.0)) motion.append(TAG_Double(0.0)) motion.append(TAG_Double(0.0)) enderCrystal["Motion"] = motion enderCrystal["Dimension"] = TAG_Int(0) enderCrystal["Air"] = TAG_Short(300) rotation = TAG_List() rotation.append(TAG_Float(0.0)) rotation.append(TAG_Float(0.0)) enderCrystal["Rotation"] = rotation enderCrystal["FallDistance"] = TAG_Float(0.0) enderCrystal["Fire"] = TAG_Short(0) enderCrystal["Invulnerable"] = TAG_Byte(Invun) enderCrystal["PortalCooldown"] = TAG_Int(0) enderCrystal["Glowing"] = TAG_Byte(0) enderCrystal["ShowBottom"] = TAG_Byte(ShowBottoms) chunk.Entities.append(enderCrystal)
spawner["MinSpawnDelay"] = TAG_Short(loopTicks) spawner["MaxSpawnDelay"] = TAG_Short(loopTicks) spawner["SpawnCount"] = TAG_Short(1) spawner["MaxNearbyEntities"] = TAG_Short(10000) spawner["RequiredPlayerRange"] = TAG_Short(range) # Creates a spawner with certain aspects return spawner def createPotion((x, y, z), (vx, vy, vz), effect, duration, amp, potionId): thrownPotion = TAG_Compound() thrownPotion["yTile"] = TAG_Short(-1) motion = TAG_List() motion.append(TAG_Double(vx)) motion.append(TAG_Double(vy)) motion.append(TAG_Double(vz)) thrownPotion["Motion"] = motion thrownPotion["OnGround"] = TAG_Byte(0) thrownPotion["inGround"] = TAG_Byte(0) thrownPotion["shake"] = TAG_Byte(0) thrownPotion["Dimension"] = TAG_Int(0) thrownPotion["inTile"] = TAG_Byte(0) thrownPotion["Air"] = TAG_Short(300) thrownPotion["id"] = TAG_String(u'ThrownPotion') pos = TAG_List() pos.append(TAG_Double(x)) pos.append(TAG_Double(y))