User Tools

Site Tools


tutorial:tooltip

This is an old revision of the document!


Adding a tooltip

In your item class, override appendTooltip like so (see lang for how to translate the tooltip) :

@Override
public void appendTooltip(ItemStack itemStack, World world, List<Text> tooltip, TooltipContext tooltipContext) {
    tooltip.add(new TranslatableText("item.tutorial.fabric_item.tooltip"));
}

For a block, do the same but override buildTooltip in your block class.

tutorial/tooltip.1563972519.txt.gz · Last modified: 2019/07/24 12:48 by fudge