Stackable items and maximum amounts
| Setting | Example | What the player gets |
|---|---|---|
| Stackable off | Brass key, Max Stack 1 | At most one copy of that item ID. |
| Stackable on; Max Stack 5 | Bearing oil | One visible slot with a quantity from 1 to 5. |
| Give 3 oil when the player has 1 | Maximum 5 | Four oil. |
| Give 20 oil when the player has 4 | Maximum 5 | Five oil, not 24. |
| Remove 1 oil from a stack of 1 | No amount remains | The item disappears from the carried list. |
Figure 5. The oil occupies one cell. Its quantity is part of the caption; four copies do not make four cells.
The widget’s capacity counts different item IDs, not the total number of objects. Eight keys represented by one stackable item still use one slot. Eight different key IDs use eight slots.
Show Quantity is supported as showQuantity in the element JSON. It is true in this example. The quantity suffix appears when the amount is greater than one. If you want a custom counter in a separate Label, update it from game logic.
Use Remove Inventory to take items away. Giving an amount of zero is not a reliable way to mean “do nothing”; the add action normalizes its count. Check your amount before calling the action.
