Jump to content

Issue with Rendering my Own Custom Player Entity / Model [1.16.5]


barnboi

Recommended Posts

Hey guys. Brand new to modding, but I've been having an issue trying to render my own custom model in place of the player. To render my player model, I've subscribed to the RenderPlayerEvent.Pre event and cancelled the default rendering process in place of my own. My custom model successfully renders into the world; however, I'm having an issue where my model constantly shakes. I've narrowed down the cause of the shaking to this line of code within LivingEntity#render

float f = MathHelper.rotLerp(partialRenderTick, playerEntity.yBodyRotO, playerEntity.yBodyRot);

My model's head's xRot value is dependent on that f value, but it seems the f value fluctuates due to the partial tick. In other words, my model can be completely standing still (having constant yBodyRot0 and yBodyRot values), but this function gives a different f value depending on the partial tick that's inputted into the function. This leads to my model "shaking" back and forth. I can set the partial tick to 0 in this function and it gets rid of the shaking; however, then my model is really only re-rendering every tick, which seems kind of choppy. I'm just sort of confused why this is happening to my custom model but not to the default player model. Obviously I'm missing something here, but I just can't put my finger on it. Any help would be greatly appreciated.

Thanks!

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.