ItemTooltipEvent
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
The event is not cancelable.
The event does not have a result.
Importing the class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
import crafttweaker.api.event.entity.player.ItemTooltipEvent;Extending PlayerEvent
ItemTooltipEvent extends PlayerEvent. That means all methods available in PlayerEvent are also available in ItemTooltipEvent
Methods
Gets the extra tooltip flags, such as if advanced tooltips should be displayed.
Returns: The tooltip flags
Return Type: TooltipFlag
// ItemTooltipEvent.getFlags() as TooltipFlag
event.getFlags();Gets the ItemStack that the tooltip is for.
Returns: The ItemStack that the tooltip is for.
Return Type: ItemStack
// ItemTooltipEvent.getItemStack() as ItemStack
event.getItemStack();Gets the player that is viewing the tooltip.
Note: The player can be null
Returns: The player htat is viewing the tooltip.
Return Type: Player?
// ItemTooltipEvent.getPlayer() as Player?
event.getPlayer();Properties
| Name | Type | Has Getter | Has Setter | Description | 
|---|---|---|---|---|
| Nameflags | TypeTooltipFlag | Has Gettertrue | Has Setterfalse | DescriptionGets the extra tooltip flags, such as if advanced tooltips should be displayed. | 
| NameitemStack | TypeItemStack | Has Gettertrue | Has Setterfalse | DescriptionGets the ItemStack that the tooltip is for. | 
| Nameplayer | TypePlayer? | Has Gettertrue | Has Setterfalse | DescriptionGets the player that is viewing the tooltip. Note: The player can be null | 
| Nametooltip | Typestdlib.List<Component> | Has Gettertrue | Has Setterfalse | DescriptionGets the list of Components that make up the tooltip. |