> For the complete documentation index, see [llms.txt](https://espergames.gitbook.io/inventool/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://espergames.gitbook.io/inventool/components/inventory.md). Agents can also search and read this documentation through its [MCP server](https://espergames.gitbook.io/inventool/~gitbook/mcp).

# Inventory

Stores items and currencies.

<figure><img src="https://658062748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkBIjnmm9A7LqfwoDhaeR%2Fuploads%2FSXkCI2Hke2idTjj4ocCo%2Fimage.png?alt=media&amp;token=7e159249-ef49-4483-8690-c2f40e83cd0b" alt="" width="290"><figcaption></figcaption></figure>

The **Inventory** component is a powerful container for managing **items and currency**. It can organize items based on configurable **grid properties**, track **item weights**, and provides a wide range of **customization options** for different inventory setups.

Check out its scripting section to learn about its full potential.

{% content-ref url="/pages/V8Sul5HRLOUd1rBEvZb0" %}
[Inventory](https://espergames.gitbook.io/inventool/scripting/inventory.md)
{% endcontent-ref %}

## Properties

#### Behaviour

| Name                  | Description                                                                                                                                                          |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enable Item Dropping  | If the player should be allowed to drop items from this inventory.                                                                                                   |
| Destroy Items On Drop | If items should be immediately lost when they're dropped. This means an item drop instance won't be created for items when they're dropped.                          |
| Can Receive Rewards   | If this inventory can receive rewards. Disabling this is useful when you need to allow reward items inside an inventory without automatically obtaining the rewards. |

#### Grid & Space

| Name                       | Description                                                                                                                                                                                                                                                                     |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enable Grid                | Only disable this if you don't plan on using grid logic at all. If disabled, the inventory will add items without any grid-based checks and won't touch item placements whatsoever. Note that this will also prevent Inventory Blocks from displaying the inventory.            |
| Layout Mode                | The grid layout mode.                                                                                                                                                                                                                                                           |
| Organization Mode          | The item organization mode.                                                                                                                                                                                                                                                     |
| Auto Sorting Algorithm     | The sorting algorithm to use when items are automatically placed.                                                                                                                                                                                                               |
| Trickle Filtered Placement | If the item placement should "trickle down" when filtering is enabled.                                                                                                                                                                                                          |
| Grid Size                  | The size of the grid. If the Layout Mode is set to Infinite Grid, this is used as the minimum grid size.                                                                                                                                                                        |
| Expandable Width           | If the grid should be expanded by width when necessary to fit items.                                                                                                                                                                                                            |
| Expandable Height          | If the grid should be expanded by height when necessary to fit items.                                                                                                                                                                                                           |
| Enable Auto Shrink         | If the grid should try to shrink itself back to the starting grid size.                                                                                                                                                                                                         |
| Pages                      | The number of pages in this inventory. This is relevant when pagination is enabled. This is used as the minimum number of pages when set to Infinite Pagination.                                                                                                                |
| Sub Inventories            | A list of all assigned sub-inventories. When sub-inventories are defined, their space is considered for slots, along with the main inventory. Currency of sub-inventories is not taken into account in most cases. It's recommended to manage currency with the main inventory. |

#### Weights

| Name                         | Description                                                                                                           |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Enable Weights               | If enabled, the inventory will keep track of the total weight of items and if the max weight has been entered/exited. |
| Max Weight                   | The maximum total weight the inventory can hold.                                                                      |
| Disallow Items If Max Weight | If the player should not be able to obtain new items if the weight has reached the max value.                         |

#### Accepted Item Types

A list of all item types that the inventory should accept. Leave this list empty to accept items of any type. Items of unsupported types will be rejected.

#### Currencies

A list of all currencies that the inventory supports. Currencies must be specified. Leaving this list empty means that the inventory does not support any currency (all currency transactions will fail).

#### Events

| Name                   | Description                                                                                                                    |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| On Item Added          | A callback for when an item is added to the inventory. This accepts 1 argument: the added item (Item Stack).                   |
| On Item Removed        | A callback for when an item is added to the inventory. This accepts 1 argument: the removed item (Item Stack).                 |
| On Item Picked Up      | A callback for when an item is picked up. This accepts 2 arguments: the item picked up (ItemStack), the item drop ID (string). |
| On Item Dropped        | A callback for when an item is dropped. This accepts 1 argument: the item dropped (ItemStack).                                 |
| On Currency Added      | A callback for when currency is added. This accepts 1 argument: the amount added (Currency).                                   |
| On Currency Removed    | A callback for when currency is removed. This accepts 1 argument: the amount removed (Currency).                               |
| On Max Weight Exceeded | A callback for when the weight limit is exceeded.                                                                              |
| On Max Weight Exited   | A callback for when the weight limit is exited.                                                                                |
| On Changed             | A callback for when any item or currency is added or removed.                                                                  |

#### Misc

| Name                   | Description                                                                  |
| ---------------------- | ---------------------------------------------------------------------------- |
| Default Drop Transform | The default transform used as the position reference to spawn dropped items. |
| Force 1x1              | Forces all item sizes to be 1x1.                                             |

#### Testing

| Name     | Description                                             |
| -------- | ------------------------------------------------------- |
| Test Box | A test loot box for immediate runtime testing purposes. |

All other options can be used for quick testing only in play mode.

## Supported Block Binding

The component itself **OR** its properties can be bound with the following:

* [Inventory Block](https://espergames.gitbook.io/inventool/components/ui-blocks/inventory-block.md)
* [Currency Block](https://espergames.gitbook.io/inventool/components/ui-blocks/currency-block.md)
* [Text Block](https://espergames.gitbook.io/inventool/components/ui-blocks/general/text-block.md)
