public class DemoBlockItem extends BlockItem { public DemoBlockItem(Block block, Settings settings) { super(block, settings); } @Override public Text getName(ItemStack stack) { final MutableText name = Text.translatable(stack.getTranslationKey()); if (stack.contains(TutorialDataComponentTypes.NUMBER)) { name.append(" - number=" + stack.get(TutorialDataComponentTypes.NUMBER)); } return name; } }