MC Modding
Please register and join the community!

[unanswered] making new materials and tools

Page 2 of 2 Previous  1, 2

View previous topic View next topic Go down

[unanswered] making new materials and tools

Post by ikke009 on Fri Oct 28, 2011 3:33 pm

First topic message reminder :

So here is what i am trying to do for my mod:
I made a new block, emerald block, and i want to create a new tool, which is not a pickaxe or shovel but a new tool called a chisel. if you use the chisel on the emerald block how you would normally use a pickaxe on a coal ore, you get an emerald crystal.
So if anyone can explain to me how to do this, it will be greatly appreciated Smile
avatar
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 22
Location : The netherlands

View user profile

Back to top Go down


Re: [unanswered] making new materials and tools

Post by ikke009 on Thu Nov 03, 2011 6:23 pm

Code:

public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
  {
      if(!world.multiplayerWorld && entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Block.dirt.blockID)
//blockID can be changed to shiftedIndex for items
      {
          dropBlockAsItem_do(world, i, j, k, new ItemStack(mod_MODSNAMEHERE.BLOCKSNAMEHERE.blockID, 1, l & 3));
      } else
      {
          super.harvestBlock(world, entityplayer, i, j, k, l);
      }
  }
avatar
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 22
Location : The netherlands

View user profile

Back to top Go down

Re: [unanswered] making new materials and tools

Post by jesshankin22 on Fri Nov 04, 2011 12:04 am

Damn, i almost had it... but this does look interesting, maybe ill use something like it in my mod

jesshankin22
Member

Posts : 47
Join date : 2011-10-24

View user profile

Back to top Go down

Re: [unanswered] making new materials and tools

Post by Sponsored content


Sponsored content


Back to top Go down

Page 2 of 2 Previous  1, 2

View previous topic View next topic Back to top


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