Item.onConsumed

If consumeable is true, this function is called. when the item is eaten/drunk by its holder, who's passed as the first arguments. Return: null: the item count will be reduced by 1 item: the item will substitutes the consumed item

class Item
onConsumed

Examples

assert(new Items.Beetroot().onConsumed(player) is null);
assert(new Items.BeetrootSoup().onConsumed(player) == Items.BOWL);

Meta