S9SourceNine Labs / CMAPI Docs 1.0
CMAPI / API reference

IItemManager

Provides item discovery and host-safe local-backpack mutations.

View source ↗
CMAPI 1.0.0Standalone runtimeWindows x64Tested with Planet Crafter 2.008
Namespace CMAPIInterfaceAssembly CMAPI.API.dll
public interface IItemManager

Provides item discovery and host-safe local-backpack mutations.

Members

AllItems

property
IReadOnlyList<IItemDefinition> AllItems

Gets a current snapshot of all inventory item definitions, ordered by display name and then ID.

TryGetItem

method
bool TryGetItem(string id, out IItemDefinition? item)

Finds an item by its stable ID, ignoring letter case.

FindItems

method
IReadOnlyList<IItemDefinition> FindItems(string search)

Finds items whose ID or localized display name contains the given text, ignoring letter case.

AddToLocalBackpackAsync

method
Task<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.