Jump to content

An effective way to detect the rate/velocity a mob is turning?


Recommended Posts

I wanted to see if there was a simple or easy way to detect how fast a mob is turning left or right and have the value sent or used in its respected model class(es) before attempting to write something on my own.


I do not necessarily need actual code but it something is open source to look at, great! If not, some general ideas such as what functions or classes to use or write would be helpful too.


If I would have to do the detection in the server side Entity class and send it to the client side Model class. If that is true, I might ask for the least resource intensive way to send that information there.

Link to comment
Share on other sites

I am actually working on mob model animation to give the illusion of my mobs' parts obeying physics better (such as a mob with a long tail turning around). Eventually I'll move on to jumps and falling.


I played around for a while and decided the variable, renderYawOffset, seemed to work best for my needs. The biggest challenge I had to face was what you mentioned with the rotation amount rollback but I did overcome that after a few hours. All the math I have handled in the client side version of the Entity class which the model class just calls over the results so as to ensure it is unique to that mob.


It works great. Thanks, your suggestions gave me a good idea of where to even start trying this.


You say you do this in your mod's animations? Which mod is that?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.