In vanilla MC, you can put two of the same tool/armor piece together in a crafting table and it would combine the two into one, but it would have more durability. For an anvil, you can put a tool in, add its respective material, and it would repair the tool a bit.
I would like to do this with my modded tools and armor. I don’t know how to do it, so does anyone else know? If you need me to provide any code, I will happily do so. Thanks
Rollback Post to RevisionRollBack
Minecraft Expansion
Mod for 1.12.2. Adding onto Minecraft while staying close to vanilla.
Are you talking about setRepairItem? If so, I tried that, and it didn’t do anything. So it looked like this: EnumHelper.addArmorMaterial(<values>).setRepairItem(ItemStack(<repair item>));
I literally made no other changes except for adding those values tho.
I probably should’ve mentioned that I’m using 1.12.2. Sorry 😐
Is there any other code I should be adding?
Rollback Post to RevisionRollBack
Minecraft Expansion
Mod for 1.12.2. Adding onto Minecraft while staying close to vanilla.
In vanilla MC, you can put two of the same tool/armor piece together in a crafting table and it would combine the two into one, but it would have more durability. For an anvil, you can put a tool in, add its respective material, and it would repair the tool a bit.
I would like to do this with my modded tools and armor. I don’t know how to do it, so does anyone else know? If you need me to provide any code, I will happily do so. Thanks
Minecraft Expansion
Mod for 1.12.2. Adding onto Minecraft while staying close to vanilla.
Download here
Hello!
Are you using forge? Because if so, then you just need to supply the repair material in your custom ItemTier/ArmorMaterial.
Are you talking about setRepairItem? If so, I tried that, and it didn’t do anything. So it looked like this: EnumHelper.addArmorMaterial(<values>).setRepairItem(ItemStack(<repair item>));
I literally made no other changes except for adding those values tho.
I probably should’ve mentioned that I’m using 1.12.2. Sorry 😐
Is there any other code I should be adding?
Minecraft Expansion
Mod for 1.12.2. Adding onto Minecraft while staying close to vanilla.
Download here
Alright, it was a while since I modded in 1.12, but you might have to also override the getIsRepairable method in your armor/tool classes.
Hmmm...that isn't working either. Am I doing this right? I'll provide the code I've added so far. I'll show my Carbon Fiber armor for an example.
Armor Material
ArmorCarbonFiber class
And each piece of armor declared in the init class references ArmorCarbonFiber, where that override is. I am extending ItemArmor.
Minecraft Expansion
Mod for 1.12.2. Adding onto Minecraft while staying close to vanilla.
Download here
Ok, I’m just a little bit of an idiot lol
I did it just for the armor for testing purposes, and I tested a Carbon Fiber sword...
Minecraft Expansion
Mod for 1.12.2. Adding onto Minecraft while staying close to vanilla.
Download here
Haha, no worries, it happens to the best of us! So it is working now after all?
Yes it worked perfectly. Thank you for your help 😊
Minecraft Expansion
Mod for 1.12.2. Adding onto Minecraft while staying close to vanilla.
Download here
No problem, glad I could help!