Started by
Arachne
on
Topic category: Advanced modding
For example, I am trying to uncraft diamond sword into 2 diamonds and I want the sword to be in a certain, or even any, damage state.
There is no such option in the recipe creating GUI, so I looked into code and found this.
public void load(FMLInitializationEvent event) {
ItemStack recStack = new ItemStack(Items.DIAMOND, 2);
GameRegistry.addShapelessRecipe(recStack, new Object[]{Items.DIAMOND_SWORD,});
}
I haved tried some editing ( e.g. {(Items.DIAMOND_SWORD, 1),} ), but then the mod cannot be recompiled.
Please HELP!
That is not how that works lol. However, tinkering with code is an easy way to figure out what works and what doesnt. Damage is stored as metadata I do believe
I better just do uncraft the diamond sword
To try this I would use "Events" (Note: wont work with in game items, ie: diamond sword) but this could work with new mod wepaons. then choose "When recipe created" use the damage item event and choose how much.