mralasic

mralasic

Mar 5th, 2022 (edited)
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.35 KB | None | 0 0
  1. #Enderman game
  2. #create variables responsible for spawning endermen and time of player teleports
  3. spawnTime=500
  4. teleportationTime=6000
  5. loops.pause(3000)
  6. #create an area for the fight
  7. blocks.fill(DOUBLE_STONE_SLAB, pos(-30, -1, -30), pos(30, -1, 30))
  8.  
  9. #Set the time to dawn. Endermen die when there is too much light
  10. gameplay.time_set(DayTime.DAWN)
  11. #Endermen don’t like water. We need to switch off any rain.
  12. gameplay.set_weather(CLEAR)
  13. #Change the game mode to survival. Now our player has defined health points.
  14. gameplay.set_game_mode(SURVIVAL, mobs.target(NEAREST_PLAYER))
  15. #adding a diamond sword to the player’s inventory
  16. mobs.give(mobs.target(NEAREST_PLAYER), DIAMOND_SWORD, 1)
  17. # Spawn 2 endermen in a random position of the arena
  18. mobs.spawn(mobs.monster(ENDERMAN), randpos(pos(-10, 0, -10), pos(10, 0, 10)))
  19. loops.pause(spawnTime)
  20. mobs.spawn(mobs.monster(ENDERMAN), randpos(pos(-10, 0, -10), pos(10, 0, 10)))
  21. loops.pause(spawnTime)
  22.  
  23. # Teleporting the player in a random position in the arena. The player might be teleported outside the arena if they are fighting next to its edge.
  24. loops.pause(teleportationTime)
  25. player.teleport(randpos(pos(-10, 0, -10), pos(10, 0, 10)))
  26. loops.pause(teleportationTime)
  27. player.teleport(randpos(pos(-10, 0, -10), pos(10, 0, 10)))
  28. loops.pause(teleportationTime)
  29. player.teleport(randpos(pos(-10, 0, -10), pos(10, 0, 10)))
Add Comment
Please, Sign In to add comment