Jump to content

Getting player head rotation angles and overriding armor render event


yorkeMC

Recommended Posts

So with forge, how would I go about first off, finding the rotation angles that a player's head is rotated at? This is so I can make some tesselator code 'stick' to the player's head. Also, how can I make an armor pieces texture different IF it has a certain NBT tag? This tag can be applied to any armour be it vanilla armor, or armour from another mod. Are these things possible?

while(awake)

{

    coffee++;

}

Link to comment
Share on other sites

Version?

 

You can remove (on game startup) ArmorLayer (name might be different) and add custom one that also checks and renders based on NBT.

Other option is to use RenderPlayerEvent and render independenly (worse I think).

Another one (I only know it from what I hear) is return different armor model from Item class - but that won't work for vanilla I guess.

 

As to head rotation - just look at Entity's pitch/yaw from EntityPlayer point.

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

So with forge, how would I go about first off, finding the rotation angles that a player's head is rotated at? This is so I can make some tesselator code 'stick' to the player's head. Also, how can I make an armor pieces texture different IF it has a certain NBT tag? This tag can be applied to any armour be it vanilla armor, or armour from another mod. Are these things possible?

If you're interested in doing some rayTracing or are in general going to be working with vectors I would suggest using these methods:

final Vec3d posVec = player.getPositionEyes(1.0F);
final Vec3d lookVec = player.getLookVec();

The first method gives you the position of the vector position of the players eyes and the second one is a vector that tells us where the player is looking at. The pitch and rotation data should be readily available in the EntityPlayer instance, just access it and search for rotationPitch, rotationYaw and rotationYawHead.

I still haven't published a mod because I can never get that in-dev version just right to warrant a public release. And yes, after two years of mod development I am still learning to speak Java.

 

Follow me on GitHub: https://github.com/yooksi

Contact me on Twitter: https://twitter.com/yooksi

Read my Minecraft blog: https://yooksidoesminecraft.blogspot.de/

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.

Guest
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.

Announcements



×
×
  • Create New...

Important Information

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