Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #castle creating function
- #the minimum 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
- #the recommended wall height 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 and specifying what we want to get and how many units
- items = [
- 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,
- SHIELD, 1,
- SPLASH_POTION, 1
- ]
- for i in range(0, len(items),2):
- #the loop going through every second element of list
- mobs.give(mobs.target(NEAREST_PLAYER), items[i], items[i+1])
- player.on_chat("inventory", inventory)
- def horseSpawn():
- mobs.spawn(HORSE, pos(1, 0, 0))
- mobs.give(mobs.target(NEAREST_PLAYER), SADDLE, 1)
- mobs.give(mobs.target(NEAREST_PLAYER), IRON_HORSE_ARMOR, 1)
- player.on_chat("horse", horseSpawn)
- def enchantedBow():
- mobs.enchant(mobs.target(NEAREST_PLAYER), "Power", 5)
- mobs.enchant(mobs.target(NEAREST_PLAYER), "Flame", 1)
- player.on_chat("enchant", enchantedBow)
Add Comment
Please, Sign In to add comment