Jump to content

Recommended Posts

Posted

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-10.12.1.1060 version of forge.

 

Can anybody help?

 

Thanks.

Posted

There's no automatic code completion when I hover on the Enumhelper. It only recommends me to create a new class. I'm trying to find the Enumhelper class on the source file.

Posted

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

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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