Posted July 29, 201411 yr Hello everybody. I've been searching around the minecraft code to try to find out how to add lore to my items and i've found nothing. So if anyone could point out the direction to go to learn how to do this, I would appretiate it . Also I would like to know how to add color to the item name and lore. BTW I'm not bad at coding, but i'm still learning. EX: Item Name: Fish Desc: a regular fish only found in water. Hello everyone! I'm the developer and owner of a mod called MagZ Aquatic Life Experience. Right now it's being worked on, but when it's released, check it out! --[Also Check Out My Website!]--
July 29, 201411 yr The best way to understadn and learn is to look up Item.class. It has all the methods and info you are looking for. For the color part you can use EnumChatFormatting.ANYCOLOR. An example: EnumChatFormatting.GREEN+"This is green"+EnumChatFormatting.RED+"This will be red". You can use EnumChatFormatting.RESET to break the color any further.
July 29, 201411 yr You'll want to look at the addInformation method in the Item class to add lore to your items.
July 30, 201411 yr Author Im not seeing it. Can you possibly say the line it begins on? Sorry if I sound like a noob Hello everyone! I'm the developer and owner of a mod called MagZ Aquatic Life Experience. Right now it's being worked on, but when it's released, check it out! --[Also Check Out My Website!]--
July 30, 201411 yr In your IDE go to Referenced Libraries>forgeSrc>net,minecraft.item>Item.class There you can see every method you can imagine with some additional info. The starting line is "public". Joking aside you can use CTRL + F to search the class so you can find everything a lot easier. Hope i helped
July 31, 201411 yr There's two ways of doing this. In your item class there is an addInformation method which contains a List variable. You can then add your own tooltip to the list (as a String). The other way to do this, which (I believe) is the only if you want to add tooltips to vanilla items, is using the ItemToolTipEvent. BEFORE ASKING FOR HELP READ THE EAQ! I'll help if I can. Apologies if I do something obviously stupid. If you don't know basic Java yet, go and follow these tutorials.
August 1, 201411 yr Author Thanks for the reply! But i'm still kinda in a pickle . I'm thinking it would be appropriate To make a different public String since i'm not asking to make the name, so I did this: public String getItemDescriptionName(ItemStack par1ItemStack) { } But now I don't know what to do the add the letters and line for my description. Do I just copy whats from the actual public String inside the addInformation method, or what? Sorry for being a big newb . Hello everyone! I'm the developer and owner of a mod called MagZ Aquatic Life Experience. Right now it's being worked on, but when it's released, check it out! --[Also Check Out My Website!]--
August 1, 201411 yr Anywhere between where your item's class is defined and where it ends, you can put this code. Note that you can add as many par3Lists as you want to create new lines of the description, and also that it doesn't auto-wrap (hence why I've split the text up onto two lines): public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("A regular fish only"); par3List.add("found in water"); } For a specifically coloured name I've been using the section symbol in my en_us.lang file followed by the letter that defines the colour, like so: §eFish That probably isn't the best way to do it, but it works! -Toastrackenigma P.S. Note that for some reason that Eclipse (on my Mac) doesn't encode the section symbol correctly; I would suggest just typing all of the contents of the en_us.lang file in a separate text editor (like notepad or textedit) to make it work
August 1, 201411 yr Author Thanks! I will get back to you if it works! Thanks for the reply ! Hello everyone! I'm the developer and owner of a mod called MagZ Aquatic Life Experience. Right now it's being worked on, but when it's released, check it out! --[Also Check Out My Website!]--
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.