Custom names in crafting recipes

Discussion in 'Plugin Development' started by mncat77, Oct 28, 2012.

Thread Status:
Not open for further replies.
  1. I messed a little bit with the new item naming feature and it worked for the most part, but I tried to name a crafted item and it does not appear to work. Is it possible to do that?

    What I tried:

    Code:
        @Override
        public void onEnable() {
         
            CraftItemStack itemSaddle = new CraftItemStack(329);
            NBTTagCompound tag = new NBTTagCompound();
            NBTTagCompound display = new NBTTagCompound();
            tag.setCompound("display", display);
            display.setString("Name", "crafted Saddle");
            itemSaddle.getHandle().tag = tag;
            //Also tried this and it worked: itemSaddle.addUnsafeEnchantment(Enchantment.OXYGEN, 1);
     
     
            ShapedRecipe saddle = new ShapedRecipe(itemSaddle);
            saddle.shape(new String[] { "LLL", "S S", "I I" });
            saddle.setIngredient('L', Material.LEATHER);
            saddle.setIngredient('S', Material.STRING);
            saddle.setIngredient('I', Material.IRON_INGOT);
            getServer().addRecipe(saddle);
         
        }
     
Thread Status:
Not open for further replies.

Share This Page