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.

[SOLVED]Is there an event to change the text that appears above the hotbar?

Featured Replies

Posted

29V4fzb.png

As it says in the title, I want to know if there is an event that I can use to change the text that appears above the hotbar when you switch to an item.

 

EDIT:

Solution:

No, there isn't, but you can override Item#getItemStackDisplayName(ItemStack) to add the text you want there.

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Find the exact event that is rendering the text (i think there was getElementsType or sth like that) cancel that event and do the rendering of it on your own (except for the text of course)

I don't think there is an event for that specifically. The game just renders the item's name. Why do you want an event to be called when changing items, or as you said when the hotbar text changes?

 

There is the class minecraftforge.client.gui.GuiInGameForge. It has all the gui render events and one is renderHUDText. I've never checkout what it actually renders on the screen.

  • Author

Find the exact event that is rendering the text (i think there was getElementsType or sth like that) cancel that event and do the rendering of it on your own (except for the text of course)

Ok, tried that, it is not cancelable.

EDIT: It appears that only Post is not cancelable, I will mess with it some more.

I don't think there is an event for that specifically. The game just renders the item's name. Why do you want an event to be called when changing items, or as you said when the hotbar text changes?

 

There is the class minecraftforge.client.gui.GuiInGameForge. It has all the gui render events and one is renderHUDText. I've never checkout what it actually renders on the screen.

I want an event to be called there so I can easily fill in item names. If I do it this way, it uses 41 less lines in the lang files(at the moment, it could save even more later) than the vanilla method. I already did this for the items' tooltips(see spoiler below), now I just need to do it for the name that shows up when changing items.

 

@SubscribeEvent
public void tooltipEvent(ItemTooltipEvent event){
	Item item = event.itemStack.getItem();
	if(item instanceof FluidityItemChestChanger){
		FluidityItemChestChanger item2 = (FluidityItemChestChanger)item;
		event.toolTip.clear();
		event.toolTip.add(String.format(StatCollector.translateToLocal("fluidity.upgrade"), StatCollector.translateToLocal("fluidity."+item2.getSourceName().toLowerCase()), StatCollector.translateToLocal("fluidity."+item2.getTargetName().toLowerCase())));
	}
}

 

As for the class minecraftforge.client.gui.GuiInGameForge, I was unable to find it.

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Guest
This topic is now closed to further replies.

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.