Skip to content

Enumerated Types Reference

Enumerated types (enums) are the named-value sets that constrain configuration fields in Unturned™ .dat and .asset files to a specific vocabulary of valid strings. When a mod developer writes Type Melee in a .dat file, the parser reads the string Melee, matches it against the named values of the EItemType enum, and assigns the corresponding integer value (16) to the asset's type field. The enum system is the mechanism by which Unturned™ maps human-readable configuration strings to the integer codes that the engine uses internally.

This article is the third in the data-types section of the 57 Studios™ Modding Knowledge Base. It documents all 23 enumerated types defined in the Smartly Dressed Games modding documentation Chapter 139, including every named value, its integer index (if indexed), its description, and its usage context in .dat and .asset files. For the three most important enums in item modding (EItemType, EItemRarity, and ESlotType), the article provides worked examples drawn from the shipped vanilla asset set. The companion articles in this section cover the C# built-in types (the underlying integer type that stores enum values) and the GUID type (the 128-bit identifier that enum-typed assets carry alongside their enum-defined type and rarity).

A grid of named enum values arranged as a reference chart with categorized type labels

Documentation source: This article references the official Smartly Dressed Games modding documentation Chapter 139 ("Enumerated Types") for all 23 enum type definitions, named values, integer indices, and descriptions. Enum usage patterns are validated against the shipped Unturned™ asset set at C:\Program Files (x86)\Steam\steamapps\common\Unturned\Bundles\Items\Guns\*\*.dat, Items\Melee\*\*.dat, and *\*.asset.

Who this article is for

This article is written for Unturned™ mod authors who need a definitive lookup table for the enum values that appear in .dat and .asset files. New mod developers should read the first three enums (EItemType, EItemRarity, ESlotType) in detail before authoring any .dat file. Experienced mod developers should bookmark the quick-reference table in Appendix A for fast lookup during authoring sessions.

What you'll learn

  • The complete catalog of all 23 Unturned™ enumerated types with every named value and its integer index
  • How enum values appear in .dat files (string form, case-sensitive, PascalCase)
  • The difference between indexed enums (where the integer index matters) and non-indexed enums (where only the name matters)
  • The default value for every enum and what happens when an unrecognized string is supplied
  • Detailed coverage of the three most important enums for item modding: EItemType (49 item types), EItemRarity (6 rarity tiers), and ESlotType (5 equipment slots)
  • Worked examples from shipped .dat and .asset files showing enum values in real configuration context
  • The relationship between enum values and asset behavior (how Type Melee activates the melee system versus Type Gun activating the firearm system)

Background: how enum types work in Unturned

In the C# type system, an enumerated type (declared with the enum keyword) is a value type that defines a set of named constants. Each named constant is assigned an underlying integer value. The C# compiler maps the name to the integer at compile time; at runtime, the integer is the stored value, and the name is a display convenience.

In Unturned™ configuration files, enum values are serialized as their named strings, not as their integer indices. The parser reads the string, performs a case-sensitive match against the enum's named values, and stores the corresponding integer. This design decision has two important consequences for mod developers:

  1. The string form is the authoring interface. Mod developers write Type Melee, not Type 16. The string is human-readable and self-documenting.
  2. The string match is case-sensitive. Writing Type melee (lowercase) does not match the named value Melee (PascalCase). The parser fails to match and assigns the enum's default value , typically None or index 0 , which may produce silent incorrect behavior.

Indexed versus non-indexed enums

Some Unturned™ enums carry explicit integer indices that are meaningful to the game engine. For example, EItemType assigns Gun to index 7 , the engine's item-processing code checks the item's type integer and dispatches to the gun handler when the value is 7. The index is the runtime dispatch key.

Other enums do not carry explicit indices and are defined only by their named values. For example, EBatteryMode defines three named values (None, Burn, Charge) with no explicit indices. The engine matches the name string at parse time and uses the underlying integer for internal dispatch, but the exact integer values are an implementation detail.

Enum naming conventions in the SDG documentation

The SDG documentation prefixes every enum type name with E (e.g., EItemType, EAssetType, EItemRarity). This is a C# naming convention inherited from the Unreal Engine (which uses the E prefix for enum types). The E prefix appears only in the documentation and in C# source code references; it never appears in .dat files. A .dat file contains Type Melee, not EItemType Melee. The parser resolves the Type field to the EItemType enum based on the field name, not on a prefix in the value.

The 23 enumerated types: complete catalog

The following table lists all 23 enumerated types documented in the SDG Chapter 139 source extract. Each enum is described with its purpose and the number of named values it defines.

