Jump to content

Recommended Posts

Posted

A screenshot of text code? Interesting ...

 

Anyway, a quick and dirty way would be to add an enchantment to the item through an NBTTagCompound with the key "ench".

 

Alternatively, I guess you could set up a custom item renderer.

 

In that case, this is the raw code for the vanilla item glint (not glitter, that is something entirely different :P):

Posted

You tried to give diesieben07 karma as well? Interesting!

 

I assume your reply was meant for diesieben07. In that case, please be more elaborate than just saying "it gives me error".

 

Specify what the error message says, and paste the relevant code - in this case, at least the

hasEffect

override you perform, and preferably the entire class.

Posted

No not karma, i meant the hasEffect overdirve is what give me an error

You tried to give diesieben07 karma as well? Interesting!

 

I assume your reply was meant for diesieben07. In that case, please be more elaborate than just saying "it gives me error".

 

Specify what the error message says, and paste the relevant code - in this case, at least the

hasEffect

override you perform, and preferably the entire class.

Posted
Specify what the error message says, and paste the relevant code - in this case, at least the
hasEffect

override you perform, and preferably the entire class.

Posted

Lucky for you, you didn't crop that screenshot perfectly.

 

I can tell you are calling

GameRegistry.registerItem

on the line above, meaning you are trying to define a method inside a method. That will not work - unless you go through some hoops or are using Java 8, which Forge (and possibly Minecraft) will not support yet.

 

You must be new to this. I suggest reading some guides on how to program in Java and in general.

 

For the time being, though, you can just move the

hasEffect

declaration/defintion out of what I assume to be the

preinit

method of your main mod class (what is it doing there?), into the base of a new class you make called

ItemTwinkleTitanite

, which you extend from

Item

.

 

It is in this class that you will want to @Override the

hasEffect

method, simply by defining it and adding

@Override

on the line above the signature, as you have already done in your screenshot.

Posted

Try following a tutorial on how to add Items to the game. Your classes and methods are all over the place.

 

Also, please start pasting code (preferably as gists) instead of screenshotting, and please paste entire classes. If those are your entire classes, start from scratch and follow a tutorial on basic modding :)

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.