Skip to content

Instantly share code, notes, and snippets.

@Kaupenjoe
Created June 17, 2022 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kaupenjoe/630e1206eb7d7aa9b7dab0e9dce02edd to your computer and use it in GitHub Desktop.
Save Kaupenjoe/630e1206eb7d7aa9b7dab0e9dce02edd to your computer and use it in GitHub Desktop.
YT345 - Fabric 119 - Tooltip
@Override
public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) {
if(Screen.hasShiftDown()) {
tooltip.add(Text.literal("Right Click to get a random number!").formatted(Formatting.AQUA));
} else {
tooltip.add(Text.literal("Press Shift for more info!").formatted(Formatting.YELLOW));
}
super.appendTooltip(stack, world, tooltip, context);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment