> ## 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.

# Has item

> Checks if an inventory has a specific item.

Checks if an inventory has a specific item.

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

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

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

### Parameters

| Name          | Data Type        | Description                               |
| ------------- | ---------------- | ----------------------------------------- |
| `inventoryId` | string \| number | The inventory ID to check                 |
| `itemName`    | string           | The name of the item to check             |
| `quantity`    | number           | How many items to check for. Default is 1 |

### Return value

| Name      | Data Type | Description                                      |
| --------- | --------- | ------------------------------------------------ |
| `boolean` | boolean   | True if the inventory has the item, false if not |


## Related topics

- [Server](/jaksam-inventory/functions/server/index.md)
- [Item harvested](/drugs-creator/server/harvestable-items/item-harvested.md)
- [Post use item](/jaksam-inventory/hooks/on-post-use-item.md)
- [Can carry item](/jaksam-inventory/functions/server/can-carry-item.md)
