Difference between revisions of "Tutorial:Tooltips"
From MineTweaker 3
m (4 revisions imported) |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 3: | Line 3: | ||
Adding tooltips can be done directly on any kind of ingredient: | Adding tooltips can be done directly on any kind of ingredient: | ||
− | <ore: | + | <ore:plankWood>.addTooltip("These are wood planks"); |
<minecraft:stick>.addTooltip("These are sticks"); | <minecraft:stick>.addTooltip("These are sticks"); | ||
Line 45: | Line 45: | ||
<minecraft:stick>.addTooltip(format.green(format.italic("This is a stick") + " with " + format.strikethrough("text")) + " in multiple styles"); | <minecraft:stick>.addTooltip(format.green(format.italic("This is a stick") + " with " + format.strikethrough("text")) + " in multiple styles"); | ||
− | Be careful to | + | Be careful to match the brackets properly! |
Latest revision as of 14:36, 12 September 2023
Since MineTweaker 3.0.8, you can now add tooltips to items.
Adding tooltips can be done directly on any kind of ingredient:
<ore:plankWood>.addTooltip("These are wood planks"); <minecraft:stick>.addTooltip("These are sticks");
Two kinds of tooltips are available: regular tooltips and tooltips that only appear when the shift key is being pressed:
<minecraft:stick>.addShiftTooltip("Only appears with shift");
Markup
Tooltips can be colored and styled using the format functions:
<minecraft:stick>.addTooltip(format.green("This is green text"));
The following formatting functions are available:
format.black format.darkBlue format.darkGreen format.darkAqua format.darkRed format.darkPurple format.gold format.gray format.darkGray format.blue format.green format.aqua format.red format.lightPurple format.yellow format.white format.obfuscated format.bold format.strikethrough format.underline format.italic
Strings (and formatted strings) can be concatenated and nested easily:
<minecraft:stick>.addTooltip(format.green(format.italic("This is a stick") + " with " + format.strikethrough("text")) + " in multiple styles");
Be careful to match the brackets properly!