How could there be a "correct" and incorrect way? Does one of them not work? Creating an ItemBlock just to add lore will most likely be more CPU intensive. There's a clear, easy, and working way right in front of you and you want to go the harder, more-work way? That just does't make any sense. Please explain if I have something "incorrect'. Also, what do you mean by "Because that is more for if you want to add tooltips to things you don't add."
Did you not see the quotes? And I meant "If you want to add tooltips to items you don't add. Such as how TiC Tooltips does it.
The event is meant for adding tooltips to items you don't create. See here and here for examples. That's really the only time it should be used. Otherwise, you make an ItemBlock for blocks and add the method.
I think it is done by the Entity's ID. So I'd try getting the Pig's EntityID from EntityList. So here it is.
ItemStack pigSpawnEgg = new ItemStack(Items.spawn_egg, 1, 90);
90 being EntityPig's ID. I got that from looking at the EntityList class. In there EntityPig is registered in the 90th spot.
@Vic_ i wasnt sure and thought i would ask. I havent had a chance to check it out/try it yet. I am creating cactus cake and pie for my mod and want to add lore (ie something like "oh the prickles!" Or "that tickles"). That my sound strange (and is, i get it) but the point of the mod is to be as stupidly outrageous as possible.
This is an excerpt from its (currently) private description I am working on:
"Our goal in creating this mod was to let it loose, break all the boundaries you thought existed, and to challenge a traditional way of thinking all while having fun.
In this mod you can turn dirt and sugar into snow, dirt and diamonds into snow, gold ingots and paintings into 10 baked potatoes. More ridiculously preposterous things to come. :-)"
It has been fun so far and has challenged me to be more creatively & think outside the box more. I am trying to make it as ridiculous as possible. If you can think of any ridiculous crafting recipes or custom items/foods let me know! :-)
I think if you want to add more than only one potion effect to your food you have to override onEaten and give the player the effects there. Maybe take a look at the golden apple? I'm not on my PC right know so I can't give you a example I think ...
@TechMage66 It wasn't working for the longest time until I remembered about that and spent about 2 minute tracking that page down (started with Items.golden_apple and tracked from there).
After commenting out the if and else statements (I just kept the protected void and the p_77849_3_.addPotionEffect part) and changed p_77849_3_ to player
I tried to figure out what the if statements did (in this case) but with them in the player only gets absorption and not the other ones I want them to. I guessed that the player had to be hungry and damaged to get the others but I simply could not get the scenario to enter "if (p_77849_1_.getItemDamage() > 0)" all I was able to get into was "if (!p_77849_2_.isRemote)"