ItemMaskAsset — Mask Clothing Definition
Overview
ItemMaskAsset defines a wearable mask/face item in Unturned. It inherits from ItemGearAsset (hair/beard override), which inherits from ItemClothingAsset (armor, proof system, movement speed), which inherits from ItemAsset. Masks occupy the EItemType.MASK slot and provide several unique features beyond basic clothing: earpiece radio functionality, gas mask filter degradation rate, and (for PRO items) mythic cosmetic aura preview.
Masks load a "Mask" 3D prefab from the master bundle and provide it through the ClothingPrefab virtual property. Unlike hats, shirts, pants, and vests, masks are not eligible for armor damage reduction in the BuildDescription system — even if an Armor value is set in the .dat file, it does not apply to incoming damage.
Source code location: Unturned/Bundles/ItemMaskAsset.cs (96 lines), inheriting from ItemGearAsset.cs (88 lines), ItemClothingAsset.cs (304 lines), and ItemAsset.cs (base).
Inheritance Chain
ItemAsset
└─ ItemClothingAsset (abstract) — armor (not applied to MASK), proof, movement speed, visuals
└─ ItemGearAsset (abstract) — hair/beard override, legacy Hair/Beard flags
└─ ItemMaskAsset — mask prefab, earpiece, filter degradation, mythic previewClass Definition
csharp
public class ItemMaskAsset : ItemGearAsset
{
protected GameObject _mask;
public GameObject mask => _mask;
private bool _isEarpiece;
public bool isEarpiece => _isEarpiece;
public float FilterDegradationRateMultiplier { get; protected set; } = 1.0f;
#if UNITY_EDITOR || DEVELOPMENT_BUILD
public ushort cosmeticPreviewMythicId;
#endif
}Mask Prefab Loading
csharp
if (!Dedicator.IsDedicatedServer)
{
_mask = loadRequiredAsset<GameObject>(p.bundle, "Mask");
if (Assets.shouldValidateAssets)
{
AssetValidation.ValidateLayersEqual(this, _mask, LayerMasks.ENEMY);
AssetValidation.ValidateClothComponents(this, _mask);
}
}| Aspect | Detail |
|---|---|
| Load key | "Mask" GameObject from master bundle |
| Required | Yes — loadRequiredAsset fails if missing |
| Server skip | Dedicated server skips prefab (visual only) |
| Layer validation | All children must be on ENEMY layer |
| Cloth validation | Warns about misconfigured Cloth components |
The ClothingPrefab override returns the mask:
csharp
internal override GameObject ClothingPrefab => mask;Earpiece Functionality
csharp
if (isPro)
{
// mythic preview (see below)
}
else
{
_isEarpiece = p.data.ContainsKey("Earpiece");
}The Earpiece flag enables radio earpiece functionality. When isEarpiece is true:
- The mask acts as a radio receiver
- Players can hear voice chat from their group without needing a separate radio item
- The mask occupies the face slot, freeing up inventory space
| Property | Detail |
|---|---|
.dat key | Earpiece (flag — presence enables it) |
| PRO restriction | Only available on non-PRO items |
| Default | false |
PRO restriction: Earpiece functionality is gated behind non-PRO items. If isPro is true, the _isEarpiece field is never read — it remains false regardless of the .dat file. This prevents cosmetic-only mask items from providing gameplay functionality.
Description display:
csharp
if (isEarpiece)
{
builder.Append(PlayerDashboardInventoryUI.FormatStatColor(
PlayerDashboardInventoryUI.localization.format("ItemDescription_Clothing_Earpiece"), true),
DescSort_ClothingStat + DescSort_Beneficial);
}The earpiece stat appears as a beneficial (green) stat in the inventory tooltip.
Filter Degradation Rate Multiplier
csharp
public float FilterDegradationRateMultiplier { get; protected set; } = 1.0f;This field controls how quickly deadzones deplete a gas mask filter's quality:
| .dat Key | Type | Default | Range | Behavior |
|---|---|---|---|---|
FilterDegradationRateMultiplier | float | 1.0 | 0.0+ | 2.0 = doubles depletion speed, 0.5 = halves it |
A value above 1.0 causes filters to deplete faster (worse mask), below 1.0 causes slower depletion (better mask). This allows tiered gas mask items: a basic cloth mask might have FilterDegradationRateMultiplier 2.0 (depletes twice as fast), while a high-end military gas mask might have 0.5 (lasts twice as long).
Description display:
csharp
if (FilterDegradationRateMultiplier != 1.0f)
{
builder.Append(PlayerDashboardInventoryUI.localization.format(
"ItemDescription_FilterDegradationRateMultiplier",
PlayerDashboardInventoryUI.FormatStatModifier(FilterDegradationRateMultiplier, true, false)),
DescSort_ClothingStat + DescSort_LowerIsBeneficial(FilterDegradationRateMultiplier));
}The stat is formatted with LowerIsBeneficial sorting — lower multiplier values are better (filter lasts longer).
PRO Mythic Cosmetic Preview
csharp
#if UNITY_EDITOR || DEVELOPMENT_BUILD
public ushort cosmeticPreviewMythicId;
#endifThe mythic cosmetic preview ID is a compile-time conditional field only available in UNITY_EDITOR or DEVELOPMENT_BUILD configurations:
csharp
if (isPro)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
cosmeticPreviewMythicId = p.data.ParseUInt16("CosmeticPreviewMythicId");
#endif
}| .dat Key | Type | Condition | Purpose |
|---|---|---|---|
CosmeticPreviewMythicId | ushort | PRO + Editor/Dev build only | Mythic item ID for aura preview |
This field is a development hack for previewing the "aura" visual effect of mythic cosmetic items. It is not present in release builds and has no gameplay effect. The field stores the MythicAsset ID for use in the editor cosmetic preview system.
Armor — Not Applied to Masks
A critical distinction: masks are excluded from the armor system in BuildDescription:
csharp
if (type == EItemType.HAT || type == EItemType.SHIRT || type == EItemType.PANTS || type == EItemType.VEST)
{
if (_armor != 1.0f) { /* show armor */ }
}The type check only includes HAT, SHIRT, PANTS, and VEST. Even if a mask .dat file sets Armor 0.5, the armor value:
- Is still parsed and stored (in
_armor) - Is NOT displayed in the inventory tooltip
- Does NOT reduce incoming damage at runtime
The armor field is set by ItemClothingAsset.PopulateAsset regardless of slot type, but the game only applies it for the four eligible types. This design quirk means masks can have an armor value in the data that is silently ignored by the gameplay systems.
Inherited Behavior: ItemGearAsset
Hair and Beard Override
Masks can replace the character's hair and beard materials, though this is less common for masks than for hats:
| .dat Key | Type | Purpose |
|---|---|---|
Hair_Override | string | Child mesh body to replace with hair material |
Hair_Override_NonGoldColor | Color32? | Non-Gold hair color fallback |
Beard_Override | string | Child mesh body to replace with beard material |
Beard_Override_NonGoldColor | Color32? | Non-Gold beard color fallback |
Legacy Hair/Beard Keys
csharp
hairVisible = p.data.ContainsKey("Hair");
beardVisible = p.data.ContainsKey("Beard");The legacy Hair and Beard keys control visibility. Most masks should hide both (the mask covers the face), so a typical mask sets neither Hair nor Beard in the .dat. The base ItemClothingAsset defaults hairVisible and beardVisible to true via Hair_Visible/Beard_Visible.
Inherited Behavior: ItemClothingAsset
Proof System
Masks are the most common carrier of proof flags. A gas mask with Proof_Radiation is the primary radiation protection item. A firefighter's mask with Proof_Fire provides burn immunity.
Movement Speed
Masks can modify movement speed. Heavy gas masks might slow the player, while lightweight face wraps might provide a minor speed bonus.
Wear Audio
Masks default to the sleeve rustle sound (not zipper):
csharp
wearAudio = new AudioReference("core.masterbundle", "Sounds/Sleeve.mp3");Cosmetic Priority
Masks use the default cosmetic priority (GetDefaultTakesPriorityOverCosmetic returns false). The cosmetic mask takes priority over the real mask unless Priority_Over_Cosmetic is explicitly set in the .dat. Unlike ItemGlassesAsset, masks do not override this based on any functional property.
PopulateAsset Call Chain
ItemAsset.PopulateAsset
└─ ItemClothingAsset.PopulateAsset — armor (stored, not applied), proof, movement, visuals
└─ ItemGearAsset.PopulateAsset — hair/beard flags, hair/beard override
└─ ItemMaskAsset.PopulateAsset
├─ FilterDegradationRateMultiplier (always parsed)
├─ Load "Mask" prefab (client only)
├─ Layer + cloth validation (if validateAssets)
├─ PRO path: cosmeticPreviewMythicId (editor/dev only)
└─ Non-PRO path: _isEarpiece flagBuildCargoData — Wiki Export
Masks contribute to three Cargo tables:
Clothing table (from ItemClothingAsset)
GUID, Armor (stored but not applied), Armor_Explosion, Falling_Damage_Multiplier, Proof_Water, Proof_Fire, Proof_Radiation, Prevents_Falling_Broken_Bones, Movement_Speed_Multiplier, Mirror_Left_Handed_Model, Priority_Over_Cosmetic.
Gear table (from ItemGearAsset + ItemMaskAsset override)
csharp
CargoDeclaration data = builder.GetOrAddDeclaration("Gear");
data.Append("GUID", GUID);
data.Append("FilterDegradationRateMultiplier", FilterDegradationRateMultiplier);
data.Append("Earpiece", isEarpiece);Note: ItemMaskAsset overrides BuildCargoData to add mask-specific columns to the Gear table. It does NOT create a new table — it appends to the Gear table that ItemGearAsset already declared. This means the Gear table for masks contains: Hair (from ItemGearAsset), Beard (from ItemGearAsset), FilterDegradationRateMultiplier, and Earpiece.
.dat File Reference — Mask-Specific
| .dat Key | Type | Default | Category |
|---|---|---|---|
Armor | float | 1.0 | Stored but NOT applied for masks |
Armor_Explosion | float | equals Armor | Stored but NOT applied |
Falling_Damage_Multiplier | float | 1.0 | Fall damage |
Proof_Water | flag | — | Water breathing |
Proof_Fire | flag | — | Fire immunity |
Proof_Radiation | flag | — | Radiation immunity |
Prevents_Falling_Broken_Bones | bool | false | No fall bone breaks |
Movement_Speed_Multiplier | float | 1.0 | Movement speed |
Hair_Visible | bool | true | Show hair through mask |
Beard_Visible | bool | true | Show beard through mask |
Visible_On_Ragdoll | bool | true | Visible on death |
Mirror_Left_Handed_Model | bool | true | Mirror model |
Earpiece | flag | — | Radio earpiece (non-PRO only) |
FilterDegradationRateMultiplier | float | 1.0 | Filter depletion rate |
CosmeticPreviewMythicId | ushort | 0 | PRO mythic preview (editor only) |
Master Bundle Asset Requirements
| Bundle Key | Type | Required | Purpose |
|---|---|---|---|
"Mask" | GameObject | Required | 3D mask prefab with SkinnedMeshRenderer |
"CosmeticPreviewOverride" | GameObject | Optional (PRO) | PRO cosmetic preview model |
Modding Example — Basic Gas Mask .dat
ini
GUID a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
Type Mask
Rarity Rare
Size_X 2
Size_Y 2
Proof_Radiation
FilterDegradationRateMultiplier 1.0
Hair_Visible false
Beard_Visible falseCreates a standard gas mask that:
- Provides radiation immunity (deadzone protection)
- Depletes filters at standard rate (1.0×)
- Hides hair and beard
- Rare rarity
Modding Example — Military Gas Mask with Earpiece .dat
ini
GUID f1e2d3c4b5a69788796a5b4c3d2e1f0a
Type Mask
Rarity Epic
Size_X 2
Size_Y 2
Proof_Radiation
Proof_Fire
Earpiece
FilterDegradationRateMultiplier 0.5
Movement_Speed_Multiplier 0.95
Hair_Visible false
Beard_Visible falseCreates a high-end military gas mask with:
- Both radiation AND fire immunity
- Earpiece radio functionality
- Filters last twice as long (0.5× rate)
- Slight 5% movement penalty for the heavy mask
Modding Example — Simple Bandana .dat
ini
GUID d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9
Type Mask
Rarity Common
Size_X 1
Size_Y 1
Hair_Visible trueCreates a simple face covering with:
- No proof flags (no gameplay function)
- No filter mechanics
- Hair still visible (bandana doesn't cover head)
- 1×1 inventory size
Common Issues
Armor not applying: Masks are excluded from the armor system. Setting
Armor 0.5in a mask.datstores the value but it never reduces damage. Use proof flags instead for mask protection.Earpiece not working on PRO mask: The
Earpieceflag is gated behind non-PRO items. PRO (cosmetic-only) masks ignore theEarpiecekey entirely.Filter depleting too fast/slow: The
FilterDegradationRateMultipliermultiplies the base depletion rate. At2.0, a filter depletes twice as fast. At0.5, it lasts twice as long. A value of0would mean infinite filter (though the game engine may handle this edge case unexpectedly).Mask clipping with hair: Set
Hair_Visible falseandBeard_Visible falseif the mask covers the full face. Hair and beard visibility defaults totruefromItemClothingAsset.Mythic preview ID in release builds:
CosmeticPreviewMythicIdis only available in editor/development builds. It has no effect in release builds and will not be parsed.Layer rendering issues: Like hats, masks should be on the
ENEMYlayer. Run-ValidateAssetsto check layer assignments.
Document history
| Version | Date | Author | Notes |
|---|---|---|---|
| 1.0 | 2026-07-28 | 57 Studios | Initial publication. Full mask asset documentation including earpiece, filter degradation, mythic preview, and armor exclusion. |
