Class GatherEffectScreenTooltipsEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.GatherEffectScreenTooltipsEvent

public class GatherEffectScreenTooltipsEvent extends net.neoforged.bus.api.Event
This event is called when the cursor is hovering over an MobEffectInstance rendered by EffectsInInventory in an AbstractContainerScreen. It can be used to create or modify the tooltip.

This event is only fired on the physical client.

  • Field Details

  • Constructor Details

  • Method Details

    • getScreen

      public AbstractContainerScreen<?> getScreen()
      Returns the screen which will be rendering the tooltip lines.
      Returns:
      the screen which will be rendering the tooltip lines
    • getEffectInstance

      public MobEffectInstance getEffectInstance()
      Returns The effect whose tooltip is being drawn.
      Returns:
      The effect whose tooltip is being drawn
    • getTooltip

      public List<Component> getTooltip()
      Returns a mutable list of tooltip lines. If this list is empty, no tooltip will be rendered.

      This list will be initially empty when hovering over an effect widget which has no tooltip by default (when the effect information is fully visible).

      Returns:
      a mutable list of tooltip lines