> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaksam-scripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Can carry item

> Checks if an inventory has space for additional items, considering both weight and slot limits.

Checks if an inventory has space for additional items, considering both weight and slot limits.

<CodeGroup>
  ```lua Export theme={null}
  exports['jaksam_inventory']:canCarryItem(inventoryId, itemName, amount)
  ```

  ```lua Example theme={null}
  -- Check if player can carry 5 bread
  local canCarry = exports['jaksam_inventory']:canCarryItem(1, 'bread', 5)

  if canCarry then
      -- Safe to add items
      exports['jaksam_inventory']:addItem(1, 'bread', 5)
  end
  ```
</CodeGroup>

### Parameters

| Name          | Data Type        | Description                                                          |
| ------------- | ---------------- | -------------------------------------------------------------------- |
| `inventoryId` | string \| number | The inventory ID to check. Can be a player server ID or inventory ID |
| `itemName`    | string           | The name of the item to check                                        |
| `amount`      | number           | How many items to check for                                          |

### Return value

| Name      | Data Type | Description                                                                                   |
| --------- | --------- | --------------------------------------------------------------------------------------------- |
| `boolean` | boolean   | True if the inventory can carry the items, false if adding would exceed weight or slot limits |


## Related topics

- [Server](/jaksam-inventory/functions/server/index.md)
- [Troubleshooting](/jaksams-scripts/troubleshooting.md)
- [Can swap item](/jaksam-inventory/functions/server/can-swap-item.md)
- [Common FAQ](/jaksams-scripts/common-faq.md)
- [Pre use item](/jaksam-inventory/hooks/on-pre-use-item.md)
