tutorial:tooltip
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:tooltip [2022/04/13 08:07] – map2fabricyarn daomephsta | tutorial:tooltip [2024/04/15 01:31] (current) – solidblock | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Adding a tooltip ====== | ====== Adding a tooltip ====== | ||
- | In your [[tutorial: | + | In your [[tutorial: |
+ | |||
+ | For versions 1.18.2 and before: | ||
< | < | ||
@Override | @Override | ||
Line 6: | Line 8: | ||
// default white text | // default white text | ||
- | tooltip.add( new class_2588(" | + | tooltip.add(new |
// formatted red text | // formatted red text | ||
- | tooltip.add( new class_2588(" | + | tooltip.add(new |
} | } | ||
</ | </ | ||
- | You can also append your tooltip in the [[tutorial: | + | |
+ | For versions since 1.19: | ||
< | < | ||
@Override | @Override | ||
+ | public void method_7851(class_1799 itemStack, class_1937 world, List< | ||
+ | tooltip.add(Text.translatable(" | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | For versions since 1.20.5: | ||
+ | < | ||
+ | @Override | ||
+ | public void method_7851(class_1799 itemStack, TooltipContext context, List< | ||
+ | tooltip.add(Text.translatable(" | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | You can also append your tooltip in the [[tutorial: | ||
+ | |||
+ | For versions below 1.20.5: | ||
+ | < | ||
@Override | @Override | ||
public void method_9568(class_1799 itemStack, class_1922 world, List< | public void method_9568(class_1799 itemStack, class_1922 world, List< | ||
- | tooltip.add( new class_2588(" | + | |
+ | | ||
+ | |||
+ | // for versions since 1.19 | ||
+ | tooltip.add(Text.translatable(" | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | For versions since 1.20.5: | ||
+ | < | ||
+ | @Override | ||
+ | public void method_9568(class_1799 itemStack, Item.TooltipContext context, List< | ||
+ | tooltip.add(Text.translatable(" | ||
} | } | ||
</ | </ |
tutorial/tooltip.1649837278.txt.gz · Last modified: 2022/04/13 08:07 by daomephsta