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.8] Accessing GameSettings in development works, but doesn't work when built

Featured Replies

Posted

Hello everyone.

 

I'm having a really strange issue at the moment. I'm currently using 1.8-Forge11.14.0.1299 (1.8 Recommended). I have the client installed and I have the source package to develop mods. Now for a mod I'm currently working on, I have to access the "gameSettings" field in the Minecraft class. It works fine in the development environment, but as soon as I compile/build the mod and put it into my mods folder in my client installation the game crashes. The log indicates that the gameSettings field in the Minecraft class is not existant.

 

Problem is that this doesn't make any sense at all. The source package and the client installation are both the same version. It works fine in the development environment, but fails when its expected to work. Those are the lines which appear to be "wrong":

 

Minecraft mc = FMLClientHandler.instance().getClient();
KeyBinding[] internalKeybindings = mc.gameSettings.keyBindings;
KeyBinding targetKeybinding = mc.gameSettings.keyBindScreenshot;

 

If further information is needed then tell me and I'll add it as soon as possible.

Thats because 'gameSettings' doesn't exist. 'field_71474_y' does.

Dont 'export jar' from your IDE. Run gradlew build.

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

Thats because 'gameSettings' doesn't exist. 'field_71474_y' does.

Dont 'export jar' from your IDE. Run gradlew build.

 

That's exactly what I did. I wouldn't have started this thread if I didn't do everything according to the wiki.

  • Author

Okay. I'm terribly stupid. I accidentally skipped a line in the tutorial on how to compile a modification. Sorry to everyone I've stolen time from.

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.