Posted November 3, 201311 yr I'm trying to add a custom tool material without editing the original class, but when I try to use it in an item is says that the new material is not resolved or isn't a field. This is what I have: @EventHandler public void preInit(FMLPreInitializationEvent event) { EnumToolMaterial FRAG = EnumHelper.addToolMaterial("FRAG", 3, 59, 8.0F, 3.0F, 10); fragSword = new ItemFragSword(8003, EnumToolMaterial.FRAG) .setCreativeTab(CreativeTabs.tabCombat).setTextureName("mymod:fragsword").setUnlocalizedName("fragSword"); } Thanks for any help. I hope this isn't too noobish. Edit: I'm having the same problem trying to add items to a custom creative tab. I have the tab working, but items won't recognise it. Eclipse tells me it is "unresolved or not a field", just like the tool material
November 3, 201311 yr Hi Just guessing here - try FRAG instead of EnumToolMaterial.FRAG @EventHandler public void preInit(FMLPreInitializationEvent event) { EnumToolMaterial FRAG = EnumHelper.addToolMaterial("FRAG", 3, 59, 8.0F, 3.0F, 10); fragSword = new ItemFragSword(8003, FRAG) .setCreativeTab(CreativeTabs.tabCombat).setTextureName("mymod:fragsword").setUnlocalizedName("fragSword"); } -TGG
November 3, 201311 yr Author BAH! I'm feeling mixed emotions of extreme thanks and self-reprimand for missing that. I feel like I jumped off the empire state building into an ocean, only to miss by two feet. You're the guy that scrapes me off the pavement and gives me back to my family. ARGH It makes sense! Its not located in that class! BTPHTPHTPH! Thanks very very much.
November 3, 201311 yr Hi no worries dude :-) If it makes you feel any better I once wrestled with nearly exactly the same error for half a day before finally figuring it out... -TGG
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.