Change Loot Lifetime & Despawn Time on DayZ Server
In this article
Adjusting loot lifetime and despawn time on a DayZ server controls how long items, vehicles, and bodies remain in the world before disappearing. This is essential for server performance, balancing resource scarcity, and preventing loot hoarding. Before you begin, ensure you have file access to your server (via FTP, a control panel like Pterodactyl, or a hosting provider’s file manager) and a text editor such as Notepad++ or VS Code.
What You'll Need
- Access to your DayZ server files (usually a folder named
mpmissionsorserverfiles) - A text editor (Notepad++ recommended for line endings)
- Knowledge of your server’s mission file location (e.g.,
dayzOffline.chernarusplusordayzOffline.deerisle) - Optional: a backup tool or method to restore files if something goes wrong
Step-by-Step
- Stop your DayZ server to avoid file conflicts or corruption. Use your hosting panel’s stop button or the console command
#shutdown. - Navigate to the mission folder. This is typically located at
DayZServer/mpmissions/dayzOffline.whereis e.g.,chernarusplus,livonia, ornamalsk. - Open the
cfgeventspawns.xmlfile in your text editor. This file controls loot spawns and their lifetimes. If it doesn’t exist, you may need to extract it from the server’s@DZmod folder or create a new one (but first check if your server uses a custom mission). - Locate the
entries that define loot spawns. Each event has attributes likename,lifetime,min,max, andnominal. Thelifetimeattribute is the key value you need to change. - Adjust the
lifetimevalue for each event. This value is in seconds. For example, a lifetime of3600means loot despawns after 1 hour. Set it to your desired duration (e.g.,7200for 2 hours,86400for 24 hours). - Save the file and close it.
- Edit the
types.xmlfile (also in the mission folder) if you want to control individual item despawn times. This file lists every item with alifetimeattribute. For example,. Change these values as needed. - For vehicles and bodies, you need to edit the
cfgeventspawns.xmlfor vehicle spawns (look fortype="Vehicle") and the server’sserverDZ.cfgfor body cleanup. InserverDZ.cfg, setcleanupLifetime(in seconds) to control when dead bodies and dropped items are removed. For example,cleanupLifetime = 3600;removes them after an hour. - Restart your server to apply the changes. Use the start button in your panel or the command line.
- Test in-game by spawning or finding an item and timing how long it takes to despawn. Adjust values if needed.
Common Mistakes
- Editing the wrong file: Some servers use a custom mission folder. Make sure you edit the one your server actually loads (check your startup parameters).
- Using minutes instead of seconds: All lifetime values are in seconds. A common error is setting
3600thinking it’s 1 minute, but it’s actually 1 hour. - Not stopping the server: Editing files while the server is running can cause changes to be overwritten or corrupted.
- Forgetting to save with correct encoding: Use UTF-8 without BOM to avoid parsing errors.
- Overlooking the
nominalandmin/maxvalues: These control how many items spawn, not their lifetime. Changing lifetime alone may not reduce loot if the spawn count is high.
Tips
- Backup before editing: Copy the original files to a safe location so you can revert if something breaks.
- Use a consistent lifetime: For realism, set similar items to the same lifetime (e.g., all food to 2 hours, all weapons to 1 hour).
- Monitor server performance: Shorter lifetimes reduce server load because fewer items are tracked. If your server lags, reduce lifetimes.
- Test on a local server: If possible, test changes on a single-player or local server before applying to a live server.
- Consider using a mod: Tools like “Loot Respawn” or “Server Cleaner” can automate cleanup without manual file edits.
Troubleshooting
- Server fails to start: Check the server log for XML parsing errors. Ensure your file is well-formed and that you didn’t accidentally delete a closing tag.
- Loot still despawns too fast: Verify you saved the file and that the server is using the correct mission. Also, check if any mod overrides the lifetime values.
- Changes not taking effect: Some hosting panels cache files. Try restarting the server twice or clearing the cache.
- Items disappear immediately: This could be a cleanup script or a mod conflict. Check your server mods and disable them temporarily to isolate the issue.
- Vehicles not despawning: Vehicle spawns are separate from item spawns. Ensure you edited the correct
type="Vehicle"event incfgeventspawns.xml.
Frequently Asked Questions
- What is the default loot lifetime in DayZ? The default varies by server, but common values are 3600 seconds (1 hour) for most items, and 7200 seconds (2 hours) for vehicles.
- Can I set different lifetimes for different items? Yes, edit the
types.xmlfile and change thelifetimeattribute for each item type. - Does changing loot lifetime affect server performance? Yes, shorter lifetimes reduce the number of items the server tracks, which can improve performance, especially on high-population servers.
- How do I make loot respawn faster? Loot respawn is controlled by the
respawnTimeattribute incfgeventspawns.xml. Lower this value (in seconds) to make loot spawn more frequently. - What is the maximum lifetime I can set? There is no hard limit, but extremely high values (e.g., 30 days) can cause memory issues. A practical maximum is around 7 days (604800 seconds).
- Do I need to edit both
cfgeventspawns.xmlandtypes.xml? Yes, becausecfgeventspawns.xmlcontrols spawn events (where loot appears), whiletypes.xmlcontrols individual item lifetimes. Both affect despawn times.