Skip to content

ItemSupplyAsset — Supply Items

Organizing crafting materials, empty containers, and non-consumable utility items in Unturned's inventory system requires understanding how ItemSupplyAsset acts as a type-marker stub — an empty class that extends ItemAsset directly rather than ItemConsumeableAsset, carrying only the EItemType.SUPPLY enum to distinguish it in the item registry. ItemSupplyAsset is unique among the consumable-adjacent classes — it extends ItemAsset directly, not ItemConsumeableAsset. It is an empty stub (11 lines) with no additional fields.

Source code location: Unturned/Bundles/ItemSupplyAsset.cs

Inheritance Chain

ItemAsset
  → ItemSupplyAsset (empty, standalone)

Unlike ItemFoodAsset, ItemWaterAsset, and ItemMedicalAsset — which all extend ItemConsumeableAssetItemWeaponAssetItemAssetItemSupplyAsset skips the intermediate hierarchy entirely and extends ItemAsset directly. This reflects the fundamental design difference: supply items are not consumed and have no stat modifiers.

Class Definition

csharp
public class ItemSupplyAsset : ItemAsset
{

}

Why Not ItemConsumeableAsset?

ItemSupplyAsset does not extend ItemConsumeableAsset because supply items:

  1. Have no health/food/water/virus/disinfectant/energy/vision/oxygen/warmth stats.
  2. Cannot be consumed (no shouldDeleteAfterUse).
  3. Have no bleeding or bones modifiers.
  4. Do not support the _hasAid targeting system.
  5. Have no mold/quality mechanics.
  6. Cannot be configured as explosive consumables.
  7. Have no quest or item reward infrastructure from consumption.

Supply items may have custom useable classes (e.g., UseableFuel for blowtorch fuel), but these are attached through the useable system rather than asset class inheritance.

Role as a Type Marker

The EItemType.SUPPLY enum value is set during ItemAsset.PopulateAsset and controls:

Inventory Filtering

Supply items appear in the "Supplies" tab of the player inventory. This tab is separate from food, water, medical, and other categories.

Crafting Category

Crafting recipes can filter by item type. Supply items are available as crafting ingredients. Vanilla crafting recipes frequently require specific supply items:

  • Nails + Wood → Wooden Barricade
  • Metal Scrap + Metal Bar → Metal Door
  • Rope + Tape → Makeshift Armor

Spawn Table Allocation

Spawn tables reference items by type for filtering. Supply items spawn in:

  • Hardware stores (tools and supplies).
  • Garages (mechanical supplies).
  • Construction sites (building materials).
  • Farms (agricultural supplies).

Vanilla Supply Items

Vanilla supply items illustrate the range of non-consumable utility items:

ItemUseCustom Useable
Blowtorch FuelRefuel generators and vehiclesUseableFuel
NailsCrafting ingredient for barricadesNone (crafting only)
Metal ScrapCrafting ingredient for structures and barricadesNone
RopeCrafting ingredient (armor, traps)None
TapeCrafting ingredient (clothing, barricades)None
ClothCrafting ingredient (clothing, bandages)None
WireCrafting ingredient (electronics)None
ChemicalsCrafting ingredient (medical supplies)None
FertilizerCrop growth accelerationFarm interaction
Empty CanContainer for refilling waterItemRefillAsset
BottleContainer for refilling waterItemRefillAsset

Note that Empty Can and Bottle are typically ItemRefillAsset (which extends ItemAsset), not ItemSupplyAsset. The distinction is that supply items have no internal state beyond amount, while refill items carry water type and benefit data.

Supply vs Refill Items

FeatureItemSupplyAssetItemRefillAsset
Base classItemAssetItemAsset
State bytesDefault ItemAsset (amount only)1 byte (water type)
Custom descriptionNoYes (water type label + stats)
Useable classVaries (or none)UseableRefill
RefillableNoYes (from water sources)
ConsumptionNoYes (drink water, apply stats)

The key distinction: ItemSupplyAsset items have no useable behavior by default. Any interactivity comes from external systems (crafting, farming, generators). ItemRefillAsset items have first-class consumption behavior through UseableRefill.

Supply Items and the ItemAsset Base

All supply items inherit the standard ItemAsset fields:

FieldTypeDescription
idushortLegacy item ID
GUIDGuidModern asset identifier
itemNamestringLocalized display name
itemDescriptionstringLocalized description text
size_x / size_ybyteInventory grid dimensions
Amount / MaxAmountbyteStack size
rarityEItemRarityItem rarity color
typeEItemTypeMust be EItemType.SUPPLY

