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

So, I'm modding in Intellig and using this:

 

return ReflectionHelper.getPrivateValue(SoundHandler.class, getSoundHandler(), "sndManager");

Which works fine until I try it in the actual minecraft game.  Then I get an error:

ReflectionHelper$UnableToAccessFieldException ... java.lang.NoSuchFieldException: sndManager

 

So it seems the field has changed.  How do I tell what I should use for a field that will work in minecraft and build in dev?

 

I'm building for 1.7.10-10.13.0.1207 btw.

 

You are using the deobfuscated name, so it will work in the dev environment, but in the non-dev environment, the name is deobfuscated and is changed, so that's why it doesn't work. You need to check if you in a dev environment or not, and use the appropriate name for that.

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/

You need to use the srg name in the obfuscated version of your mod.

You can find them at C:\Users\{YOUR_USER}\.gradle\caches\minecraft\net\minecraftforge\forge\{VERSION}\srgs\mcp-srg.srg

 

So for this one I took the time to find it for you, it's 'field_147694_f'. So your code would look like:

return ReflectionHelper.getPrivateValue(SoundHandler.class, getSoundHandler(), "sndManager", "field_147694_f");

 

Also, if this method is being called frequently, consider saving the 'Field' instance somewhere, and just calling Field#get(Object) on it.

BEFORE ASKING FOR HELP READ THE EAQ!

 

I'll help if I can. Apologies if I do something obviously stupid. :D

 

If you don't know basic Java yet, go and follow these tutorials.

  • Author

Thanks!  That works!

 

I also noticed the ReflectionHelper is overloaded to allow checking by index of field.  Was going to try and see if that works as well; might be quicker to use in the future.

  • Author

Oh, looks like you can also pass an array of field names so it works in both environments (I think).  I'm learning!

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.