Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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!

I would imagine yBodyRoyO probably only gets update eachย tick.ย  So if you're linear interpolating from yBodyRotO to yBodyRot more than once a tick, it would cause it to "rewind" and "replay" rapidly.

Edited by bradsk88

  • Author

Hmm that'd make sense, but it doesn't make sense to me how this issue doesn't affect the default player entity / model, since this code is a part of the default render process as well.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.