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 want to edit the ToolMaterial on an item arbitrarily, is there any function that can update the ToolMaterial after it's been registered, or any method of working around this?

  • Author

From the end of that post, it seems that reflection is only really needed for efficiency and harvest level?  What's the call for attack damage?  But that's very useful anyway, thanks for that.  :D

  • Author

My material is created and registered in Main.class, so would I want

 

ReflectionHelper.setPrivateValue(Main.class, Main.material, x, y);

 

because when I try to do that, setPrivateValue errors, saying

 

The method setPrivateValue(Class<? super T>, T, E, int) in the type ReflectionHelper is not applicable for the arguments (Class<Main>, Item.ToolMaterial, float, int)

 

One more thing, when I do the field listing for Main, it doesn't give the fields for the tool material, just the tool material itself.

In this case you should use a Material as the second-to-last argument, not a float, since you are setting a Material variable.

You Only Live Once, So Win At Golf.

Sorry for my English, I'm American.

  • Author

Do you mean that I should create a new ToolMaterial with the modified values and give it as the second to last argument?  That gives the same error, with Item.ToolMaterial instead of Float.

  • 2 weeks later...

You're not supplying it with the correct arguments. That's why it's "not applicable for the arguments".

-Mitchellbrine

 

Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible.

It may be freaking fucking hard though, but still possible ;)

 

If you create a topic on Modder Support, live by this motto:

I don't want your charity, I want your information
  • Author

I figured the reflection out shortly after posting that last reply, but it turns out I never needed it.

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.