Changing Player Look Direction

Started by Alienmikey9999 on Thu, 12/24/2020 - 01:23

Topic category: Help with modding (Java Edition)

Last seen on 19:00, 9. Mar 2021
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Changing Player Look Direction
Thu, 12/24/2020 - 01:23

I am trying to make a sword that when right-clicked on a mob it will teleport the player behind the mob's back and make the player look at the mob's back. I got the teleporting part of that down but I can not for the life of me figure out how to change the direction the player is looking. I have already tried using set rotation a few different ways but that did not seem to work. If this is possible I would like to know how to do it.

Use set rotation block, this…
Thu, 12/24/2020 - 09:51

Use set rotation block, this one is for it. If it does not work, show the setup you have so far

Last seen on 19:00, 9. Mar 2021
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I do not know what/how to do…
Sat, 12/26/2020 - 04:04

I do not know what/how to do pitch, but I do not believe it is necessary because I only want to look at the mob's back not up and down. I tried the "Direction (yaw) in deg. relative to S of event/target entity" block, and I tried just doing the "look z position of event/target entity with raytrace distance of 0" block in the "Yaw" part of the set rotation block. Both of the attempts failed and being the inexperienced dev I am I have no clue what to try next. I'm sorry I did not just do screenshots, but I can not get them to upload here so I had to type them out. Any help with this would be greatly appreciated as I can not find how to use this block anywhere. Now if i understand how pitch and yaw work, and how the Set rotation should work I should be able to get the mob's yaw and then set the player's yaw to the mob's yaw. If this understanding is incorrect please tell me.