SHARE
TWEET

python code for clab students

a guest Apr 22nd, 2019 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '''
  2. Huge Impressive Python Examples
  3. Swimming Pool
  4. Build a swimming pool!
  5. '''
  6. from mcpi.minecraft import Minecraft
  7. mc = Minecraft.create()
  8.  
  9. x, y, z = mc.player.getTilePos()
  10. y -= 1
  11.  
  12. '''==Modify these values to set size=='''
  13. width = 64
  14. height = 5
  15. length = 64
  16. '''==================================='''
  17.  
  18. edgeBlock = 4 #Cobble Stone
  19.  
  20. #Clear the area
  21. mc.setBlocks(x, y, z,
  22.              x + width, y + height, z + length,
  23.              0)
  24.  
  25. #Swimming Pool
  26. mc.setBlocks(x, y, z,
  27.              x + width, y - height, z + length,
  28.              edgeBlock)
  29. mc.setBlocks(x + 1, y, z + 1,
  30.              x + width - 1, y - height + 1, z + length - 1,
  31.              9)
  32.  
  33. #Floor is dobule stone slab, because it looks nice!
  34. mc.setBlocks(x, y - height, z,
  35.              x + width, y - height, z + length,
  36.              43)
  37.  
  38. #Fancy Edge with stone slab
  39. mc.setBlocks(x, y + 1, z,
  40.              x + width, y + 1, z + length,
  41.              44)
  42. mc.setBlocks(x + 1, y + 1, z + 1,
  43.              x + width - 1, y + 1, z + length - 1,
  44.              0)
  45.  
  46. #glow stone inside water
  47. mc.setBlock(x + 1, y - height, z + 1, 89)
  48. mc.setBlock(x + 1, y - height, z + length - 1, 89)
  49. mc.setBlock(x + width - 1, y - height, z + 1, 89)
  50. mc.setBlock(x + width - 1, y - height, z + length - 1, 89)
  51.  
  52. ##diving
  53. #plank
  54. mc.setBlocks(x + width/2, y + 1, z,
  55.              x + width/2, y + 4, z,
  56.              5)
  57. mc.setBlock(x + width/2, y + 4, z + 1, 5)
  58.  
  59. #ladder
  60. mc.setBlocks(x + width/2, y + 1, z - 1,
  61.              x + width/2, y + 4, z - 1,
  62.              65)
  63. #stair
  64. mc.setBlock(x + width/2, y + 3, z + 1, 53, 7)
  65. mc.setBlock(x + width/2, y + 4, z + 2, 53, 7)
  66.  
  67. mc.player.setPos(x + width/2 + 0.5, y + 5, z + 2.5)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top