Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Enderman game
- #create variables responsible for spawning endermen and time of player teleports
- spawnTime=500
- teleportationTime=6000
- loops.pause(3000)
- #create an area for the fight
- blocks.fill(DOUBLE_STONE_SLAB, pos(-30, -1, -30), pos(30, -1, 30))
- #Set the time to dawn. Endermen die when there is too much light
- gameplay.time_set(DayTime.DAWN)
- #Endermen don’t like water. We need to switch off any rain.
- gameplay.set_weather(CLEAR)
- #Change the game mode to survival. Now our player has defined health points.
- gameplay.set_game_mode(SURVIVAL, mobs.target(NEAREST_PLAYER))
- #adding a diamond sword to the player’s inventory
- mobs.give(mobs.target(NEAREST_PLAYER), DIAMOND_SWORD, 1)
- # Spawn 2 endermen in a random position of the arena
- mobs.spawn(mobs.monster(ENDERMAN), randpos(pos(-10, 0, -10), pos(10, 0, 10)))
- loops.pause(spawnTime)
- mobs.spawn(mobs.monster(ENDERMAN), randpos(pos(-10, 0, -10), pos(10, 0, 10)))
- loops.pause(spawnTime)
- # 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.
- loops.pause(teleportationTime)
- player.teleport(randpos(pos(-10, 0, -10), pos(10, 0, 10)))
- loops.pause(teleportationTime)
- player.teleport(randpos(pos(-10, 0, -10), pos(10, 0, 10)))
- loops.pause(teleportationTime)
- player.teleport(randpos(pos(-10, 0, -10), pos(10, 0, 10)))
Add Comment
Please, Sign In to add comment