Class ExpandItemTooltipEvent

java.lang.Object
com.blamejared.crafttweaker.natives.event.item.ExpandItemTooltipEvent

@ZenRegister public class ExpandItemTooltipEvent extends Object
This event is fired whenever a tooltip is calculated.

Note: the player may not always be present, make sure you check if it is null before trying to use it

DocParam:
this event
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final IEventBus<net.minecraftforge.event.entity.player.ItemTooltipEvent>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.world.item.TooltipFlag
    getFlags(net.minecraftforge.event.entity.player.ItemTooltipEvent internal)
    Gets the extra tooltip flags, such as if advanced tooltips should be displayed.
    static IItemStack
    getItemStack(net.minecraftforge.event.entity.player.ItemTooltipEvent internal)
    Gets the ItemStack that the tooltip is for.
    static net.minecraft.world.entity.player.Player
    getPlayer(net.minecraftforge.event.entity.player.ItemTooltipEvent internal)
    Gets the player that is viewing the tooltip.
    static List<net.minecraft.network.chat.Component>
    getToolTip(net.minecraftforge.event.entity.player.ItemTooltipEvent internal)
    Gets the list of Components that make up the tooltip.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • BUS

      public static final IEventBus<net.minecraftforge.event.entity.player.ItemTooltipEvent> BUS
  • Constructor Details

    • ExpandItemTooltipEvent

      public ExpandItemTooltipEvent()
  • Method Details

    • getFlags

      public static net.minecraft.world.item.TooltipFlag getFlags(net.minecraftforge.event.entity.player.ItemTooltipEvent internal)
      Gets the extra tooltip flags, such as if advanced tooltips should be displayed.
      Returns:
      The tooltip flags
    • getItemStack

      public static IItemStack getItemStack(net.minecraftforge.event.entity.player.ItemTooltipEvent internal)
      Gets the ItemStack that the tooltip is for.
      Returns:
      The ItemStack that the tooltip is for.
    • getToolTip

      public static List<net.minecraft.network.chat.Component> getToolTip(net.minecraftforge.event.entity.player.ItemTooltipEvent internal)
      Gets the list of Components that make up the tooltip.
      Returns:
      The list of Component that make up the tooltip.
    • getPlayer

      public static net.minecraft.world.entity.player.Player getPlayer(net.minecraftforge.event.entity.player.ItemTooltipEvent internal)
      Gets the player that is viewing the tooltip.

      Note: The player can be null

      Returns:
      The player that is viewing the tooltip.