Hi,
I'm wondering if someone can help me.
I would like to create a recipe that will allow players to create indestructible items. The same way this command works "/give @a minecraft:diamond_sword 1 0 {Unbreakable:1}" In this command it sets the tag "Unbreakable" to 1. I believe that there must be a way to do this from within the code.
This is what i have tried so far.
[embed=425,349]
ItemStack unbreakableSword = new ItemStack(Items.diamond_sword, 1);
setUnbreakable(unbreakableSword);
System.out.println("done");
GameRegistry.addRecipe(unbreakableSword,
"ABA",
"ACA",
"ADA", 'A', Blocks.diamond_block, 'B', Items.magma_cream, 'C', Items.ender_eye, 'D', Items.diamond_sword);
private static void setUnbreakable(ItemStack unbreakableItem) {
NBTTagCompound tag1 = new NBTTagCompound();
tag1.setInteger("Unbreakable", 1);
unbreakableItem.setTagCompound(tag1);
}[/embed]
Thank you In advance.