Enum NameNamed ValuesPurposeUsed In
EAssetType11Scopes legacy IDs to asset categoriesInternal engine code, legacy asset references
EBatteryMode3Controls vehicle battery charge/discharge behaviorVehicle assets
EItemOrigin4Tracks the source of a spawned itemItem spawning system, admin commands
EItemRarity6Defines the six loot-rarity tiers with UI colorAll item .dat and .asset files; Rarity field
EItemType49Defines every possible item categoryAll item .dat and .asset files; Type field
ELightingVision4Controls night-vision and headlamp lighting modesGlasses, headlamps, tactical items
ENPCHoliday9Defines recognized holidays and seasonal eventsLandscape materials, holiday-restricted assets
EObjectChart12Determines map chart-view rendering style for objectsObject assets, map chart configuration
EObjectType5Defines object size categories (Large, Medium, Small, NPC, Decal)Object assets
ESlotType5Defines equipment slots (None, Primary, Secondary, Tertiary, Any)All equippable item .dat files; Slot field
EAction4 (inferred)Defines melee attack types (Slash, Stab, Punch, Stomp)Melee .dat files; Action_Primary, Action_Secondary fields
EFiremode4 (inferred)Defines gun fire modes (Safety, Semi, Auto, Burst)Gun .dat files; fire mode flag fields
ERefillType(inferred)Defines refill behavior for consumable itemsRefill/consumable .dat files
EBlueprintType(inferred)Defines blueprint operation types (Craft, Repair, Salvage)Blueprint recipes in .dat files
EAudioCategory(inferred)Defines audio categories for weapon attack and hit soundsMelee and gun .dat files
EUseableType(inferred)Defines the useable script handler (Melee, Gun, Throwable, Consume)All item .dat files; Useable field
ECaliber(inferred)Not a true enum; caliber is a uint16 numeric identifierGun and magazine .dat files
EHolidayRestriction(inferred)Filters asset visibility/behavior by active holidayCosmetic .dat and .asset files
EQuality(inferred)Separate from EItemRarity; used for Steam Economy item qualitiesEconomy configuration
EMythicEffectType(inferred)Defines mythic effect visual behaviorsMythic effect assets
ESpawnType(inferred)Defines spawn table behavior typesSpawn table assets
EVehicleType(inferred)Defines vehicle category typesVehicle assets
EAnimalType(inferred)Defines animal behavior typesAnimal assets

The enums marked "(inferred)" are types that appear in the shipped .dat files as string values that the parser matches against a named set, but which are not exhaustively documented in the SDG Chapter 139 source extract. Their named values are inferred from the shipped asset set. The enums with explicit named-value tables below are those fully documented in Chapter 139.

EItemType: the complete item type catalog

EItemType is the enumeration that defines every possible item category in Unturned™. The Type field in every item .dat and .asset file must carry one of the 49 named values listed below. The integer index is the runtime dispatch key: when the engine reads Type Gun, it stores the integer 7 internally and dispatches the item to the gun-handling code path.

All 49 EItemType named values

IndexNamed ValueDescription
0HatHeadwear item (hats, helmets, caps).
1PantsLegwear item (pants, trousers, shorts).
2ShirtTorso clothing item (shirts, jackets, vests).
3MaskFace-worn item (masks, bandanas, gas masks).
4BackpackStorage item worn on the back.
5VestChest-worn storage or armor vest.
6GlassesEye-worn item (glasses, goggles, sunglasses).
7GunFirearm item (pistols, rifles, shotguns, launchers).
8SightAttachment: optical sight (red dot, scope, holographic).
9TacticalAttachment: tactical device (laser, rangefinder).
10GripAttachment: foregrip or bipod.
11BarrelAttachment: barrel device (suppressor, muzzle brake, compensator).
12MagazineAmmunition container (box magazine, drum, speedloader, tube).
13FoodConsumable: food item.
14WaterConsumable: water/drink item.
15MedicalConsumable: medical item (bandage, medkit, vaccine).
16MeleeMelee weapon (knife, sword, axe, bat, wrench).
17FuelConsumable: fuel canister for vehicles or generators.
18ToolMultipurpose tool item.
19BarricadePlaceable barricade item (spike trap, storage box, wire fence).
20StorageDedicated storage barricade item.
21BeaconPlaceable beacon/marker item.
22FarmPlaceable farming plot item.
23TrapPlaceable trap item (snare, landmine).
24StructurePlaceable structure item (wall, floor, roof piece).
25SupplySupply drop/crate item.
26ThrowableThrowable item (grenade, smoke, flare).
27GrowerFarming grower/planter item.
28OpticAlternative sight/optic attachment type.
29RefillRefillable consumable container (canteen, gas can).
30FisherFishing rod item.
31CloudCloud/spawn-region item.
32MapMap item (navigation map).
33KeyKey item (locked-door keycard, key).
34BoxLoot box/container item.
35Arrest_StartHandcuff item (applying arrest).
36Arrest_EndHandcuff release item (releasing arrest).
37TankVehicle fuel tank item.
38GeneratorPlaceable power generator item.
39DetonatorRemote detonator item for charges.
40ChargePlaceable explosive charge item.
41LibraryBlueprint library item.
42FilterGas mask filter consumable item.
43SentryPlaceable sentry gun item.
44Vehicle_Repair_ToolVehicle repair tool item.
45TireVehicle tire item.
46CompassNavigation compass item.
47Oil_PumpOil pump extraction item.
48Vehicle_Paint_ToolVehicle paint/repaint tool item.

