Solved Teleport to location with yaw and pitch

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
D

Deleted member

Hello!
I am trying to figure out how to teleport an entity or a player to a location which has a yaw and a pitch set as well.

code_language.skript:
command /spawn:
   permission: spawn.spawn
   permission message: &cNo permission.
   trigger:
       # Method 1
       teleport player to location at (0, 64, 0) in world "world" with pitch 0 and yaw 0
       # Method 2
       set {_spawn} to location at (0, 64, 0) in world "world"
       set pitch of {_spawn}'s pitch to 0
       set yaw of {_spawn}'s yaw to 0
       teleport player to {_spawn}

With Method 1 the following error is returned: "Can't understand this condition/effect: teleport player to location at (0, 64, 0) in world "world" with pitch 0 and yaw 0"

With Method 2 no errors are returned, but when issuing the /spawn command it teleports me to the location without adjusting the yaw and pitch to 0.

Skript Version: 2.2 by Bensku
Minecraft Version: 1.12.2
Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
 
With the second method, try setings the yaw and pitch to 0.1 instead of 0
 
0.1 does, work, but neither does 0.0 or 0 work. Looks like Skript uses 0 as null instead of the integer 0.
[doublepost=1529757685,1529757602][/doublepost]0.01 seems to do the trick. When teleporting to a location with pitch and yaw 0.01 in F3 it reports 0.0. No more OCD.

Thank you.
 
I had the same problem some time ago, and didn't really know why at the time. This did fix it tho
 
  • Like
Reactions: Deleted member
Status
Not open for further replies.