Barrel Asset Reference
Intermediate40-60 minutesWindowsNotepad++Unity Editor
The barrel attachment is the single most statistically powerful attachment slot in the Unturned™ modding ecosystem. Where sight attachments improve target acquisition and grip attachments refine handling, barrel attachments can simultaneously alter a weapon's audio signature, visual muzzle behavior, ballistic trajectory, recoil pattern, spread profile, and effective engagement range through a single .dat file that is typically fewer than twenty lines long. Despite this outsized effect on weapon behavior, the barrel attachment is also one of the most frequently misconfigured asset types in the Workshop, with errors ranging from accidentally omitting the Silenced flag on a suppressor to incorrectly assigning caliber compatibility values that lock the attachment to an unintended weapon family.
This article is the 57 Studios™ canonical reference for the ItemBarrelAsset class. It documents every barrel-specific .dat field drawn from the official Smartly Dressed Games documentation, every inherited field that the barrel asset type carries forward from its base classes, the complete caliber compatibility mechanism that controls which guns accept which barrel attachments, the behavioral distinction between the Braked and Silenced flags, the durability degradation system, the Gunshot_Rolloff_Distance_Multiplier field and its interaction with the gun's audio rolloff model, the Volume multiplier and its relationship to suppressed and unsuppressed fire, the Hook_Barrel placement requirements on the weapon prefab, a full set of worked .dat examples covering every common barrel archetype, and a diagnostic table that maps symptoms to root causes for every failure mode the cohort has encountered. Modders who read this article in its entirety will be able to author, configure, debug, and balance any barrel attachment the game supports, from a simple flash hider to a custom suppressor with a unique suppressed audio profile.

