Adding a Smithing Recipe doesn't set item meta to the result...

Discussion in 'Plugin Development' started by BlaSfaiMe, Jun 18, 2021.

  1. Offline



    I'm doing a plugin for me and my friends, and i'm trying to add a new type of armor for us.

    The thing is i've already create a Smithing Recipe, and the result item has his item meta. But when I'm trying to make another one, the result is here... But without any custom name or else ! I want to add some custom item in, which I did, but even with base items, no meta... here is some screens, showing the problem and the pieces of code that I made.
    Capture d’écran du 2021-06-18 09-07-12.png Capture d’écran du 2021-06-18 09-07-41.png
        public void onEnable() {
    SmithingRecipe smithingRecipe = new SmithingRecipe(new NamespacedKey(this, "nethered_obsidian"), getReinforcedObi(), new RecipeChoice.MaterialChoice(Material.CRYING_OBSIDIAN), new RecipeChoice.MaterialChoice(Material.NETHERITE_INGOT));this.getServer().addRecipe(smithingRecipe);
    SmithingRecipe enderiumHelmet = new SmithingRecipe(new NamespacedKey(this, "enderium_helmet"), getEnderiumIngot2(), new RecipeChoice.MaterialChoice(Material.NETHERITE_HELMET), new RecipeChoice.MaterialChoice(Material.NETHERITE_INGOT));
         public ItemStack getEnderiumIngot(){
               ItemStack it = new ItemStack(Material.IRON_INGOT);
               ItemMeta tm = it.getItemMeta();
               tm.setDisplayName(ChatColor.LIGHT_PURPLE + "Enderium Ingot");
               return it;
        public ItemStack getEnderiumIngot2(){
            ItemStack it = new ItemStack(Material.IRON_INGOT);
            ItemMeta im = it.getItemMeta();
            try {
                im.setDisplayName(ChatColor.YELLOW + "cesssss");
            }catch (NullPointerException e) {
            return it;
  2. Offline


    I copy and pasted your code and it seems to be working fine

    EDIT: I think I misunderstood you, are you trying to make your custom iron ingot the product?
  3. Offline


    Yes, but you got the cessss, this is what I want, and I don't get it...

Share This Page