Advertisement
Juffix

Surface - Juffix

May 17th, 2020
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. options:
  2. cooldown: 10 minutes #formated as (Amount of time) (Seconds, Minutes, days ect...)
  3. avoid: water or lava #Avoid spawning formated as (Block) or (Block) ect...
  4.  
  5. worlds: "world" #worlds formated as "(World name)" or "(World name)" or "(World name)" ect...
  6.  
  7. Permission: Surface.use #Permission
  8. PermissionMessage: &cYou do not have permission to use this command! #No permission message
  9. CommandIsNotExecuteableInWorld: &cYou can’t use this command in this world! #Can not execute command in this world message
  10. 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)
  11. BlockAvoidMessage: &cYou can't surface right now! #Called when the surface is a block to avoid message
  12.  
  13. Command Surface:
  14. permission: {@Permission}
  15. Permission Message: {@PermissionMessage}
  16. trigger:
  17. if world is not {@worlds}:
  18. send "{@CommandIsNotExecuteableInWorld}"
  19. else:
  20. if difference between {Surface::%player%} and now is less than {@cooldown}:
  21. set {_cooldown} to {@cooldown}
  22. remove difference between {Surface::%player%} and now from {_cooldown}
  23. send "{@CooldownMessage}"
  24. else:
  25. wait 1 tick
  26. set {_loc} to location at player
  27. set y-coordinate of {_loc} to 255
  28. while block at {_loc} is air:
  29. remove 1 from y-coordinate of {_loc}
  30. loop all blocks in radius 1 of {_loc}:
  31. if loop-block is not {@avoid}:
  32. add 1 to y-coordinate of {_loc}
  33. teleport player to {_loc}
  34. set {Surface::%player%} to now
  35. stop
  36. else:
  37. send "{@BlockAvoidMessage}"
  38. stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement