Class ItemTooltipEvent


public class ItemTooltipEvent extends PlayerEvent
  • Field Details

  • Constructor Details

    • ItemTooltipEvent

      public ItemTooltipEvent(@NotNull @NotNull ItemStack itemStack, @Nullable @Nullable Player player, List<Component> list, TooltipFlag flags)
      This event is fired in
      invalid reference
      ItemStack#getTooltipLines(Player, TooltipFlag)
      , which in turn is called from its respective GUIContainer. Tooltips are also gathered with a null player during startup by
      invalid reference
      Minecraft#createSearchTrees()
      .
  • Method Details

    • getFlags

      public TooltipFlag getFlags()
      Use to determine if the advanced information on item tooltips is being shown, toggled by F3+H.
    • getItemStack

      @NotNull public @NotNull ItemStack getItemStack()
      The ItemStack with the tooltip.
    • getToolTip

      public List<Component> getToolTip()
      The ItemStack tooltip.
    • getEntity

      @Nullable public @Nullable Player getEntity()
      This event is fired with a null player during startup when populating search trees for tooltips.
      Overrides:
      getEntity in class PlayerEvent