So the hammer class now extends item tool and i discovered that the reason that the item wasn't breaking was because I wasn't actually breaking a block. So i moved my code out of the ItemEventHandler class and into the onBlockDestroyed method. This allows the item to break properly however the stone is not cracking anymore and it seems that the setBlock() method doesn't work.
Here is what I have:
@Override
public boolean onBlockDestroyed(ItemStack item, World world, Block block, int x, int y, int z, EntityLivingBase player) {
item.damageItem(1, player);
if (block.equals(Blocks.stone)) {
world.setBlock(x, y, z, ModBlocks.crackedStone);
}
return true;
}
Could someone try to explain why the block that was broken is not replaced by cracked stone?