Resource icon

Script Parse Location from Command Input 1.0

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Supported Skript Version
  1. 2.8
Supported Minecraft Versions
  1. 1.13
  2. 1.14
  3. 1.15
  4. 1.16
  5. 1.17
  6. 1.18
  7. 1.19
  8. 1.20
Parse Location from Command Input.
Provides functions to allow Minecraft-like coordinates in commands (^ and ~)

To use, add text arguments to your command to capture the coordinates.
Feed these arguments into the locationFromCommandInput function,
along with an origin location (usually the sender's location).
The function will return the origin location modified by the inputs.
This follows typical Minecraft command coordinates, which can be read about on the wiki:

You do not need to supply all 3 coordinates, the function will work fine if one or more are not set.
You can also use numbers as inputs. 12 will be treated the same as "12".
Finally, you can also mix and match normal coords, ~, and ^. Just remember they're applied in xyz order.

Advanced users may want to use the parsed coordinates on their own.
Please see the parseCoordinate() and applyParsedCoordinate() functions for that purpose.

Examples of use:
Code:
command /teleport-me <x:text> <y:text> <z:text>:
    executable by: player
    trigger:
        teleport player to locationFromCommandInput({_x}, {_y}, {_z}, player)
Author
Sovde
Downloads
68
Views
415
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Sovde