• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    InventoryItem

    InventoryItem contains the data for an item retrieved through Inventory.GetItem or Inventory.GetItems. Provides information about item quantity, availability, timestamps, and reservations.

    Properties

    amount

    number
    ServerOnly
    ReadOnly

    Total quantity of this item the owner has (includes reserved items).

    print("Total items: " .. item.amount)
    

    available

    number
    ServerOnly
    ReadOnly

    Quantity of this item that is not reserved and can be used in transactions.

    print("Available items: " .. item.available)
    local reservedCount = item.amount - item.available
    

    createdAt

    number
    ServerOnly
    ReadOnly

    Unix epoch timestamp (UTC) when the holder first obtained this item. Use os.date() to format into human-readable format.

    local createdDate = os.date("%Y-%m-%d %H:%M:%S", item.createdAt)
    print("Item created: " .. createdDate)
    

    holderId

    string
    ServerOnly
    ReadOnly

    The ID of the holder (player) who owns this item.

    print("Owner ID: " .. item.holderId)
    

    id

    string
    ServerOnly
    ReadOnly

    The unique identifier of the item.

    print("Item ID: " .. item.id)
    

    Array of InventoryReservations showing how many items are reserved and their purposes.

    for i, reservation in ipairs(item.reservations) do
        print("Reserved: " .. reservation.amount .. " for " .. reservation.reservedFor)
    end
    

    updatedAt

    number
    ServerOnly
    ReadOnly

    Unix epoch timestamp (UTC) when this item was last modified. Use os.date() to format into human-readable format.

    local updatedDate = os.date("%Y-%m-%d %H:%M:%S", item.updatedAt)
    print("Item updated: " .. updatedDate)
    

    Updated 19 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.