Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #= Executes a string as a console command from a player's perspective
- effect execute as %player% %text%:
- trigger:
- set {_command} to expression-2
- if first character of expr-2 is "/":
- set {_command} to last (length of expr-2) - 1 characters of expression-2
- if expr-2.startsWith("minecraft:"):
- set {_command} to last (length of expr-2) - 10 characters of expression-2
- console command "minecraft:execute as %expr-1% at @s run %{_command}%"
- #= Executes a string as a console command from a player's perspective
- effect execute as entity %entity% %text%:
- trigger:
- set {_UUIDLeast} to expression-1.getUniqueId().getLeastSignificantBits()
- set {_UUIDMost} to expression-1.getUniqueId().getMostSignificantBits()
- set {_NBT} to "{UUIDLeast:%{_UUIDLeast}%L,UUIDMost:%{_UUIDMost}%L}"
- set {_command} to expression-2
- if first character of expr-2 is "/":
- set {_command} to last (length of expr-2) - 1 characters of expression-2
- if expr-2.startsWith("minecraft:"):
- set {_command} to last (length of expr-2) - 10 characters of expression-2
- console command "minecraft:execute as @e[nbt=%{_NBT}%] run %{_command}%"
- #= Executes a string as a console command from a player's perspective
- effect execute as all players %text%:
- trigger:
- set {_command} to expression-2
- if first character of expr-2 is "/":
- set {_command} to last (length of expr-2) - 1 characters of expression-2
- if expr-2.startsWith("minecraft:"):
- set {_command} to last (length of expr-2) - 10 characters of expression-2
- console command "minecraft:execute as @a at @s run %{_command}%"
- #= Executes a command in a given world by executing it from a random player in that world
- effect execute in [world] %world/text% %text%:
- trigger:
- set {_world} to world("%expression-1%")
- {_world} is set
- set {_player} to first element of (players in world {_world})
- {_player} is set
- execute as {_player} expression-2
Add Comment
Please, Sign In to add comment