public interface IItemManagerProvides item discovery and host-safe local-backpack mutations.
Members
AllItemsGets a current snapshot of all inventory item definitions, ordered by display name and then ID.propertyTryGetItemFinds an item by its stable ID, ignoring letter case.methodFindItemsFinds items whose ID or localized display name contains the given text, ignoring letter case.methodAddToLocalBackpackAsyncAdds an item to the local host player's backpack through Planet Crafter's network-aware inventory system.methodAllItems
propertyIReadOnlyList<IItemDefinition> AllItemsGets a current snapshot of all inventory item definitions, ordered by display name and then ID.
TryGetItem
methodbool TryGetItem(string id, out IItemDefinition? item)Finds an item by its stable ID, ignoring letter case.
FindItems
methodIReadOnlyList<IItemDefinition> FindItems(string search)Finds items whose ID or localized display name contains the given text, ignoring letter case.
AddToLocalBackpackAsync
methodTask<GameplayActionResult> AddToLocalBackpackAsync( string itemId, int amount = 1 )Adds an item to the local host player's backpack through Planet Crafter's network-aware inventory system.
This request is host-only. It checks that the entire amount fits before adding anything and automatically shows a native item notification when successful. The call may be made from any thread; CMAPI performs the game interaction on the main thread.