mralasic

combat_arena

Apr 2nd, 2022 (edited)
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.10 KB | None | 0 0
  1. def inventory():
  2.     player.execute("/clear")
  3.     mobs.give(mobs.target(NEAREST_PLAYER), DIAMOND_PICKAXE, 1)
  4.     mobs.give(mobs.target(NEAREST_PLAYER), DIAMOND_SWORD, 1)
  5.     mobs.give(mobs.target(NEAREST_PLAYER), DIAMOND_CHESTPLATE, 1)
  6.     mobs.give(mobs.target(NEAREST_PLAYER), DIAMOND_HELMET, 1)
  7.     mobs.give(mobs.target(NEAREST_PLAYER), DIAMOND_LEGGINGS, 1)
  8.     mobs.give(mobs.target(NEAREST_PLAYER), DIAMOND_BOOTS, 1)
  9.     mobs.give(mobs.target(NEAREST_PLAYER), BOW, 1)
  10.     mobs.give(mobs.target(NEAREST_PLAYER), ARROW, 64)
  11.     mobs.give(mobs.target(NEAREST_PLAYER), TRIDENT, 1)
  12.  
  13.  
  14. def runda(x,y,z,runda):
  15.     mobs.apply_effect(SPEED, mobs.target(NEAREST_PLAYER),20)
  16.     mobs.apply_effect(REGENERATION, mobs.target(NEAREST_PLAYER),20)
  17.     mobs.apply_effect(STRENGTH, mobs.target(NEAREST_PLAYER),20)
  18.     blocks.print(str(runda), SEA_LANTERN, world(x+5,y+10,z+45), WEST)
  19.     for i in range(runda):
  20.         mobs.spawn(ZOMBIE, randpos(world(x+5,y+5,z+5), world(x+35,y+5,z+35)))
  21.     loops.pause(1000)
  22.     for i in range(runda):
  23.         mobs.spawn(SKELETON, randpos(world(x+5,y+5,z+5), world(x+35,y+5,z+35)))
  24.     loops.pause(1000)
  25.     for i in range(runda):
  26.         mobs.spawn(BLAZE, randpos(world(x+5,y+5,z+5), world(x+35,y+5,z+35)))
  27.     loops.pause(1000)
  28.     for i in range(runda):
  29.         mobs.spawn(CREEPER, randpos(world(x+5,y+5,z+5), world(x+35,y+5,z+35)))
  30.     loops.pause(1000)
  31.     for i in range(runda):
  32.         mobs.spawn(GHAST, randpos(world(x+5,y+5,z+5), world(x+35,y+5,z+35)))
  33.     loops.pause(30000)
  34.  
  35. #function responsible for creating the arena
  36. def arenaBuilder():
  37.     #setting the time to night
  38.     gameplay.time_set(DayTime.NIGHT)
  39.     #getting the current coordinates of the player with a slight offset so the arena isn't built on the player
  40.     position=positions.add(player.position(), pos(10, 0, 0))
  41.     x=position.get_value(Axis.X)
  42.     y=position.get_value(Axis.Y)
  43.     z=position.get_value(Axis.Z)    
  44.     #creating the arena
  45.     blocks.fill(STONE_BRICKS, world(x,y,z),world(x+40,y+4,z+40))
  46.     #putting diamond blocks in the corners which are beacon blocks need so it lets out a beam of light
  47.     blocks.fill(DIAMOND_BLOCK, world(x,y+4,z),world(x+2,y+4,z+2))
  48.     blocks.fill(DIAMOND_BLOCK, world(x+38,y+4,z),world(x+40,y+4,z+2))
  49.     blocks.fill(DIAMOND_BLOCK, world(x,y+4,z+38),world(x+2,y+4,z+40))
  50.     blocks.fill(DIAMOND_BLOCK, world(x+38,y+4,z+38),world(x+40,y+4,z+40))
  51.    
  52.     #adding beacon blocks
  53.     blocks.place(BEACON, world(x+1,y+5,z+1))
  54.     blocks.place(BEACON, world(x+39,y+5,z+1))
  55.     blocks.place(BEACON, world(x+1,y+5,z+39))
  56.     blocks.place(BEACON, world(x+39,y+5,z+39))
  57.    
  58.     #creating stairs
  59.     for i in range(15,21):
  60.         shapes.line(STONE_BRICK_STAIRS, world(x-4,y,z+i), world(x,y+4,z+i))
  61.  
  62.     inventory()
  63.     blocks.print("ROUND", SEA_LANTERN, world(x+35,y+10,z+45), WEST)
  64.     gameplay.set_game_mode(SURVIVAL, mobs.target(NEAREST_PLAYER))
  65.     runda(x,y,z,1)
  66.     runda(x,y,z,2)
  67.     runda(x,y,z,3)
  68.  
  69. player.on_chat("arena", arenaBuilder)
  70.  
  71. def after_death():
  72.     gameplay.set_game_mode(CREATIVE, mobs.target(NEAREST_PLAYER))
  73.  
  74. player.on_died(after_death)
  75.  
Add Comment
Please, Sign In to add comment