Jump to content

Recommended Posts

Posted

Trying to add a tooltip to an item, seen a couple topics about but nothing is really helping. I've got:

public ModItem(){...} //Standard setup

public void ItemTooltipEvent(ItemStack itemStack, EntityPlayer entityPlayer, List<String> toolTip, ITooltipFlag flags) {
		toolTip.add("This Is A ToolTip");
	} //Not sure what I'm missing

Like I'm asking, I know I'm missing something but not sure what. Any pointers are great and much appreciated.

 

Thanks.

Posted

You've got everything wrong.

 

1) You haven't registered an event handler

2) Your event handler method has the wrong signature

3) The method signature you do seem to have is the one from the Item class.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
57 minutes ago, Blu_Nighttime said:

Trying to add a tooltip to an item, seen a couple topics about but nothing is really helping. I've got:

Are they your own Items override addInformation in your Item or Block class. If they are not subscribe to the ItemToolTipEvent, you can read more about events on the forge docs.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
9 hours ago, Animefan8888 said:

Are they your own Items override addInformation in your Item or Block class. If they are not subscribe to the ItemToolTipEvent, you can read more about events on the forge docs.

This is exactly what I was looking for. I found the addInformation event in another forum page but it looked a little like this

@Override
public void addInformation(ItemStack stack, EntityPlayer entityPlayer, List list, boolean par4){...}

I'm not sure if this is an old version but this no longer works. Now I know it's addInformation, I just looked up Item#addInformation and it's completely different now

@Override
public void addInformation(ItemStack stack, World worldIn, List<String> tooltip, ITooltipFlag flagIn){...}

 

9 hours ago, Draco18s said:

You've got everything wrong.

 

1) You haven't registered an event handler

2) Your event handler method has the wrong signature

3) The method signature you do seem to have is the one from the Item class.

I'm assuming this is the way to add tooltips to already existing items, like vanilla items. Thanks for letting me know the differences and how to perform that way.

 

P.S. Is changing colour of the text a flag or is it a little more complicated?

 

Thanks.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.