Okay, thanks for attempting to help. What i do not understand is i did exactly what you said to do(without the chat thing) but it crashes still. here is my code:
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int coords, float one, float two, float three)
{
if(player.getHeldItem().getItem() != null)
{
if(player.getHeldItem().getItem() == MyMod.olKey)
{
world.setBlock(x, y, z, Blocks.air);
player.inventory.consumeInventoryItem(MyMod.olKey);
}
else
{
System.out.println("Are you trying to unlock it with THAT?");
}
}
else
{
System.out.println("Stpo trying to pry it open");
}
return super.onBlockActivated(world, x, y, z, player, coords, one, two, three);
}