Interface ItemComponentTooltipProviderRegistry
@NonExtendable
public interface ItemComponentTooltipProviderRegistry
A registry of
TooltipProvider item components. Adding your item component to this registry will render the
item component to the tooltip of them item when it is present, in a location relative to other item components.-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic voidaddAfter(net.minecraft.core.component.DataComponentType<?> anchor, net.minecraft.core.component.DataComponentType<? extends net.minecraft.world.item.component.TooltipProvider> componentType) Adds the specified item component type to the list of tooltip providers so that it will render after the tooltip provider associated with the specified anchor component type.static voidaddBefore(net.minecraft.core.component.DataComponentType<?> anchor, net.minecraft.core.component.DataComponentType<? extends net.minecraft.world.item.component.TooltipProvider> componentType) Adds the specified item component type to the list of tooltip providers so that it will render before the tooltip provider associated with the specified anchor component type.static voidaddFirst(net.minecraft.core.component.DataComponentType<? extends net.minecraft.world.item.component.TooltipProvider> componentType) Adds the specified item component type to the list of tooltip providers to be called first.static voidaddLast(net.minecraft.core.component.DataComponentType<? extends net.minecraft.world.item.component.TooltipProvider> componentType) Adds the specified item component type to the list of tooltip providers to be called last.
-
Method Details
-
addFirst
static void addFirst(net.minecraft.core.component.DataComponentType<? extends net.minecraft.world.item.component.TooltipProvider> componentType) Adds the specified item component type to the list of tooltip providers to be called first. The component will render at the top of the tooltip.- Parameters:
componentType- the component type to add
-
addLast
static void addLast(net.minecraft.core.component.DataComponentType<? extends net.minecraft.world.item.component.TooltipProvider> componentType) Adds the specified item component type to the list of tooltip providers to be called last. The component will render at the bottom of the tooltip.- Parameters:
componentType- the component type to add
-
addBefore
static void addBefore(net.minecraft.core.component.DataComponentType<?> anchor, net.minecraft.core.component.DataComponentType<? extends net.minecraft.world.item.component.TooltipProvider> componentType) Adds the specified item component type to the list of tooltip providers so that it will render before the tooltip provider associated with the specified anchor component type.- Parameters:
anchor- the component type before which the specified component type will be renderedcomponentType- the component type to add
-
addAfter
static void addAfter(net.minecraft.core.component.DataComponentType<?> anchor, net.minecraft.core.component.DataComponentType<? extends net.minecraft.world.item.component.TooltipProvider> componentType) Adds the specified item component type to the list of tooltip providers so that it will render after the tooltip provider associated with the specified anchor component type.- Parameters:
anchor- the component type after which the specified component type will be renderedcomponentType- the component type to add
-