net.minecraftforge.client.event.RenderTooltipEvent Java Examples

The following examples show how to use net.minecraftforge.client.event.RenderTooltipEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ShulkerViewer.java    From ForgeHax with MIT License 5 votes vote down vote up
@SubscribeEvent
public void onPreTooptipRender(RenderTooltipEvent.Pre event) {
  if (!(MC.currentScreen instanceof GuiContainer) || isModGeneratedToolTip) {
    return;
  }
  
  if (isMouseInShulkerGui) {
    // do not render tool tips that are inside the region of our shulker gui
    event.setCanceled(true);
  } else if (event.getStack().getItem() instanceof ItemShulkerBox) {
    event.setCanceled(true); // do not draw normal tool tip
  }
}
 
Example #2
Source File: NEIClientEventHandler.java    From NotEnoughItems with MIT License 4 votes vote down vote up
@SubscribeEvent
public void tooltipPreEvent(RenderTooltipEvent.Pre event) {
    event.setY(MathHelper.clip(event.getY(), 8, event.getScreenHeight() - 8));
}