Skip to content
1.0 · DemoSample product content

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.

StateExpected inventory
Initial stateFour empty slots.
First collectionOne potion in the first slot.
Second collectionTwo potions in the same slot.
Stack limit reachedAdditional 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.

Multiple products. One knowledge base.