ItemStack itemStack = new ItemStack(Items.DIAMOND_SWORD); String itemName = itemStack.getDisplayName().getString(); System.out.println(itemName); // prints "Diamond Sword" to consoleIn this example, we create a new ItemStack object for a diamond sword item, and then get the display name of that item using the `getDisplayName` method. We then print this name to the console. Package/library: This method is part of the Minecraft game's codebase and is included in the `net.minecraft.item` package of the game's Java API.