Guest User

Untitled

a guest
Dec 14th, 2018
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. #= Executes a string as a console command from a player's perspective
  2. effect execute as %player% %text%:
  3. trigger:
  4. set {_command} to expression-2
  5. if first character of expr-2 is "/":
  6. set {_command} to last (length of expr-2) - 1 characters of expression-2
  7. if expr-2.startsWith("minecraft:"):
  8. set {_command} to last (length of expr-2) - 10 characters of expression-2
  9. console command "minecraft:execute as %expr-1% at @s run %{_command}%"
  10.  
  11. #= Executes a string as a console command from a player's perspective
  12. effect execute as entity %entity% %text%:
  13. trigger:
  14. set {_UUIDLeast} to expression-1.getUniqueId().getLeastSignificantBits()
  15. set {_UUIDMost} to expression-1.getUniqueId().getMostSignificantBits()
  16. set {_NBT} to "{UUIDLeast:%{_UUIDLeast}%L,UUIDMost:%{_UUIDMost}%L}"
  17. set {_command} to expression-2
  18. if first character of expr-2 is "/":
  19. set {_command} to last (length of expr-2) - 1 characters of expression-2
  20. if expr-2.startsWith("minecraft:"):
  21. set {_command} to last (length of expr-2) - 10 characters of expression-2
  22. console command "minecraft:execute as @e[nbt=%{_NBT}%] run %{_command}%"
  23.  
  24. #= Executes a string as a console command from a player's perspective
  25. effect execute as all players %text%:
  26. trigger:
  27. set {_command} to expression-2
  28. if first character of expr-2 is "/":
  29. set {_command} to last (length of expr-2) - 1 characters of expression-2
  30. if expr-2.startsWith("minecraft:"):
  31. set {_command} to last (length of expr-2) - 10 characters of expression-2
  32. console command "minecraft:execute as @a at @s run %{_command}%"
  33.  
  34. #= Executes a command in a given world by executing it from a random player in that world
  35. effect execute in [world] %world/text% %text%:
  36. trigger:
  37. set {_world} to world("%expression-1%")
  38. {_world} is set
  39. set {_player} to first element of (players in world {_world})
  40. {_player} is set
  41. execute as {_player} expression-2
Add Comment
Please, Sign In to add comment