I want to make food items which can spoil over time while in a stack. It seems logical to use the vanilla item damage/durability for the spoilage, but damaged items can't be stacked. My first instinct would be to make a subclass of ItemStack and implement my own functionality for combining damage and stack sizes, but since ItemStack is final I can't do that. Does anyone have any ideas for how I could achieve something like this? Or will it be painfully difficult/unachieveable?
Edit: update