Posted October 9, 201411 yr 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?
October 9, 201411 yr Reflection, my friend. http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/2151027-1-7-x-using-reflection-to-modify-vanilla-values They don't necessarily have to be Vanilla values. You Only Live Once, So Win At Golf. Sorry for my English, I'm American.
October 9, 201411 yr 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.
October 9, 201411 yr Glad to be of service. You Only Live Once, So Win At Golf. Sorry for my English, I'm American.
October 9, 201411 yr 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.
October 9, 201411 yr 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.
October 10, 201411 yr 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.
October 18, 201411 yr 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
October 18, 201411 yr 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.