CraftTweaker

CraftTweaker

151M Downloads

[Feature Request] You can choose where to insert the tooltip

Laifsyn opened this issue ยท 1 comments

commented

Describe the feature you'd like

An additional option that lets you choose at what index to push into the tooltip
image

Describe alternatives you've considered

No response

Additional context

No response

Minecraft version

No response

Modloader

All

commented

This is already possible using tooltip functions:
https://docs.blamejared.com/1.18/en/vanilla/api/item/IItemStack#modifyTooltip

Something like

import stdlib.List;
import crafttweaker.api.item.IItemStack;
import crafttweaker.api.item.TooltipFlag;
import crafttweaker.api.text.Component;


<item:my:item>.modifyTooltip((stack as IItemStack, tooltip as List<Component>, flag as TooltipFlag) => {
    var index = 2;
    tooltip.insert(index, "my_tooltip");
});