Community listing page, reviews here may not be monitored by the author.
TipTool
No reviews yet
Minecraft 1.12.2 CraftTweaker addon to simplify adding translated item tooltips with standardised formatting to many items, intended for use in modpacks
Community voices
Reviews
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
Resources
External Links
About
Description
TipTool
Minecraft 1.12.2 CraftTweaker addon to simplify adding translated item tooltips with standardised formatting to many items, intended for use in modpacks.
Instructions:
First, define tooltip sections and their formatting with
import mods.tiptool.TipTool;
val section = TipTool.registerTooltipSection("sectionKey");
section.aqua(); # Any of the formatting options from format.*
section.header(
format.red(section.translate('header')), # lang key prefixed with 'tiptool.sectionKey.tooltip.'
2 # optional indent level (as number of spaces) automatically applied to body underneath the header
);
Then, enable automatic tooltipping on items
# will use lang keys 'tiptool.iron_ingot.tooltip.sectionKey' for each section,
# OR 'tiptool.iron_ingot.tooltip.sectionKey.1' - 'tiptool.iron_ingot.tooltip.sectionKey.n' for multiline sections
<minecraft:iron_ingot>.automateTooltips()
# All variants of stone will receive the same tooltips from 'tiptool.iron_ingot.tooltip.sectionKey'
<minecraft:stone>.automateTooltips()
# Only regular stone will receive the tooltips from 'tiptool.iron_ingot.tooltip.sectionKey'
<minecraft:stone:0>.automateTooltips()
# specify an explicit language key if you want to use different tooltips for different variants
# this will use language keys 'tiptool.variantLangKey.sectionKey' for each section
<minecraft:stone:1>.automateTooltips("variantLangKey")
# A more likely example for variants
val woolDefinition = <minecraft:wool>.definition;
for i in 0 to 15 {
woolDefinition.makeStack(i).automateTooltips("minecraft:wool:" + i);
}
Defining translations
You can define translations in regular lang files, but that can become cumbersome quickly. Instead, you can use the TipTool.registerLangFiles(path) method to register a set of .yml lang files to be loaded specifically for tooltips. The path is relative to the scripts/ directory.
# scripts/some_zs.zs
mods.tiptool.TipTool.registerLangFiles("path/tooltip")
# scripts/path/tooltip/en_us.yml
minecraft:iron_ingot:
sectionKey: translation for the "sectionKey" section of minecraft:iron_ingot's tooltip
multilineSection: |
Multiple lines will be split up into separate lang keys automatically
minecraft:iron_ingot will have multiple lines of translated tooltips for this section
Under the hood, the lang keys used are:
- tiptool.minecraft:iron_ingot.tooltip.multilineSection.1
- tiptool.minecraft:iron_ingot.tooltip.multilineSection.2
- etc.
You can mix single- and multi-line tooltips for the same section on different items.
minecraft:stone:1:
multilineSection: sections themselves don't care if you use a single line or multiple
sectionKey:
key: translation for text created with `registerTooltipSection("sectionKey").translate("key")`
header: This matches up with the `section.translate('header')` in the header example above
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
(opens in a new tab)
Get it on
Available Platforms
On ModDex
Community snapshot
By the numbers
Statistics
Resources