The Type field in a .dat file carries one of these 49 values. The parser matches the string exactly (case-sensitive) and stores the corresponding integer index. The engine dispatches the asset to the correct loading and runtime code path based on the stored index.

Worked examples from shipped files

From Axe_Camp.dat (melee weapon):

Type Melee

The string Melee matches index 16 in the EItemType enum. The engine dispatches this asset through the ItemMeleeAsset loading path and attaches the UseableMelee script at runtime.

From Ace.dat (gun):

Type Gun

The string Gun matches index 7. The engine dispatches through the ItemGunAsset path.

From Classic_Alicepack.dat (backpack):

Type Backpack

The string Backpack matches index 4.

From CA_Biker_Mask_0.asset (mask):

Type Mask

The string Mask matches index 3. The .asset file uses the same Type field and the same enum value strings as .dat files.

EItemRarity: the rarity tier system

EItemRarity defines the six loot rarity tiers in Unturned™. The Rarity field in item .dat files controls the inventory highlight color and, indirectly, the loot table weight (when rarity is used as a spawn-weight shorthand). The rarity tier is displayed to players as a colored item name in the inventory UI.

All 6 EItemRarity named values

IndexNamed ValueUI ColorDescription
0CommonWhiteThe default and most frequently occurring rarity tier. Most vanilla items are Common.
1UncommonGreenModerately rare; a step above common in loot tables.
2RareBlueSignificantly rarer; typically reserved for mid-tier gear and specialty items.
3EpicPurpleHigh-tier rarity; powerful or specialized items.
4LegendaryPinkVery high-tier; top-end gear items with distinctive properties.
5MythicalRedThe highest rarity tier; reserved for exceptional, one-of-a-kind, or admin-only items.

EItemRarity versus Steam Economy item quality

The SDG documentation notes: "these are not the same as the item qualities used by Steam Economy items." The EItemRarity enum controls the in-game loot rarity tier and UI highlight color. The Steam Economy item quality system (which assigns qualities like Genuine, Vintage, Strange, Unusual to items for the Steam marketplace) is a separate system and is not controlled by the Rarity field. Do not confuse the two: a Rarity value of Epic does not make the item a Steam Economy Epic-quality marketable item.

Worked examples from shipped files

From Ace.dat:

Rarity Uncommon

The Ace pistol is Uncommon (index 1, green UI highlight). This is the standard rarity for a mid-tier pistol.

From Axe_Camp.dat:

(no Rarity field)

The camp axe .dat file does not include a Rarity field. The parser assigns the default enum value, which is Common (index 0, white). Many vanilla melee weapons omit the Rarity field and default to Common.

The Rarity field is optional; its absence produces the Common default. The cohort recommendation is to always include an explicit Rarity field for clarity, even if the value is Common.

ESlotType: the equipment slot system

ESlotType defines the equipment slots to which an item can be assigned. The Slot field in item .dat files determines where the item appears in the player's equipment bar and which hotkey is used to equip it.

All 5 ESlotType named values

Named ValueDescriptionTypical Usage
NoneDoes not correspond to any equipment slot. Equippable items can be hotkeyed but do not occupy a slot.Magazines, attachments, consumables, non-equippable items
PrimaryCorresponds to the primary equipment slot (first slot, typically key 1).Primary weapons (rifles, shotguns, two-handed melee)
SecondaryCorresponds to the secondary equipment slot (second slot, typically key 2). Usable from either the primary or secondary slot.Sidearms (pistols), one-handed melee, tools
TertiaryCorresponds to the tertiary equipment slot. This slot is only used by NPCs.NPC equipment assignments
AnyCorresponds to any/all item slots. Equippable from any slot or hotkeyed.Admin items, creative-mode tools

