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

One of the items in my mod allows the user to zoom in at a location which I did using the FOV hook. However, I have noticed that there is no hook for the mouse sensitivity. It is simply hard coded to directly use the value of the sensitivity slider and I can't override that without changing the value of the slider (which is not optimal), overriding the whole entityRendere class, overriding the gameSettings class, or using ASM. Note; I am using minecraft 1.7.10, this would be of no use to me in forge for 1.8. The troublesome code where it would be nice to have a hook added:

 

net.minecraft.client.renderer.EntityRenderer.java

        this.mc.mcProfiler.startSection("mouse");

        if (this.mc.inGameHasFocus && flag)
        {
            this.mc.mouseHelper.mouseXYChange();
            float f1 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; //Right here. Note the direct access to the variable
            float f2 = f1 * f1 * f1 * 8.0F;
            float f3 = (float)this.mc.mouseHelper.deltaX * f2;
            float f4 = (float)this.mc.mouseHelper.deltaY * f2;
            byte b0 = 1;

            if (this.mc.gameSettings.invertMouse)
            {
                b0 = -1;
            }

            if (this.mc.gameSettings.smoothCamera)
            {
                this.smoothCamYaw += f3;
                this.smoothCamPitch += f4;
                float f5 = p_78480_1_ - this.smoothCamPartialTicks;
                this.smoothCamPartialTicks = p_78480_1_;
                f3 = this.smoothCamFilterX * f5;
                f4 = this.smoothCamFilterY * f5;
                this.mc.thePlayer.setAngles(f3, f4 * (float)b0);
            }
            else
            {
                this.mc.thePlayer.setAngles(f3, f4 * (float)b0);
            }
        }

        this.mc.mcProfiler.endSection();

 

BTW: If anyone knows a good way to do this without a new code or ASM, I would be happy to here it. I should mention I did try overriding the instance of the mouseHelper class with my own that undid the math of the sensitivity code and used my own modifications but the use of integers rendered it a useless change due to it being impossible to move the perspective below certain mouse speeds.

What do you want to do with it? You can just access the mouse sensitivity with

Minecraft.getMinecraft().gameSettings.mouseSensitivity 

.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Author

That value is the settings value and would be save as the user's settings. It would be by far from optimal, Imagine doing the same with FOV rather than using the Hook. A hook is preferable.

No new features are going into 1.7.10, and you've already stated that this value can be edited in the game settings directly. You would just have to store the value and revert it before the next time the config was saved.

I'm not seeing anything in here that needs a hook, and definitely not seeing anything that warrants asm.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

  • Author

sure, I'll do it that way but I should have asked for this back in 1.6 when I started my mod (I didn't because forge for 1.6 was not being updated due to 1.7 being out). Would it be possible to have this in forge for 1.8? FOV got one and its in the same boat.

"but but he got to have icecream!!!" is not a valid reasoning.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.