Supply Items and the Power System

Some supply items interact with the power system:

ItemPower Interaction
Blowtorch FuelRefuels generators (power source)
WireUsed in crafting electrical items
Metal ScrapUsed in crafting generator components

The power grid is managed by PowerTool which validates connections within PowerTool.MAX_POWER_RANGE. Supply items serve as the crafting inputs for the electrical network rather than consuming or producing power directly.

Supply Items as Crafting Components

The most common role for supply items is crafting component. The crafting system references supply items by their item ID:

csharp
// Example crafting recipe (pseudocode):
recipe.AddIngredient(supplyItemId, quantity);
recipe.AddProduct(productItemId, quantity);

Supply items in crafting:

  • Are consumed at recipe execution (removed from inventory).
  • May have minimum quality requirements (rare).
  • Can produce supply, clothing, barricade, structure, or tool items.
  • May have skill requirements (e.g., Crafting level 2).

Supply Items and the Spawn Table System

Supply items in spawn tables use the standard SpawnAsset / SpawnTableTool infrastructure. Spawn tables can reference supply items by:

  • Direct item ID.
  • Item type filter (EItemType.SUPPLY).
  • Asset GUID.
  • Spawn table alias (nested spawn tables).

The spawn rate, drop count, and quality are configured per entry.

Common Issues

  1. Empty class, complete ItemAsset — Although ItemSupplyAsset is empty, it inherits ~30 fields from ItemAsset. Modders creating supply items must configure standard item fields (ID, Name, Size_X, Size_Y, Amount, Rarity, Type) in addition to any custom behavior.
  2. No consumption flags — Supply items have no shouldDeleteAfterUse, showQuality, or stat modifier fields. A mod that attempts to set Health=20 on a supply item will find the key is silently ignored during PopulateAsset because supply items never call ItemConsumeableAsset.PopulateAsset.
  3. Custom useable attachment — Supply items that need interactive behavior (like blowtorch fuel) must have a custom useable class assigned through the item lookup system. The base ItemSupplyAsset provides no useable attachment out of the box.
  4. Confusion with ItemRefillAsset — Empty cans and bottles that need refilling should use ItemRefillAsset, not ItemSupplyAsset. A supply item can hold state (amount) but cannot hold water type or provide stat benefits on consumption like a refill item.
  5. Cargo data exportItemSupplyAsset does not override BuildCargoData. Only the base ItemAsset fields are exported to the Item Cargo table. No supply-specific table exists in the Cargo system.
  6. Future expansion potential — The empty ItemSupplyAsset class is expected to remain minimal. Adding fields here would suggest a refactoring of the supply system, which has not been prioritized. Custom behavior for supply items is better implemented through dedicated useable classes than through asset fields.

Worked Code Example: Supply Item Manager

csharp
using SDG.Unturned;
using System.Collections.Generic;

public static class SupplyItemManager
{
    public static List<ItemJar> GetSupplyItems(Player player)
    {
        List<ItemJar> supplyItems = new List<ItemJar>();
        foreach (Items page in player.inventory.items)
        {
            if (page == null) continue;
            for (int i = 0; i < page.getItemCount(); i++)
            {
                ItemJar jar = page.getItem(i);
                if (jar?.item?.GetAsset() is ItemSupplyAsset)
                    supplyItems.Add(jar);
            }
        }
        return supplyItems;
    }

    public static int CountSupplyById(Player player, ushort itemId)
    {
        int count = 0;
        foreach (ItemJar jar in GetSupplyItems(player))
            if (jar.item.id == itemId) count += jar.item.amount;
        return count;
    }
}

Mermaid Diagram: Supply Item Classification

FeatureItemSupplyAssetItemRefillAssetItemConsumeableAssetItemCurrencyAsset
Base classItemAssetItemAssetItemWeaponAssetItemAsset
ConsumableNoYes (water)Yes (food/medical)No
State bytesDefault (amount)1 byteVariableVariable
QualityNoNoYesNo
Custom useableOptionalUseableRefillUseableConsumeableN/A

How This Differs from SDG Docs

  • SDG docs group supply items under "materials." In the SDK, supply is a broader type marker — any non-consumable utility item can be typed as SUPPLY including containers, tools, and components.

Deeper FAQ

Q: Can supply items have durability?

No. showQuality returns false. Implement ItemConsumeableAsset or a custom useable for quality-tracking items.

Q: How do I make a supply item stackable?

Set Amount in the .dat to the stack size. The base ItemAsset handles stacking — supply items stack by default.

Cross-References

Document history