Guest1221

RandomTP

Jan 21st, 2018
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. options:
  2. #Minimum amount of blocks farm from X cord to tp to
  3. min.x: -100000
  4. #maximum amount of blocks farm from X cord to tp to
  5. max.x: 100000
  6. #Minimum amount of blocks farm from Z cord to tp to
  7. min.z: -100000
  8. #maximum amount of blocks farm from Z cord to tp to
  9. max.z: 100000
  10. #Amount of time before the player will be allowed to use the command again
  11. cooldown: 10 minutes
  12. #Avoid spawning in lava, water and air
  13. avoid: air or water block or lava block
  14. #To add worlds it would look like
  15. # worlds: "world" or "world_nether" or "world_the_end"
  16. worlds: "world"
  17. #Permission
  18. permission: randomtp.use
  19. #No permission message
  20. PermMsg: &8Β» &7You do not have permission to use this command!
  21. #Can not execute command in this world message
  22. NoWorldMsg: &8Β» &7You can’t use this command in this world!
  23. #Cooldown message
  24. SpamMsg: &8Β» &7You can use this command in 10 minutes
  25.  
  26.  
  27. Command /randomtp:
  28. description: Teleports player to random location not in water
  29. permission: {@permission}
  30. permission message: {@PermMsg}
  31. aliases: /rtp, /wild, /random
  32. trigger:
  33. if world is not {@worlds}:
  34. message "{@NoWorldMsg}"
  35. else:
  36. if difference between {cooldowns::randomtp::%player%} and now < {@cooldown}:
  37. send "{@SpamMsg}"
  38. else:
  39. set {_loc::old} to player's location
  40. while player's location is {_loc::old}:
  41. set {_loc::new} to location at random number between {@min.x} and {@max.x}, 0, random number between {@min.z} and {@max.z}
  42. loop blocks above {_loc::new}:
  43. if loop-block and block above loop-block are air:
  44. if block under loop-block is not {@avoid}:
  45. set {_loc::new} to location of loop-block
  46. teleport player to {_loc::new}
  47. if light level at player <= 2:
  48. set block at player to ground torch
  49. set {cooldowns::randomtp::%player%} to now
  50. stop loop
  51. wait 10 ticks
Add Comment
Please, Sign In to add comment