
Removing lines from a tooltip
Closed this issue ยท 4 comments
Mod loader
NeoForge
Minecraft version
1.21.1
Mod version
15.10.0
Modloader version
NeoForge: 21.1.137
Modpack info
No response
[IMPORTANT] If bug:
- I have confirmed this bug is reproducible on a minimal setup, not a modpack with many other mods.
[IMPORTANT] If bug: The latest.log file, not the crash report
No response
Issue description
In my mod, I have it where if you press SHIFT, it shows you more info. I want to hide that and just show the gasses and amount contained.
public void appendHoverText(ItemStack stack, TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
if (tooltipFlag.hasShiftDown() || (FMLEnvironment.dist.isClient() && Minecraft.getInstance().screen == null)) {
// ...
} else {
// ...
}
}