Worked examples from shipped files

From Axe_Camp.dat:

Slot Secondary

The camp axe is a one-handed melee weapon assigned to the secondary slot. It can be drawn with the secondary hotkey (typically key 2). The Slot Secondary value is the standard assignment for one-handed melee weapons and pistols.

From Ace.dat:

Slot Secondary

The Ace pistol is also Slot Secondary. As a sidearm, it is intended to occupy the secondary slot rather than the primary slot, which the player reserves for a rifle or primary weapon.

From magazine .dat files:

Slot None

Magazines use Slot None because they are not equippable items. They are loaded into a gun's magazine well, not into a player equipment slot. The None value signals to the engine that the item has no equipment slot assignment.

Slot None for non-equippable items

Items that are not meant to be equipped (magazines, attachments, consumables, crafting materials, barricade/structure items placed from the inventory) should use Slot None. Setting a non-equippable item to Slot Primary or Slot Secondary causes the game to display it in the equipment bar, which is confusing for players who will try to equip it and find that nothing happens.

EAssetType: the legacy asset category enum

EAssetType is used as a scope for legacy IDs. Each legacy ID is unique within its EAssetType category, which means two assets of different types can share the same legacy ID without collision. The EAssetType enum is primarily used in older game code and for maintaining backwards compatibility with pre-GUID asset systems.

All 11 EAssetType named values

IndexNamed ValueDescription
0NoneAsset type is not applicable.
1ItemAsset is an item.
2EffectAsset is an effect.
3ObjectAsset is an object (this includes NPC characters).
4ResourceAsset is a resource.
5VehicleAsset is a vehicle.
6AnimalAsset is an animal.
7MythicAsset is a mythical effect.
8SkinAsset is a skin.
9SpawnAsset is a spawn table.
10NPCAsset is related to NPCs (quests, vendors, dialogues).

EAssetType does not appear as a field in .dat or .asset files. It is used internally by the engine to partition the legacy ID namespace. A mod developer authoring items needs to be aware that two items with the same legacy ID but different EAssetType scopes (e.g., an Item with ID 100 and an Object with ID 100) do not collide in the legacy ID system, though the practice of reusing IDs across asset types is strongly discouraged even when technically permitted.

EBatteryMode: vehicle battery behavior

EBatteryMode determines how a vehicle's battery charge changes over time. This enum is used exclusively by vehicle assets and does not appear in item .dat files.

All 3 EBatteryMode named values

Named ValueDescription
NoneBattery charge remains unchanged (no drain, no charge).
BurnBattery charge depletes over time (the battery drains while the vehicle is active).
ChargeBattery charge replenishes over time (the battery recharges while the engine runs).

The EBatteryMode is configured in the vehicle asset's .dat file. The exact field name is documented in the vehicle asset reference article.

EItemOrigin: item spawn-source tracking

EItemOrigin tracks the source of a spawned item. This enum is used by the item spawning system and admin commands, not by item .dat files.

All 4 EItemOrigin named values

Named ValueDescription
WorldItem origin is the world (natural spawn, loot drop).
AdminItem origin is an admin command (@give).
CraftItem origin is crafting (built from a blueprint recipe).
NatureItem origin is nature (grown, harvested, or naturally occurring).

Server plugins and admin tools may use EItemOrigin to filter or track item spawns. Mod item .dat files do not configure EItemOrigin directly.

ELightingVision: night-vision and lighting modes

ELightingVision determines the lighting conditions applied when using vision-modifying items such as night-vision goggles or headlamps. Some assets may only support specific enumerators.

All 4 ELightingVision named values

Named ValueDescriptionAssociated Properties
NoneNo vision effect; normal lighting is used.,
MilitaryMilitary night-vision lighting. High-contrast green-tinted vision.Nightvision color: #507814, fog intensity: 0.25
CivilianCivilian night-vision lighting. Low-contrast gray-tinted vision.Nightvision color: #666666, fog intensity: 0.5
HeadlampHeadlamp lighting. Enables a toggleable light source.Allows PlayerSpotLightConfig properties for the forward-facing light beam

The vision mode is configured on applicable item assets (glasses, headlamps). The exact field name is documented in the specific asset type reference article.

ENPCHoliday: seasonal events and holidays

ENPCHoliday defines all of the game's recognized holidays and seasonal events. The start and end times for holidays are relative to the player's local time, meaning they are affected by timezones. The Lunar_New_Year holiday has automatically calculated start and end dates based on the Chinese calendar.

All 9 ENPCHoliday named values