Documentation source: The barrel-specific field definitions in this article are drawn from Chapter 21 ("Barrel Assets") of the official Smartly Dressed Games modding documentation. The inherited fields from the
ItemAssetandCaliberAssetbase classes are documented against those classes' respective chapters and cross-verified against shipped game files. Field behaviors are validated against the 57 Studios cohort's published modding practice.
Prerequisites
Before reading this article you should be familiar with the following topics. If any of these are new, read the linked article first and then return here.
- The base
ItemAssetclass and its universal fields:ID,GUID,Type,Rarity,Slot,Size_X,Size_Y. See Item Asset Anatomy for the complete reference. - The
CaliberAssetclass and its inherited ballistic fields:Ballistic_Drop,Ballistic_Steps. See Caliber Asset for the complete reference. - The attachment slot system and how guns declare which slots they support. See Attachment Slots for the slot configuration overview.
- The
.datfile format including comment syntax, key-value pairs, and the float/flag/uint8 type system. See Data File Format Reference for the format specification. - The master bundle export workflow for packaging attachment prefabs into the game's asset bundle system. See Master Bundle Export for the bundling workflow.
What you will learn
- The complete class hierarchy for
ItemBarrelAssetand how it inherits fields fromCaliberAssetandItemAsset. - The five barrel-specific
.datfields from the official SDG documentation:Braked,Durability,Gunshot_Rolloff_Distance_Multiplier,Silenced, andVolume. - How the
Brakedflag redirects muzzle flash and distinguishes muzzle brakes and compensators from other barrel attachment types. - How the
Silencedflag suppresses alert generation, switches the audio category, and interacts with theVolumemultiplier. - How
Durabilityas a uint8 value governs per-shot quality degradation and when the quality bar is displayed on the item icon. - How
Gunshot_Rolloff_Distance_Multiplierextends or contracts the distance over which gunshot audio attenuates to silence. - How the
Volumemultiplier functions independently of theSilencedflag and what happens when both are set. - How ballistic modifier fields (
Spread,Ballistic_Drop,Ballistic_Steps) inherited from theCaliberAssetclass override the gun's corresponding values while the barrel is equipped. - How recoil modifier fields (
Recoil_X,Recoil_Y) adjust the weapon's horizontal and vertical recoil pattern. - How the caliber compatibility system (
Caliberfield matching) controls which guns accept each barrel attachment. - How
Hook_Barrelmust be positioned on the weapon prefab for correct visual attachment. - A complete set of worked
.datexamples covering suppressors, muzzle brakes, compensators, flash hiders, and barrel extensions. - A diagnostic table for every common barrel attachment failure mode.
Background: the barrel attachment system
A barrel attachment in Unturned™ is an inventory item of type Barrel that, when equipped to a weapon's barrel slot, applies a set of modifier fields to the weapon's runtime behavior. The attachment is defined in a .dat file whose fields are read at game load time by the ItemBarrelAsset class. The game engine applies the attachment's modifier values as multipliers or overrides on the weapon's own statistical values at the moment the weapon fires.
The class hierarchy for a barrel attachment is as follows:
ItemAsset
└── CaliberAsset
└── ItemBarrelAssetItemAsset provides the universal fields that every inventory item requires: identity (ID and GUID), classification (Type), rarity (Rarity), slot behavior (Slot), and inventory footprint (Size_X, Size_Y). CaliberAsset provides the ballistic configuration fields that were originally part of the barrel attachment system but were subsequently promoted to a shared class: Ballistic_Drop and Ballistic_Steps, which govern projectile trajectory, as well as caliber compatibility and damage fields that are shared with other asset types. ItemBarrelAsset provides the five fields that are exclusive to barrel attachments: Braked, Durability, Gunshot_Rolloff_Distance_Multiplier, Silenced, and Volume.
The diagram above shows the three-level inheritance chain that every barrel attachment passes through at load time. Each level contributes its own field set, and the resulting composite configuration is what governs the attachment's in-game behavior. A field defined at a higher level (for example, ID on ItemAsset) is available to the barrel attachment without being declared in the ItemBarrelAsset-specific field set.
The barrel attachment does not exist in isolation. It depends on the weapon prefab providing a Hook_Barrel GameObject at the muzzle position. If this hook is missing, the barrel attachment's 3D model will not render on the weapon even though the attachment equips successfully in the inventory system. The attachment's visual model extends forward along the hook's forward (Z) axis from the Hook_Barrel position, which means the hook must be placed at the physical barrel exit, not at the midpoint of the barrel geometry.
How modifier values compose
When a barrel attachment is equipped, the game engine reads the attachment's modifier fields and applies them as multiplicative factors on the weapon's base values. The attachment's Spread value multiplies the weapon's Spread_Hip and Spread_Aim values at the time of firing. The attachment's Recoil_X and Recoil_Y values multiply the weapon's horizontal and vertical recoil per shot. The attachment's Ballistic_Drop and Ballistic_Steps values fully override the weapon's corresponding ballistic simulation parameters rather than multiplying them. This override behavior means that a barrel extension that increases ballistic steps provides a flat improvement to trajectory simulation quality regardless of the weapon's base ballistic configuration.
Values of 1.0 for float-type modifier fields produce no change from the weapon's base behavior. Values below 1.0 reduce the corresponding statistic (tighter spread, less recoil). Values above 1.0 increase the statistic (wider spread, more recoil). The Braked and Silenced flags operate as toggles whose effects are applied when the flag is present regardless of the numeric values of other fields.
Barrel-specific .dat fields
The five fields listed in this section are exclusive to the ItemBarrelAsset class. They appear in no other asset type. These fields are the minimum configuration surface that distinguishes a barrel attachment from a generic attachment of another slot type. Every barrel attachment must declare at least one of these five fields to justify its existence as a barrel attachment; an attachment that has Type Barrel but sets none of these fields will equip and render but will produce no behavioral change to the weapon.
Braked
The Braked field is a flag, meaning it takes no value. Its presence in the .dat file is sufficient to activate the behavior. When Braked is present, the engine hides the weapon's muzzle flash visual effect. This is the defining characteristic of a muzzle brake or compensator: the propellant gasses are redirected to reduce muzzle rise, and the visible flash at the muzzle is suppressed as a side effect of the gas redirection. The field is absent by default, and its absence means the weapon's configured muzzle flash renders normally.
The Braked flag is typically paired with Recoil_X and Recoil_Y values below 1.0 to model the mechanical effect of redirecting propellant gasses counteracting the weapon's recoil impulse. A standard muzzle brake in the vanilla balance scheme uses Recoil_X 0.75 and Recoil_Y 0.85; a compensator that prioritizes horizontal recoil reduction uses Recoil_X 0.80 and Recoil_Y 0.80. The Braked flag itself does not apply any recoil modification -- it only controls the muzzle flash visibility. All recoil modification is accomplished through the numeric Recoil_X and Recoil_Y fields.
Silenced
The Silenced field is a flag, like Braked, that takes no value. When Silenced is present, two effects occur at runtime. First, the weapon's fire audio category is switched from its configured Shoot category to the engine's internal suppressed audio category, which produces a quieter, lower-pitched report. Second, the weapon generates no alerts -- zombie characters, animal NPCs, and other entities that would normally respond to gunfire within their detection radius will not receive an alert event when the weapon fires with a Silenced attachment equipped.
The Silenced flag does not automatically reduce the fire volume to zero. It switches the audio category, and the suppressed audio category has its own volume characteristics that are baked into the engine's audio bank. The Volume field, which is a separate float multiplier, controls the absolute volume level independently of the audio category switch. A suppressor should typically set both Silenced (to switch the category and suppress alerts) and Volume (to a value below 1.0, such as 0.3, to further reduce the output level).
Durability
Durability is a uint8 field with a default value of 0. It represents the amount of quality lost after each firing of the ranged weapon while the barrel attachment is equipped. When the value is 0 (the default), no quality is lost per shot, and the barrel attachment operates indefinitely without degradation -- it is effectively indestructible in normal use. When the value is greater than 0, the attachment's item quality is reduced by that amount each time the weapon is fired, and the item icon always displays a visible quality bar so the player can monitor the attachment's remaining service life.
Unlike the Volume or Spread fields which are float-typed and accept fractional values, Durability is a uint8 with a valid range of 0 through 255. A value of 1 means the attachment loses one full quality point per shot. A value of 2 means it loses two quality points per shot. The attachment's total quality capacity is governed by the item quality system that applies to all degradable items, and once quality reaches zero the attachment breaks and must be repaired or replaced. The cohort-validated durability curve for a suppressor intended to model realistic baffle erosion is Durability 1, which at the default maximum item quality yields a service life of approximately one hundred shots before the suppressor becomes ineffective.
Gunshot_Rolloff_Distance_Multiplier
Gunshot_Rolloff_Distance_Multiplier is a float32 field that multiplies the distance over which the gunshot audio signal attenuates from full volume to silence. Its default value depends on whether the Silenced flag is present: if Silenced is set, the default is 0.5, meaning the rolloff distance is halved and the gunshot is audible over a shorter distance; if Silenced is not set, the default is 1.0, meaning the rolloff distance is unchanged from the weapon's configured value.
This field directly affects how far away a gunshot can be heard in the game world. A value of 0.5 cuts the audible range in half. A value of 0.25 reduces it to one quarter. A value of 2.0 doubles the audible range. The field is independent of the Volume multiplier: Volume controls the loudness of the gunfire sound at the source, while Gunshot_Rolloff_Distance_Multiplier controls how quickly that sound diminishes over distance. Both fields can be tuned independently to achieve the desired audio profile. A suppressor that should be quiet at close range but still audible at moderate distances would set Volume 0.3 (quiet source) and Gunshot_Rolloff_Distance_Multiplier 0.6 (moderate rolloff), while a suppressor that should make the weapon nearly silent beyond point-blank range would set both values lower, such as Volume 0.15 and Gunshot_Rolloff_Distance_Multiplier 0.3.
Volume
Volume is a float32 field with a default value of 1.0. It serves as a multiplier on the gunfire sound volume at the source. A value of 0.3 reduces the fire volume to 30 percent of the unsuppressed level. A value of 0.0 would produce silence, though this is not a typical configuration for any barrel attachment because a completely silent weapon offers no auditory feedback to the firing player.
The Volume field is independent of the Silenced flag. It can be set on a barrel attachment that does not have the Silenced flag present, and it will reduce the fire volume without switching the audio category to the suppressed variant and without suppressing alerts. This allows an attachment that is mechanically a muzzle brake (using the Braked flag) to also have a moderate volume reduction modeled as Volume 0.85, representing the sound-dampening effect of the brake's gas redirection without fully suppressing the report. Conversely, Volume can be omitted from a suppressor (leaving it at the default 1.0) and the Silenced flag alone will switch to the suppressed audio category -- the result will still be quieter than unsuppressed fire because the suppressed audio category is itself quieter in the engine's audio bank.
Ballistic_Drop: moved to CaliberAsset
The Ballistic_Drop field was historically part of the barrel attachment field set but has been moved to the CaliberAsset class in the current modding API. Barrel attachments that set Ballistic_Drop in their .dat file are effectively setting the value on the inherited CaliberAsset portion of the attachment's configuration. The field is a float32 with a default of 1.0 and governs the per-step projectile drop in the trajectory simulation. The move to CaliberAsset means that ballistic drop configuration is now shared across all asset types that inherit from CaliberAsset, allowing a caliber to define its own ballistic drop independently of any attachment.
Full field reference table
The following table documents every field that a barrel attachment .dat file can contain, organized by the source class that defines the field. Fields marked with an asterisk (*) are barrel-specific as documented in the SDG Chapter 21 specification; all other fields are inherited from CaliberAsset or ItemAsset.
ItemAsset inherited fields
| Field | Type | Required | Default | Valid values | Purpose |
|---|---|---|---|---|---|
ID | uint16 | Yes | , | 0-65535 | Unique numeric identifier for the item. Must not conflict with any other loaded item. |
GUID | uint128 | Yes | , | 32-character hexadecimal string | Globally unique identifier for the asset. Generated once per asset and never reused. |
Type | enum (AssetType) | Yes | , | Must be Barrel | Classifies the asset as a barrel attachment. The parser rejects any other value. |
Name | string | Yes | , | Alphanumeric string | Internal name for asset identification. Not displayed to the player. |
Rarity | enum (ItemRarity) | No | Common | Common, Uncommon, Rare, Epic, Legacy, Mythical | Rarity tier that determines the item's name color and loot table classification. |
Slot | enum (AttachmentSlot) | Yes | , | Must be None | Attachment slot classification. Barrel attachments always use None because the slot assignment is implicit from the parent gun's Barrel field. |
Size_X | uint8 | Yes | , | 1-6 | Inventory width in grid cells. |
Size_Y | uint8 | Yes | , | 1-6 | Inventory height in grid cells. |
Pro | flag | No | absent | present only | When present, the attachment is eligible for the Pro variant drop pool in addition to normal loot tables. |
CaliberAsset inherited fields
| Field | Type | Required | Default | Valid values | Purpose |
|---|---|---|---|---|---|
Caliber | uint16 | No | 0 | 0-65535 | Caliber compatibility integer. 0 means universal. Any non-zero value must match the gun's Caliber field for the attachment to be equippable. |
Spread | float32 | No | 1.0 | 0.0-any | Multiplier on the weapon's Spread_Hip and Spread_Aim values. Values below 1.0 tighten the spread cone. |
Ballistic_Drop | float32 | No | 1.0 | 0.0-any | Per-step projectile drop override. Fully replaces the gun's Ballistic_Drop value while the attachment is equipped. |
Ballistic_Steps | uint8 | No | , | 1-255 | Number of trajectory simulation steps override. Fully replaces the gun's Ballistic_Steps value while the attachment is equipped. |
Recoil_X | float32 | No | 1.0 | 0.0-any | Multiplier on the weapon's horizontal recoil. Values below 1.0 reduce horizontal recoil. |
Recoil_Y | float32 | No | 1.0 | 0.0-any | Multiplier on the weapon's vertical recoil. Values below 1.0 reduce vertical recoil. |
ItemBarrelAsset specific fields
| Field | Type | Required | Default | Valid values | Purpose |
|---|---|---|---|---|---|
Braked* | flag | No | absent | present only | When present, hides the muzzle flash visual effect. Used for muzzle brakes and compensators. |
Silenced* | flag | No | absent | present only | When present, switches the fire audio to the suppressed category and suppresses alert generation. |
Durability* | uint8 | No | 0 | 0-255 | Quality lost per shot fired. When greater than 0, the item always shows a visible quality bar. |
Gunshot_Rolloff_Distance_Multiplier* | float32 | No | 0.5 if Silenced, else 1.0 | 0.0-any | Multiplier on the distance over which gunfire audio attenuates from full volume to silence. |
Volume* | float32 | No | 1.0 | 0.0-any | Multiplier on the gunfire sound volume at the source. Independent of the Silenced flag. |
Braked versus Silenced: the two behavioral flags
The Braked and Silenced flags represent two distinct barrel attachment archetypes that are frequently confused by new modders. Both flags modify the weapon's visual and audio output, but they affect different systems and produce different gameplay outcomes.
Braked is the flag for attachments that redirect propellant gasses to reduce felt recoil and muzzle rise. Its sole engine-level effect is to hide the muzzle flash. The name derives from the muzzle brake, a device that vents gasses sideways and upward to counteract the weapon's recoil impulse. The flag does not affect audio, does not suppress alerts, does not alter the weapon's ballistic behavior, and does not change the fire audio category. The recoil reduction that players associate with muzzle brakes and compensators is implemented through the Recoil_X and Recoil_Y fields, which must be explicitly set in the .dat file alongside Braked.
Silenced is the flag for attachments that suppress the weapon's report through baffle or wetted-chamber technology. Its engine-level effects are two: it switches the fire audio to the suppressed category (which is inherently quieter than the unsuppressed category), and it suppresses all alert generation for nearby NPC entities. The flag does not automatically hide the muzzle flash, does not modify recoil, and does not modify ballistic behavior. The Volume multiplier provides additional audio level control that many suppressors use alongside Silenced, and the Gunshot_Rolloff_Distance_Multiplier field can extend or contract the audible range.
A barrel attachment can carry both flags simultaneously. A hypothetical integrated suppress-brake attachment could set both Braked and Silenced, pair them with Recoil_X 0.85 and Recoil_Y 0.80, set Volume 0.3, and set Gunshot_Rolloff_Distance_Multiplier 0.4. Such an attachment would hide muzzle flash, switch audio to the suppressed category, suppress alerts, reduce both horizontal and vertical recoil, quiet the source volume, and shorten the audible range -- a maximally modified barrel attachment that trades a large inventory footprint and higher rarity for comprehensive behavioral modification.
How barrel attachments interact with weapon audio
The audio model for barrel attachments in Unturned™ operates on three independent parameters: the fire audio category (controlled by the Silenced flag), the source volume multiplier (controlled by the Volume field), and the rolloff distance multiplier (controlled by the Gunshot_Rolloff_Distance_Multiplier field). The following flowchart illustrates how the engine resolves the final audio output when a weapon fires with a barrel attachment equipped.
As the flowchart above demonstrates, the Silenced flag branches into two separate audio subsystems simultaneously: it selects the suppressed audio category for the sound bank lookup, and it gates the alert-generation path. The Volume and Gunshot_Rolloff_Distance_Multiplier fields apply independently of the Silenced flag and function as pure mathematical multipliers on the audio engine's output parameters.
A critical detail that the flowchart does not capture is the suppressed audio category fallback. When Silenced is present, the engine looks for a suppressed variant of the weapon's Shoot audio category in the game's audio bank. If the weapon uses a custom Shoot audio category -- one that was authored by a modder for a specific gun model -- and no corresponding suppressed variant exists in the audio bank, the engine falls back to the default suppressed tone. The result is a suppressor-equipped custom gun that sounds like a generic suppressed weapon rather than the custom sound the modder authored. The resolution for this scenario is to author a suppressed audio variant bundle for the custom gun, documented in detail in the Audio Packaging for Unturned article.
Durability and the quality system
The Durability field on a barrel attachment operates within Unturned's larger item quality system. Every item in Unturned has an internal quality value that ranges from 100 (full condition) down to 0 (broken). The Durability field on the barrel attachment specifies the number of quality points deducted from this value each time the weapon is fired. A Durability value of 0 means no deduction occurs and the item's quality never decreases through normal use. A Durability value of 1 means one quality point is deducted per shot, and after approximately one hundred shots the attachment's quality reaches zero and the item breaks.
The quality system uses integer arithmetic. Because Durability is uint8, the per-shot deduction is an integer value -- the engine does not apply fractional quality loss. A Durability value of 0 produces no loss. A Durability value of 1 produces one full point of loss per shot. The engine does not interpolate or accumulate fractional values between shots.
When Durability is greater than 0, the item icon in the player's inventory and hotbar always displays a visible quality bar. This quality bar shows the attachment's remaining quality as a fraction of the maximum item quality (typically 100). The player can see at a glance how much service life remains on the suppressor, muzzle brake, or barrel extension. When the quality bar is empty, the attachment no longer functions and must be repaired at a repair bench or replaced with a fresh attachment from the player's inventory or loot.
The cohort recommendation for Durability values by barrel archetype is as follows:
| Barrel archetype | Durability value | Approximate service life (shots) | Design rationale |
|---|---|---|---|
| Flash hider | 0 | Infinite | Flash hiders have no moving parts and minimal thermal stress; they do not degrade meaningfully. |
| Muzzle brake | 0 | Infinite | Muzzle brakes redirect gasses but do not degrade from normal use. |
| Compensator | 0 | Infinite | Same as muzzle brake; compensators are mechanically simple devices with no wear surface. |
| Lightweight suppressor | 1 | ~100 shots | Suppressor baffles erode from thermal and mechanical stress; lightweight construction accelerates wear. |
| Heavy suppressor | 1 | ~100 shots | Heavy-duty construction extends baffle life marginally, but the game's uint8 precision makes 100 shots the standard service life. |
| Barrel extension | 0 | Infinite | Barrel extensions are fixed-length tubes with no moving parts; they do not degrade. |
Ballistic and recoil modifiers
Barrel attachments can modify a weapon's ballistic behavior through the inherited Spread, Ballistic_Drop, Ballistic_Steps, Recoil_X, and Recoil_Y fields. These fields function as modifiers that apply at the moment the weapon fires while the attachment is equipped.
Spread modification
The Spread field multiplies the weapon's Spread_Hip and Spread_Aim values. A barrel attachment with Spread 0.95 reduces the weapon's hip-fire and aim-down-sights spread cones to 95 percent of their base values, effectively tightening the shot pattern. A barrel attachment with Spread 1.10 increases the spread cones to 110 percent, widening the pattern. The field applies as a direct multiplication: if the weapon's Spread_Hip is 2.0 degrees and the barrel applies Spread 0.90, the effective hip-fire spread becomes 2.0 * 0.90 = 1.80 degrees.
Ballistic trajectory override
The Ballistic_Drop and Ballistic_Steps fields operate differently from the modifier-style fields. They do not multiply the weapon's values; they fully override them. When a barrel attachment specifies Ballistic_Steps 14, the weapon uses 14 trajectory simulation steps regardless of the weapon's base Ballistic_Steps value. When the attachment specifies Ballistic_Drop 0.04, the projectile drop per step is 0.04 meters regardless of the weapon's base value. This override behavior means a barrel extension that sets Ballistic_Steps to a higher value than the weapon's base provides a meaningful ballistic upgrade even on weapons that already have high ballistic step values -- the extension replaces the weapon's steps entirely with the higher value.
Recoil modification
The Recoil_X and Recoil_Y fields function as multipliers on the weapon's horizontal and vertical recoil values. A compensator with Recoil_X 0.80 reduces horizontal recoil to 80 percent of the weapon's base. A muzzle brake with Recoil_Y 0.85 reduces vertical recoil to 85 percent. Both values default to 1.0, meaning no change from the weapon's base recoil behavior. Setting either value to 0.0 eliminates that axis of recoil entirely, producing a weapon that does not move on that axis when firing -- the cohort recommends against values below 0.30 for publicly released mods because near-zero recoil produces gameplay that feels unearned to experienced players.
Caliber compatibility system
The caliber compatibility system for barrel attachments uses the integer Caliber field that the attachment inherits from CaliberAsset. The system is a simple integer match between the attachment's Caliber value and the gun's Caliber value. If either value is 0, the attachment is treated as universal and can be equipped on any gun irrespective of the other value. If both values are non-zero and they match, the attachment is compatible. If both values are non-zero and they differ, the attachment is rejected by the gun's equipment validation at runtime with no error message presented to the player.
The flowchart above illustrates the three-branch caliber matching logic that the engine runs at equipment time. The critical detail for modders is the silent rejection: when the values do not match, the equipment operation silently fails with no error message, no console warning, and no visual indicator. The attachment simply does not move from the player's inventory to the weapon's barrel slot. This silent rejection is the single most common debugging frustration for new barrel attachment authors.
The following table maps common caliber values to their vanilla round classifications for reference when configuring caliber-restricted barrel attachments:
| Caliber value | Round classification | Example vanilla weapon |
|---|---|---|
0 | Universal | Compatible with any gun |
1 | 9x19mm Parabellum (pistol class) | Colt, Ace |
2 | 7.62x39mm (rifle class) | Zubeknakov |
3 | 5.56x45mm NATO (rifle class) | Maplestrike |
4 | 7.62x51mm NATO (battle rifle class) | Nykorev |
5 | 7.62x54mmR (precision class) | Dragonfang |
6 | .50 BMG (anti-material class) | Grizzly |
7 | 12 gauge (shotgun class) | Bluntforce |
8 | 9x18mm Makarov (pistol class) | Ace variant |
9 | 5.45x39mm (rifle class) | Maschinengewehr |
10 | .338 Lapua Magnum (sniper class) | Timberwolf |
11 | .45 ACP (pistol class) | Desert Falcon |
12 | 4.6x30mm (PDW class) | Honeybadger |
The cohort recommendation for caliber-restricted barrel attachments is to use Caliber 0 (universal) for attachments that should work across multiple weapon families, and to use a custom caliber value in the range 50000-65535 for attachments that should be exclusive to a specific custom weapon family. Caliber values are only meaningful within the scope of a single content package and carry no cross-mod semantic guarantee.
Hook_Barrel placement
The Hook_Barrel GameObject on the weapon prefab is the physical attachment point for the barrel attachment's visual model. The barrel attachment's mesh extends forward from this hook's position along the hook's forward (Z) axis. Correct placement requires the hook to be positioned at the physical muzzle exit -- the forward-most point of the barrel where gasses exit the bore -- and oriented so that the forward axis aligns with the bore direction.
A common placement error is positioning Hook_Barrel at the midpoint of the barrel rather than at the muzzle tip. When a suppressor or muzzle brake is attached to a hook positioned at the midpoint, the attachment model extends from that midpoint rather than from the barrel exit, causing the model to overlap with the barrel geometry visually and to extend only halfway past the muzzle into empty air. The result is visually incorrect and immediately noticeable in third-person view. The physical position check for Hook_Barrel is one of the most frequently required corrections in first-time weapon mods.
Worked .dat examples
The following examples demonstrate complete .dat configurations for each major barrel attachment archetype. Each example shows the full field set that a modder would place in the barrel attachment's Asset.dat file, including inherited fields from ItemAsset and CaliberAsset and the barrel-specific fields documented in this article.
Suppressor
ID 50030
GUID e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0
Type Barrel
Name MySuppressor
Rarity Rare
Slot None
Size_X 3
Size_Y 1
Caliber 0
Spread 1.05
Recoil_Y 0.90
Silenced
Volume 0.3
Durability 1
Gunshot_Rolloff_Distance_Multiplier 0.5This suppressor configuration uses Silenced to switch the audio category and suppress alerts, Volume 0.3 to reduce the source volume to 30 percent, Durability 1 to model baffle erosion at one quality point per shot, and Gunshot_Rolloff_Distance_Multiplier 0.5 to halve the audible range. The Spread 1.05 introduces a slight spread penalty, modeling the effect of gas turbulence from the suppressor baffles on the projectile's exit path. The Recoil_Y 0.90 provides a minor vertical recoil reduction.
Muzzle brake
ID 50031
GUID f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1
Type Barrel
Name MyMuzzleBrake
Rarity Uncommon
Slot None
Size_X 2
Size_Y 1
Caliber 0
Spread 1.0
Recoil_X 0.75
Recoil_Y 0.85
Braked
Volume 0.9This muzzle brake uses Braked to hide the muzzle flash, Recoil_X 0.75 to reduce horizontal recoil to 75 percent, and Recoil_Y 0.85 to reduce vertical recoil to 85 percent. The Volume 0.9 provides a minor source volume reduction modeling the sound-dampening effect of the gas redirection. The Spread 1.0 leaves the weapon's spread unchanged.
Compensator
ID 50032
GUID a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
Type Barrel
Name MyCompensator
Rarity Uncommon
Slot None
Size_X 2
Size_Y 1
Caliber 0
Spread 1.0
Recoil_X 0.80
Recoil_Y 0.80
BrakedThis compensator uses Braked to hide the muzzle flash and applies symmetric recoil reduction of 80 percent on both horizontal and vertical axes. The Recoil_X and Recoil_Y values are equal, which distinguishes a compensator from a muzzle brake: a compensator reduces both axes evenly, while a muzzle brake typically prioritizes horizontal or vertical reduction.
Flash hider
ID 50033
GUID b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7
Type Barrel
Name MyFlashHider
Rarity Common
Slot None
Size_X 2
Size_Y 1
Caliber 0
Spread 0.95
Recoil_Y 1.0A flash hider in the Unturned™ modding system does not use the Braked flag, because the Braked flag hides muzzle flash through gas redirection (muzzle brake behavior) rather than through flash suppression. Instead, the flash hider achieves muzzle flash reduction purely through the visual model -- the barrel attachment's mesh physically obscures the muzzle flash from the player's view. The Spread 0.95 provides a minor tightening of the shot pattern, modeling the effect of the flash hider's pronged design on the escaping gasses.
Barrel extension
ID 50034
GUID c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8
Type Barrel
Name MyBarrelExtension
Rarity Rare
Slot None
Size_X 3
Size_Y 1
Caliber 0
Spread 0.98
Ballistic_Steps 14
Ballistic_Drop 0.85
Recoil_X 1.0
Recoil_Y 1.0This barrel extension uses Ballistic_Steps 14 to increase the trajectory simulation to 14 steps (improving the trajectory over distance), Ballistic_Drop 0.85 to reduce the per-step drop by 15 percent, and Spread 0.98 to tighten the shot pattern modestly. The barrel extension does not use Braked or Silenced because its purpose is ballistic, not acoustic or visual. The Recoil_X 1.0 and Recoil_Y 1.0 values leave recoil unchanged.
Frequently asked questions
What is the difference between the barrel-specific Durability field and the item quality system?
The barrel-specific Durability field (uint8, default 0) specifies the number of quality points deducted from the item's quality pool per shot fired. The item quality system is the broader system that governs every item's quality value (default 100) and how it degrades and is repaired. The barrel-specific Durability field is the per-event deduction amount; the item quality value is the running total that decreases by that amount each time the event occurs. An attachment with Durability 2 loses two quality points per shot and breaks after approximately fifty shots at maximum quality.
Can Volume have an effect without the Silenced flag?
Yes. The Volume field is a pure multiplier on the weapon's fire audio source level and functions independently of the Silenced flag. Setting Volume 0.5 on a barrel attachment that does not have Silenced present will reduce the fire volume to 50 percent without switching the audio category to the suppressed variant and without suppressing alert generation. This configuration is appropriate for a muzzle brake or compensator that redirects some acoustic energy away from the shooter but does not suppress the weapon's report fully.
What happens if both Braked and Silenced are present on the same attachment?
Both flags are evaluated independently. Braked hides the muzzle flash. Silenced switches the audio category to the suppressed variant and suppresses alerts. The result is a barrel attachment that combines the visual behavior of a muzzle brake with the acoustic behavior of a suppressor. This is a valid configuration for an integrated barrel device that vents gasses to reduce flash while also baffling the report. Both flags impose no gameplay cost on their own -- the cost is expressed through the attachment's rarity, size, durability, and any modifier values that accompany the flags.
How do I make a suppressor that sounds different from the default suppressed audio?
The suppressed audio category is determined by the engine's audio bank. To provide a custom suppressed sound, you must author a suppressed audio variant for the weapon's fire sound. See Audio Packaging for Unturned for the full workflow. Without a custom suppressed audio variant, the engine falls back to its default suppressed tone, which produces the same sound for every suppressed weapon in the game regardless of the weapon's base fire audio.
Why does my barrel attachment equip but have no visible effect on the weapon?
If the barrel attachment equips (it appears in the weapon's slot on the inventory screen) but its mesh is not visible on the weapon in the world, the gun prefab is missing the Hook_Barrel GameObject. The attachment's visual model attaches to the hook; without the hook, the model has no attachment point and is not rendered. Add Hook_Barrel to the weapon prefab in Unity at the muzzle tip position and rebuild the bundle. See the hook placement section above for the exact placement requirements.
Can a barrel attachment affect the weapon's firemode or rate of fire?
Barrel attachments in the standard modding API do not have fields that directly modify firemode or rate of fire. The ItemBarrelAsset class provides no field for automatic, burst, or semi-automatic firemode overrides, nor does it provide a field for rounds-per-minute modification. Firemode and rate of fire are properties of the weapon asset and are not overridable through barrel attachment fields.
What is the correct Caliber value for a universal barrel attachment?
The correct value is Caliber 0. A barrel attachment with Caliber 0 is compatible with any gun that has any Caliber value, including Caliber 0 itself. This is the recommended configuration for barrel attachments that are intended to work across multiple weapon families. If you want a barrel attachment that works only with guns of a specific caliber, set the attachment's Caliber to the same non-zero value as the target gun's Caliber.
Does the Gunshot_Rolloff_Distance_Multiplier affect the player's own hearing of the gunshot?
No. The rolloff distance multiplier affects how far away other players and NPCs can hear the gunshot. The firing player always hears the gunshot at the source volume (modified by Volume) because the sound originates from the player's own weapon. The rolloff model governs the sound's propagation through the game world to other listeners, not the shooter's own audio experience.
How is muzzle velocity affected by barrel attachments?
The ItemBarrelAsset class does not provide a muzzle velocity field. Muzzle velocity is defined at the caliber level (in the CaliberAsset class's Muzzle_Velocity field) and at the magazine level (in the Speed field on the magazine asset). Barrel attachments cannot alter muzzle velocity through any standard field. A barrel extension that should model the velocity increase from a longer barrel must instead use Ballistic_Steps and Ballistic_Drop to simulate the improved trajectory that a higher-velocity round would exhibit.
Best practices
- Set
Caliber 0on barrel attachments that are intended to work across all firearms in a mod or across vanilla weapons. Reserve non-zero caliber values for attachments that should be restricted to a specific weapon family within the mod's content ecosystem. - Always pair
Silencedwith aVolumevalue between0.2and0.4. The suppressed audio category alone produces a quieter report, but theVolumemultiplier provides the additional attenuation that makes a suppressor feel genuinely suppressed rather than merely muffled. - Use
Gunshot_Rolloff_Distance_Multiplierin concert withVolumeto model the full acoustic profile of each barrel archetype. A suppressor that is quiet at the source but still audible at moderate distances provides better gameplay feedback than a suppressor that becomes inaudible beyond ten meters. - Set
Durability 1on suppressors that are intended to degrade, andDurability 0(the default) on all other barrel types. Suppressors are the only barrel archetype where degradation is a meaningful gameplay mechanic; muzzle brakes, compensators, flash hiders, and barrel extensions do not require durability degradation. - Avoid
Recoil_XorRecoil_Yvalues below0.30in publicly released mods. Extremely low recoil values eliminate the weapon's character and reduce the skill gap between players, which hurts the mod's reputation on competitive servers. - Test every barrel attachment on at least three different guns in single-player before packaging for the Workshop. A suppressor that works correctly on a rifle may produce unexpected audio behavior on a pistol if the pistol's fire audio does not have a suppressed variant in the engine's audio bank.
- Document the attachment's caliber compatibility clearly in the
English.datdescription. Players should know at a glance whether a barrel attachment fits their current weapon or is restricted to a specific caliber family. - Verify the
Hook_Barrelposition on the target weapon prefab before finalizing the attachment's visual model length. A long suppressor designed for a hook at the muzzle tip will clip through the barrel if the hook is positioned at the barrel midpoint.
Advanced considerations
Integrated barrel-attachment weapons
Some weapon mods integrate a barrel attachment directly into the weapon model rather than providing a separate attachment item. In this configuration, the barrel attachment's effects are built into the weapon's own .dat fields, and no separate barrel attachment asset is authored. The weapon effectively has a permanently attached barrel device that cannot be removed or replaced by the player. This approach simplifies the player's attachment management but eliminates the modularity that the attachment system is designed to provide. The cohort recommendation is to use integrated barrel-attachment weapons only for unique or exotic weapons where modularity is not a design goal.
Suppressed audio category fallback chain
When a weapon fires with a Silenced attachment equipped, the engine searches for a suppressed audio variant in the following order: first, it checks for a suppressed variant of the weapon's configured shoot audio category; second, if no matching suppressed variant exists, it falls back to the engine's default suppressed sound bank. The default suppressed sound bank is the same for every weapon in the game, which means any custom gun without a suppressed audio variant will sound identical to every other suppressed custom gun. The fallback is silent and produces no log entry, so a modder who does not know to check for a suppressed audio variant may publish a suppressor that works mechanically but produces an unsatisfying universal audio experience.
Barrel attachment and game performance
Barrel attachments with high Ballistic_Steps values (above 16) increase the per-shot CPU cost of the trajectory simulation. On a server with automatic weapons firing at 600+ rounds per minute and multiple players engaging simultaneously, the cumulative cost of high-step ballistic simulations can produce frame-time spikes. The cohort recommends keeping Ballistic_Steps at or below 16 for standard barrel extensions and at or below 12 for suppressors and muzzle brakes, where ballistic step overrides are not the attachment's primary purpose.
Interaction with the gun's native Ballistic_Drop and Ballistic_Steps
When a barrel attachment specifies Ballistic_Drop or Ballistic_Steps, those values fully replace the gun's corresponding fields for the duration of the barrel's equipment. This replacement is not a temporary override that reverts when the attachment is unequipped -- the gun's base values are unchanged in the asset definition, but the runtime ballistic simulation uses the attachment's values while the attachment is present. The implication for modders is that a barrel attachment cannot selectively override only one ballistic parameter: if the attachment specifies Ballistic_Drop, it overrides the gun's Ballistic_Drop entirely; if it specifies Ballistic_Steps, it overrides the gun's Ballistic_Steps entirely. There is no multiplicative composition for these fields.
Appendix A: Quick-reference field card
| Field | Type | Req. | Default | Barrel-specific | Purpose |
|---|---|---|---|---|---|
ID | uint16 | Yes | , | No | Unique item identifier |
GUID | uint128 | Yes | , | No | 128-bit globally unique identifier |
Type | enum | Yes | , | No | Must be Barrel |
Name | string | Yes | , | No | Internal name reference |
Rarity | enum | No | Common | No | Rarity tier for name color and loot |
Slot | enum | Yes | , | No | Must be None |
Size_X | uint8 | Yes | , | No | Inventory grid width |
Size_Y | uint8 | Yes | , | No | Inventory grid height |
Caliber | uint16 | No | 0 | No | Caliber compatibility integer; 0 universal |
Spread | float32 | No | 1.0 | No | Multiplier on weapon's spread angle |
Ballistic_Drop | float32 | No | 1.0 | No | Override projectile drop per step |
Ballistic_Steps | uint8 | No | , | No | Override trajectory simulation steps |
Recoil_X | float32 | No | 1.0 | No | Multiplier on horizontal recoil |
Recoil_Y | float32 | No | 1.0 | No | Multiplier on vertical recoil |
Braked | flag | No | absent | Yes | Hides muzzle flash |
Silenced | flag | No | absent | Yes | Suppressed audio + no alerts |
Durability | uint8 | No | 0 | Yes | Quality lost per shot |
Gunshot_Rolloff_Distance_Multiplier | float32 | No | see note | Yes | Multiplier on gunshot rolloff distance |
Volume | float32 | No | 1.0 | Yes | Multiplier on fire audio source volume |
Pro | flag | No | absent | No | Pro variant drop pool eligibility |
Note on Gunshot_Rolloff_Distance_Multiplier default: 0.5 if Silenced is present, otherwise 1.0.
Appendix B: Diagnostic table
| Symptom | Most likely cause | Resolution |
|---|---|---|
| Attachment equips but barrel mesh is invisible | Hook_Barrel missing from weapon prefab | Add Hook_Barrel GameObject at muzzle exit in Unity; rebuild bundle |
| Attachment equips but sits at wrong position on the weapon | Hook_Barrel positioned at barrel midpoint instead of muzzle tip | Reposition Hook_Barrel to the physical barrel exit |
| Suppressor equips but gun still generates zombie alerts | Silenced flag absent from barrel .dat | Add Silenced flag (no value) to the attachment .dat |
| Suppressor equips but gun sounds the same as unsuppressed | Silenced flag absent or weapon has no suppressed audio variant | Add Silenced flag; if gun uses custom audio, author suppressed audio variant |
| Barrel attachment cannot be equipped on the intended gun | Caliber mismatch: attachment and gun have different non-zero values | Set attachment Caliber 0 (universal) or match both values exactly |
| Muzzle flash visible on a muzzle brake attachment | Braked flag absent from barrel .dat | Add Braked flag to the attachment .dat |
Barrel attachment has no visible quality bar despite setting Durability | Durability value is 0 (the default) | Set Durability to a value of 1 or higher |
| Barrel attachment degrades too quickly in gameplay | Durability value is too high | Reduce Durability to 1 for reasonable suppressor service life |
| Barrel extension has no noticeable effect on range | Ballistic_Steps and Ballistic_Drop not set | Add Ballistic_Steps 14 and Ballistic_Drop 0.85 to the .dat |
Suppressor is audible across the entire map despite Volume 0.2 | Gunshot_Rolloff_Distance_Multiplier not reduced from default | Set Gunshot_Rolloff_Distance_Multiplier to 0.4 or lower |
| Recoil does not change when a muzzle brake is equipped | Recoil_X and Recoil_Y both at default 1.0 | Set Recoil_X and Recoil_Y to values below 1.0 |
| Attachment works in single-player but not on a dedicated server | Bundle or .dat file not deployed to server's mod folder | Copy both the .uniti3d bundle and the Asset.dat to the server's Bundles folder |
| Flash hider does not suppress muzzle flash despite the model | Flash hiders do not use Braked by convention; only visible suppression | Add Braked flag if behavioral flash suppression is desired, or accept visual-only suppression |
Cross-references
- Attachment Slots: Sight, Grip, Tactical, Barrel , the slot system overview that introduces the barrel slot, Hook_Barrel placement, and the caliber compatibility flowchart.
- Caliber Asset , the parent class reference that documents Ballistic_Drop, Ballistic_Steps, and the GUID-based caliber linkage system.
- Gun Mod Tutorial , the end-to-end weapon mod tutorial that covers the gun-side configuration required for barrel attachment support, including the
Barrelfield declaration on the weapon.dat. - Magazine Asset , the magazine asset reference that covers the companion caliber linkage system used for magazine-gun compatibility.
- Audio Packaging for Unturned , the audio authoring guide required for custom suppressed audio variants that pair with suppressors using the
Silencedflag. - Item Asset Anatomy , the base class reference for the universal ItemAsset fields that every barrel attachment inherits.
- Smartly Dressed Games modding documentation , the official specification source for the ItemBarrelAsset class and all field definitions documented in this article.
- Unturned on Steam , the game's Steam store page for version reference and community context.
Document history
| Version | Date | Author | Notes |
|---|---|---|---|
| 1.0 | 2026-07-26 | 57 Studios | Initial publication. Full ItemBarrelAsset reference: barrel-specific fields from SDG Chapter 21, inherited fields from ItemAsset and CaliberAsset, caliber compatibility, audio interaction model, durability system, worked examples, diagnostic table, FAQ. |
Authoring checklist
Complete this checklist before publishing any barrel attachment mod to the Steam Workshop. Each item represents a failure mode documented in the cohort's modding practice.
Asset identification
- [ ]
IDis in the 50000+ range and does not conflict with any other loaded mod. - [ ]
GUIDis a unique 32-character hexadecimal string with no hyphens, generated fresh for this attachment. - [ ]
Typeis exactlyBarrel(case-sensitive). - [ ]
SlotisNone.
Visual and spatial configuration
- [ ]
Size_XandSize_Ydefine an inventory footprint that matches the attachment's visual size. A suppressor is typically3 x 1; a muzzle brake or flash hider is2 x 1. - [ ] The target weapon prefab has
Hook_Barrelat the muzzle exit position, not at the barrel midpoint. - [ ]
Hook_Barrelforward (Z) axis aligns with the weapon bore direction.
Barrel-specific fields
- [ ]
Silencedflag is present if the attachment is a suppressor; absent otherwise. - [ ]
Brakedflag is present if the attachment is a muzzle brake or compensator; absent otherwise. - [ ]
Durabilityis set to1for suppressors;0(omitted) for all other barrel types. - [ ]
Volumeis set to a value between0.2and0.4for suppressors; between0.85and1.0for muzzle brakes and compensators. - [ ]
Gunshot_Rolloff_Distance_Multiplieris set to0.5or lower for suppressors;1.0(or omitted) for other barrel types. - [ ]
Recoil_XandRecoil_Yare set to values below1.0for muzzle brakes and compensators;1.0(or omitted) for suppressors and flash hiders. - [ ]
Spreadis set to1.0or slightly above for suppressors (spread penalty);0.95or below for barrel extensions and flash hiders (spread improvement).
Caliber compatibility
- [ ]
Caliberis0(universal) if the attachment should work across multiple weapon families. - [ ]
Calibermatches the target gun'sCaliberfield exactly if caliber-restricted behavior is intended. - [ ] Tested the attachment on at least one gun with
Caliber 0and one gun with the target non-zero caliber.
Audio verification
- [ ] Suppressor: confirmed that the gun's fire audio switches to the suppressed category when the attachment is equipped.
- [ ] Suppressor with custom gun: verified that a suppressed audio variant exists in the audio bundle, or the fallback to default suppressed tone is acceptable.
- [ ] Muzzle brake or compensator: confirmed that
Volumereduction (if set) is audible but does not silence the weapon.
Durability verification
- [ ] Suppressor: fired the weapon at least 110 times and confirmed the suppressor's quality reaches zero after approximately 100 shots (if
Durability 1). - [ ] Non-suppressor: confirmed that
Durability 0(default) produces no quality degradation over 200+ shots.
Field correctness
- [ ] All float values use period (
.) as the decimal separator. - [ ] No
Ballistic_Dropfield present unless a ballistic trajectory override is intended. (The field is inherited fromCaliberAssetand its placement on the barrel.datis valid but must be intentional.) - [ ] No deprecated or banned field names are present. Confirm against the official SDG documentation.
