Posted July 5, 201411 yr What code do i use to add the echnatment Glitter to an item. This is how i have setup my Titanites Code "Upgrade materials" http://prntscr.com/3zi061 Note: The only item i want with the glow is the "TwinkleTitanite"
July 5, 201411 yr 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 ):
July 5, 201411 yr There are not enough hours in the day for the amount of Karma I want to give you, diesieben07!
July 5, 201411 yr Author There are not enough hours in the day for the amount of Karma I want to give you, diesieben07! I tried but it gives me error
July 5, 201411 yr 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.
July 5, 201411 yr Author 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.
July 5, 201411 yr 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.
July 5, 201411 yr Author http://prntscr.com/3ziizs And on the overdrive it says Anotations not allowed here
July 5, 201411 yr 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.
July 5, 201411 yr Author Thank you very much, and your correct, im really new to this EDIT: I get this error with override http://prntscr.com/3zitee This is my code BTW Main Class http://prntscr.com/3zitjf ItemTwinkleTitanite class http://prntscr.com/3zitob ModItems class http://prntscr.com/3zittt
July 5, 201411 yr Author I did, then this happened http://prntscr.com/3zitee This is my code BTW Main Class http://prntscr.com/3zitjf ItemTwinkleTitanite class http://prntscr.com/3zitob ModItems class http://prntscr.com/3zittt
July 5, 201411 yr 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
July 5, 201411 yr Ah, right, thank you. A lot of the classes referenced are not in the repository, though - and as such, I cannot view them.
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.