MC Modding
Please register and join the community!


Join the forum, it's quick and easy

MC Modding
Please register and join the community!
MC Modding
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[Answered] Armor code gives error

3 posters

MC Modding :: Help :: Help

Go down

[Answered] Armor code gives error Empty [Answered] Armor code gives error

Post by mastereric Sat Oct 29, 2011 12:07 am

I coded armor into my mod according to youtube.com/watch?v=Qv0u-7bQ6_Q this video and when I try to recompile I get an error!
[Answered] Armor code gives error SXZFp


Last edited by mastereric on Thu Nov 03, 2011 4:22 pm; edited 1 time in total
mastereric
mastereric
Member

Posts : 30
Join date : 2011-10-26

Back to top Go down

[Answered] Armor code gives error Empty Re: [Answered] Armor code gives error

Post by lcass Sat Oct 29, 2011 1:12 pm

here use this code instead in the code he gave the variables are diffrent so it may not function I had the same problem
Code:
package net.minecraft.src;

import net.minecraft.client.Minecraft;

public class mod_earmour extends BaseMod
{

    public mod_earmour()
    {
       eHelmet.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/emeraldHelmet.png");
        ModLoader.AddName(eHelmet, "eHelmet");
        ModLoader.AddRecipe(new ItemStack(eHelmet, 1), new Object[] {
            "rrr", "r r",  Character.valueOf('r'), mod_emeraldgem.emeraldgem
        });
        eBody.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/emeraldBody.png");
        ModLoader.AddName(eBody, "eChestplate");
        ModLoader.AddRecipe(new ItemStack(eBody, 1), new Object[] {
            "r r", "rrr", "rrr", Character.valueOf('r'), mod_emeraldgem.emeraldgem
        });
        eLegs.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/emeraldLegs.png");
        ModLoader.AddName(eLegs, "eLeggings");
        ModLoader.AddRecipe(new ItemStack(eLegs, 1), new Object[] {
            "rrr", "r r", "r r", Character.valueOf('r'), mod_emeraldgem.emeraldgem
        });
        eBoots.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/emeraldBoots.png");
        ModLoader.AddName(eBoots, "eBoots");
        ModLoader.AddRecipe(new ItemStack(eBoots, 1), new Object[] {
            "r r", "r r", Character.valueOf('r'), mod_emeraldgem.emeraldgem
        });
        RBoots.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/rubyBoots.png");
        ModLoader.AddName(RBoots, "RBoots");
        ModLoader.AddRecipe(new ItemStack(RBoots, 1), new Object[] {
          "rrr", "r r", "r r", Character.valueOf('r'), mod_ruby.ruby
        });
        RLegs.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/rubyLegs.png");
        ModLoader.AddName(RLegs, "RLegs");
        ModLoader.AddRecipe(new ItemStack(RLegs, 1), new Object[] {
            "r r", "r r", Character.valueOf('r'), mod_ruby.ruby
        });
        RBody.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/rubyBody.png");
        ModLoader.AddName(RBody, "RChestplate");
        ModLoader.AddRecipe(new ItemStack(RBody, 1), new Object[] {
            "r r", "rrr", "rrr", Character.valueOf('r'), mod_ruby.ruby
        });
        RHelmet.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/rubyHelmet.png");
        ModLoader.AddName(RHelmet, "RHelmet");
        ModLoader.AddRecipe(new ItemStack(RHelmet, 1), new Object[] {
            "rrr", "r r",  Character.valueOf('r'), mod_ruby.ruby
        });
    }

    public String Version()
    {
        return "1.8.1";
    }

    public static Item eHelmet = (new ItemArmor(2612, 3,5 , 0)).setItemName("eHelmet");
    public static Item eBody = (new ItemArmor(2623, 3, 5, 1)).setItemName("eBody");
    public static Item eLegs = (new ItemArmor(2634, 3, 5, 2)).setItemName("eLegs");
    public static Item eBoots = (new ItemArmor(2645, 3, 5, 3)).setItemName("eBoots");
    public static Item RHelmet = (new ItemArmor(2616, 3,5 , 0)).setItemName("RHelmet");
    public static Item RBody = (new ItemArmor(2627, 3, 5, 1)).setItemName("RBody");
    public static Item RLegs = (new ItemArmor(2638, 3, 5, 2)).setItemName("RLegs");
    public static Item RBoots = (new ItemArmor(2649, 3, 5, 3)).setItemName("RBoots");



lcass
Member

Posts : 145
Join date : 2011-10-24
Location : england

https://www.youtube.com/user/thealcasgroup

Back to top Go down

[Answered] Armor code gives error Empty Re: [Answered] Armor code gives error

Post by mastereric Sun Oct 30, 2011 5:50 pm

lcass wrote:here use this code instead in the code he gave the variables are diffrent so it may not function I had the same problem
Code:
package net.minecraft.src;

import net.minecraft.client.Minecraft;

public class mod_earmour extends BaseMod
{

    public mod_earmour()
    {
       eHelmet.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/emeraldHelmet.png");
        ModLoader.AddName(eHelmet, "eHelmet");
        ModLoader.AddRecipe(new ItemStack(eHelmet, 1), new Object[] {
            "rrr", "r r",  Character.valueOf('r'), mod_emeraldgem.emeraldgem
        });
        eBody.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/emeraldBody.png");
        ModLoader.AddName(eBody, "eChestplate");
        ModLoader.AddRecipe(new ItemStack(eBody, 1), new Object[] {
            "r r", "rrr", "rrr", Character.valueOf('r'), mod_emeraldgem.emeraldgem
        });
        eLegs.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/emeraldLegs.png");
        ModLoader.AddName(eLegs, "eLeggings");
        ModLoader.AddRecipe(new ItemStack(eLegs, 1), new Object[] {
            "rrr", "r r", "r r", Character.valueOf('r'), mod_emeraldgem.emeraldgem
        });
        eBoots.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/emeraldBoots.png");
        ModLoader.AddName(eBoots, "eBoots");
        ModLoader.AddRecipe(new ItemStack(eBoots, 1), new Object[] {
            "r r", "r r", Character.valueOf('r'), mod_emeraldgem.emeraldgem
        });
        RBoots.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/rubyBoots.png");
        ModLoader.AddName(RBoots, "RBoots");
        ModLoader.AddRecipe(new ItemStack(RBoots, 1), new Object[] {
          "rrr", "r r", "r r", Character.valueOf('r'), mod_ruby.ruby
        });
        RLegs.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/rubyLegs.png");
        ModLoader.AddName(RLegs, "RLegs");
        ModLoader.AddRecipe(new ItemStack(RLegs, 1), new Object[] {
            "r r", "r r", Character.valueOf('r'), mod_ruby.ruby
        });
        RBody.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/rubyBody.png");
        ModLoader.AddName(RBody, "RChestplate");
        ModLoader.AddRecipe(new ItemStack(RBody, 1), new Object[] {
            "r r", "rrr", "rrr", Character.valueOf('r'), mod_ruby.ruby
        });
        RHelmet.iconIndex = ModLoader.addOverride("/gui/items.png", "/crystal/rubyHelmet.png");
        ModLoader.AddName(RHelmet, "RHelmet");
        ModLoader.AddRecipe(new ItemStack(RHelmet, 1), new Object[] {
            "rrr", "r r",  Character.valueOf('r'), mod_ruby.ruby
        });
    }

    public String Version()
    {
        return "1.8.1";
    }

    public static Item eHelmet = (new ItemArmor(2612, 3,5 , 0)).setItemName("eHelmet");
    public static Item eBody = (new ItemArmor(2623, 3, 5, 1)).setItemName("eBody");
    public static Item eLegs = (new ItemArmor(2634, 3, 5, 2)).setItemName("eLegs");
    public static Item eBoots = (new ItemArmor(2645, 3, 5, 3)).setItemName("eBoots");
    public static Item RHelmet = (new ItemArmor(2616, 3,5 , 0)).setItemName("RHelmet");
    public static Item RBody = (new ItemArmor(2627, 3, 5, 1)).setItemName("RBody");
    public static Item RLegs = (new ItemArmor(2638, 3, 5, 2)).setItemName("RLegs");
    public static Item RBoots = (new ItemArmor(2649, 3, 5, 3)).setItemName("RBoots");


I don't understand this code. Where do I put it?
It doesn't make sense to put it in my mod_ class file. The error is with RenderPlayer, Eclipse gives the error

The method func_35865_n() is undefined for the type ItemStack RenderPlayer.java /Client/src/net/minecraft/src line 230
mastereric
mastereric
Member

Posts : 30
Join date : 2011-10-26

Back to top Go down

[Answered] Armor code gives error Empty Re: [Answered] Armor code gives error

Post by lcass Sun Oct 30, 2011 7:50 pm

you replace the code you put in your mod_ .java replace the entire code I got that same error and the reason is people always use the func. but they forget its a code they modified

lcass
Member

Posts : 145
Join date : 2011-10-24
Location : england

https://www.youtube.com/user/thealcasgroup

Back to top Go down

[Answered] Armor code gives error Empty Re: [Answered] Armor code gives error

Post by Gardentiver Thu Nov 03, 2011 4:20 pm

Use the tutorial made by Strengthowns

Gardentiver
Member

Posts : 3
Join date : 2011-10-15
Location : Nunya! :)

Back to top Go down

[Answered] Armor code gives error Empty Re: [Answered] Armor code gives error

Post by mastereric Thu Nov 03, 2011 4:22 pm

nvm i found this and it is what i'm using now.
mastereric
mastereric
Member

Posts : 30
Join date : 2011-10-26

Back to top Go down

[Answered] Armor code gives error Empty Re: [Answered] Armor code gives error

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

MC Modding :: Help :: Help

 
Permissions in this forum:
You cannot reply to topics in this forum