QuestionSolvedHelp With The "onBlockAdded" Command

Posts 1–4 of 4 · Page 1 of 1
Help With The "onBlockAdded" Command
Hey guys,
as the title is a give away i wanna go into a little detail

so im making a mod and and putting a step on it but i cant make it so when 1 is placed onto another it should stack

the files ive got are

BlockWhiteGoldSingle
BlockWhiteGoldDouble
mod_whiteGold

using the
Code:
	public void onBlockAdded(World world, int i, int j, int k)
		{
			if(this != Block.whiteGoldSingle)
			{
				super.onBlockAdded(world, i, j, k);
			}
			int l = world.getBlockId(i, j - 1, k);
			int i1 = world.getBlockMetadata(i, j, k);
			int j1 = world.getBlockMetadata(i, j - 1, k);
			if(i1 != j1)
			{
				return;
			}
				if(l == whiteGoldSingle.blockID)
			{
            world.setBlockWithNotify(i, j, k, 0);
            world.setBlockAndMetadataWithNotify(i, j - 1, k, Block.whiteGoldDouble.blockID, i1);
			}
		}
how would i go about re-arranging it to work properly

thanks in advance

Ok, Ive Done This
Code:
   public void onBlockAdded(World world, int i, int j, int k)
      {
         if(world.getBlockId(i, j -, k)!= Block.whiteGoldSingle)
	  {
         int l = world.getBlockId(i, j - 1, k);
         int i1 = world.getBlockMetadata(i, j, k);
         int j1 = world.getBlockMetadata(i, j - 1, k);
         if(i1 != j1)
         {
            return;
         }
            if(l == whiteGoldSingle.blockID)
         {
            world.setBlockWithNotify(i, j, k, 0);
            world.setBlockAndMetadataWithNotify(i, j - 1, k, Block.whiteGoldDouble.blockID, i1);
         }
       }
	}

But Im Still Getting An Error;
Code:
src\minecraft\net\minecraft\src\BlockWhiteGoldSingle.java:22: illegal start of expression
if(world.getBlockId(i, j -, k)!= Block.whiteGoldSingle)
^
i have no clue but ima start modding minecraft :P
sounds like i need something to do...... gonna be hard
How do you make it so the title is solved and not help request cos ive done it
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Talk with us