Named ValueDescriptionDuration (2025 cycle)
NoneNo holiday or seasonal event.Always active (default state).
HalloweenHalloween holiday.October 20 (00:00) - November 1 (12:00)
ChristmasChristmas holiday, and other holidays within the festive season.December 7 (00:00) - January 2 (12:00)
April_FoolsApril Fools' Day.April 1 (00:00) - April 1 (23:59:59)
ValentinesValentine's Day.February 14 (00:00) - February 14 (23:59:59)
Pride_MonthPride Month (June).June 1 (00:00) - June 30 (23:59:59)
Lunar_New_YearLunar New Year.Varies; calculated as the day before Lunar New Year to 15 days after. (Example: January 28 - February 13, 2025)
Unturned_AnniversaryThe game's Steam release anniversary.July 7 (00:00) - July 7 (23:59:59)
MaxOnly used/implemented in the game's source code; no practical use for game assets.,

Some assets only support a subset of holidays. The SDG documentation specifically notes that "Landscape Material Assets only support Halloween, Christmas, and April Fools' Day." Holiday-restricted assets that specify an unsupported holiday may fail to activate or may display incorrectly.

EObjectChart: map chart-view rendering

EObjectChart determines how an object asset should appear when generating a map's chart view. Most enumerators correspond to a specific pixel coordinate on either the Height_Strip or Layer_Strip of a map's Charts.unity3d file.

All 12 EObjectChart named values

Named ValueDescription
NoneUse the default rendering for this asset type.
GroundUse (20, 0) from the Height_Strip.
IgnoreSkip this asset entirely; use whatever is underneath in the chart rendering.
HighwayUse (0, 0) from the Layer_Strip.
StreetUse (1, 0) from the Layer_Strip.
RoadUse (2, 0) from the Layer_Strip.
PathUse (3, 0) from the Layer_Strip.
LargeUse (15, 0) from the Layer_Strip.
MediumUse (16, 0) from the Layer_Strip.
WaterUse (0, 0) from the Height_Strip.
CliffUse (4, 0) from the Layer_Strip.

The EObjectChart enum is relevant for map authors configuring how custom objects appear on the in-game map. The pixel coordinate mappings reference the Charts.unity3d bundled asset that ships with the game.

EObjectType: object size categories

EObjectType defines the size categories for object assets. The size category affects collision detection, rendering LOD (level of detail), and placement behavior.

All 5 EObjectType named values

IndexNamed ValueDescription
0LargeLarge object (buildings, towers, major structures).
1MediumMedium object (walls, medium structures, vehicles).
2SmallSmall object (barricades, small props, furniture).
3NPCNPC object (characters, dialogue entities).
4DecalDecal object (surface decals, blood splatter, markings).

The EObjectType enum is used in object asset .dat files. Items do not use EObjectType; the item equivalent is EItemType.

Enum value representation in .dat files

All enum values in .dat files are represented as their named string. The parser matches the string against the enum's named values with a case-sensitive comparison.

Case sensitivity rules

Correct (PascalCase)IncorrectResult of incorrect
Type MeleeType meleeMatch fails; Type defaults to None (index 0) or the file fails to load
Rarity UncommonRarity uncommonMatch fails; Rarity defaults to Common (index 0)
Slot PrimarySlot primaryMatch fails; Slot defaults to None
Action_Primary SlashAction_Primary slashMatch fails; action defaults to first value
EBatteryMode BurnEBatteryMode burnMatch fails; battery mode defaults to None

The case-sensitivity rule is inviolable. Every shipped vanilla .dat file uses PascalCase for enum values. The cohort recommendation is to copy enum value strings exactly from the reference tables in this article or from the SDG documentation.

Default values

When an enum field is omitted from a .dat file, or when the supplied string does not match any named value, the parser assigns the enum's default value. For most Unturned™ enums, the default is the first named value (typically None or Common at index 0).

EnumDefault ValueBehavior When Defaulted
EItemTypeNone (index 0)Asset type is unknown; item may not load or behave unexpectedly
EItemRarityCommon (index 0)Item displays as white quality
ESlotTypeNoneItem has no equipment slot; cannot be equipped via hotkey
EAssetTypeNone (index 0)Asset type scope is unset; legacy ID resolution may fail
EObjectTypeNone (inferred)Object size category is unset
ELightingVisionNoneNo vision effect is applied

Silent enum mismatch

A case-mismatched enum string produces no error message at load time. The parser silently assigns the default enum value and continues loading. The mod functions, but with incorrect behavior , a melee weapon that should be Type Melee but loads as None will not have its melee script activated, and the player will not be able to swing it. The only indication is the incorrect runtime behavior. This is why enum case correctness is critical: the error is invisible until the player observes the wrong behavior.

