zh_cn:tutorial:tooltip
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
zh_cn:tutorial:tooltip [2022/05/27 15:38] – solidblock | zh_cn:tutorial:tooltip [2022/12/16 00:22] – solidblock | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== 添加一个物品提示 ====== | ====== 添加一个物品提示 ====== | ||
- | 在您的[[zh_cn: | + | 在您的[[zh_cn: |
对于 1.18.2 及之前的版本: | 对于 1.18.2 及之前的版本: | ||
Line 8: | Line 8: | ||
// 默认为白色文本 | // 默认为白色文本 | ||
- | tooltip.add( new class_2588(" | + | tooltip.add(new |
// 格式化为红色文本 | // 格式化为红色文本 | ||
- | tooltip.add( new class_2588(" | + | tooltip.add(new |
} | } | ||
</ | </ | ||
Line 21: | Line 21: | ||
// 默认为白色文本 | // 默认为白色文本 | ||
- | tooltip.add(Text.translatable(" | + | tooltip.add(Text.translatable(" |
// 格式化为红色文本 | // 格式化为红色文本 | ||
- | tooltip.add(Text.translatable(" | + | tooltip.add(Text.translatable(" |
} | } | ||
</ | </ | ||
- | 你也可以在[[zh_cn: | + | 你也可以在[[zh_cn: |
< | < | ||
@Override | @Override | ||
public void method_9568(class_1799 itemStack, class_1922 world, List< | public void method_9568(class_1799 itemStack, class_1922 world, List< | ||
// 对于 1.18.2 及之前的版本 | // 对于 1.18.2 及之前的版本 | ||
- | tooltip.add(new | + | tooltip.add(new |
| | ||
// 对于 1.19 之后的版本 | // 对于 1.19 之后的版本 | ||
- | tooltip.add(Text.translatable(" | + | tooltip.add(Text.translatable(" |
} | } | ||
</ | </ |
zh_cn/tutorial/tooltip.txt · Last modified: 2024/04/15 01:31 by solidblock