How add description to item ? (code )

Started by michal2010 on Sun, 08/30/2015 - 20:12
Last seen on 16:46, 18. Apr 2016
Joined Feb 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
How add description to item ? (code )
Sun, 08/30/2015 - 20:12

Hi ,

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

 

Last seen on 15:41, 24. Feb 2018
Joined Aug 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
So did some research for you,
Mon, 08/31/2015 - 06:00

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...

Last seen on 16:46, 18. Apr 2016
Joined Feb 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Thx men :D you are my Good :D
Mon, 08/31/2015 - 09:33

Thx men :D you are my Good :D

 

Last seen on 15:41, 24. Feb 2018
Joined Aug 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Know anyone that could help
Tue, 09/01/2015 - 21:00

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

Last seen on 21:39, 10. Dec 2017
Joined Jul 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:Know anyone that could help
Mon, 07/24/2017 - 01:29

@#3

I dont know much about Stairs, but i do know you can make a Slab Model using Mr Crayfish's Model Creator and Change the Hitbox on Max Y to half