Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #castle creating function
- #mimnum length of the walls is 20. if the walls are shorter the stairs won't be generated correctly
- #the length of the walls has to be EVEN or the corners won't be generated correctly
- #recommended wall heigh is 4. Only then the creepers can get activated and explode
- def castleBuilder(wallLength, wallHeight):
- wallLengthCopy = wallLength / 2
- builder.teleport_to(pos(-5, 0, 5))
- builder.set_origin()
- builder.mark()
- i = 0
- #the loop creating 3 layer wall around the player
- while i < 3:
- j = 0
- while j < 4:
- builder.move(FORWARD, wallLength)
- builder.raise_wall(MOSSY_STONE_BRICKS, wallHeight)
- builder.turn(RIGHT_TURN)
- j += 1
- wallLength += -2
- builder.move(RIGHT, 1)
- builder.move(FORWARD, 1)
- builder.mark()
- i += 1
- builder.move(UP, wallHeight - 1)
- builder.face(WEST)
- builder.move(BACK, 15)
- builder.mark()
- i = 0
- #the loop creating stairs
- while i < wallHeight - 1:
- builder.shift(1, -1, 0)
- builder.line(STONE_BRICK_STAIRS)
- i += 1
- builder.teleport_to_origin()
- builder.move(UP, wallHeight)
- builder.face(NORTH)
- builder.mark()
- i = 0
- #the loop creating corners
- while i < 4:
- j = 0
- while j < wallLengthCopy:
- builder.place(SEA_LANTERN)
- builder.move(FORWARD, 2)
- j += 1
- builder.turn(RIGHT_TURN)
- i += 1
- player.on_chat("castle", castleBuilder)
- def inventory():
- #creating the array according to the template, specyfying what we want to get and how many units
- itemsArray = [IRON_SWORD,1,IRON_AXE,1,BOW,1,ARROW,64,FIREBALL,10,LAVA_BUCKET,5,IRON_HELMET,1,IRON_CHESTPLATE,1,IRON_LEGGINGS,1,IRON_BOOTS,1,SPRUCE_DOOR,20,TORCH,30,LADDER,64,ENCHANTED_APPLE,2]
- #the loop giving the items to the player. step of 2
- for i in range(0,len(itemsArray),2):
- #adding the items, getting data from the array
- mobs.give(mobs.target(NEAREST_PLAYER), itemsArray[i], itemsArray[i+1])
- player.on_chat("inventory", inventory)
- #adding a horse
- def horseSpawn():
- mobs.spawn(HORSE, pos(1, 0, 0))
- #saddle
- mobs.give(mobs.target(NEAREST_PLAYER), SADDLE, 1)
- #horse armour
- mobs.give(mobs.target(NEAREST_PLAYER), IRON_HORSE_ARMOR, 1)
- player.on_chat("horse", horseSpawn)
- def enchantedBow():
- #maximum damage
- mobs.enchant(mobs.target(NEAREST_PLAYER), "Power", 5)
- #fire arrows
- mobs.enchant(mobs.target(NEAREST_PLAYER), "Flame", 1)
- player.on_chat("bow", enchantedBow)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement