You are viewing a potentially older version of this package. View all versions.
Zenaug-Locked_Cargo-0.3.1 icon

Locked Cargo

Lock your ships like a ward. Owners lock and unlock at the cargo or rudder; while a ship is locked, only the owner, players on the ship's list and admins can steer, open the cargo or take the ship apart. Every player and the server need the mod.

By Zenaug
Date uploaded a month ago
Version 0.3.1
Download link Zenaug-Locked_Cargo-0.3.1.zip
Downloads 82
Dependency string Zenaug-Locked_Cargo-0.3.1

This mod requires the following mods to function

ValheimModding-Jotunn-2.30.2 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.2
denikson-BepInExPack_Valheim-5.4.2351 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.2351

README

Locked Cargo

Lock your ships like a ward. A ship belongs to the player who built it. The owner can lock it anywhere on the map; while it is locked, only the owner, players on the ship's list and admins can steer it, open its cargo, use its parts or take it apart.

How to use it

  • The key: use the game's alternate-use key (AltPlace) together with the Use key. The hover text always shows the exact keys for your bindings.
  • Where: at the ship's cargo box, or at its rudder. Both work on every ship; the Raft has no cargo box, so on the Raft use the rudder.
  • The owner locks and unlocks the ship with that key.
  • Other players use the same key while the ship is unlocked to add themselves to the ship's list, or to remove themselves from it. This works like an inactive ward.
  • Ships from the ship construction site have no owner. The first player to use the key on one claims it, and it becomes locked.
  • New ships start locked. Ships built before the mod was installed start unlocked. Their hover shows "Unknown owner" until the builder interacts with the ship once.
  • The hover text on the cargo and the rudder shows whether the ship is locked, who owns it, which action the key will do for you, and the ship's list.

What a locked ship blocks

For anyone who is not the owner, on the ship's list, or an admin:

  • steering;
  • opening the cargo (including stack-all and take-all);
  • using anything else on the ship, including parts added by other mods, and using items on them;
  • deconstructing and repairing the ship with the hammer.

Refused actions show a message and the ward's flash, as a ward does. If someone has the cargo open when the ship becomes locked for them, the cargo window closes. Someone who is steering when the ship becomes locked for them is released from the helm.

What stays open

  • Seats and ladders, so passengers can always come aboard and sit.
  • Weapon damage is not blocked. A vanilla ward does not block it either.
  • An unlocked ship works as in vanilla.

Wards

  • Inside someone else's ward, the ship's owner, the players on the ship's list, and admins (while "Admins bypass ship locks" is on) can still steer, open the cargo, use the ship's parts, and deconstruct and repair the ship, with no ward refusal. The owner can also lock and unlock the ship there.
  • Everyone else is still stopped by both the ward and the lock. Inside someone else's ward a stranger cannot claim an ownerless ship or add themselves to a ship's list.
  • Nothing changes for things that are not part of a ship, such as chests on the shore.

Setting

"Admins bypass ship locks" (section "1 - General", default on), editable in the in-game Configuration Manager.

  • On: server admins, and the host of a locally hosted game, can use, lock and unlock every ship.
  • Off: admins are treated like every other player, which is handy for testing the lock yourself.
  • The setting is synced from the server and only admins can change it.

Works with

These mods were checked against their code, and Locked Cargo adds compatibility for them only when they are installed:

  • ProtectiveWards: ship ownership comes first inside a foreign ward (see Wards). Its other protections are unchanged.
  • LongshipUpgrades: its parts on the Longship (such as the Hull, the lantern, the trophy stand and turrets) follow the lock and show "No access" only to players without access.
  • MultiUserChest: multi-user opening still works for players with access, and never admits anyone else to locked cargo.
  • CraftFromContainers and EpicLoot craft-from-containers: a locked ship's cargo is not used for crafting by players without access.
  • ItemHopper: hoppers never take from or put into a locked ship's cargo, including the owner's hoppers.
  • GorilaChestMod: a locked ship's cargo is skipped for players without access.
  • Vikings_Village: villagers never take from or put into a locked ship's cargo, and use the next chest instead.

Requirements

  • Every player and the server need the mod. Jotunn refuses players who do not have it.
  • Players and the server must have the same minor version (for example 0.3.x).
  • Requires BepInExPack_Valheim and Jotunn.

Known limits

  • Clients: the lock relies on every player running the mod. A deliberately modified client can get around it, as with any Valheim protection.
  • Modded ships are covered only if they use the game's normal ship component.
  • Parts without their own ward check: parts added by other mods that do no ward check of their own show their normal hover text on a locked ship, but using them is still refused.
  • Lock messages: after using the key, the "Ship locked" / "Ship unlocked" message appears straight away, before the change is confirmed. The hover text always shows the real state.
  • Distance: anyone close enough to see the hover text can use the key on the cargo or rudder, even from the dock.
  • ProtectiveWards' rule for strangers is unchanged on unlocked ships inside a ward. It lets through only the player who last steered that ship.
  • Villager timing: a villager who picked an unlocked ship's cargo just before the owner locks it can still take that one load.
  • Names on the list: names are stored when a player is added, and are not updated if the character is renamed.

Testing status