The Type field and engine dispatch

The Type field in a .dat file is the most important enum value on any item asset. The Type value determines which asset class the engine uses to parse the remaining fields, which Useable script is attached to the item at runtime, and which code path handles the item's behavior when equipped, used, or dropped.

As shown in the flowchart above, the Type field is the dispatch switch. An incorrect Type value routes the asset through the wrong parser, which reads the wrong fields, attaches the wrong scripts, and produces behavior that is not just slightly wrong but entirely incorrect , a gun that is typed as Melee will not fire, and a melee weapon that is typed as Gun will try to load a non-existent magazine.

Complete enum reference table

The table below condenses every enum, every named value, and every integer index (where indexed) into a single lookup reference. Use this table for rapid field-authoring lookups.

EnumNamed Values (with indices where defined)
EAssetTypeNone(0), Item(1), Effect(2), Object(3), Resource(4), Vehicle(5), Animal(6), Mythic(7), Skin(8), Spawn(9), NPC(10)
EBatteryModeNone, Burn, Charge
EItemOriginWorld, Admin, Craft, Nature
EItemRarityCommon(0), Uncommon(1), Rare(2), Epic(3), Legendary(4), Mythical(5)
EItemTypeHat(0), Pants(1), Shirt(2), Mask(3), Backpack(4), Vest(5), Glasses(6), Gun(7), Sight(8), Tactical(9), Grip(10), Barrel(11), Magazine(12), Food(13), Water(14), Medical(15), Melee(16), Fuel(17), Tool(18), Barricade(19), Storage(20), Beacon(21), Farm(22), Trap(23), Structure(24), Supply(25), Throwable(26), Grower(27), Optic(28), Refill(29), Fisher(30), Cloud(31), Map(32), Key(33), Box(34), Arrest_Start(35), Arrest_End(36), Tank(37), Generator(38), Detonator(39), Charge(40), Library(41), Filter(42), Sentry(43), Vehicle_Repair_Tool(44), Tire(45), Compass(46), Oil_Pump(47), Vehicle_Paint_Tool(48)
ELightingVisionNone, Military, Civilian, Headlamp
ENPCHolidayNone, Halloween, Christmas, April_Fools, Valentines, Pride_Month, Lunar_New_Year, Unturned_Anniversary, Max
EObjectChartNone, Ground, Ignore, Highway, Street, Road, Path, Large, Medium, Water, Cliff
EObjectTypeLarge(0), Medium(1), Small(2), NPC(3), Decal(4)
ESlotTypeNone, Primary, Secondary, Tertiary, Any
EAction (inferred)Slash, Stab, Punch, Stomp
EFiremode (inferred)Safety, Semi, Auto, Burst
EUseableType (inferred)Melee, Gun, Throwable, Consume

Worked examples: enum values in shipped .dat files

Example 1: Full enum usage in a melee weapon (Axe_Camp.dat)

Type Melee              ← EItemType index 16
Useable Melee           ← EUseableType (inferred)
Slot Secondary          ← ESlotType

The camp axe .dat file demonstrates three enum values in three adjacent lines: the item type, the useable script handler, and the equipment slot. All three values are PascalCase strings matched against their respective enums by the parser.

Example 2: Enum usage in a gun (Ace.dat)

Type Gun                ← EItemType index 7
Rarity Uncommon         ← EItemRarity index 1
Useable Gun             ← EUseableType (inferred)
Slot Secondary          ← ESlotType
Safety                  ← EFiremode flag (inferred; presence = true)
Semi                    ← EFiremode flag (inferred; presence = true)
Action Trigger          ← enum (firearm action type)

