So far, I have created an item that takes damage in a crafting table, but it doesn't get destroyed when all of the durability is used, and also crashes the game when it is used after shift-clicking an amount of items over the durability.
Here is the Item class:
And here is the crafting recipe code:
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.lithium_carbonate), ModItems.lithium_ingot, Items.COAL, new ItemStack(ModItems.oxygen_extractor, 1, OreDictionary.WILDCARD_VALUE));
Coal is used as a placeholder here.