-
Notifications
You must be signed in to change notification settings - Fork 2
For Mod Developers
If you wish to add the library to your mod, I highly recommend you use the jar-in-jar system, which will embed the library within your mod's jar file, meaning players won't have to download it separately.
To do so, first add Modrinths' Maven repository into your build.gradle's repositories section like so:
repositories {
//modrinth
maven {
url = "https://api.modrinth.com/maven"
}
}
After adding the repository, you can then add LibTooltip as a jar-in-jar dependency, like so:
dependencies {
//libtooltips
jarJar(implementation("maven.modrinth:libtooltips:2.0-NEOFORGE-1.21.1"))
}
Now all you need to do is reload gradle and you should have access to LibTooltip!
There is only one class (excluding the config) which is under com.wdiscute.libtooltips
LibTooltip's methods are all public so you are free to use them for anything you wish.
For example, if I wanted to use the text this is in <ltrgb>RGB!</ltrgb> in my UI I could call Tooltips#resolveTagsToComponent which would return me a MutableComponent for me to use however I want.
Ready to add your tooltips through translation keys now? Head over to the Modpack Developers area!