I'm trying to create a item that when you click on a certain block, it will change into a different block that you can collect. Here is my code so far:
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int par4, int par5, int par6, int par7)
{
if(world.getBlockId(par4, par5, par6) == ModpackExtras.minedawnoreblock.blockID)
{
itemstack.damageItem(1, entityplayer);
entityplayer.inventory.addItemStackToInventory(new ItemStack(ModpackExtras.glowshardblock));
return true;
} else
{
return false;
}
}
I set it to give you it instead of changing into the block for testing purposes. I went to try it, but it did not activate or do anything. I tried taking out the if statement to see if it was getting caught up on checking the block, but it did not work. Please help.