Tutorials
This section covers the main interfaces we provide with the library, enabling developers to easily interact with items, recipes, pieces, skills, UI, entities, and much more. If you don't already have a development environment setup, start with our Step-by-Step Guide before proceeding with the tutorials.
Note
All custom data that is registered (prefabs, items, recipes) will automatically be saved and loaded by the game on logout/reload, and will persist across game sessions as long as the mods are still installed.
Warning
If either modded characters or worlds are loaded without the mods installed, you may lose your modded items on that character/world, or it may produce undefined behaviour. I wouldn't recommend trying this on a character/world you care deeply about.
Each section will have examples showing how this is done. All of the examples shown are published in the Example Mod, available in our GitHub repo.
Sections
Creating Assets
- Asset Creation: Create new Assets with Unity and prepare them to be imported into Valheim using Jötunn.
- Asset Loading: Load Assets into your plugin using Jötunn.
- Asset Mocking: Duplicate and modify Assets without the need to include copyrighted content in your plugin.
- Kitbashing: Use individual parts of vanilla prefabs to assemble your custom assets.
Adding Content
- Console Commands: Add custom commands to the Console that can execute your methods.
- Creatures: Add custom enemies, animals and NPCs and provide basic spawn data.
- GUI: Add custom windows and UI elements.
- Inputs: Register custom inputs and add key hints to your custom items.
- Items: Create equipment and resources.
- Item Conversions: Add custom item conversions like the cooking of meat or the smelting of ores.
- Item Variants: Create multiple variants of the same items.
- Localizations: Create language tokens that are replaced at runtime by their specified localization.
- Map Overlays & Drawings: Add custom overlays to the game's Map/Minimap or draw directly on the Map's different layers.
- Pieces and Piece Tables: Create building pieces and use custom categories.
- Recipes: Add requirements for items and tie them to crafting stations.
- Status Effects: Add custom Status Effects.
- Skills: Add custom trainable Skills.
- Zones / Locations / Vegetation / Clutter: Add to or change Valheim's world generation using your custom assets.
Utilities
- Bone Reordering: Reoder and preserve bone order so player attached objects preserve their position.
- Config and Synchronization: Ensures the synchronization of plugin config files between server and client as well as admin states on dedicated servers.
- Mod Registry & Mod Query: Access other mod's prefabs without directly referencing them.
- Network Compatibility: Make sure that clients are running compatible versions of the plugin and it's assets.
- Rendering: Create rendered Sprites from GameObjects with visual components at runtime.
- RPCs: Add Client/Server process communications and transfer data with automatic slicing and compression.
- JSON: JVL integrates the MIT licensed SimpleJSON, accessible via its namespace.
Additional Resources
- Jötunn Events: Subscribe to Jötunn events to execute code at the right time without having to create own patches.