Appearance
Quick start
Walk through adding a health potion to a sample inventory. This guide demonstrates a focused, readable first integration.
1. Define a sample item
Give each item a stable ID and a display name. The JSON below is a data model example, not an import format for a real product.
json
{
"id": "health_potion",
"displayName": "Health Potion",
"stackLimit": 5,
"quantity": 1
}2. Create four empty slots
Start with four empty slots. Leave persistence and automatic sorting out of this first scenario.
3. Collect one item
After a single collection action, check that the first slot contains health_potion with a quantity of 1. Collecting the same item again increases the stack to 2.
| State | Expected inventory |
|---|---|
| Initial state | Four empty slots. |
| First collection | One potion in the first slot. |
| Second collection | Two potions in the same slot. |
| Stack limit reached | Additional quantity moves to a suitable empty slot. |
4. Test a failure case
If every slot is occupied and all matching stacks are full, a new collection should fail. The world item should remain available, and the player should receive a clear inventory-full message.
NEXT STEP
Learn how IDs, quantities, and slots relate in Items and slots.