Jump to content

Enumhelper.addToolMaterial not working


Recommended Posts

Hi everyone!


This is the first time I am trying to make a mod, so forgive me if I'm acting dumb.

I'm trying to create a custom sword, and I used this code to create the material for the sword:


public static final Item.ToolMaterial TESTMATERIAL = EnumHelper.addToolMaterial("TESTMATERIAL", 2, 192, 5.0F, 1.5F, 12);


but it gave me an error saying that Enumhelper cannot be resolved.

I already tried importing Enumhelper on the class but the import also gave me an error, I added this import code:


import net.minecraftforge.common.EnumHelper;


It also gave me a cannot be resolved error. The version of minecraft that I'm trying to mod is version 1.7.2 using forge-1.7.2- version of forge.


Can anybody help?



Link to comment
Share on other sites

Well first of all, I do use Ctrl-Space whenever I code. I also assume that you did not get what I meant. The error is in the Enumhelper and not the chain of Enumhelper, and Enumhelper is giving an error because it doesn't know what Enumhelper is and what class, and I found a forum thread in the internet which the person who solve the problem gave the import code:


import net.minecraftforge.common.EnumHelper;


The chain code of Enumhelper is in the correct state.


P.S I did use the Ctrl+Shift+O hotkey to automatically add imports(but it added no imports regarding Enumhelper).

Link to comment
Share on other sites

This topic is now closed to further replies.


  • Create New...

Important Information

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