Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import minecraft
- import random
- import time
- def tower( x, y ,z, floors, size):
- mc.setBlocks(x, y, z, x + size, y + (floors * 3), z+size, 0)
- i=y;
- wall=random.randint(1,15)
- floorChoices=(1, 4, 5, 24, 22, 42, 45, 48, 49, 82, 87, 98, 112, 155)
- floor=floorChoices[random.randint(0, len(floorChoices) - 1)]
- windowChoices=(0, 20, 85, 102)
- window=windowChoices[random.randint(0, len(windowChoices) - 1)]
- itemChoices=(41, 46, 47, 51, 54, 57, 58, 61, 103, 245, 247)
- while i < floors * 3:
- #Floor
- mc.setBlocks(x, i, z, x + size, i, z + size, floor)
- mc.setBlock(x+1, i, z + 1, 65, 3)
- #Floor light
- mc.setBlock( x + (size/2), i, z + (size/2), 89)
- #First wall layer
- i+=1
- mc.setBlocks(x, i, z, x + size, i, z, 35, wall)
- mc.setBlocks(x, i, z, x, i, z + size, 35, wall)
- mc.setBlocks(x, i, z + size, x + size, i, z + size, 35, wall)
- mc.setBlocks(x + size, i, z, x + size, i, z + size, 35, wall)
- #Ladder and glowstone
- mc.setBlock(x, i, z, 89)
- mc.setBlock(x, i, z + size, 89)
- mc.setBlock(x + size, i, z, 89)
- mc.setBlock (x+size, i, z+size, 89)
- mc.setBlock(x+1, i, z + 1, 65, 3)
- #If they're lucky, put an item on the floor
- if random.randint(1, 100)==50:
- mc.setBlock(random.randint(x + 1, x + size -1), i, random.randint(z + 1, z + size - 1), itemChoices[random.randint(0, len(itemChoices) -1)])
- i+=1
- #Windows
- mc.setBlocks(x, i, z, x + size, i, z, window)
- mc.setBlocks(x, i, z, x, i, z + size, window)
- mc.setBlocks(x, i, z + size, x + size, i, z + size, window)
- mc.setBlocks(x + size, i, z, x + size, i, z + size, window)
- #mc.setBlock(x+1, i, z + 1, 65, 3)
- i+=1
- #Next wall
- mc.setBlocks(x, i, z, x + size, i, z, 35, wall)
- mc.setBlocks(x, i, z, x, i, z + size, 35, wall)
- mc.setBlocks(x, i, z + size, x + size, i, z + size, 35, wall)
- mc.setBlocks(x + size, i, z, x + size, i, z + size, 35, wall)
- mc.setBlock(x, i, z, 89)
- mc.setBlock(x, i, z + size, 89)
- mc.setBlock(x + size, i, z, 89)
- mc.setBlock (x+size, i, z+size, 89)
- mc.setBlock(x+1, i, z + 1, 65, 3)
- i+=1
- def city():
- for i in range (30):
- tower(random.randint(-100, 100), random.randint(-5, 5), random.randint(-100, 100), random.randint(5, 20), random.randint(5, 20))
- def main():
- city()
- mc=minecraft.Minecraft.create()
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement