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

Hello, I've been looking all day to a way to animate any BidepModel (player, zombie, squelleton, any other biped, vanilla or not...) with the same animation/pose (all biped having the same "structure" arms, legs...).

My first approach was to use the render event hook that way:

    @SubscribeEvent 
    public void onRenderBiped(RenderLivingEvent.Pre event){
    	/*ICaster caster = CasterHandler.getCaster(event.getEntity());
    	if(caster!=null) {
    		ModelPlayer modelplayer = event.getRenderer().getMainModel();
    		modelplayer.bipedRightArm.
    	}*/
    	if(event.getRenderer().getMainModel() instanceof ModelBiped) {
    		event.setCanceled(true);
    		ModelBiped model = (ModelBiped)event.getRenderer().getMainModel();
    		model.bipedRightArm.rotateAngleX = 5f;
    	}
    }

but it does'nt work (because the rotate angle values are overrided by the model render method, and of course if I use RenderLivingEvent.Post the model is already rendered so it's too late).

 

I found some answers saying to create a custom BipedModel but it would mean to create as many Renderer as biped entity to override the vanilla BipedModel (and is it even possible?), plus would'nt it be a compatibility-killer?

 

Is there a better maintenable solution?

You can force the model to skip normal rendering by canceling the event with event.setCanceled(true). The plus side is you'll be able to do exactly what you want with the model. The down side is you'll have to write the entire rendering method, including rendering sleeping/sneaking conditions as well as nameplates.

Edited by Azaka7

  • Author
4 minutes ago, Azaka7 said:

You can force the model to skip normal rendering by canceling the event with event.setCanceled(true). The plus side is you'll be able to do exactly what you want with the model. The down side is you'll have to write the entire rendering method, including rendering sleeping/sneaking conditions as well as nameplates.

I tough of this solution but imagine the render method changes in future versions or is used in other mods. It's kind the same problem as overriding the model. 

Guest
This topic is now closed to further replies.

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.