question

Muhammad Roshaan Tariq avatar image
Muhammad Roshaan Tariq asked

How to get custom data of inventory item when using UnlockContainerItem API

Hi, I am using UnlockContainerItem API to award some loot to my players but I'm not getting the custom data of my item which is awarded to player from my container. I checked the JSON result and the custom data is null in it.

How can I get the item's custom data?

apisdataPlayer Inventory
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

It is the expected behavior because the custom data defined in the catalog item won’t go inventory item’s custom data field as they should be maintained separately. Catalog is the resource that shouldn’t be changed frequently and usually it comes with the client version update. I suggest store a local copy of catalog Item for the later reference.

To manage the inventory item custom data, we use UpdateUserInventoryItemCustomData API. Since it is server API, if you want to sync 2 sides of custom data, you can handle this process on the Cloud Script when the item is being granted to the player.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.