This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
I am new to making mods and I made a few tools and items and they work fine, however, i cannot figure out how to set the repair material for the tools here is what i have. Also here is the src if you need more: https://github.com/Vortron-96/Tmod/tree/275b932abeb8728b1fa498c6994ed9f1d8eb8e64/src/main
package sx.root.tcraft.tmod.materials; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.EnumHelper; import sx.root.tcraft.tmod.tmod; import sx.root.tcraft.tmod.init.ModItems; import sx.root.tcraft.tmod.util.RegistryHandler; public class CustomCobalt { public static final Item.ToolMaterial Cobalt = EnumHelper.addToolMaterial(tmod.MODID + ":" + "Cobalt", 4, 1200, 5.5F, 4.5F, 9).setRepairItem(new ItemStack(ModItems.alloyiron)); public static final Item.ToolMaterial AxeCobalt = EnumHelper.addToolMaterial(tmod.MODID + ":" + "AxeCobalt", 4, 1200, 5.5F, 8.0F, 9).setRepairItem(new ItemStack(ModItems.alloyiron)); public static final Item.ToolMaterial SpadeCobalt = EnumHelper.addToolMaterial(tmod.MODID + ":" + "SpadeCobalt", 4, 1200, 5.5F, -1F, 9).setRepairItem(new ItemStack(ModItems.alloyiron)); public static final Item.ToolMaterial SwordCobalt = EnumHelper.addToolMaterial(tmod.MODID + ":" + "SwordCobalt", 4, 1200, 5.3F, 4.5F, 9).setRepairItem(new ItemStack(ModItems.ingoturmomium)); }
dXIgbW9tIDY5NDIwIHVtbS4uLiBkb3JpdG9zIGFuZCBtdG4gZGV3IDEuMTIuMiBpcyB0aGUgYmVzdCBhbmQgYWx3YXlzIHdpbGwgYmUNCg
It has been a while since I have done anything in 1.12.2, but you only need to specify the material your items will be made of once. For each item you create, you just specify the 'Cobalt' where toolMaterial is required.
I am new to making mods and I made a few tools and items and they work fine, however, i cannot figure out how to set the repair material for the tools here is what i have. Also here is the src if you need more: https://github.com/Vortron-96/Tmod/tree/275b932abeb8728b1fa498c6994ed9f1d8eb8e64/src/main
dXIgbW9tIDY5NDIwIHVtbS4uLiBkb3JpdG9zIGFuZCBtdG4gZGV3IDEuMTIuMiBpcyB0aGUgYmVzdCBhbmQgYWx3YXlzIHdpbGwgYmUNCg
It has been a while since I have done anything in 1.12.2, but you only need to specify the material your items will be made of once. For each item you create, you just specify the 'Cobalt' where toolMaterial is required.