Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

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.

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.