Jump to content

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


Recommended Posts

Posted

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)

Posted

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.

Posted

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.

Announcements



×
×
  • Create New...

Important Information

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