Started by
Alienmikey9999
on
Topic category: Help with Minecraft modding (Java Edition)
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 one is for it. If it does not work, show the setup you have so far
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.