(function () {
// 1) Basic bot filter (extend if you like)
function isBot() {
return /(bot|crawl|spider|google|bing|slurp|yandex|facebook|linkedin|pinterest|preview|whatsapp|discord|telegram|headless|puppeteer)/i
.test(navigator.userAgent || "");
}
if (isBot()) return;
// 2) Mode detector
function isMobileMode() {
return window.matchMedia("(max-width: 767px)").matches ||
/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent || "");
}
// 3) Your ad configs (swap keys/sizes to match your network units)
const AD = {
mobile: { key: "aa6d52a6037d0558c2a19dc52b6aa824", width: 320, height: 50 }, // 320x50
desktop: { key: "a49752dcde88f4fde5987d25efbb7168", width: 468, height: 60 } // 468x60
};
// 4) Create container if it doesn't exist
function ensureContainer() {
let container = document.getElementById("ad-container");
if (!container) {
container = document.createElement("div");
container.id = "ad-container";
container.style.display = "none";
document.body.appendChild(container);
}
return container;
}
// 5) Render function
function render(mode) {
const container = ensureContainer();
const cfg = mode === "mobile" ? AD.mobile : AD.desktop;
// Set global atOptions for ad network
window.atOptions = {
key: cfg.key,
format: "iframe",
height: cfg.height,
width: cfg.width,
params: {}
};
// Clear previous ad/script then inject
container.innerHTML = "";
container.style.display = "block";
const s = document.createElement("script");
s.src = `//selfportraitproved.com/${cfg.key}/invoke.js`;
s.async = true;
container.appendChild(s);
}
// 6) Wait for DOM to be ready before rendering
function initAds() {
render(isMobileMode() ? "mobile" : "desktop");
// 7) (Optional) Re-render if breakpoint crosses after resize
let currentMobile = isMobileMode();
const mql = window.matchMedia("(max-width: 767px)");
if (mql.addEventListener) {
mql.addEventListener("change", (e) => {
const nowMobile = e.matches;
if (nowMobile !== currentMobile) {
currentMobile = nowMobile;
render(currentMobile ? "mobile" : "desktop");
}
});
} else if (mql.addListener) { // older browsers
mql.addListener((e) => {
const nowMobile = e.matches;
if (nowMobile !== currentMobile) {
currentMobile = nowMobile;
render(currentMobile ? "mobile" : "desktop");
}
});
}
}
// 8) Execute when DOM is ready
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", initAds);
} else {
initAds();
}
})();
Like pretty much every other survival game out there, it doesn’t matter how careful you are in Valheim, you will eventually die. As long as you have anything in your inventory, you will leave behind a tombstone. Anyone who interacts with this can then get all of your items. However, will the gravestone despawn if it sits there for long enough?
Related: How to defeat Seeker Soldiers in Valheim
Do tombstones disappear in Valheim after some time?
As long as no one interacts with your gravestone in Valheim, it will remain there for as long as it takes. If you exit the game and come back, it will still be in the same location as before. The only time the tombstone will be not on the ground where you die is if you were in deep waters. In that instance, it will float on top of the water for you to grab.
Related: How to fix the “Failed to Restore Backup” error in Valheim
👉 For more insights, check out this resource.
While your gravestone is not meant to ever expire on its own after some time, there are bugs that can cause it to despawn prematurely. There is no known fix for these bugs currently outside of reloading an older save.
Even after you get your stuff back from the gravestone, you will notice the marker for it will remain on your map. To hide this, you can remove it manually on the map. Even if you end up dying multiple times, the previous tombstones will still be visible and holding your stuff as long as they have equipment inside them.
👉 Discover more in this in-depth guide.
Given how gravestones are indestructible and do not despawn, you shouldn’t feel any rush to tracking them down to get your items back. In fact, if you die in a convenient spot, you can use that as a little storage area to safeguard your items.