Set Inventory
setInventorySet a specific hotbar or backpack slot for an entity or player, validating the item and stack count; use air or count 0 to clear that slot.
Instructions
Set one inventory slot of an entity or player. section is "hotbar" (slots 0-8) or "inventory" (backpack, slots 0-26). The item is validated against the item registry and the count must fit the item stack size. Use "minecraft:air" or count 0 to clear a slot. The target is an entity UUID or a player name.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"target": "<target>",
"slot": "<slot>",
"item": "<item>"
},
"name": "setInventory"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | Yes | Item id, such as "minecraft:diamond_sword" or "diamond_sword". Use "minecraft:air" or count 0 to clear the slot. | |
| slot | Yes | Slot index within the section (hotbar 0-8, backpack 0-26) | |
| count | No | Stack count (1 to the item stack size); 0 clears the slot | |
| target | Yes | Entity UUID or player name (player names are case-insensitive) | |
| section | No | "hotbar" for the 9 hotbar slots or "inventory" for the 27 backpack slots | inventory |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | Yes | ||
| slot | Yes | ||
| entity | Yes | ||
| hotbar | Yes | ||
| section | Yes | ||
| previous | Yes | ||
| inventory | Yes | ||
| usedSlots | Yes | ||
| hotbarUsed | Yes | ||
| totalSlots | Yes | ||
| inventoryUsed | Yes |