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

[I've written lots of code before, but this would be my first time writing a minecraft mod from scratch]

I'm looking to adjust the height of the first person camera with client-side modifications to work with a custom player model.

Based on reading some of the decompiled code from MCP and the source code for https://github.com/Exopandora/ShoulderSurfing , I believe I need to update the getEyeHeight method.

From what I've read, the two standard way of achieving this would be Access Transformers and Bytecode manipulation. I'm wondering if there's a simpler way I could modify this value or rewrite the method?

```Java

public float getEyeHeight()
    {
        float f = 1.62F;

        if (this.isPlayerSleeping())
        {
            f = 0.2F;
        }
        else if (!this.isSneaking() && this.height != 1.65F)
        {
            if (this.isElytraFlying() || this.height == 0.6F)
            {
                f = 0.4F;
            }
        }
        else
        {
            f -= 0.08F;
        }

        return f;
    }

```

Method taken from MCP with minecraft version 1.12.2 and the class EntityPlayer.

 

Right now I'd like to try something simple like changing `float f = 1.62F` to 1.20F or something like that.

Any direction or help would be appreciated.

There are events within EntityEvent now that handle this (Size and EyeHeight iirc) for 1.16. Note, if you are requesting help for 1.12.2, that version is not supported on the forums.

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.