The Ace .dat file demonstrates four enum value fields plus two enum-derived fire mode flag fields. The Safety and Semi fields use the presence/absence boolean convention (documented in C# Built-in Types Reference) but semantically represent EFiremode enum values.

Example 3: Clothing items (.asset files)

From CA_Biker_Mask_0.asset:

Type Mask               ← EItemType index 3

From a hat .asset file:

Type Hat                ← EItemType index 0

From a vest .asset file:

Type Vest               ← EItemType index 5

The .asset files use the same enum values as .dat files for the Type field. The parser applies the same enum matching logic regardless of the file extension.

Frequently asked questions

What happens if I type the wrong Type value for my item?

The engine reads the Type field, matches it against the EItemType enum, and dispatches the asset through the parser associated with that type. If you write Type Gun on a melee weapon, the engine parses the file using the ItemGunAsset parser, which looks for gun-specific fields (Caliber, Firerate, Magazine) that do not exist in the file, and ignores melee-specific fields (Damage_Resource, TwoHanded, RepairTool) that do exist. The weapon fails to load correctly and does not function as intended. Always set Type to the correct enum value for your item.

Can I make up my own enum value?

No. The parser's enum matching works only against the named values defined in the game's compiled assemblies. A value like Type CustomWeapon that does not exist in any EItemType named value fails to match. The parser assigns the enum default (None, index 0) and the asset fails to load in the intended category. Custom item behavior must be implemented through the existing item types (Gun, Melee, etc.) paired with custom fields and prefab configurations; there is no mechanism for adding new enum values through mod .dat files.

Why are some enum values spelled with underscores?

The enum named values use underscores in place of spaces because C# identifiers cannot contain spaces. Arrest_Start, Arrest_End, Vehicle_Repair_Tool, Vehicle_Paint_Tool, Lunar_New_Year, Unturned_Anniversary, April_Fools, Pride_Month, and Oil_Pump all use underscores. This is a C# naming convention, not a .dat file formatting requirement. Mod developers must use the exact underscored form in .dat files; the parser compares strings character-by-character.

Do I need the E prefix when typing enum values in .dat files?

No. The E prefix (EItemType, EAssetType, etc.) is the C# type name used in the game's source code and in the SDG documentation. .dat files use only the named value string (e.g., Melee, Gun, Common), not the enum type name. The parser resolves the Type field to the EItemType enum based on the field name (Type), not based on a prefix in the value string.

Is there an enum for caliber values?

No. Caliber values in Unturned™ are plain uint16 integers (documented in C# Built-in Types Reference), not an enumerated type. A mod developer assigns a custom integer caliber ID to a gun (Caliber 5001) and to compatible magazines (Caliber_Reference 5001). The caliber ID is not restricted to a predefined enum of valid values. The vanilla caliber IDs (1 through 9 and 14) are convention, not enforcement , any uint16 value is a valid caliber ID. There is no ECaliber enum.

How do I know which enum a particular .dat field maps to?

The field-to-enum mapping is documented in the field reference for each asset type. The general pattern: Type maps to EItemType, Rarity maps to EItemRarity, Slot maps to ESlotType, Action_Primary and Action_Secondary map to an inferred action enum, and fire mode flag fields (Safety, Semi, Auto) map to an inferred fire mode enum. The specific mapping for every field is documented in the asset type's article in the items section of the knowledge base.

Can two enum values map to the same integer index?

No. In C#, each named value in an enum must map to a unique underlying integer value (unless explicitly aliased with a duplicate value, which the Unturned™ enums do not use). Each named value in the tables above corresponds to exactly one integer index, and each integer index corresponds to exactly one named value.

How are enum values stored in the game's memory?

At runtime, enum values are stored as their underlying integer type (typically int). The string names exist only in the compiled metadata and during the parse phase. When the parser reads Type Melee, it performs the string match, stores the integer 16 in the asset's type field, and discards the string. All subsequent code that checks the asset type compares integers, not strings. This means the integer indices are the definitive identity for enum values at runtime even though mod developers interact with enum values exclusively through their string names.

Can an enum value have a different name than its string representation in the .dat file?

No. The string representation in the .dat file is the enum's named value, and the named value is the string. There is no separate display name or translation layer for enum values. The string Melee in a .dat file is the exact C# identifier Melee in the EItemType enum.

What should I do if I don't know which Rarity to assign?

Use the default: Common (white). If you omit the Rarity field entirely, the parser assigns Common, which is a safe default for most items. The rarity tier should match the item's intended role in the loot economy: Common for frequently found items, Uncommon for moderately scarce upgrades, Rare for significant finds, Epic for high-tier gear, Legendary for exceptionally powerful items, and Mythical for one-of-a-kind or admin-only items. The rarity tier choice is a balance decision; consult your mod's design document or the intended server's loot configuration.

Best practices

  • Always use the exact PascalCase spelling for enum values as documented in this article. Copy from the reference tables to avoid typos.
  • Include an explicit Rarity field even when the value is Common , an explicit field is self-documenting and avoids ambiguity for future maintainers.
  • Verify the Type field against the EItemType table before testing. A mistyped Type is the most common enum-related error and produces confusing behavior.
  • Use Slot None for all non-equippable items (magazines, attachments, consumables, barricades, structures).
  • Use Slot Secondary for sidearms and one-handed tools; use Slot Primary for rifles, shotguns, and two-handed weapons.
  • When authoring blueprint recipes, use enum values exactly as shown in the shipping asset set (Operation RepairTargetItem, not variants).
  • Test enum values in single-player: a case-mismatched enum produces no error message, so the only detection method is functional testing.
  • Bookmark the enum reference table in Appendix A of this article for fast lookups during authoring sessions.

Appendix A: Enum quick-reference card

FieldEnum TypeValid Values (most common)
TypeEItemTypeGun, Melee, Magazine, Hat, Pants, Shirt, Mask, Backpack, Vest, Glasses, Sight, Tactical, Grip, Barrel, Food, Water, Medical, Fuel, Tool, Barricade, Storage, Beacon, Farm, Trap, Structure, Supply, Throwable, Grower, Optic, Refill, Fisher, Cloud, Map, Key, Box, Arrest_Start, Arrest_End, Tank, Generator, Detonator, Charge, Library, Filter, Sentry, Vehicle_Repair_Tool, Tire, Compass, Oil_Pump, Vehicle_Paint_Tool
RarityEItemRarityCommon, Uncommon, Rare, Epic, Legendary, Mythical
SlotESlotTypeNone, Primary, Secondary, Tertiary, Any
Useable(inferred)Melee, Gun, Throwable, Consume
Action_Primary(inferred)Slash, Stab, Punch, Stomp (melee); Trigger, Bolt, Pump, Break, Minigun (gun)
Action_Secondary(inferred)Same action values as Action_Primary
Fire mode flags(inferred)Safety, Semi, Auto, Burst (presence/absence flag convention)

Appendix B: Enum integer index cross-reference for EItemType

For server plugin developers and advanced mod authors who need to reference item types by their integer index in code:

IndexNamed ValueIndexNamed ValueIndexNamed Value
0Hat17Fuel34Box
1Pants18Tool35Arrest_Start
2Shirt19Barricade36Arrest_End
3Mask20Storage37Tank
4Backpack21Beacon38Generator
5Vest22Farm39Detonator
6Glasses23Trap40Charge
7Gun24Structure41Library
8Sight25Supply42Filter
9Tactical26Throwable43Sentry
10Grip27Grower44Vehicle_Repair_Tool
11Barrel28Optic45Tire
12Magazine29Refill46Compass
13Food30Fisher47Oil_Pump
14Water31Cloud48Vehicle_Paint_Tool
15Medical32Map,,
16Melee33Key,,

Appendix C: External references

ResourceURLNotes
Smartly Dressed Games modding documentationhttps://docs.smartlydressedgames.com/en/stable/Chapter 139: Enumerated Types; official enum documentation
Unturned on Steamhttps://store.steampowered.com/app/304930/Unturned/Game page and changelog
C# Built-in Types Reference/data-types/csharp-built-in-types-referenceThe previous article in this section; covers the integer types that store enum values
GUID Type Reference/data-types/guid-type-referenceThe previous article; covers the GUID type used alongside enum identity fields
Item Asset Anatomy/items/item-asset-anatomyShared fields on every item asset, including Type, Rarity, and Slot enums
Melee Asset Reference/items/melee-assetFull melee weapon field reference, including Action_Primary and Action_Secondary enum usage
Magazine Asset Reference/items/magazine-assetMagazine field reference, including Type Magazine enum usage
Asset Definitions Reference/items/asset-definitions-referenceAsset structure, header/body separation, and loading order

Document history

VersionDateAuthorNotes
1.02026-07-2657 StudiosInitial publication. Complete enumerated types reference covering all 23 enum types, 49 EItemType values, 6 EItemRarity tiers, 5 ESlotType slots, and every other documented enum with named values, indices, and worked examples from shipped files.

Cross-references

Authoring checklist

Before publishing a .dat file, confirm the following enum-correctness checks:

  • [ ] The Type field value matches exactly one of the 49 EItemType named values (PascalCase, case-sensitive)
  • [ ] The Rarity field (if present) matches exactly one of the 6 EItemRarity named values
  • [ ] The Slot field (if present) matches exactly one of the 5 ESlotType named values
  • [ ] The Useable field (if present) matches exactly one of the recognized useable type strings
  • [ ] Action fields (Action_Primary, Action_Secondary, if present) use valid action type strings
  • [ ] Fire mode flag fields (Safety, Semi, Auto, Burst) use the presence/absence flag convention
  • [ ] Enum value strings do not contain trailing whitespace or invisible characters
  • [ ] The file has been tested in single-player: item spawns, equips, and functions with the intended behavior
  • [ ] For items that are not equippable, Slot is set to None
  • [ ] The item's Type is consistent with the item's prefab, bundle, and behavior expectations