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

First, i know i have to use RenderPlayerEvent.Post for changing player stuff like size, rotation of player body parts, etc. And .Pre for capes, elytras, etc

 

Knowing that, i tried 2 things, rotate the player's arm and change the player's size(only visual but still) but non of them works

@EventBusSubscriber
public class PlayerRenderingEvent {

	@SubscribeEvent
	public void playerRendering(RenderPlayerEvent.Post event) {
		//This one
		PoseStack pose = new PoseStack();
		pose.pushPose();
		pose.scale(2, 2, 2);
		pose.popPose();
		
		//Or this one
		event.getRenderer().getModel().leftArm.xRot = (float) Math.toRadians(120);
	}
}

 

 I know why it is not working, but I don't know enough about entity models/animations to tell you how to do it properly (if its even possible?)

 

Doing anything in Post will do nothing since its *after* the rendering.

 

Even if you did it in Pre:

Quote

PoseStack pose = new PoseStack();

pose.pushPose();

pose.scale(2, 2, 2);

pose.popPose();

Creating your own PoseStack isn't going to affect the one used by the renderer which you can get from the event state.

But since you popPose() your rescaling will be erased anyway.

 

I doubt you will be able to change the xRot like that.

These values are recalculated based on the animation state,

see: HumanoidModel.setupAnim() used by LivingEntityRender.render() before drawing the model parts, but after the call to Pre.

Like I said above. I don't know the correct way to do this?

 

Edited by warjort

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

  • Author
5 hours ago, warjort said:

 I know why it is not working, but I don't know enough about entity models/animations to tell you how to do it properly (if its even possible?)

 

Doing anything in Post will do nothing since its *after* the rendering.

 

Even if you did it in Pre:

Creating your own PoseStack isn't going to affect the one used by the renderer which you can get from the event state.

But since you popPose() your rescaling will be erased anyway.

 

I doubt you will be able to change the xRot like that.

These values are recalculated based on the animation state,

see: HumanoidModel.setupAnim() used by LivingEntityRender.render() before drawing the model parts, but after the call to Pre.

Like I said above. I don't know the correct way to do this?

 

well there isn't enough information to learn how to to this well, so i have to wait until someone that knows a bit of this theme helps me, thank you anyway

1 hour ago, ElTotisPro50 said:

well there isn't enough information to learn how to to this well

There is no helpful information for most things, in the mosts cases there is a vanilla example or something like that where you can take a look at.
Then try and hopeyou get the things to work.

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.