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.

[1.16.3] [SOLVED] Scale Player Model

Featured Replies

Posted

Not sure what I've messed up here, but I've been trying to scale the player model, and basically no matter what value I try to scale to, the player is like the size of a house. Any ideas of what's going wrong here?

    @SubscribeEvent
    public void preRenderPlayer(RenderPlayerEvent.Pre event) {
        event.getMatrixStack().scale(0.25f, 0.5f, 0.25f);
        event.getMatrixStack().pop();
        event.getMatrixStack().push();
    }

    @SubscribeEvent
    public void postRenderPlayer(RenderPlayerEvent.Post event) {
        event.getMatrixStack().getLast();
    }

 

Edited by jstN0body

        event.getMatrixStack().scale(0.25f, 0.5f, 0.25f);
        event.getMatrixStack().pop();
        event.getMatrixStack().push();

You should call MatrixStack#push then do your own transformations, and pop afterwards (after finish your rendering).

Afaik you can't just scale the player's model there, you need to hide them in Pre and render them yourself in Post.

 

  • Author

Working code snippet for anyone who wants it:

    @SubscribeEvent
    public void preRenderPlayer(RenderPlayerEvent.Pre event) {
        event.getMatrixStack().push();
        event.getMatrixStack().scale(0.5f, 0.5f, 0.5f);
    }

    @SubscribeEvent
    public void postRenderPlayer(RenderPlayerEvent.Post event) {
        event.getMatrixStack().pop();
    }

 

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.