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 ItemConsumeableAsset → ItemWeaponAsset → ItemAsset — ItemSupplyAsset 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:
- Have no health/food/water/virus/disinfectant/energy/vision/oxygen/warmth stats.
- Cannot be consumed (no
shouldDeleteAfterUse). - Have no bleeding or bones modifiers.
- Do not support the
_hasAidtargeting system. - Have no mold/quality mechanics.
- Cannot be configured as explosive consumables.
- 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:
| Item | Use | Custom Useable |
|---|---|---|
| Blowtorch Fuel | Refuel generators and vehicles | UseableFuel |
| Nails | Crafting ingredient for barricades | None (crafting only) |
| Metal Scrap | Crafting ingredient for structures and barricades | None |
| Rope | Crafting ingredient (armor, traps) | None |
| Tape | Crafting ingredient (clothing, barricades) | None |
| Cloth | Crafting ingredient (clothing, bandages) | None |
| Wire | Crafting ingredient (electronics) | None |
| Chemicals | Crafting ingredient (medical supplies) | None |
| Fertilizer | Crop growth acceleration | Farm interaction |
| Empty Can | Container for refilling water | ItemRefillAsset |
| Bottle | Container for refilling water | ItemRefillAsset |
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
| Feature | ItemSupplyAsset | ItemRefillAsset |
|---|---|---|
| Base class | ItemAsset | ItemAsset |
| State bytes | Default ItemAsset (amount only) | 1 byte (water type) |
| Custom description | No | Yes (water type label + stats) |
| Useable class | Varies (or none) | UseableRefill |
| Refillable | No | Yes (from water sources) |
| Consumption | No | Yes (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:
| Field | Type | Description |
|---|---|---|
id | ushort | Legacy item ID |
GUID | Guid | Modern asset identifier |
itemName | string | Localized display name |
itemDescription | string | Localized description text |
size_x / size_y | byte | Inventory grid dimensions |
Amount / MaxAmount | byte | Stack size |
rarity | EItemRarity | Item rarity color |
type | EItemType | Must be EItemType.SUPPLY |
Supply Items and the Power System
Some supply items interact with the power system:
| Item | Power Interaction |
|---|---|
| Blowtorch Fuel | Refuels generators (power source) |
| Wire | Used in crafting electrical items |
| Metal Scrap | Used 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
- Empty class, complete ItemAsset — Although
ItemSupplyAssetis empty, it inherits ~30 fields fromItemAsset. Modders creating supply items must configure standard item fields (ID,Name,Size_X,Size_Y,Amount,Rarity,Type) in addition to any custom behavior. - No consumption flags — Supply items have no
shouldDeleteAfterUse,showQuality, or stat modifier fields. A mod that attempts to setHealth=20on a supply item will find the key is silently ignored duringPopulateAssetbecause supply items never callItemConsumeableAsset.PopulateAsset. - 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
ItemSupplyAssetprovides no useable attachment out of the box. - Confusion with ItemRefillAsset — Empty cans and bottles that need refilling should use
ItemRefillAsset, notItemSupplyAsset. A supply item can hold state (amount) but cannot hold water type or provide stat benefits on consumption like a refill item. - Cargo data export —
ItemSupplyAssetdoes not overrideBuildCargoData. Only the baseItemAssetfields are exported to theItemCargo table. No supply-specific table exists in the Cargo system. - Future expansion potential — The empty
ItemSupplyAssetclass 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
Comparison: Supply vs. Related Item Types
| Feature | ItemSupplyAsset | ItemRefillAsset | ItemConsumeableAsset | ItemCurrencyAsset |
|---|---|---|---|---|
| Base class | ItemAsset | ItemAsset | ItemWeaponAsset | ItemAsset |
| Consumable | No | Yes (water) | Yes (food/medical) | No |
| State bytes | Default (amount) | 1 byte | Variable | Variable |
| Quality | No | No | Yes | No |
| Custom useable | Optional | UseableRefill | UseableConsumeable | N/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
- ItemFuelAsset — Fuel Can Items — Fuel as a supply-like item with specialized transfer.
- ItemRefillAsset — Refillable Container Items — Refill class for consumable liquids.
- ItemConsumeableAsset — Food/Water/Medical — Consumable item chain comparison.
- ItemCurrencyAsset — Currency Items — Spendable non-consumable items.
