Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello,

I have just started modding with Forge in 1.6.2. Before that I was using Modloader. Now when I switched, I, of course, had lots of issues, most of which I have solved. However I cant get my custom armor to work correctly. Before this I didn't even have an ItemArmor.java, I just had everything done in the main mod file. Now, I think I have created an Armor file that will work, but I don't know what I need in my main mod file. If you could help that would be great. Thanks

 

ItemSapphireArmor

 

 

package superninjaman45.elvesanddwarves;

import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;

public class ItemSapphireArmor extends ItemArmor{

public ItemSapphireArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
	super(par1, par2EnumArmorMaterial, par3, par4);
}

public String getArmorTextureFile(ItemStack itemstack) {
	if(itemstack.itemID == ElvesAndDwarves.SapHelmet.itemID){
		return "elvesanddwarves:textures/armor/saparmor_layer_1.png";}

	if(itemstack.itemID == ElvesAndDwarves.SapBody.itemID){
		return "elvesanddwarves:textures/armor/saparmor_layer_1.png";}

	if(itemstack.itemID == ElvesAndDwarves.SapBoots.itemID){
		return "elvesanddwarves:textures/armor/saparmor_layer_2.png";}

	if(itemstack.itemID == ElvesAndDwarves.SapPants.itemID){
		return "elvesanddwarves:textures/armor/saparmor_layer_2.png";
		}
	else return null;

	}


}

 

Here is some bits and pieces from my mod file about the armor. (The entire thing is very large and cluttered with other things)

 

 

public static final Item SapBody = (new ItemSapphireArmor(2108, EnumArmorMaterial.DIAMOND ,5,1 ).setUnlocalizedName("spbd").func_111206_d("elvesanddwarves:spbd"));
public static final Item SapHelmet = (new ItemSapphireArmor(2109,EnumArmorMaterial.DIAMOND ,5,0 ).setUnlocalizedName("sphm").func_111206_d("elvesanddwarves:sphm"));
public static final Item SapPants = (new ItemSapphireArmor(2111,EnumArmorMaterial.DIAMOND ,5,2 ).setUnlocalizedName("sppt").func_111206_d("elvesanddwarves:sppt"));
public static final Item SapBoots = (new ItemSapphireArmor(2112,EnumArmorMaterial.DIAMOND, 5, 3 ).setUnlocalizedName("spbt").func_111206_d("elvesanddwarves:spbt"));


@EventHandler
        public void load(FMLInitializationEvent event) {
                proxy.registerRenderers();
         // Sapphire Chest Armor

        				ModLoader.addName(SapBody, "Sapphire Chestplate");
        				ModLoader.addRecipe(new ItemStack(SapBody,1), new Object[]{
        					"* *", "***", "***", Character.valueOf('*'), Sapphire});
        				
        				// Sapphire Helmet Armor

        				ModLoader.addName(SapHelmet, "Sapphire Helmet");
        				ModLoader.addRecipe(new ItemStack(SapHelmet,1), new Object[]{
        					"***", "* *", "   ", Character.valueOf('*'), Sapphire});
        				
        				
        				// Sapphire Pants Armor
        				
        				ModLoader.addName(SapPants, "Sapphire Leggings");
        				ModLoader.addRecipe(new ItemStack(SapPants,1), new Object[]{
        					"***", "* *", "* *", Character.valueOf('*'), Sapphire});
        				
        				// Sapphire Boots Armor

        				ModLoader.addName(SapBoots, "Sapphire Boots");
        				ModLoader.addRecipe(new ItemStack(SapBoots,1), new Object[]{
        					"   ", "* *", "* *", Character.valueOf('*'), Sapphire});
        					
        				ModLoader.addArmor("saparmor"); 
}

 

 

Very sorry if this seems very easy or obvious. I has just been a long time since I have fiddled with the armor. Frankly, I am surprised I got this working in Modloader, I am not sure how the ModLoader.addArmor("saparmor"); got the armor set up correctly as I don't refer to "saparmor" anywhere. Also, sorry for using Modloader in my code.

Thanks for your help.

An average guy who mods Minecraft. If you need help and are willing to use your brain, don't be afraid to ask.

 

Also, check out the Unofficial Minecraft Coder Pack (MCP) Prerelease Center for the latest from the MCP Team!

 

Was I helpful? Leave some karma/thanks! :)

public String getArmorTextureFile(ItemStack itemstack)

I am pretty sure this method do not exist anymore in 1.6. Change to the following:

public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)

  • Author

Actually it is

public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)

An average guy who mods Minecraft. If you need help and are willing to use your brain, don't be afraid to ask.

 

Also, check out the Unofficial Minecraft Coder Pack (MCP) Prerelease Center for the latest from the MCP Team!

 

Was I helpful? Leave some karma/thanks! :)

  • Author

Whoops. I had the texture in the wrong folder. Sorry about that. Though for some reason, when my character puts on boots it just makes a bigger pair of leggings. Working on that.

An average guy who mods Minecraft. If you need help and are willing to use your brain, don't be afraid to ask.

 

Also, check out the Unofficial Minecraft Coder Pack (MCP) Prerelease Center for the latest from the MCP Team!

 

Was I helpful? Leave some karma/thanks! :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.