How add description to item ? (code )

4 posts / 0 new
Last post
Offline
Last seen: 9 months 5 days ago
Joined: 02/17/2015 - 21:19
Gems: 0
How add description to item ? (code )

Hi ,

how I can add description to item ? Code pls :D 

 



Demonic_Intent's picture
Offline
Last seen: 6 months 1 week ago
Joined: 08/29/2015 - 07:45
Gems: 0
So did some research for you,

So did some research for you, and a few hours of testing different methods that were found on the interwebz, it was until I combined a few methods that I came up with the following:

The first bit is the code I was playing with, and is being used as an example:

 

 

public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List list, boolean show)
{
list.add("The Book of Lore " + EnumChatFormatting.BOLD + EnumChatFormatting.UNDERLINE + "Is "); list.add(EnumChatFormatting.BOLD + "A " + EnumChatFormatting.UNDERLINE + "WONDERFUL" + EnumChatFormatting.RESET + " book with lore.");
}

 The above that has been italicized is what you want to be looking at, what I did was removed the boolean par4 and changed it to boolean show. After that using an easy method when creating an item, when you give an item a texture it says "Special Information" enter in some Text for example: "placeholder,placeholder,placeholder"

In which afterwards you will end up with the following: (This is an item that was just created and is using the Special Information with the above example placeholder.)

public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List list, boolean par4)
{
list.add("placeholder");
list.add("placeholder");
list.add("placeholder");
}

 After you get the following, above you see the text "boolean par4)" change that to: "boolean show)" by doing so it will show your text that you add in between the quotation marks as Item Lore. (Description Text)

public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List list, boolean show)
{
list.add("This is line one, and ");
list.add("you should not have too");
list.add("much text per line, nor");
list.add("should you ever have too many lines.");
}

NEVER have too many lines, or have your lines too long - it looks bad, and will run off the screen cutting some parts out.

After filling in your Description Text (Lore), you can then save and recompile. If you run into any errors contact me. 

 

Now if you want to know in the first bit of code the "EnumChatFormatting.BOLD" etc text, is in chat modifiers. So that using that will make the following text Bold, and so forth. You would need to know more about Minecraft's Color Format System to use it fully, and I myself am doing more research on it too.

I hope this answers your question...

Offline
Last seen: 9 months 5 days ago
Joined: 02/17/2015 - 21:19
Gems: 0
Thx men :D you are my Good :D

Thx men :D you are my Good :D

 

Demonic_Intent's picture
Offline
Last seen: 6 months 1 week ago
Joined: 08/29/2015 - 07:45
Gems: 0
Know anyone that could help

Know anyone that could help me with making stairs/slabs? Just to return the favor?