Interface TooltipContext
public interface TooltipContext
Context for computing itemstack tooltips via
ItemStack.computeTooltipLines(TooltipContext, Player)
-
Method Summary
Modifier and TypeMethodDescriptionReturns a new context withisAdvanced()
set to true.Returns a new context withisCreative()
set to true.static @NotNull TooltipContext
create()
Creates a new context that is neither advanced nor creative.static @NotNull TooltipContext
create
(boolean advanced, boolean creative) Creates a new context with the given advanced and creative mode settings.boolean
Returns whether the context is for advanced tooltips.boolean
Returns whether the context is for the creative mode inventory.
-
Method Details
-
create
@Contract("_, _ -> new") @NotNull static @NotNull TooltipContext create(boolean advanced, boolean creative) Creates a new context with the given advanced and creative mode settings.- Parameters:
advanced
- whether the context is for advanced tooltipscreative
- whether the context is for the creative inventory- Returns:
- a new context
-
create
Creates a new context that is neither advanced nor creative.- Returns:
- a new context
-
isAdvanced
boolean isAdvanced()Returns whether the context is for advanced tooltips.Advanced tooltips are shown by default when a player has
F3+H
enabled.- Returns:
- true if for advanced tooltips
-
isCreative
boolean isCreative()Returns whether the context is for the creative mode inventory.Creative tooltips are shown by default when a player is in the creative inventory.
- Returns:
- true if for creative mode inventory
-
asAdvanced
Returns a new context withisAdvanced()
set to true.- Returns:
- a new context
-
asCreative
Returns a new context withisCreative()
set to true.- Returns:
- a new context
-