Class ItemTooltipEvent


public class ItemTooltipEvent extends PlayerEvent
  • Field Details

    • flags

      private final net.minecraft.world.item.TooltipFlag flags
    • itemStack

      private final net.minecraft.world.item.ItemStack itemStack
    • toolTip

      private final List<net.minecraft.network.chat.Component> toolTip
    • context

      private final net.minecraft.world.item.Item.TooltipContext context
  • Constructor Details

    • ItemTooltipEvent

      public ItemTooltipEvent(net.minecraft.world.item.ItemStack itemStack, @Nullable @Nullable net.minecraft.world.entity.player.Player player, List<net.minecraft.network.chat.Component> list, net.minecraft.world.item.TooltipFlag flags, net.minecraft.world.item.Item.TooltipContext context)
      This event is fired in ItemStack.getTooltipLines(TooltipContext, 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 net.minecraft.world.item.TooltipFlag getFlags()
      Use to determine if the advanced information on item tooltips is being shown, toggled by F3+H.
    • getItemStack

      public net.minecraft.world.item.ItemStack getItemStack()
      The ItemStack with the tooltip.
    • getToolTip

      public List<net.minecraft.network.chat.Component> getToolTip()
      The ItemStack tooltip.
    • getEntity

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

      public net.minecraft.world.item.Item.TooltipContext getContext()
      The tooltip context.