# Last Created Inventory Item

Grammar — Last created inventory item
FlagsNative | Function

Returns the last item created via the “Create Inventory Item” action. This function ignores items created by other triggers.

Returns — unit

native unit UnitInventoryLastCreated();

Category: Unit / Items

# Examples

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicSystem.galaxy:472

        lv_container = UnitInventoryContainer(lv_item);
        UnitInventoryCreate(lv_target, UnitGetType(lv_item));
        lv_itemCopy = UnitInventoryLastCreated();
        UnitInventoryMove(lv_itemCopy, lv_container, lv_slot);
        ItemSetChargeCount(lv_itemCopy, lv_itItemStack);