Skip to main content

Manage player inventories using your game server

Last updated on March 20, 2025
note

The Inventory service is available upon request. To integrate this service into your environment, please open a request through the AccelByte Customer Support Portal.

Overview

The AccelByte Gaming Service (AGS) Inventory service allows you to manage players inventory and items directly from the game server, enabling inventory and items management, organization, or manipulation.

This article lists how you can enable your game server to manage the inventories owned by your players.

Prerequisites

Grant inventory to the player

You can use this action if you want to allow your game server to grant inventories to players after they reach an achievement or complete a specific action within the game, for example, granting new inventory after a player achieved level 20.

You can enable the game server to grant a new inventory to the player as long as the number of inventory with the same code does not exceed the "maxInstancesPerUser" set in the inventory configuration.

Use this function for reference:


// The code snippet will be available on the future update

Retrieve list of player inventories

Retrieving a list of player inventories can give you information about a player's inventory, such as the inventoryId and inventoryConfigurationId.

To retrieve a list of player inventories via your game server, use this function for reference:


// The code snippet will be available on the future update

Update player inventory slot limit

Use this action to update a specific player's inventory maximum slot limit by providing the inventory ID and the new number of slots that will be implemented.

To update a player's inventory slot limit via your game server, use this function for reference:


// The code snippet will be available on the future update

Delete player inventory

Player inventories can only be deleted if they're empty. Ensure that you first remove all the items from a player's inventory before deleting it.

To delete a player's inventory via your game server, use this function for reference:


// The code snippet will be available on the future update

Add item to player inventory using inventoryId

Use this action to add items to a player's inventory. This requires you to provide the player's inventoryId, which is information that you can get from retrieving a list of player inventories.

Use this function for reference:


// The code snippet will be available on the future update

Add item to player inventory by inventoryConfigurationCode

Use this action to add items to a player's specific inventory configuration. This action requires you to provide the inventoryConfigurationCode, which is information that you can get from retrieving a list of player inventories.

Use this function for reference:


// The code snippet will be available on the future update

Retrieve list of items from a player's inventory

Use this function for reference:


// The code snippet will be available on the future update

Update item attributes and tags

Unlike the game client, the game server has more ability to add additional attributes and tags.

Update custom attributes

You can use your game server to update custom attributes written by players and attributes that can only be modified by the server with required permissions. You can use this action to update attributes that will impact gameplay experience, such as item stats modifier. This attribute will be stored in the serverCustomAttributes field, for example, items with additional damage, critical, durability, etc.

Using Server Custom attributes in Inventory item in AGS

Update tags

You can use your game server to add tags to the items for the purpose of tagging and grouping them. Game servers can add tags to the items and not allow players to update it.

The following image shows a sample item with a tag.

Using tags in Inventory item in AGS

Use this function for reference:


// The code snippet will be available on the future update

Consume items

To consume items owned by the players via your game server, use this function for reference:


// The code snippet will be available on the future update

Remove items from player's inventory

To remove items owned by players from their inventory via your game server, use this function for reference:


// The code snippet will be available on the future update