Jump to content

[1.8] Errors while trying to make an Item


Hardc0r3Br0n3

Recommended Posts

I've been following this tutorial: https://docs.google.com/document/d/1q5zGvnSslQK8QUFJlEtGClZCM9esf88LzZTEzaY6Mlo/edit

 

I have all the code needed but I still have two errors that I can't seem to fix.

It's telling me that there isn't a such thing as 'RegisterHelper' From these:

	public static void registerItems()
{
	RegisterHelper.registerItem(cythar);
}

public static void registerItemRenderer()
{
	RegisterHelper.registerItemRenderer(cythar);
}
}

and it's tell me to erase 'cythar' from this:

public static Item cythar = new ItemEXTS().setUnlocalizedName(“cythar”);

Which is the name of the Item I am trying to add.

"It's basically a big ball of wibily wobily timey wimey." - The Doctor

Link to comment
Share on other sites

Unless you added it yourself, there isn't any such thing as 'RegisterHelper' - there is a GameRegistry class which is the one most modders use to register their items and blocks.

 

You shouldn't be inline instantiating your items, either - I suggest you find a tutorial author that knows what they are doing. Items and blocks need to be declared, and then instantiated during the FMLPreInitializationEvent.

 

Inline instantiation looks like this:

public static Item whatever; // that's a declaration
public static Item whatever = new Item(); // that's inline instantiation

 

As for your second error, my guess is that ItemEXTS does not extend Item, and thus has no method for setUnlocalizedName.

Link to comment
Share on other sites

To  Jedispencer21, yes I have made the ItemEXTS class. Although I have not made the Helper one. I had thought that It came with Forge since the tutorial author said nothing about having to make that class.

 

To cool, I've been looking all over the place for tutorials and can never seem to find the right one.

 

EDIT: to Jedispencer21, oh that would help, thanks!

"It's basically a big ball of wibily wobily timey wimey." - The Doctor

Link to comment
Share on other sites

Whats The Problem with inline instation of items @cool?

Nothing really. @coolAlias has tutorials on his GitHub repository, impressive I must say, though I dislike the way he registers his items and its renders. It's personal preference, really, if done correctly.

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

Link to comment
Share on other sites

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.