You are viewing a potentially older version of this package. View all versions.
Santos_Arcana-HearthstoneMod-1.0.2 icon

HearthstoneMod

Adds a craftable Hearthstone that teleports you to your bed spawn point. 10 minute cooldown, reusable, never consumed, no gear loss, bypasses all portal restrictions since it never uses the portal system.

Date uploaded a month ago
Version 1.0.2
Download link Santos_Arcana-HearthstoneMod-1.0.2.zip
Downloads 142
Dependency string Santos_Arcana-HearthstoneMod-1.0.2

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2333 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2333
ValheimModding-Jotunn-2.30.0 icon
ValheimModding-Jotunn

Jötunn (/ˈjɔːtʊn/, 'giant'), the Valheim Library was created with the goal of making the lives of mod developers easier. It enables you to create mods for Valheim using an abstracted API so you can focus on the actual content creation.

Preferred version: 2.30.0

README

HearthstoneMod (Valheim 1.0)

A craftable Hearthstone item. Activate it to teleport instantly to your bed spawn point with your full inventory intact. It's a reusable keepsake, not a consumable, with a short cooldown between uses. It never goes through Valheim's portal system, so none of the usual portal restrictions apply (no ore/metal blocking, no linked-portal pairing needed) - it just moves you.

How to use

  1. Craft one at a Workbench: 5 Fine Wood, 2 Silver, 5 Greydwarf Eye (tunable by the server/pack owner - see Configuration below).
  2. Set a spawn point the normal way - sleep in or claim any bed. That's where the Hearthstone sends you.
  3. Activate it - right-click the Hearthstone in your inventory, or drop it on a hotbar slot and press your use key. You'll teleport straight to your bed, gear and all.
  4. Cooldown: 10 minutes between uses by default. You keep the item forever - it's never consumed, just wait out the cooldown to use it again.

Requirements

Needs BepInEx and Jotunn, and because it registers a new item/recipe, everyone connecting to the same world needs the mod installed - it's marked EveryoneMustHaveMod, so mismatched clients won't be able to connect. If you're playing with friends by having one person host directly (no separate dedicated server), that host needs it too, same as everyone else. If you run a separate dedicated server process, install it there as well.

Configuration

After the first run, BepInEx writes a config file under BepInEx/config/ named after this plugin. Edit it while the game is closed (or with a config-manager mod while it's running):

[General]
CooldownSeconds = 600
RequireBedSpawnPoint = true

[Recipe]
FineWood = 5
Silver = 2
GreydwarfEye = 5

Why it bypasses portal restrictions and doesn't drop your gear

Both fall out naturally from how it's built, not from special-casing:

  • It never calls into Valheim's Portal/TeleportWorld system at all, so none of the checks that system applies (linked portal required, certain ores/metals blocked, etc.) ever run for this item.
  • Valheim doesn't drop your gear on a direct position teleport - that's only a death mechanic. This mod just moves your character; your inventory comes with you.

Building from source

This is an open BepInEx + Jotunn mod project; the source (.cs/.csproj files) isn't included in the packaged download but is available if you want to modify or rebuild it. In short: it's a net472 class library referencing BepInEx, Jotunn, and Valheim's own game assemblies (from your local install - those are never redistributed), built with dotnet build. See the project's HearthstoneMod.csproj for the exact reference paths - they're driven by VALHEIM_INSTALL and BEPINEX_ROOT properties/environment variables so they can point at any install location, including a Thunderstore Mod Manager or r2modman profile folder rather than the game's own top-level BepInEx folder (mod managers commonly nest the actual active plugins folder under a per-profile path).

If you hit a compile error after a Valheim update renamed or reshuffled an internal field, the fix is usually small: open your own valheim_Data\Managed\assembly_valheim.dll in a free decompiler (dnSpy or ILSpy) - this is your own legally-owned copy, so inspecting it locally is fine - find the closest-named current member, and update the corresponding line in the source.

License

No explicit license is currently set for this project (all rights reserved by default). Contact the author if you'd like to reuse or bundle it.

CHANGELOG

Changelog

1.0.5

  • Found and fixed the REAL bug behind the teleport never firing - it's been here since 1.0.0. Your BepInEx log had it in plain text the whole time: [Error:HarmonyX] Failed to patch void Humanoid::UseItem(...): System.Exception: Cannot get result from void method. Our prefix declared a ref bool __result parameter, which tells Harmony "the original method returns bool, hook its return value" - but on this game version, Humanoid.UseItem actually compiles to a void method, not bool. That mismatch made Harmony refuse to weave the patch in AT ALL, silently, on every single load since the mod's first release - not because of ItemType (1.0.3) and not because of Player's override (1.0.4's theory - a real and still-worthwhile defensive fix, kept in this version, but not what was actually broken). Removed __result entirely; the prefix now just returns bool to tell Harmony whether to run vanilla's code afterward, which was always the only thing that return value needed to do. This is the fix that should finally make the Hearthstone actually teleport you.

1.0.4

  • Fixed the Hearthstone playing the food/consumable sound and vanishing instead of teleporting (the 1.0.3 fix made it activate instantly on right-click, but our Harmony patch still never actually ran). Cause: Player overrides Humanoid.UseItem with its own compiled method, so patching typeof(Humanoid), nameof(Humanoid.UseItem) only patched the base class's copy - the game was really calling Player's own override, which our patch never touched, so vanilla's normal "consumable" handling ran instead (eat sound, then destroy the item). Now explicitly locates and patches whichever method actually runs on both Humanoid and Player, so this can't silently miss again. Also added a temporary diagnostic log line so future issues like this show up immediately in the console instead of just failing silently.
  • Swapped Silver out of the recipe for Leather Scraps (5, configurable). Silver needs a Mountain-biome pickaxe and smelting - way too late-game for an item meant to be craftable early. Recipe is now FineWood x5, LeatherScraps x5, GreydwarfEye x5 (all editable in the BepInEx config file).

1.0.3

  • Fixed the Hearthstone doing nothing when used (showed vanilla's "Use Hearthstone on what?" prompt instead of teleporting). The item was cloned from AmberPearl, which is an ItemType.Material - right-clicking a Material item never calls Humanoid.UseItem, so our activation patch never ran. Now explicitly set to ItemType.Consumable (same category as potions/food), which activates instantly on right-click like intended.

1.0.2

  • Rewrote README.md - it had personal/machine-specific build notes in it that don't belong on a public listing page. No functional changes.

1.0.1

  • Added a guaranteed-to-render warm light burst effect at both ends of the teleport (departure and arrival), built from plain UnityEngine primitives so it doesn't depend on any specific Valheim asset name.

1.0.0

  • Initial release: craftable Hearthstone item, Workbench recipe, teleport-to-bed on use via Harmony patch, 10-minute per-item cooldown, configurable recipe cost and cooldown.