public class DemoBlock extends BlockWithEntity { [...] @Override public void appendTooltip(ItemStack stack, Item.TooltipContext context, List tooltip, TooltipType options) { final Integer i = stack.get(TutorialDataComponentTypes.NUMBER); if (i == null) return; tooltip.add(Text.literal("Number: " + i)); } }