Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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.

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.

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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.