Edit: It was an incorrect import.
I tried running
Here's the surrounding code if needed:
I tried running
meta.displayName(new TranslatableComponent("item.minecraftplus.copper_sword")); but it gave me the error The method displayName(Component) in the type ItemMeta is not applicable for the arguments (TranslatableComponent), can anyone tell me how to make it work? The javadocs say under setLocalizedName to "Use displayName(Component) with a TranslatableComponent." and that caused the error.Here's the surrounding code if needed:
copperSword = new ItemStack(Material.STONE_SWORD);
ItemMeta meta = copperSword.getItemMeta();
meta.displayName(new TranslatableComponent("item.minecraftplus.copper_sword"));
copperSword.setItemMeta(meta);