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

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

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

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.

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.