All in-game testing so far was done by the author, playing solo: two characters, played one after the other, in one locally hosted world.

  • 0.1.0: a first check that the lock lines show and the lock toggles on all five vanilla ships.
  • 0.2.0: a full solo test run covering refusals, adding and removing yourself, crafting from cargo, the admin bypass setting, the ward cases and reloading the world. Everything worked except one case inside someone else's ward, which 0.3.0 fixed.
  • 0.3.0: the same kind of run, including the new ward rules. Everything worked except a false "No access" on the LongshipUpgrades Hull, which 0.3.1 fixed.
  • 0.3.1: tested solo, and the fix for a false "No access" on ship parts is confirmed. Inside someone else's ward, the ship's owner could use the Hull, the lantern and the other LongshipUpgrades parts with no "No access" and no ward message, with the ship locked and unlocked. A stranger saw "No access" on the same parts and was refused, on the locked ship both inside and outside a ward. The change that makes villagers use the next kiln chest was not tested in game.
  • Vikings_Village: not tested in game yet.

Not yet tested with two players on separate machines. That is needed for:

  • someone steering while the owner locks the ship;
  • two players in the cargo through MultiUserChest;
  • the cargo window closing for another player;
  • the ship's data being held by another player's machine;
  • a player without the mod being refused;
  • an admin who is not the host;
  • ProtectiveWards' "Prevent building and demolishing" for a player on the ship's list.

Made with AI

This mod and its package were made with generative AI.

  • Code, tests, tools and package files: all the mod's code, its test tools, the build reports and the package files (this README, the changelog and the manifest) were written by Claude Code (Anthropic), model Claude Opus 5.5. The code was checked by Claude Opus and Claude Sonnet review agents (their versions were not recorded).
  • Specifications, briefs and icon: the specifications, the design questions, the work briefs and the icon artwork were written by Claude (Anthropic) in a claude.ai chat. The model was not recorded. The author chose the icon from six options.
  • The author (Zenaug) decided all behaviour, wording and look, and did all in-game testing.
  • No analytics, no network access: the mod collects no analytics and opens no network connections of its own. It only uses the game's own multiplayer messages to share each ship's lock state.

Changelog

See CHANGELOG.md.

CHANGELOG

Changelog: Locked Cargo

0.3.1 (2026-10-17)

P-SHIPLOCK-06. A fix release: a 0.3.0 player can still join a 0.3.1 server (minor version matches). Not yet on Danaheim.

  • Inside someone else's ward, the ship's owner, permitted players and admins (with admin bypass on) no longer see "No access" on ship parts that check the ward themselves, and can use them: LongshipUpgrades' Hull and other parts, its trophy stand and turrets, a map table on the ship, and cargo boxes that check wards.
  • Vikings_Village kilns: when a locked ship's cargo is the nearest chest to a kiln or smelter, villagers now use the next nearest chest instead of none.
  • Added AI-assistance disclosure (README and assembly metadata) for publishing.

0.3.0 (2026-10-16)

P-SHIPLOCK-05. Not yet on Danaheim. Every player and the server need 0.3.x (minor version must match).

  • Inside someone else's ward, the ship's owner, its permitted players and admins (with admin bypass on) can steer, open the cargo, use the ship's other parts, deconstruct and repair it, locked or unlocked, with no ward refusal. ProtectiveWards used to let only the ship's last helmsman through. Everyone else is still stopped by the ward and the lock, and nothing changes for pieces that are not part of a ship.
  • Vikings_Village villagers no longer take items from (or return items to) a locked ship's cargo.

0.2.0 (2026-10-16)

P-SHIPLOCK-04. Not yet on Danaheim. Every player and the server need 0.2.x (minor version must match).

  • New setting in Configuration Manager: "1 - General" / "Admins bypass ship locks" (default on). Synced from the server; only admins can change it; takes effect at once. Off: admins and the host are treated like any player.
  • The lock toggle (Shift+E, i.e. AltPlace + Use) now also works at the rudder of every ship, with the same rules as on the cargo. The rudder hover shows the lock lines and the available action.
  • The ship's owner (and an admin while admin bypass is on) can lock and unlock their own ship inside someone else's ward. Others still cannot claim an ownerless ship or add themselves there.

0.1.0 (2026-10-16)

First build (P-SHIPLOCK-03). Not yet on Danaheim.

  • Ward-style ship lock. The ship's builder owns it; Shift+E (AltPlace + Use) on the cargo locks or unlocks.
  • While unlocked, other players use Shift+E on the cargo to add or remove themselves, as on an inactive ward.
  • Ships from the ship construction site have no owner; the first player to Shift+E the cargo claims and locks it.
  • While locked, only the owner, permitted players and admins can steer, open the cargo, deconstruct, repair or use anything else on the ship. Seats and ladders stay open. Weapon damage is not blocked, as with a ward.
  • Craft-from-containers, MultiUserChest, ItemHopper and GorilaChestMod cannot reach a locked ship's cargo for players without access.
  • New ships start locked; ships that existed before the mod start unlocked and show "Unknown owner" until their builder interacts with them.
  • Every player and the server must have the mod (Jotunn: EveryoneMustHaveMod, minor version must match).