Skip to content

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 preview

Class 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);
    }
}
AspectDetail
Load key"Mask" GameObject from master bundle
RequiredYes — loadRequiredAsset fails if missing
Server skipDedicated server skips prefab (visual only)
Layer validationAll children must be on ENEMY layer
Cloth validationWarns 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
PropertyDetail
.dat keyEarpiece (flag — presence enables it)
PRO restrictionOnly available on non-PRO items
Defaultfalse

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 KeyTypeDefaultRangeBehavior
FilterDegradationRateMultiplierfloat1.00.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;
#endif

The 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 KeyTypeConditionPurpose
CosmeticPreviewMythicIdushortPRO + Editor/Dev build onlyMythic 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 KeyTypePurpose
Hair_OverridestringChild mesh body to replace with hair material
Hair_Override_NonGoldColorColor32?Non-Gold hair color fallback
Beard_OverridestringChild mesh body to replace with beard material
Beard_Override_NonGoldColorColor32?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 flag

BuildCargoData — 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 KeyTypeDefaultCategory
Armorfloat1.0Stored but NOT applied for masks
Armor_Explosionfloatequals ArmorStored but NOT applied
Falling_Damage_Multiplierfloat1.0Fall damage
Proof_WaterflagWater breathing
Proof_FireflagFire immunity
Proof_RadiationflagRadiation immunity
Prevents_Falling_Broken_BonesboolfalseNo fall bone breaks
Movement_Speed_Multiplierfloat1.0Movement speed
Hair_VisiblebooltrueShow hair through mask
Beard_VisiblebooltrueShow beard through mask
Visible_On_RagdollbooltrueVisible on death
Mirror_Left_Handed_ModelbooltrueMirror model
EarpieceflagRadio earpiece (non-PRO only)
FilterDegradationRateMultiplierfloat1.0Filter depletion rate
CosmeticPreviewMythicIdushort0PRO mythic preview (editor only)

Master Bundle Asset Requirements

Bundle KeyTypeRequiredPurpose
"Mask"GameObjectRequired3D mask prefab with SkinnedMeshRenderer
"CosmeticPreviewOverride"GameObjectOptional (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 false

Creates 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 false

Creates 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 true

Creates 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

  1. Armor not applying: Masks are excluded from the armor system. Setting Armor 0.5 in a mask .dat stores the value but it never reduces damage. Use proof flags instead for mask protection.

  2. Earpiece not working on PRO mask: The Earpiece flag is gated behind non-PRO items. PRO (cosmetic-only) masks ignore the Earpiece key entirely.

  3. Filter depleting too fast/slow: The FilterDegradationRateMultiplier multiplies the base depletion rate. At 2.0, a filter depletes twice as fast. At 0.5, it lasts twice as long. A value of 0 would mean infinite filter (though the game engine may handle this edge case unexpectedly).

  4. Mask clipping with hair: Set Hair_Visible false and Beard_Visible false if the mask covers the full face. Hair and beard visibility defaults to true from ItemClothingAsset.

  5. Mythic preview ID in release builds: CosmeticPreviewMythicId is only available in editor/development builds. It has no effect in release builds and will not be parsed.

  6. Layer rendering issues: Like hats, masks should be on the ENEMY layer. Run -ValidateAssets to check layer assignments.

Document history

VersionDateAuthorNotes
1.02026-07-2857 StudiosInitial publication. Full mask asset documentation including earpiece, filter degradation, mythic preview, and armor exclusion.