consume Use
Spends one charge of item, increasing its damage by one.
⚠️ Pass the actual stack from the player's inventory (e.g. the one in hand), never a createItemStack() copy — a fresh stack has damage = 0, so consuming it does nothing and silently resets the counter. When passed an inventory stack, the mutation is written back to that stack.
On the final charge the stack is emptied (amount = 0) so it disappears.
val bag = player.inventory.itemInMainHand
if (EffectiveDurability.consumeUse(bag)) {
// charges left — bag still usable
} else {
// was the last charge — bag consumed
}Content copied to clipboard
Return
true if charges remain, false if this was the last one (the stack is emptied).