Posted April 9, 20223 yr So I want to create a new pose for my player. I have tried using the PlayerRenderEvent.Pre and Post. But the player's body are rendered upside down just like the following picture. here is my code @OnlyIn(Dist.CLIENT) @SubscribeEvent public static void onPreRender(RenderPlayerEvent.Pre e){ PlayerEntity p = e.getPlayer(); if(p.getHeldItemMainhand().getItem() instanceof Lance){ PlayerModel<AbstractClientPlayerEntity> model = e.getRenderer().getEntityModel(); model.bipedBody.showModel = false; } } @OnlyIn(Dist.CLIENT) @SubscribeEvent public static void onPostRender(RenderPlayerEvent.Post e){ PlayerEntity p = e.getPlayer(); if(p.getHeldItemMainhand().getItem() instanceof Lance){ PlayerModel<AbstractClientPlayerEntity> model = e.getRenderer().getEntityModel(); IVertexBuilder builder = e.getBuffers().getBuffer(RenderType.getEntitySolid(((AbstractClientPlayerEntity)e.getPlayer()).getLocationSkin())); int light = e.getRenderer().getRenderManager().getPackedLight(e.getPlayer(), e.getPartialRenderTick()); MatrixStack stack = e.getMatrixStack(); model.bipedBody.showModel = true; model.bipedBody.render(stack, builder,light,655360); } } You can see I even didn't rotate anything. I also have tried stack.push() and stack.pop() but it didn't help at all. Can anyone help? Thank you.
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.