Advertisement
Juffix

RandomTP - Juffix

May 16th, 2020
372
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-x: -500 #Minimum x of randomtp
  3. Maximum-x: 500 #Maximum x of randomtp
  4. Minimum-z: -500 #Minimum z of randomtp
  5. Maximum-z: 500 #Maximum x of randomtp
  6.  
  7. cooldown: 5 seconds #formated as (Amount of time) (Seconds, Minutes, days ect...)
  8. avoid: water or lava #Avoid spawning formated as (Block) or (Block) ect...
  9.  
  10. worlds: "world" #worlds formated as "(World name)" or "(World name)" or "(World name)" ect...
  11.  
  12. Permission: randomtp.use #Permission
  13. PermissionMessage: &cYou do not have permission to use this command! #No permission message
  14. CommandIsNotExecuteableInWorld: &cYou can’t use this command in this world! #Can not execute command in this world message
  15. CooldownMessage: &CYou have to wait another %{_cooldown}% &cbefore you can execute this command again! #Cooldown message %{_cooldown}% is the time until the command is executeable again)
  16.  
  17. Command RandomTP:
  18. aliases: rtp, wild
  19. permission: {@Permission}
  20. Permission Message: {@PermissionMessage}
  21. trigger:
  22. if world is not {@worlds}:
  23. send "{@CommandIsNotExecuteableInWorld}"
  24. else:
  25. if difference between {randomtp::%player%} and now is less than {@cooldown}:
  26. set {_cooldown} to {@cooldown}
  27. remove difference between {randomtp::%player%} and now from {_cooldown}
  28. send "{@CooldownMessage}"
  29. else:
  30. set {_Randomtp.avoid} to 0
  31. while {_Randomtp.avoid} is equal to 0:
  32. wait 1 tick
  33. set {_loc} to location at random number between {@Minimum-x} and {@Maximum-x}, 255, random number between {@Maximum-z} and {@Minimum-z}
  34. while block at {_loc} is air:
  35. remove 1 from y-coordinate of {_loc}
  36. loop all blocks in radius 1 of {_loc}:
  37. if loop-block is not {@avoid}:
  38. add 1 to y-coordinate of {_loc}
  39. set {_Randomtp.avoid} to 1
  40. teleport player to {_loc}
  41. set {randomtp::%player%} to now
  42. stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement