Help With Code Please!

Sometimes, we all need a little general help.

Post Permalink
by Azthat » 4/10/2012

Hi, I'm trying to do a new ore mod and this is my code:

Code: Select all
public class mod_Amber extends BaseMod{
       
       
        private static BlockAmber = new BlockAmber(488).setBlockName("Amber");
       

        public mod_Amber()
        {
               
                ModLoader.AddName(Amber, "Amber");

                Amber.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Amber.png");

                ModLoader.RegisterBlock(Amber);

                ModLoader.AddRecipe(new ItemStack(Amber,1), new Object[]
                {"#",Character.valueOf('#'),Block.dirt});
        }
           @Override
            public String Version() {

                return "v0.1";
        }
}


It says I have 1 error in:
private static BlockAmber = new BlockAmber(488).setBlockName("Amber");
^

please help :( I want to know how to do mods

THANKS
Level 1
New Miner
Posts: 8
Joined: 4/9/12

Post Permalink
by ike325 » 4/10/2012

Did you make a BlockAmber class? If so could you post the code for it?
User avatar
Level 33
Artisan Droid
Posts: 157
Joined: 7/2/11
Location: Indiana
Says: Why can't we all just get along!?
Minecraft: ChuckNorris2213

Post Permalink
by Azthat » 4/10/2012

My BlockAmber.class code is this:

Code: Select all
package net.minecraft.src;

public class BlockAmber extends Block {
 
                protected BlockAmber (int i) {
                super(i, Material.rock);

        }
}


Thanks
Level 1
New Miner
Posts: 8
Joined: 4/9/12

Post Permalink
by ZombieMike » 4/16/2012

Most of modloader's *thingys* now begin lowercase
for example;
'AddName' Is now 'addName'
'GenerateSurface' is 'generateSurface'
It also applies to addRecipe addSmelting and a few other ones
User avatar
Level 1
New Miner
Posts: 28
Joined: 2/29/12


Return to General Help