Jotunn
Configuration class for adding custom inputs and custom key hints.
See
for more information on Unity Input handling.
Name of the config. Use this to react to the button press bound by this config.
Axis string this config should be bound to.
Use special Axis "Mouse ScrollWheel" to display the scroll icon as the key hint.
Private store for the Key property
Unity KeyCode this config should be bound to.
BepInEx configuration entry of a KeyCode that should be used.
Overrides the value of this config.
Private store for the shortcut
BepInEx KeyboardShortcut this config should be bound to.
BepInEx configuration entry of a KeyCode that should be used.
Overrides the value of this config.
Private store for the GamepadButton property
GamepadButton this config should be bound to for gamepads.
BepInEx configuration entry of a GamepadButton that should be used.
Overrides the value of this config.
Should the Axis value be inverted?
Delay until a constantly pressed key is considered "pressed" again.
Interval in which the check timer for the repeat delay is decremented.
Key hint text, overrides HintToken when set
Token for translating the key hint text.
Should this button react on key presses when a Valheim GUI is open? Defaults to false.
Should this button react on key presses when a custom GUI is open and requested to block input? Defaults to false.
Should this button block all other inputs using the same key or button? Defaults to false.
Warning: If set to true, all other input using the same key or axis is reset when queried via ZInput.
Make sure to gate your usage properly.
Internal flag if this button config is backed by any BepInEx ConfigEntry
Configuration class for adding custom clutter.
Use this in a constructor of
Whether this clutter gets spawned in the world. Defaults to true.
Biome to spawn in, multiple Biomes can be allowed with .
Default to all biomes.
Whether this clutter has an attached that should be used.
The amount of displayed clutter prefabs per patch.
For high values an should be used to lower the amount of overall prefabs.
Whether this clutter should be shown on unmodified ground.
Whether this clutter should be shown on modified ground.
Minimum random size of the prefab, only active when is used.
Maximum random size of the prefab, only active when is used.
Maximum terrain tilt in degrees this clutter will be placed on.
Minimum terrain height this clutter will be placed on.
Maximum terrain height this clutter will be placed on.
Whether the y position will always be at water level.
Used before
Random y offset of every individual prefab.
Calculated after .
Whether this clutter will be rotated with the underlying terrain.
Otherwise it will always point straight up.
Whether the clutter should check for ocean height.
Minimum ocean depth that is needed to place this clutter.
Needs to be true.
Maximum ocean depth to place this clutter.
Needs to be true.
Whether the clutter should check for forest thresholds.
Minimum value of the forest fractal:
0 - 1: inside the forest
1: forest edge
1 - infinity: outside the forest
Maximum value of the forest fractal:
0 - 1: inside the forest
1: forest edge
1 - infinity: outside the forest
Size of a noise map used to determine if the clutter should be placed.
Set to 0 to disable and place it everywhere.
Offset of the noise map.
Minimum value of the noise map that is needed to place the clutter.
Maximum value of the noise map to place the clutter.
Create a new
Create a copy of the
Base class for adding new ItemConversions to various Valheim stations
The name of the station prefab this conversion is added to.
The name of the item prefab you need to put ín the station.
The name of the item prefab that your "FromItem" will be turned into.
Used to add new ItemConversions to the CookingStation
The name of the station prefab this conversion is added to. Defaults to .
Amount of time it takes to perform the conversion. Defaults to 10f.
Turns the CookingConversionConfig into a Valheim CookingStation.ItemConversion item.
The Valheim CookingStation.ItemConversion
Loads a single CookingConversionConfig from a JSON string
JSON text
Loaded CookingConversionConfig
Loads a list of CookingConversionConfigs from a JSON string
JSON text
Loaded list of CookingConversionConfigs
Helper to get existing cooking station names
Cooking station
Iron cooking station
Stone oven cooking station
Gets the human readable name to internal names map
Get a of all cooking station names.
This can be used to create a where only valid cooking stations can be selected.
Example:
var stationConfig = Config.Bind("Section", "Key", nameof(CookingStations.CookingStation), new ConfigDescription("Description", CookingStations.GetAcceptableValueList()));
Get the internal name for a cooking station from its human readable name.
The matched internal name.
If the cookingStation parameter is null or empty, an empty string is returned.
Otherwise the unchanged cookingStation parameter is returned.
Helper to get existing crafting station names
No crafting station
Workbench crafting station
Forge crafting station
Stonecutter crafting station
Cauldron crafting station
Artisan table crafting station
Black forge crafting station
Galdr table crafting station
Mead Ketill crafting station
Food Preparation Table crafting station
Gets the human readable name to internal names map
Get a of all crafting station names.
This can be used to create a where only valid crafting stations can be selected.
Example:
var stationConfig = Config.Bind("Section", "Key", nameof(CraftingStations.Workbench), new ConfigDescription("Description", CraftingStations.GetAcceptableValueList()));
Get the internal name for a crafting station from its human readable name.
The matched internal name.
If the craftingStation parameter is null or empty, is returned.
Otherwise the unchanged craftingStation parameter is returned.
Configuration class for adding custom creature spawns.
Use this in a constructor of
The unique name for your custom creature. May be tokenized.
Group tag of this creature.
Creatures in the same group don't attack each other, regardless of faction.
of this creature.
If set to true, stack the "EnableObject" action for all levels
instead of only activating the GameObject of the highest level matched.
Array of DropConfigs to use for this creature's .
A component will automatically be added if not present.
The drop table of an existing component will be replaced.
Array of SpawnConfigs used for world spawns of your custom creature.
Leave empty if you don't want your creature to spawn in the world automatically.
String array of items this creature can consume to use in the component.
Jötunn will try to resolve all strings to ItemDrops at runtime.
An existing consumeItems table will be replaced.
Apply this config's values to a creature GameObject.
Prefab to apply this config to
Converts the DropConfigs to Valheim style array.
The Valheim array
Converts the SpawnConfigs to Valheim style array.
The Valheim array
Creates an array of mocks for the consumeItem list of the creature.
An array of mocks
Appends a new to the array of existing ones.
Appends a new to the array of existing ones.
Appends a new consumable to the array of existing ones.
Configuration class for drops of CustomCreatures used in .
Name of the item prefab of this drop. Gets resolved by Jötunn at runtime.
Minimum amount of this drop. Defaults to 1.
Maximum amount of this drop. Defaults to 1.
Chance of this drop in percent. Defaults to 100f.
If true, only one instance per active player will be dropped regardless of min/max amount. Defaults to false.
Should the drop amount be multiplied by the creature level. Defaults to true.
Creates a Valheim from this config.
The Valheim
Used to add new ItemConversions to the Fermenter
The name of the station prefab this conversion is added to. Defaults to .
The amount of items one conversion yields. Defaults to 4.
Turns the FermenterConversionConfig into a Valheim Fermenter.ItemConversion item.
The Valheim Fermenter.ItemConversion
Loads a single FermenterConversionConfig from a JSON string
JSON text
Loaded FermenterConversionConfig
Loads a list of FermenterConversionConfigs from a JSON string
JSON text
Loaded list of FermenterConversionConfigs
Helper to get existing fermenter names
Fermenter
Gets the human readable name to internal names map
Get a of all fermenter names.
This can be used to create a where only valid fermenter can be selected.
Example:
var fermenterConfig = Config.Bind("Section", "Key", nameof(Fermenters.Fermenter), new ConfigDescription("Description", Fermenters.GetAcceptableValueList()));
Get the internal name for a fermenter from its human readable name.
The matched internal name.
If the fermenter parameter is null or empty, an empty string is returned.
Otherwise the unchanged fermenter parameter is returned.
Used to add new IncineratorConversions to the Incinerator
The name of the station prefab this conversion is added to. Defaults to .
List of requirements for this conversion.
The amount of items one conversion yields. Defaults to 1.
Priority of this conversion.
Lower prioritized conversions will be incinerated first when mulitple conversions requirements are met.
True: Requires only one of the list of ingredients to be able to produce the result.
False: All of the ingredients are required.
Defaults to false.
Turns the IncineratorConversionConfig into a Valheim Incinerator.IncineratorConversion item.
The Valheim Incinerator.IncineratorConversion
Loads a single IncineratorConversionConfig from a JSON string
JSON text
Loaded IncineratorConversionConfig
Loads a list of IncineratorConversionConfigs from a JSON string
JSON text
Loaded list of IncineratorConversionConfigs
Wrapper for the
Name of the item prefab of this incinerator requirement
Amount that is needed to fulfill the requirement. Defaults to 1.
Creates a new incinerator requirement config with default values.
Creates a new incinerator requirement config with the given values.
Creates a Valheim Piece.Requirement from this config.
Helper to get existing incinerator names
Incinerator
Gets the human readable name to internal names map
Get a of all incinerator names.
This can be used to create a where only valid incinerator can be selected.
Example:
var incineratorConfig = Config.Bind("Section", "Key", nameof(Incinerators.Incinerator), new ConfigDescription("Description", Incinerators.GetAcceptableValueList()));
Get the internal name for a incinerator from its human readable name.
The matched internal name.
If the incinerator parameter is null or empty, an empty string is returned.
Otherwise the unchanged incinerator parameter is returned.
Configuration class for adding custom items. Automatically creates a recipe for this item.
Use this in a constructor of and
Jötunn resolves the references to the game objects at runtime.
The unique name for your item. May be tokenized.
The description of your item. May be tokenized.
The name of the item prefab. Is automatically set in .
The amount of that will be created when crafting this item. Defaults to 1.
Whether this item is craftable or not. Defaults to true.
The name of the piece table prefab this item uses to build pieces.
The name of the crafting station prefab where this recipe can be crafted.
Can be set to null to have the recipe be craftable without a crafting station.
The name of the crafting station prefab where this item can be repaired.
Can be set to null to have the item be repairable without a crafting station.
The minimum required level for the crafting station. Defaults to 1.
Whether this recipe requires only one of the crafting requirements to be crafted. Defaults to false.
Multiplier for the amount of items created by the recipe based on the quality of the crafting materials. Defaults to 1.
Weight of a single item in an inventory. Values lower than 0 are ignored when applying the config. Defaults to -1.
Maximum stack size. Values lower than 1 are ignored when applying the config. Defaults to -1.
Icons for this item. If more than one icon is added, this item automatically has variants.
Gets or sets the first icon of the item. For item variants with multiple icons, use the property instead.
Texture holding the variants different styles.
Array of s for all crafting materials it takes to craft the recipe.
Apply this config's values to a GameObject's ItemDrop.
Converts the RequirementConfigs to Valheim style Piece.Requirements
The Valheim Piece.Requirement array
Converts the ItemConfig to a Valheim style Recipe.
The Valheim recipe
Loads a single ItemConfig from a JSON string
JSON text
Loaded ItemConfig
Loads a list of ItemConfigs from a JSON string
JSON text
Loaded list of ItemConfigs
Appends a new to the array of existing ones.
If the requirement is null or is not valid (has not item name or amount set) nothing will be added.
Appends a new to the array of existing ones.
If the item name is null or empty or the amount is less than 1 nothing will be added.
The internal item prefab id, see https://valheim-modding.github.io/Jotunn/data/objects/item-list.html or the Valheim Wiki
The amount of items needed to craft this item
The amount of items needed to upgrade this item. The basic formular is: Upgrade Amount = Item Level * Amount Per Level
Configuration class for adding custom key hints.
Item for which the KeyHint should be displayed when equipped.
Must be the name of the prefab as registered in the .
If not null or empty the KeyHint will also be bound to a specific
which must be selected for building.
Array of s used for this key hint.
Internal marker if any of the button configs backed by a BepInEx ConfigEntry did change
to regenerate the key hint object
Kitbash configuration for a prefab
A list of KitbashSourceConfigs to apply to the prefab
Optional: The layer of the prefab, all Kitbashed parts will be set to this layer
Whether to fix references on the prefab
Configuration class for defining kitbash parts to add to a prefab with
An optional name of the pasted GameObject
Defaults to the source name
Target parent of the pasted GameObject
Defaults to the root of the prefab
Source prefab that contains the GameObject to copy
Location of the GameObject to copy from the source prefab
Position of the pasted GameObject
Defaults to
Rotation of the pasted GameObject
Defaults to (no rotation)
Scale of the pasted GameObject
Defaults to (no rescale)
An optional list of Materials to set on the pasted GameObject
Defaults to the original materials
Configuration class for adding custom localizations.
Language of this localization. Defaults to English.
Dictionary of tokens and their respective translation in this configs language.
A new localization for a specific language.
Name of the language
Configuration class for adding custom locations.
Use this in a constructor of and
Associated component
Biome to spawn in, multiple Biomes can be allowed with
BiomeArea to spawn in, defaults to Everything
Enable to place this kind of location first, and make it twice as likely that the objects will all be placed (random samples increase from 100,000 to 200,000)
Upper limit on how many of these locations will be placed in the world
Unused in Valheim, but available in case that changes in the future
Radius of the location. Terrain delta is calculated within this circle.
If left unset, falls back to the prefab's component value when one exists.
Defaults to 10f when no value has been set and no component is present.
True when the caller explicitly assigned a value to .
Attempt to place in the central zone first
Enable to check forest thresholds against the forest fractal.
Minimum value of the forest fractal:
0 - 1: inside the forest
1: forest edge
1 - infinity: outside the forest
Maximum value of the forest fractal:
0 - 1: inside the forest
1: forest edge
1 - infinity: outside the forest
Enable to make this location unique, it will not be replaced when locations change
Minimal altitude of the location
Maximum altitude of the location
Minimum distance from the center of the map of the location
Maximum distance from the center of the map of the location
Group of the location. Used with
Minimum distance to a similar location, either the same location or a location with the same
Minimum terrain delta (difference between min and max height) in the circle defined by
Maximum terrain delta (difference between min and max height) in the circle defined by
Rotate towards the average slope of the terrain in the circle defined by
Enable to activate interior handling
Radius of the interior attached to the location.
If left unset, falls back to the prefab's component value when one exists.
True when the caller explicitly assigned a value to .
Environment string used by the interior
Randomize location rotation when placing
Place at water level
Enable if the location places an icon to push the location icons
Always show the associated icon on the minimap
Enable to forbid Vegetation from spawning inside the circle defined by .
If left unset, falls back to the prefab's component value when one exists.
True when the caller explicitly assigned a value to .
Create a new
Create a copy of the
ZoneLocation to copy
Converts the LocationConfig to a Valheim style .
The Valheim
Helper to get existing piece category names
Piece 'Misc' category
Piece 'Crafting' category
Piece 'Building' category
Piece 'HeavyBuild' category
Piece 'Furniture' category
Piece 'DeepNorth' category
Piece 'Food' category
Piece 'Mead' category
Piece 'Feasts' category
All piece categories.
Since Valheim 1.0 this doesn't show the piece under every tag in the build menu anymore,
use to define where a piece shows up.
Gets the human readable name to internal names map
Get a of all piece category names.
This can be used to create a where only valid piece category can be selected.
Example:
var pieceCategoryConfig = Config.Bind("Section", "Key", nameof(PieceCategories.Building), new ConfigDescription("Description", PieceCategories.GetAcceptableValueList()));
Get the internal name for a piece category from its human readable name.
The matched internal name.
If the pieceCategory parameter is null or empty, an empty string is returned.
Otherwise the unchanged pieceCategory parameter is returned.
Configuration class for adding custom pieces.
Use this in a constructor of and
Jötunn resolves the references to the game objects at runtime.
The name for your piece. May be tokenized.
The description of your piece. May be tokenized.
Whether this piece is buildable or not. Defaults to true.
Can this piece be built in dungeons? Defaults to false.
The name of the piece table where this piece will be added.
The name of the category this piece belongs to.
If the given category can't be found, a new is created.
Pieces of a custom category are shown under an own tag in the build menu,
next to the vanilla tags defined by .
Hammer categories where this piece can be selected.
See for valid values.
If left empty, Jötunn will guess appropriate tags from the piece's category, components and name.
The name of the crafting station prefab which needs to be in close proximity to build this piece.
The name of the crafting station prefab to which this piece will be an upgrade to.
Icon which is displayed in the crafting GUI.
Array of s for all crafting materials it takes to craft the recipe.
Apply this configs values to a piece GameObject.
Converts the RequirementConfigs to Valheim style array.
The Valheim array
Loads a single PieceConfig from a JSON string
JSON text
Loaded PieceConfig
Loads a list of PieceConfigs from a JSON string
JSON text
Loaded list of PieceConfigs
Appends a new to the array of existing ones.
If the requirement is null or is not valid (has not item name or amount set) nothing will be added.
Appends a new to the array of existing ones.
If the item name is null or empty or the amount is less than 1 nothing will be added.
The internal item prefab id, see https://valheim-modding.github.io/Jotunn/data/objects/item-list.html or the Valheim Wiki
The amount of items needed to place this piece
Whether the item is dropped after deconstructing a piece
Configuration class for adding custom piece tables.
Indicator if the uses the vanilla categories. Defaults to true.
Indicator if the uses custom categories. Defaults to false.
Array of custom categories the uses.
Will be ignored when is false.
Indicator if the can also remove pieces. Defaults to true.
Indicator if Jötunn guesses the hammer usage tags for pieces added to this
which have no usage tags set. Defaults to true.
Creates the final categories array for this .
Adds vanilla categories when is true.
Adds custom categories when is true.
Array of category strings.
Apply this configs values to a piece table GameObject.
Helper to get existing piece table names
Hammer piece table
Cultivator piece table
Hoe piece table
Serving Tray piece table
Gets the human readable name to internal names map
Get a of all piece table names.
This can be used to create a where only valid piece table can be selected.
Example:
var pieceTableConfig = Config.Bind("Section", "Key", nameof(PieceTables.Hammer), new ConfigDescription("Description", PieceTables.GetAcceptableValueList()));
Get the internal name for a piece table from its human readable name.
The matched internal name.
If the pieceTable parameter is null or empty, an empty string is returned.
Otherwise the unchanged pieceTable parameter is returned.
Helper to get existing piece usage tag names
Piece 'Misc' usage tag
Piece 'Crafting' usage tag
Piece 'Building' usage tag
Piece 'Floor' usage tag
Piece 'Wall' usage tag
Piece 'Roof' usage tag
Piece 'Architecture' usage tag
Piece 'Furniture' usage tag
Piece 'Lighting' usage tag
Piece 'Decor' usage tag
Piece 'Storage' usage tag
Piece 'Transport' usage tag
Piece 'Food' usage tag
Piece 'Meads' usage tag
Piece 'Feasts' usage tag
Piece 'Defense' usage tag
Piece 'Stacks' usage tag
Piece 'Stairs' usage tag
Piece 'Doors' usage tag
Piece 'Seasonal' usage tag
Gets the human readable name to internal names map
Get a of all piece usage tag names.
Since a piece can have any number of tags, store them as one comma separated
Example:
var pieceUsageConfig = Config.Bind("Piece", "Hammer Usages", $"{PieceUsages.Storage},{PieceUsages.Doors}", $"Comma separated usage tags.\n{PieceUsages.GetAcceptableValueList().ToDescriptionString()}");
pieceConfig.Usage = pieceUsageConfig.Value.Split(',');
Get the internal name for a piece usage tag from its human readable name.
The matched internal name.
If the pieceUsage parameter is null or empty, an empty string is returned.
Otherwise the unchanged pieceUsage parameter is returned.
Configuration class for adding custom recipes.
The unique name for your recipe.
The name of the item prefab that this recipe should create.
The amount of that will be created from this Recipe. Defaults to 1.
Whether this recipe is craftable or not. Defaults to true.
The name of the crafting station prefab where this recipe can be crafted.
Can be set to null to have the recipe be craftable without a crafting station.
The name of the crafting station prefab where this item can be repaired.
Can be set to null to have the recipe be repairable without a crafting station.
The minimum required level for the crafting station. Defaults to 1.
Whether this recipe requires only one of the crafting requirements to be crafted. Defaults to false.
Multiplier for the amount of items created by the recipe based on the quality of the crafting materials. Defaults to 1.
Array of s for all crafting materials it takes to craft the recipe.
Converts the RequirementConfigs to Valheim style Piece.Requirements
The Valheim Piece.Requirement array
Converts the RecipeConfig to a Valheim style Recipe.
The Valheim recipe
Loads a single RecipeConfig from a JSON string.
JSON text
Loaded RecipeConfig
Loads a list of RecipeConfigs from a JSON string.
JSON text
Loaded list of RecipeConfigs
Appends a new to the array of existing ones.
If the requirement is null or is not valid (has not item name or amount set) nothing will be added.
Appends a new to the array of existing ones.
If the item name is null or empty or the amount is less than 1 nothing will be added.
The internal item prefab id, see https://valheim-modding.github.io/Jotunn/data/objects/item-list.html or the Valheim Wiki
The amount of items needed to craft this item
The amount of items needed to upgrade this item. The basic formular is: Upgrade Amount = Item Level * Amount Per Level
Configuration class for requirements needed to craft items or build pieces.
Name of the item prefab of this requirement.
Amount that is needed to fulfill the requirement. Defaults to 1.
How much more of this requirement is needed per item level. Defaults to 0.
Whether the item is dropped after deconstructing a piece. Defaults to true.
Creates a new requirement config with default values.
Creates a new requirement config with the given values.
The internal item prefab id, see https://valheim-modding.github.io/Jotunn/data/objects/item-list.html or the Valheim Wiki
The amount of items needed to craft an item/piece
The amount of items needed to upgrade an item. Does not apply to pieces. The basic formular is: Upgrade Amount = Item Level * Amount Per Level
Whether the item is dropped after deconstructing a piece
Creates a Valheim Piece.Requirement from this config.
Checks if the requirement has any item and amount set.
Configuration class for adding custom rooms.
Use this in a constructor of
Theme name of this room. If adding a room to a vanilla dungeon, use nameof(Room.Theme.value)
If set to false, room will not be added to , thus
won't be used during generation.
Flag indicating if this room is a dungeon entrance.
Flag indicating if this room is an endcap.
Flag indicating if this room is a divider.
A rank value to prioritize this endcap over others during generation.
Exclude this room if the adjoining connection's is less than this value.
A weight value used to sort available rooms during some modes of generation. Defaults to 1f.
Flag to orient this room towards the center. Used only for generating camps (draugr/fuling villages).
Flag to ensure this room is only placed around the perimeter of a camp. Used only for generating camps (draugr/fuling villages).
Create a config with a theme name.
Create a new
Converts the RoomConfig to a Valheim style .
Configuration class for adding custom skills.
A SkillType used to distinguish this skill from others. This is a unique ID that Jotunn generates
based on the Identifier provided.
A unique string used to identify the skill, and used to generate the .
Do not change the Identifier after you have released a mod using it.
If the Identifier changes, so will the skill's SkillType/UID, so
all users who have your mod will lose their save progress for the skill.
The in-game name for your skill.
Can either be the name you want to see in-game, or a localization token.
The in-game description for your skill.
Can either be the description you want to see in-game, or a localization token.
The in-game icon for your skill. If null, will default to a "shield" icon.
The multiplier applied to all XP gained for this skill via .
If this is set to 0, your skill will be unable to gain XP at all.
The path to load an icon png/jpg file from.
If you wish to load from an asset bundle, use a $ to separate the path to the asset bundle,
and your sprite name in the asset bundle
This cannot be set if is also set. You can only set one of them at once.
This sample shows how you would load a sprite from an asset bundle:
IconPath = "MyMod/Assets/assetbundle$mysprite"
Converts the SkillConfig to a printable string.
String representation of the SkillConfig
Converts a Jotunn SkillConfig into a Valheim SkillDef.
Valheim SkillDef representation of the SkillConfig
Creates a SkillConfig object for mods that previously used SkillInjector.
Unique identifier of the new skill, ex: "com.jotunn.testmod.testskill"
"id" from SkillInjector
"name" from SkillInjector
"description" from SkillInjector
"increment" from SkillInjector
"icon" from SkillInjector
New SkillConfig object that bridges SkillInjector to Jotunn without losing user progress
For any new skills please do not use this method!
Loads a single SkillConfig from a JSON string.
JSON text
Loaded SkillConfig
Loads a list of SkillConfigs from a JSON string.
JSON text
Loaded list of SkillConfigs
Used to add new ItemConversions to the Smelter
The name of the station prefab this conversion is added to. Defaults to .
Turns the SmelterConversionConfig into a Valheim Smelter.ItemConversion item.
The Valheim Smelter.ItemConversion
Loads a single SmelterConversionConfig from a JSON string
JSON text
Loaded SmelterConversionConfig
Loads a list of SmelterConversionConfigs from a JSON string
JSON text
Loaded list of SmelterConversionConfigs
Helper to get existing smelter names
Smelter
Blast furnace
Charcoal kiln
Eitr refinery
Bathtub
Spinning wheel
Windmill
Gets the human readable name to internal names map
Get a of all smelter names.
This can be used to create a where only valid smelter can be selected.
Example:
var smelterConfig = Config.Bind("Section", "Key", nameof(Smelters.Smelter), new ConfigDescription("Description", Smelters.GetAcceptableValueList()));
Get the internal name for a smelter from its human readable name.
The matched internal name.
If the smelter parameter is null or empty, an empty string is returned.
Otherwise the unchanged smelter parameter is returned.
Configuration class for adding custom creature spawns.
Use this to define spawn configurations in your .
The unique name for your spawn configuration.
Should this creature be loaded into the world spawn lists? Defaults to true.
Biome to spawn in, multiple Biomes can be allowed with .
BiomeArea to spawn in. Defaults to Everything.
Maximum count of instances of this creature that can be active at the same time. Defaults to 1.
Spawning interval. Defaults to 4f.
Spawn chance each spawn interval. Defaults to 100f.
Minimum distance to another instance. Defaults to 10f.
Minimun spawn range (0 = use global setting).
Maximum spawn range.
Minimum level the creature spawns with. Defaults to 1.
Maximum level the creature spawns with. Defaults to 1.
Only spawn if this key is set. See for constant values
Only spawn if this environment is active, see for constant values
Minimum number of entities to attempt to spawn at a time. Defaults to 1.
Maximum number of entities to attempt to spawn at a time. Defaults to 1.
Radius for the group to spawn in. Defaults to 3f.
Creature can spawn at day. Defaults to true.
Creature can spawn at night. Defaults to true.
The minimum altitude (distance to water surface) for the creature to spawn. Defaults to -1000f.
The maximum altitude (distance to water surface) for the creature to spawn. Defaults to 1000f.
The minimum tilt of terrain required to spawn. Range 0 to 90.
The maximum tilt of terrain required to spawn. Range 0 to 90. Defaults to 35f.
The minimum ocean depth for the creature to spawn.
The maximum ocean depth for the creature to spawn.
Spawn can happen in forest areas. Defaults to true.
Spawn can happen outside forest areas. Defaults to true.
Set true to let the AI hunt the player on spawn.
Offset to the ground the creature spawns on. Defaults to 0.5f
Converts the SpawnConfig to a Valheim style without a prefab set.
The Valheim
Configuration class for adding custom vegetation.
Use this in a constructor of and
Biome to spawn in, multiple Biomes can be allowed with
BiomeArea to spawn in, defaults to Everything
Do a check before placing that there is nothing already from layers: "Default", "static_solid", "Default_small", "piece"
Unlike what the name suggests, Valheim will attempt 50 times the normal amount of placements, almost guaranteeing that everything will be placed
Minimum amount per zone
Values between 0 - 1 are used as a chance to place
Values above 1 are used as integer amount of maximum per zone
Minimal altitude of the vegetation
Maximum altitude of the vegetation
Minimum ocean depth
Maximum ocean depth
Minimum terrain delta (difference between min and max height) in the circle defined by
Maximum terrain delta (difference between min and max height) in the circle defined by
Minimum tilt in degrees
Maximum tilt in degrees
Enable to check forest thresholds against the forest fractal.
Minimum value of the forest fractal:
0 - 1: inside the forest
1: forest edge
1 - infinity: outside the forest
Maximum value of the forest fractal:
0 - 1: inside the forest
1: forest edge
1 - infinity: outside the forest
Size of the circle used to determine terrain delta
Minimum scale of placed instances
Maximum scale of place instances
Minimum amount in group
Maximum amount in group
Radius of group
Placement offset, use negatives to bury underground
Create a new
Create a copy of the
ZoneVegetation to copy
A custom console command.
The command that the user will need to type in their console to run your command.
The help text that will be displayed to the user for your command when they type `help` into their console.
If true, this command will only work after `devcommands` is run in the console.
If true, this command will only be allowed in networked play.
If true, and IsNetwork is true, this command will only be allowed in networked play, but only for the server.
If true, this command will not be shown when the user types `help` into their console.
The function that will be called when the user runs your console command, with space-delimited arguments.
The arguments the user types, with spaces being the delimiter.
The function that will be called when the user runs your console command, with space-delimited arguments and
a context object (Console or Chat). Use context?.AddString() to write to the respective
output.
The arguments the user types, with spaces being the delimiter.
Terminal from which this command is run (Console or Chat window)
Override this function to return a list of strings that are valid options for your command
List of valid command options
Main interface for adding custom clutter to the game.
Clutter are client side only objects scattered on the ground.
All custom clutter have to be wrapped inside this class to add it to Jötunns .
The prefab for this custom clutter.
Associated class.
Name of this custom clutter.
Indicator if references from s will be replaced at runtime.
Custom clutter from a prefab.
Can fix references for mocks.
The prefab for this custom clutter.
If true references for objects get resolved at runtime by Jötunn.
The for this custom vegation.
Custom clutter from a prefab loaded from an .
Can fix references for mocks.
A preloaded
Name of the prefab in the bundle.
If true references for objects get resolved at runtime by Jötunn.
The for this custom clutter.
Checks if a custom clutter is valid (i.e. has a prefab).
true if all criteria is met
Main interface for adding custom creatures to the game.
All custom creatures have to be wrapped inside this class to add it to Jötunns .
The creature prefab.
Associated list of of the creature.
Indicator if references from mocks will be replaced at runtime.
Indicator if references from configs should get replaced
Internal flag for the cumulative level effects hook. Value is set in the config.
Custom creature from a prefab.
The prefab of this custom creature.
If true references for objects get resolved at runtime by Jötunn.
Custom creature from a prefab with a attached.
The prefab of this custom creature.
If true references for objects get resolved at runtime by Jötunn.
The for this custom creature.
Custom creature created as a copy of a vanilla Valheim creature.
SpawnData is not cloned, you will have to add SpawnConfigs
to your if you want to spawn the cloned creature automatically.
The new name of the creature after cloning.
The name of the base prefab the custom creature is cloned from.
The for this custom creature.
Custom creature from a prefab loaded from an with a attached.
The members and references from the will be referenced by Jötunn at runtime.
A preloaded
Name of the prefab in the bundle.
If true references for objects get resolved at runtime by Jötunn.
The for this custom creature.
Checks if a custom creature is valid (i.e. has a prefab and all required components).
true if all criteria is met
Helper method to determine if a prefab with a given name is a custom creature created with Jötunn.
Name of the prefab to test.
true if the prefab is added as a custom creature to the .
Base class for all custom entities
Reference to the which added this entity.
ctor automatically getting the SourceMod
ctor with manual assigned SourceMod
Metadata of the mod adding this entity
ctor with passed calling assembly.
If the calling is no BepInEx plugin or Jotunn itself, the SourceMod will be searched via reflection
Main interface for adding custom items to the game.
All custom items have to be wrapped inside this class to add it to Jötunns .
The prefab for this custom item.
The component for this custom item as a shortcut.
The associated with this custom item. Is needed to craft
this item on a workbench or from the players crafting menu.
Indicator if references from s will be replaced at runtime.
Texture holding the variants different styles.
Indicator if references from configs should get replaced
Custom item from a prefab.
Can fix references for s and the .
The prefab for this custom item.
If true references for objects get resolved at runtime by Jötunn.
Custom item from a prefab with a made from a .
Can fix references for s.
The prefab for this custom item.
If true references for objects get resolved at runtime by Jötunn.
The item config for this custom item.
Custom item created as an "empty" primitive.
At least the name and the Icon of the must be edited after creation.
Name of the new prefab. Must be unique.
If true a ZNetView component will be added to the prefab for network sync.
Custom item created as an "empty" primitive with a made from a .
Name of the new prefab. Must be unique.
If true a ZNetView component will be added to the prefab for network sync.
The item config for this custom item.
Custom item created as a copy of a vanilla Valheim prefab.
The new name of the prefab after cloning.
The name of the base prefab the custom item is cloned from.
Custom item created as a copy of a vanilla Valheim prefab with a made from a .
The new name of the prefab after cloning.
The name of the base prefab the custom item is cloned from.
The item config for this custom item.
Custom item from a prefab loaded from an with a made from a .
Can fix references for s.
A preloaded
Name of the prefab in the bundle.
If true references for objects get resolved at runtime by Jötunn.
The item config for this custom item.
Checks if a custom item is valid (i.e. has a prefab, an and an icon, if it should be craftable).
true if all criteria is met
Helper method to determine if a prefab with a given name is a custom item created with Jötunn.
Name of the prefab to test.
true if the prefab is added as a custom item to the .
Main interface for adding custom item conversions to the game.
Supports and combines conversions for the cooking station, fermenter and smelter.
All custom item conversions have to be wrapped inside this class to add it to Jötunns .
Type of the conversion component used in game.
Add a conversion to a station with the CookingStation component attached.
Add a conversion to a station with the Fermenter component attached.
Add a conversion to a station with the Smelter component attached.
Add a conversion to a station with the Incinerator component attached.
Type of the item conversion. Defines to which station the conversion is added.
Config of the item conversion. Depends on the of the conversion.
Indicator if the conversion needs fixing.
Actual ItemConversion type as . Needs to be cast according to .
Create a custom item conversion. Depending on the config class this custom
conversion represents one of the following item conversions:
- CookingStation.ItemConversion
- Fermenter.ItemConversion
- Smelter.ItemConversion
The item conversion config
Checks if a custom item conversion is valid.
true if all criteria is met
Wrapper to hold each mod localization data.
Map that work as [language][token] = translation.
Returns true if YamlDotNet is loaded in the current AppDomain.
Placed here (not on LocalizationManager) so it can be called without triggering
LocalizationManager's static constructor, which requires the game runtime.
Default constructor.
SourceMod hint constructor.
Mod data in the shape of BepInPlugin class.
Retrieve list of languages that have been added.
Retrieve translations for given language.
Language of the translation you want to retrieve.
Retrieve a translation from this custom localization or .
Searches with the user language with a fallback to English.
Word to translate.
Translated word in player language or english as a fallback.
Checks if a translation exists for given language and token.
Language being checked.
Token being checked.
True if the token was found.
Add a translation.
Token of the translation you want to add.
The translation.
Add a translation.
Language of the translation you want to add.
Token of the translation you want to add.
The translation.
Add a group of translations.
Language of the translation you want to add.
Token-Value dictionary.
Add a translation file via absolute path.
Absolute path to file.
Is the language file a json file.
Add a json language file (match crowdin format).
Language for the json file, for example, "English"
Entire file as string
Add a YAML language file. Keys are flat string-to-string mappings.
Language for the yaml file, for example, "English"
Entire file as string
Add a Unity style translation file.
Contents of the language file in string format.
Attempts to remove a given token from certain language.
Language from which to search the token.
Token to clear.
Attempts to remove a given token from default language.
Token to clear.
Attempts to remove given language.
Language to clear.
Clear all localization data.
Main interface for adding custom locations to the game.
All custom locations have to be wrapped inside this class to add it to Jötunns .
The exterior prefab for this custom location.
Associated component
Associated component
Name of this custom location
Indicator if references from s will be replaced at runtime.
Indicator if location is added from SoftReferenceableAssets.
Used to delay mocking prefabs until ZoneSystem.SpawnLocation()
Custom location from a prefab with a attached.
Does not fix references.
The exterior prefab for this custom location.
The for this custom location.
Custom location from a prefab with a attached.
Does not fix references.
The exterior prefab for this custom location.
The interior prefab for this custom location.
The for this custom location.
Custom location from a prefab with a attached.
The exterior prefab for this custom location.
If true references for objects get resolved at runtime by Jötunn.
The for this custom location.
Custom location from a prefab with a attached.
The exterior prefab for this custom location.
The interior prefab for this custom location.
If true references for objects get resolved at runtime by Jötunn.
The for this custom location.
Custom location from a prefab with a attached. Using SoftReference system.
The exterior prefab for this custom location.
If true references for objects get resolved at runtime by Jötunn.
The for this custom location.
Helper method to determine if a location prefab with a given name is a custom location created with Jötunn.
Name of the prefab to test.
true if the prefab is added as a custom location to the .
Main interface for adding custom pieces to the game.
All custom pieces have to be wrapped inside this class to add it to Jötunns .
The prefab for this custom piece.
The component for this custom piece as a shortcut.
Name of the this custom piece belongs to.
Name of the category this custom piece belongs to.
When setting this value, Piece.m_category will be updated as well.
Pieces of a custom category are shown under an own tag in the build menu,
next to the vanilla tags defined by .
Hammer categories where this custom piece can be selected.
See for valid values.
If left empty, Jötunn will guess appropriate tags from the piece's category, components and name.
Indicator if references from s will be replaced at runtime.
Indicator if references from configs should get replaced
Custom piece from a prefab.
Will be added to the provided by name.
Can fix references from s or not.
The prefab for this custom piece.
Name of the the custom piece should be added to.
Can by the "internal" or the s name (e.g. "_PieceTableHammer" or "Hammer")
If true references for objects get resolved at runtime by Jötunn.
Custom piece from a prefab with a attached.
The members and references from the will be referenced by Jötunn at runtime.
The prefab for this custom piece.
The for this custom piece.
Custom piece from a prefab with a attached.
The members and references from the will be referenced by Jötunn at runtime.
The prefab for this custom piece.
If true references for objects get resolved at runtime by Jötunn.
The for this custom piece.
Custom piece from a prefab loaded from an .
Will be added to the provided by name.
Can fix references from s or not.
A preloaded
Name of the prefab in the bundle.
Name of the the custom piece should be added to.
Can by the "internal" or the s name (e.g. "_PieceTableHammer" or "Hammer")
If true references for objects get resolved at runtime by Jötunn.
Custom piece from a prefab loaded from an with a attached.
The members and references from the will be referenced by Jötunn at runtime.
A preloaded
Name of the prefab in the bundle.
The for this custom piece.
Custom piece from a prefab loaded from an with a attached.
The members and references from the will be referenced by Jötunn at runtime.
A preloaded
Name of the prefab in the bundle.
If true references for objects get resolved at runtime by Jötunn.
The for this custom piece.
Custom piece created as an "empty" primitive.
Will be added to the provided by name.
Name of the new prefab. Must be unique.
If true a ZNetView component will be added to the prefab for network sync.
Name of the the custom piece should be added to.
Can by the "internal" or the s name (e.g. "_PieceTableHammer" or "Hammer")
Custom piece created as an "empty" primitive with a attached.
The members and references from the will be referenced by Jötunn at runtime.
Name of the new prefab. Must be unique.
If true a ZNetView component will be added to the prefab for network sync.
The for this custom piece.
Custom piece created as a copy of a vanilla Valheim prefab.
Will be added to the provided by name.
The new name of the prefab after cloning.
The name of the base prefab the custom item is cloned from.
Name of the the custom piece should be added to.
Can by the "internal" or the s name (e.g. "_PieceTableHammer" or "Hammer")
Custom piece created as a copy of a vanilla Valheim prefab with a attached.
The members and references from the will be referenced by Jötunn at runtime.
The new name of the prefab after cloning.
The name of the base prefab the custom item is cloned from.
The for this custom piece.
Checks if a custom piece is valid (i.e. has a prefab, a target PieceTable is set,
has a component and that component has an icon).
true if all criteria is met
Helper method to determine if a prefab with a given name is a custom piece created with Jötunn.
Name of the prefab to test.
true if the prefab is added as a custom piece to the .
Main interface for adding custom piece tables to the game.
All custom piece tables have to be wrapped inside this class
to add it to Jötunns .
The prefab for this custom piece table.
The component for this custom piece table as a shortcut.
String array of categories used on the .
All categories listed here are registered when the table is added.
Indicator if Jötunn guesses the hammer usage tags for pieces added to this
which have no usage tags set. Defaults to true.
Set to false to keep the usage tags defined on the piece prefabs untouched.
Custom piece table from a prefab.
The prefab for this custom piece table. It has to have a component attached
Custom piece table from a prefab with a attached.
The prefab for this custom piece table. It has to have a component attached.
The for this custom piece table.
"Empty" custom piece table with a attached.
The name of the custom piece table.
The for this custom piece table.
Custom piece table from a prefab loaded from an with a attached.
A preloaded
Name of the prefab in the bundle. It has to have a component attached.
The for this custom piece table.
Checks if a custom piece table is valid (i.e. has a prefab and a PieceTable component).
true if all criteria is met
Wrapper for custom added GameObjects holding the mod reference.
Original prefab
Indicator if references from s will be replaced at runtime.
Internal ctor with provided metadata.
Does not fix references.
Prefab added
Metadata of the mod adding this prefab
Custom prefab.
Can fix references for s.
The prefab for this custom item.
If true references for objects get resolved at runtime by Jötunn.
Custom prefab loaded from an .
Can fix references for s.
A preloaded
Name of the prefab in the bundle.
If true references for objects get resolved at runtime by Jötunn.
Checks if a custom item is valid (i.e. has a prefab, an and an icon, if it should be craftable).
true if all criteria is met
Helper method to determine if a prefab with a given name is a custom prefab created with Jötunn.
Name of the prefab to test.
true if the prefab is added as a custom prefab to the .
Main interface for adding custom recipes to the game.
All custom recipes have to be wrapped inside this class to add it to Jötunns .
The for this custom recipe.
Indicator if references from s will be replaced at runtime.
Indicator if references from s will be replaced at runtime.
Custom recipe from a .
Can fix references for s and s or not.
The for a custom item.
If true references for objects get resolved at runtime by Jötunn.
If true references for s get resolved at runtime by Jötunn.
Custom recipe from a .
The is created automatically by Jötunn at runtime.
The for a custom recipe.
Checks if a custom status effect is valid (i.e. has a ).
true if all criteria is met
Main interface for adding custom dungeon rooms to the game.
All custom rooms have to be wrapped inside this class to add it to Jötunns .
The prefab for this custom room.
The component for this custom room as a shortcut.
The name of this custom room as a shortcut.
Indicator if references from s will be replaced at runtime.
Theme name of this room.
Indicator if room is added from SoftReferenceableAssets.
Used to delay mocking prefabs until DungeonGenerator loads the room.
Associated holding data used during generation.
Custom room from a prefab loaded from an with a made from a .
Can fix references for s.
A preloaded
Name of the prefab in the bundle.
If true references for objects get resolved at runtime by Jötunn.
The config for this custom room.
Custom room from a prefab loaded from an with a made from a .
Can fix references for s.
The prefab for this custom room.
If true references for objects get resolved at runtime by Jötunn.
The config for this custom room.
Custom room from a SoftReference prefab with a attached. Using SoftReference system.
The prefab is not loaded until the DungeonGenerator needs it during generation.
A to the room prefab registered in a SoftRef manifest.
If true references for objects get resolved at runtime by Jötunn.
The config for this custom room.
Helper method to determine if a prefab with a given name is a custom room created with Jötunn.
Name of the prefab to test.
true if the prefab is added as a custom item to the .
Helper method to determine if a given themeName matches any vanilla values.
Name of the theme to test.
true if the themeName matches a built-in value, or false.
Helper method to get the value, if the given themeName matches any vanilla values.
Name of the theme.
The value, or Room.Theme.None if no match is found.
Wrapper for Valheim's RPC calls implementing convenience delegate methods for client and server processing of packages.
Automatically compresses and slices big packages to fit into the Steam package limit.
All sending and processing of received packages is executed in Coroutines to ensure the game loop's execution.
Name of the custom RPC as defined at instantiation
True, if this RPC is currently sending data
True, if this RPC is currently receiving data
True, if this RPC is currently processing received data.
This is always true while executing the registered delegates.
True, if this RPC is processing received data outside the current delegate call.
This should only be used in the registered delegate methods to determine
if this RPC is already processing another package.
Unique ID of this RPC to prevent name clashes between mods
Delegate called when a package is received on the server
Delegate called when a package is received on the client
Internal constructor only, CustomRPCs are instantiated via
Reference to the which created this RPC.
Initiates an RPC exchange with the server by sending an empty package.
Send a package to a single target. Compresses and fragments the package if necessary.
Send a package to a list of peers. Compresses and fragments the package if necessary.
Coroutine to send a package to a single target. Compresses and fragments the package if necessary.
Coroutine to send a package to a list of peers. Compresses and fragments the package if necessary.
Coroutine to send a package to an actual peer.
Receive and handle an incoming package
Main interface for adding custom status effects to the game.
All custom status effects have to be wrapped inside this class to add it to Jötunns .
The for this custom status effect.
Indicator if references from s will be replaced at runtime.
Custom status effect from a .
Can fix references for s.
A preloaded
If true references for objects get resolved at runtime by Jötunn.
Checks if a custom status effect is valid (i.e. has a ).
true if all criteria is met
Main interface for adding custom vegetation to the game.
All custom vegetation have to be wrapped inside this class to add it to Jötunns .
The prefab for this custom vegetation.
Associated component
Name of this custom vegetation
Indicator if references from s will be replaced at runtime.
Custom vegetation from a prefab.
The prefab for this custom vegetation.
The vegetation config for this custom vegation.
Custom vegetation from a prefab.
Can fix references for mocks.
The prefab for this custom vegetation.
If true references for objects get resolved at runtime by Jötunn.
The for this custom vegation.
Custom vegetation from a prefab loaded from an .
Can fix references for mocks.
A preloaded
Name of the prefab in the bundle.
If true references for objects get resolved at runtime by Jötunn.
The for this custom vegation.
Helper method to determine if a prefab with a given name is a custom Vegetation created with Jötunn.
Name of the prefab to test.
true if the prefab is added as a custom vegetation to the .
Checks if a custom vegetation is valid (i.e. has a prefab, an and an icon, if it should be craftable).
true if all criteria is met
Container class for Kitbashed prefabs, returned by
Callback that is called when Kitbashes are applied
The Kitbashed prefab
Config for the KitbashObject
Helper class for creating Mocks of a given vanilla Component.
Type of the mocked
Create a new Mock of type T : Component
Name of the original component
Mocked
Helper class for creating Mocks of item/piece requirements.
Creates a mocked Piece.Requirement
Prefab name
Amount
Whether the item is dropped after deconstructing a piece
Creates a mocked Piece.Requirement array
List of prefab names and amounts
Whether the items are dropped after deconstructing a piece
Helper for Arrays
Populate an array with a default value
Array value type
Array instance
Default value
Reference to the array instance
Extends with convenience functions.
Check, if this config entry is "visible"
Check, if this config entry is "syncable"
Get bound button's name
Get bound button config
Get the local value of an admin config
Set the local value of an admin config
Extends ConfigFile with a convenience method to bind config entries with less boilerplate code
and explicitly expose commonly used configuration manager attributes.
Formats section name as "{sectionNumber} - {section}" based on how
many sections have been bound to this config.
Orders settings within a section.
Bind a new config entry to the config file and modify description to state whether the config entry is synced or not.
Type of the value the config entry holds.
Configuration file to bind the config entry to.
Configuration file section to list the config entry in. Settings are grouped by this.
Name of the setting.
Default value of the config entry.
Plain text description of the config entry to display as hover text in configuration manager.
Whether the config entry IsAdminOnly and should be synced with server.
Whether to number the section names using a prefix based on the order they are bound to the config file.
Whether to order the settings in each section based on the order they are bound to the config file.
Acceptable values for config entry as an AcceptableValueRange, AcceptableValueList, or custom subclass.
Custom setting editor (OnGUI code that replaces the default editor provided by ConfigurationManager).
Config manager attributes for additional user specified functionality. Any fields of BindConfig will overwrite properties in configAttributes.
ConfigEntry bound to the config file.
Bind a new config entry to the config file and modify description to state whether the config entry is synced or not.
Type of the value the config entry holds.
Configuration file to bind the config entry to.
Configuration file section to list the config entry in. Settings are grouped by this.
Name of the setting.
Default value of the config entry.
Plain text description of the config entry to display as hover text in configuration manager.
Whether the config entry IsAdminOnly and should be synced with server.
Order of the setting on the settings list relative to other settings in a category. 0 by default, higher number is higher on the list.
Acceptable values for config entry as an AcceptableValueRange, AcceptableValueList, or custom subclass.
Custom setting editor (OnGUI code that replaces the default editor provided by ConfigurationManager).
Config manager attributes for additional user specified functionality. Any fields of BindConfig will overwrite properties in configAttributes.
ConfigEntry bound to the config file.
Sets SaveOnConfigSet and returns the original value before this method was called.
Helper methods for strings
Returns true if the string contains any of the substrings.
Returns true if the string ends with any one of the suffixes.
Returns true if the string starts with any one of the prefixes.
If the string ends with the suffix then return a copy of the string
with the suffix stripped, otherwise return the original string.
If the string starts with the prefix then return a copy of the string
with the prefix stripped, otherwise return the original string.
Returns a copy of the string with the first character capitalized
Convenience methods for Transforms
Extension method to find nested children by name using either
a breadth-first or depth-first search. Default is breadth-first.
Name of the child object to search for.
Whether to preform a breadth first or depth first search. Default is breadth first.
Helper class for C# Events.
try/catch the delegate chain so that it doesnt break on the first failing Delegate.
try/catch the delegate chain so that it doesnt break on the first failing Delegate.
try/catch the delegate chain so that it doesnt break on the first failing Delegate.
try/catch the delegate chain so that it doesnt break on the first failing Delegate.
Extends GameObject with a shortcut for the Unity bool operator override.
Facilitates use of null propagation operator for unity GameObjects by respecting op_equality.
this
Returns null when GameObject.op_equality returns false.
Facilitates use of null propagation operator for unity MonBehaviours by respecting op_equality.
Any type that inherits MonoBehaviour
this
Returns null when MonoBehaviours.op_equality returns false.
Returns the component of Type type. If one doesn't already exist on the GameObject it will be added.
Source: https://wiki.unity3d.com/index.php/GetOrAddComponent
The type of Component to return.
The GameObject this Component is attached to.
Component
Adds a new copy of the provided component to a gameObject
Check if GameObject has any of the specified components.
Check if GameObject has any of the specified components.
Check if GameObject has all of the specified components.
Check if GameObject has all of the specified components.
Check if GameObject or any of it's children
have any of the specified components.
Extension method to find nested children by name using either
a breadth-first or depth-first search. Default is breadth-first.
Name of the child object to search for.
Whether to preform a breadth first or depth first search. Default is breadth first.
Extension method to find nested children by an ordered list of names using either
a breadth-first or depth-first search. Default is breadth-first.
Names in order of the child object to search for.
Whether to preform a breadth first or depth first search. Default is breadth first.
Use only, if you know what you do.
There are no checks if a component exists.
Extends GameObject with a check if the GameObject is valid
Check for validity
Extends ItemDrop with a TokenName
m_itemData.m_shared.m_name
Extends ItemData with a TokenName.
m_shared.m_name
Extends StatusEffect with a TokenName and a check if the StatusEffect is valid so it can be added to the game.
Check for validity
Extends Piece with a TokenName
m_name
Extends StatusEffect with a TokenName and a check if the StatusEffect is valid so it can be added to the game.
m_name
Check for validity
Extends prefab GameObjects with functionality related to the mocking system.
Will attempt to fix every field that are mocks gameObjects / Components from the given object.
Resolves all references for mocks in this GameObject's components recursively
Resolves all references for mocks in this GameObject recursively.
Can additionally traverse the transforms hierarchy to fix child GameObjects recursively.
This GameObject
Traverse all child transforms
Resolves all references for mocks in this GameObject recursively.
Can additionally traverse the transforms hierarchy to fix child GameObjects recursively.
This GameObject
Traverse all child transforms
Clones all fields from this GameObject to objectToClone.
Helpful Unity Object extensions.
Extensions for working with Unity UI RectTransforms
Test if a RectTransform overlaps another RectTransform in world space
Test if a RectTransform overlaps another RectTransform in world space
Calculate the world rect of a RectTransform
Extends ZNet with a clear diversion between local, client and server instances.
Possible states of the game regarding to networking.
A local game instance playing on a local world.
A local game instance playing on a dedicated server.
A dedicated server instance.
Returns true if the game was started locally and a local world was started.
Returns true if the game was started locally and is connected to a server.
Returns true if the game was started as a dedicated server.
Determine the current game instance type regarding to networking.
Determine if a peer uid is in the admin list on the current . Only works on the server instance
The base class for all the library's various Managers
Initialize manager class after all manager scripts have been added to the root game object
A namespace wide Logger class, which automatically creates a ManualLogSource
for every Class from which it is being called.
Add DateTime to the log output
Remove and clear all Logger instances
Get or create a with the callers
A BepInEx
Logs a message with level.
Data to log
Logs a message with level.
This is used when the responsible mod is different from mod logging this message.
Known mod that is responsible for this log
Data to log
Logs a message with level.
Data to log
Logs a message with level.
This is used when the responsible mod is different from mod logging this message.
Known mod that is responsible for this log
Data to log
Logs a message with level.
Data to log
Logs a message with level.
This is used when the responsible mod is different from mod logging this message.
Known mod that is responsible for this log
Data to log
Logs a message with level.
Data to log
Logs a message with level.
This is used when the responsible mod is different from mod logging this message.
Known mod that is responsible for this log
Data to log
Logs a message with level.
Data to log
Logs a message with level.
This is used when the responsible mod is different from mod logging this message.
Known mod that is responsible for this log
Data to log
Logs a message with level.
Data to log
Logs a message with level.
This is used when the responsible mod is different from mod logging this message.
Known mod that is responsible for this log
Data to log
Main class implementing BaseUnityPlugin.
The current version of the Jotunn library.
The name of the library.
The BepInEx plugin Mod GUID being used (com.jotunn.jotunn).
Manager to handle interactions with the vanilla asset system, called SoftReferenceableAssets.
See the Vanilla FAQ for more information.
The singleton instance of this manager.
Event that is invoked when the soft referenceable system is ready to be used.
Hide .ctor
Checks if the vanilla loader is ready.
If false, Runtime.Loader must not be accessed and no assets may be loaded.
If the vanilla loader is initialized too early, mods can become incompatible.
true if the vanilla asset loader is ready, false otherwise
Registers a new asset with the same asset dependencies as the original asset and generates a unique AssetID.
Assets can be added at any time and will be registered as soon as the vanilla loader is ready.
The asset to register
Assets to copy dependencies from
AssetID generated from the prefab's name
Registers a new asset and generates a unique AssetID.
Assets can be added at any time and will be registered as soon as the vanilla loader is ready.
The asset to register
AssetID generated from the prefab's name
Registers an asset to be instantiated and have its mock references resolved on load.
Must be called before the asset is loaded the first time.
The of the asset to instantiate and resolve mocks for on load
Registers an asset to be instantiated under the given parent and have its mock references resolved on load.
Must be called before the asset is loaded the first time.
The of the asset to instantiate and resolve mocks for on load
Optional transform under which the asset will be instantiated, otherwise a default container is used
Registers an asset to be instantiated under the given parent and have its mock references resolved on load.
Must be called before the asset is loaded the first time.
The callback will be invoked when the asset is already resolved and instantiated. Multiple callbacks can be registed for the same asset.
The to instantiate and resolve mocks for on load
Optional transform under which the asset will be instantiated, otherwise a default container is used
Adds a callback when the asset was resolved and instantiated
Registers an asset to be instantiated under the given parent and have its mock references resolved on load.
Must be called before the asset is loaded the first time.
The callback will be invoked when the asset is already resolved and instantiated. Multiple callbacks can be registed for the same asset.
The of the asset to instantiate and resolve mocks for on load
Optional transform under which the asset will be instantiated, otherwise a default container is used
Adds a callback when the asset was resolved and instantiated
Generates a unique AssetID, based on the asset name
AssetID generated from the prefab's name
Generates a unique AssetID, from a given string
AssetID generated from the prefab's name
Clones a prefab and registers it in the SoftReference system with the same dependencies as the original asset
Finds the AssetID by an asset name at runtime.
The closed matching base type must be used.
E.g. for prefabs use , for Textures use etc.
If no asset is found, an invalid AssetID is returned.
Asset type to search for
Asset name to search for
The AssetID of the searched asset if found, otherwise an invalid AssetID
Thrown if the vanilla asset system is not initialized yet
Finds the AssetID by an asset name at runtime.
The closed matching base type must be used.
E.g. for prefabs use , for Textures use etc.
If no asset is found, an invalid AssetID is returned.
Asset name to search for
Asset type to search for
Thrown if the vanilla asset system is not initialized yet
Finds the AssetID by an asset name at runtime and returns a SoftReference to the asset.
Asset type to search for
Asset name to search for
Finds the AssetID by an asset name at runtime and returns a SoftReference to the asset.
Asset name to search for
Asset type to search for
Manager for handling custom console and chat commands.
The singleton instance of this manager.
Hide .ctor
Internal Action delegate to add custom entities into vanilla command's option list
A list of all the custom console commands that have been added to the game through this manager,
either by Jotunn or by mods using Jotunn.
Initialize console commands that come with Jotunn.
Adds a new console command to Valheim.
The console command to add
Fire for any ConsoleCommand when its tabOptions member
is first populated to add Jötunn entities to the option list
Manager for handling all custom data added to the game related to creatures.
The singleton instance of this manager.
Hide .ctor
Unity "character" layer ID.
Event that gets fired after the vanilla creatures are in memory and available for cloning.
Your code will execute every time before a new is copied (on every menu start).
If you want to execute just once you will need to unregister from the event after execution.
Event that gets fired after registering all custom creatures to .
Your code will execute every time a new ZNetScene is created (on every game start).
If you want to execute just once you will need to unregister from the event after execution.
Internal lists of all custom entities added
Container for Jötunn's SpawnSystemList in the DontDestroyOnLoad scene.
Reference to the SpawnList component of the container.
Creates the spawner container and registers all hooks.
Add a to the game.
Checks if the custom creature is valid and unique and adds it to the list of custom creatures.
The custom Creature to add.
true if the custom Creature was added to the manager.
Get a custom creature by its name.
Name of the custom creature to search.
The if found.
Get a custom or vanilla creature prefab by its name.
Name of the creature to search.
The prefab of the creature if found.
Remove a custom creature by its name.
Name of the creature to remove.
Remove a custom creature by its ref. Removes the custom recipe, too.
to remove.
Safely invoke the event
Resolve mocks of all custom creatures if necessary.
Safely invoke the event.
Add the internal to the awoken spawner if not already added.
Enable cumulative level effects for custom creatures requesting it. Thx ASP for the code.
Manager for handling all custom data added to the game related to creatures.
The singleton instance of this manager.
Event that gets fired after the vanilla has loaded rooms. Your code will execute
every time a main scene is started (on joining a game).
If you want to execute just once you will need to unregister from the event after execution.
Event that gets fired after all custom rooms are registered to the . Your code will execute
every time a main scene is started (on joining a game).
If you want to execute just once you will need to unregister from the event after execution.
Internal dictionary of all custom rooms
Container for Jötunn's DungeonRooms in the DontDestroyOnLoad scene.
Hide .ctor
Creates the spawner container and registers all hooks.
Add a to the game.
Checks if the custom room is valid and unique and adds it to the list of custom rooms.
The custom Room to add.
true if the custom Room was added to the manager.
Get a custom room by its name.
Name of the custom room to search.
The if found.
Remove a custom room by its name.
Name of the room to remove.
Registers a new dungeon theme, identified by a unique theme name string.
Assets can be added at any time and will be registered as soon as the vanilla loader is ready.
The prefab.
The name of the theme to register.
True if theme is successfullly registered, otherwise false.
Adds a new environment prefab to be registered when runs.
If you intend to use a custom interior environment , this method enables you
to provide a prefab with an appropriately configured containing atleast one
within .
The containing the prefab.
The name of the prefab to register.
Attempt to get room by hash.
Manager for handling anything GUI related. Provides Valheim style
GUI elements as well as an anchor for custom GUI prefabs.
Singleton instance
Hide .ctor
Event that gets fired every time the Unity scene changed and a new PixelFix
object was created. Subscribe to this event to create your custom GUI objects
and add them as a child to the .
GUI container with automatic scaling for high res displays.
Gets rebuild at every scene change so make sure to add your custom
GUI prefabs again on each scene change.
Event that gets fired every time the Unity scene changed and new CustomGUI
objects were created. Subscribe to this event to create your custom GUI objects
and add them as a child to either or .
GUI container in front of Valheim's GUI elements with automatic scaling for
high res displays and pixel correction.
Gets rebuild at every scene change so make sure to add your custom
GUI prefabs again on each scene change.
GUI container behind Valheim's GUI elements with automatic scaling for
high res displays and pixel correction.
Gets rebuild at every scene change so make sure to add your custom
GUI prefabs again on each scene change.
Unity layer constant for UI objects.
The default Valheim beige color.
The default Valheim orange color.
The default Valheim yellow color.
Scrollbar handle color block in default Valheim orange.
Toggle color block in Valheim style.
Button color block in Valheim style
Valheim's standard font, normal faced.
Valheim's standard font, bold faced.
Valheim's rune-like font, normal faced.
Valheim's rune-like font, bold faced.
Valheim's standard font as a TMPro FontAsset
Valheim's rune-like font as a TMPro FontAsset
with default Valheim assets.
SpriteAtlas holding the references to the sprites used in the helper methods.
SpriteAtlas holding the references to the sprites used in the helper methods.
Indicates if the PixelFix must be created for the start or main scene.
Detect headless mode (aka dedicated server)
Global indicator if the input is currently blocked by the GUIManager.
Counter to track multiple block requests.
Block all input except GUI
Indicator if the input should be blocked or released
Enable the InputBlock
Reset the InputBlock to its initial state (disabled)
Initialize the manager
Prevents hiding the InventoryGui on an E press or similar when the GUIManager blocks the input
Load GUI assets on first start
Create GameObjects for mods to append their custom GUI to
Add a to the manager.
Checks if the custom key hint is unique (i.e. the first one registered for an item).
Custom status effects are displayed in the game instead of the default
KeyHints for equipped tools or weapons they are registered for.
The custom key hint config to add.
true if the custom key hint config was added to the manager.
Removes a from the game.
The custom key hint config to add.
Get a sprite by name.
The sprite name
The sprite with given name
Creates and displays a Valheim style ColorPicker
Min anchor on first instantiation
Max anchor on first instantiation
Position on first instantiation
Color before editing
Display message
Event that gets called when the color gets modified
Event that gets called when one of the buttons done or cancel get pressed
When set to false the colors used don't have an alpha channel
Creates and displays a Valheim style GradientPicker
Min anchor on first instantiation
Max anchor on first instantiation
Position on first instantiation
Color before editing
Display message
Event that gets called when the gradient gets modified
Event that gets called when one of the buttons done or cancel gets pressed
Creates a Valheim style woodpanel which is draggable per default
Parent
Minimal anchor
Maximal anchor
Anchored position
Optional width
Optional height
A as a Valheim style woodpanel
Creates a Valheim style woodpanel, can optionally be draggable
Parent
Minimal anchor
Maximal anchor
Anchored position
Optional width
Optional height
Optional flag if the panel should be draggable (default true)
A as a Valheim style woodpanel
Create a complete scroll view
parent transform
show horizontal scrollbar
show vertical scrollbar
size of the handle
Colorblock for the handle
Background color for the sliding area
rect width
rect height
Create a with a Text (and optional Outline and ContentSizeFitter) component
Text to show
Parent transform
Anchor min
Anchor max
Anchored position
Font
Font size
Font color
Add outline component
Outline color
Width
Height
Add ContentSizeFitter
A text
Create a new button (Valheim style).
Text to display on the button
Parent transform
Min anchor
Max anchor
Position
Set width if > 0
Set height if > 0
Button GameObject in Valheim style
Create a new InputField (Valheim style).
Parent transform
Min anchor
Max anchor
Position
Content type for the input field
Text to display as a placeholder (can be null)
Optional font size, defaults to 16
Set width if > 0
Set height if > 0
Input field GameObject in Valheim style
Create toggle field
Parent transform
Set width
Set height
Create dropdown field
Parent transform
Min anchor
Max anchor
Position
Optional font size, defaults to 16
Set width if > 0
Set height if > 0
Create key binding field
Apply Valheim style to a woodpanel.
Apply Valheim style to a Component
Target component
Own font or GUIManager.Instance.AveriaSerifBold/GUIManager.Instance.AveriaSerif
Custom color or GUIManager.Instance.ValheimOrange
creates an component when true
Optional font size, defaults to 16
Apply Valheim style to a Component.
Uses GUIManager.Instance.AveriaSerifBold by default
Target component
Custom color or GUIManager.Instance.ValheimOrange
creates an component when true
Optional font size, defaults to 16
Apply Valheim style to a Component.
Uses GUIManager.Instance.AveriaSerifBold, Color.white and creates an outline by default
Target component
Optional font size, defaults to 16
Apply valheim style to a Component
Component to apply the style to
Optional font size, defaults to 16
Apply Valheim style to an Component.
Component to apply the style to
Apply Valheim style to an Component.
Component to apply the style to
Optional font size, defaults to 16
Apply Valheim style to a component.
Component to apply the style to
Apply Valheim style to a component.
Component to apply the style to
Optional font size, defaults to 16
Apply Valheim style to a component.
Component to apply the style to
Apply Valheim style to a component.
Component to apply the style to
Apply Valheim style to a component.
Apply Valheim style to a component.
Manager for handling custom inputs registered by mods.
Abstraction for gamepad buttons and axes used as inputs
No gamepad button, internally treated as null
Up direction on the directional pad
Down direction on the directional pad
Left direction on the directional pad
Right direction on the directional pad
Southern button on the gamepad (A on XBox-like)
Eastern button on the gamepad (B on XBox-like)
Western button on the gamepad (X on XBox-like)
Nothern button on the gamepad (Y on XBox-like)
Left shoulder button
Right shoulder button
Left trigger
Right trigger
Left special button (Back on XBox-like)
Right special button (Menu on XBox-like)
Left Joystick press
Right Joystick press
Translates a to its value
Translate a to its axis string value
Translate an axis string to its
UnityEngine.InputSystem.InputBinding.path value
Translate a to its
UnityEngine.InputSystem.InputBinding.path value
Translates a to its printable string value
Translates an axis string to its value
Translate an axis string to its value
Translate a to its value
Singleton instance
Hide .ctor
Initialize the manager
Add a Button to Valheim
Mod GUID
Button config
Manager for handling all custom data added to the game related to items.
The singleton instance of this manager.
Hide .ctor
Event that gets fired after the vanilla items are in memory and available for cloning.
Your code will execute every time a new ObjectDB is copied (on every menu start).
If you want to execute just once you will need to unregister from the event after execution.
Internal event that gets fired after did run.
On this point all mods should have their items and pieces registered with the managers.
Event that gets fired after all items were added to the ObjectDB on the FejdStartup screen.
Your code will execute every time a new ObjectDB is copied (on every menu start).
If you want to execute just once you will need to unregister from the event after execution.
Event that gets fired after all items were added to the ObjectDB.
Your code will execute every time a new ObjectDB is created (on every game start).
If you want to execute just once you will need to unregister from the event after execution.
Registers all hooks.
Add a to the game.
Checks if the custom item is valid and unique and adds it to the list of custom items.
Also adds the prefab of the custom item to the .
Custom items are added to the current on every .
The custom item to add.
true if the custom item was added to the manager.
Get a custom item by its name.
Name of the item to search.
Remove a custom item by its name. Removes the custom recipe, too.
Name of the item to remove.
Remove a custom item by its ref. Removes the custom recipe, too.
to remove.
Add a to the game.
Checks if the custom recipe is unique and adds it to the list of custom recipes.
Custom recipes are added to the current on every .
The custom recipe to add.
true if the custom recipe was added to the manager.
Adds recipes defined in a JSON file at given path, relative to BepInEx/plugins
JSON file path, relative to BepInEx/plugins folder
Get a custom recipe by its name.
Name of the recipe to search.
Remove a custom recipe by its name. Removes it from the manager and the , if instantiated.
Name of the recipe to remove.
Remove a custom recipe by its ref. Removes it from the manager and the , if instantiated.
to remove.
Add a to the game.
Checks if the custom status effect is unique and adds it to the list of custom status effects.
Custom status effects are added to the current on every .
The custom status effect to add.
true if the custom status effect was added to the manager.
Add a new item conversion
Item conversion details
Whether the addition was successful or not
Remove an item conversion
item conversion to remove
Whether the removal was successful or not
Register all custom items added to the manager to the given
Register a single item in the current ObjectDB.
Also adds the prefab to the and if necessary.
No mock references are fixed.
with an component to add to the
Internal method for adding a prefab to a specific ObjectDB.
the prefab should be added to
with an component to add
which created the prefab
Register the custom recipes added to the manager to the given
Register the custom status effects added to the manager to the given
Register the custom item conversions added to the manager
Prefix on to add custom items to FejdStartup screen (aka main menu)
Safely invoke the event
Safely invoke the event
Safely invoke the event late in the detour chain
Hook on to register all custom entities from this manager to the .
Safely invoke the event
Hook on to refresh recipes for the custom items.
Manager for handling custom key hints
Singleton instance
Hide .ctor
Internal Dictionary holding the references to the custom key hints added to the manager
Internal Dictionary holding the references to the key hint GameObjects created per KeyHintConfig
Reference to the current "KeyHints" instance
Reference to the games "KeyHint" GameObjects RectTransform
Base GameObjects of vanilla key hint parts
Initialize the manager
Add a to the manager.
Checks if the custom key hint is unique (i.e. the first one registered for an item).
Custom key hints are displayed in the game instead of the default
KeyHints for equipped tools or weapons they are registered for.
The custom key hint config to add.
true if the custom key hint config was added to the manager.
Removes a from the game.
The custom key hint config to add.
Instantiate base GameObjects from vanilla KeyHints to use in our custom key hints
Extract base key hint elements and create key hint objects.
Copy vanilla BuildHints object and create a custom one from a KeyHintConfig.
Hook on to show custom key hints instead of the vanilla ones.
Set any key hint config using buttons without a backing bep config dirty
Manager for handling Kitbashed objects
The singleton instance of this manager.
Hide .ctor
Internal list of objects to which Kitbashing should be applied.
Registers all hooks.
Register a prefab with a KitbashConfig to be applied when the vanilla prefabs are available
Prefab to add kitbashed parts to
KitbashConfig to apply to the prefab
The KitbashObject container for this prefab
Apply all Kitbashs to the objects registered in the manager.
Apply kitbash to a single object.
Manager for handling localizations for all custom content added to the game.
List where all data is collected.
Your token must start with this character.
Default language of the game.
Name of the folder that will hold the custom .json translations files.
Name of the community translation files that will be the first custom languages files loaded before any others.
String of chars not allowed in a token string.
Array of chars not allowed in a token string.
The singleton instance of this manager.
Hide .ctor
Localizations for internal use.
Event that gets fired after all custom localization has been added to the game.
Use this event if you need to translate strings using the vanilla class.
Your code will execute every time the localization gets reset (on every menu start).
If you want to execute just once you will need to unregister from the event after execution.
Call into unity's DoQuoteLineSplit.
Initialize localization manager.
Add your mod's custom localization. Only one can be added per mod.
The localization to add.
true if the custom localization was added to the manager.
Get the CustomLocalization for your mod.
Creates a new if no localization was added before.
Existing or newly created .
Get the CustomLocalization for a given mod.
Creates a new if no localization was added before.
Existing or newly created .
Retrieve a translation if it's found in any CustomLocalization or .
Word to translate.
Translated word in player language or english as a fallback.
Registers a new Localization for a language.
Wrapper which contains a language and a Token-Value dictionary.
Registers a new Localization for a language.
The language being added.
Token-Value dictionary.
Add a token and its value to the "English" language.
Token
Translation.
Replace the token if it already exists
Add a token and its value to the specified language (default to "English").
Token
Translation.
Language ID for this token.
Replace the token if it already exists
Add a file via absolute path.
Absolute path to file.
Is the language file a json file.
Add a json language file (match crowdin format).
Language for the json file, for example, "English"
Entire file as string
Add a language file that matches Valheim's language format.
Entire file as string
Manager for adding custom Map Overlays to the game.
The singleton instance of this manager.
Hide .ctor
Event that gets fired once the Map for a World has started and Mods can begin to draw.
Event that gets fired once data for a specific Map for a world has been loaded. Eg, Pins are available after this has fired.
Colour which sets a filter on. Used for ForestFilter and FogFilter.
A full alpha value enables this pixel, and then the red value is written to the result texture.
Colour which sets a filter off. See FilterOn.
Height "Colour" used for the base height of "Meadows"
Container to hold all live Overlays.
Container to hold all live Drawings.
Creates the Overlays and registers hooks.
Create a new MapOverlay with a custom overlay name
Custom name for the MapOverlay
When set to true, that layer will be drawn regardless of exploration status, defaults to false
Reference to MapOverlay for modder to edit
Create a new MapDrawing with a custom overlay name
Custom name for the MapDrawing
Reference to MapDrawing for modder to edit
Causes MapManager to stop updating the MapOverlay object and removes this Manager's reference to that overlay.
The name of the MapOverlay to be removed
True if removal was successful. False if there was an error removing the object from the internal dict.
Causes MapManager to stop updating the MapDrawing object and removes this Manager's reference to that drawing.
The name of the MapDrawing to be removed
True if removal was successful. False if there was an error removing the object from the internal dict.
Return a list of all current overlay names
List of names
Return a list of all current MapDrawing names
List of names
Input a World Coordinate and the size of the overlay texture to retrieve the translated overlay coordinates.
World Coordinates
Size of the image from your MapOverlay
The 2D coordinate space on the MapOverlay
Input a MapOverlay Coordinate and the size of the overlay texture to retrieve the translated World coordinates.
The 2D Overlay coordinate
The size of the Overlay
The 3D World coordinate that corresponds to the input Vector
Setup GUI on .
Safely invoke OnVanillaMapAvailable event.
Setup textures and GUI on
Safely invoke InvokeOnVanillaMapDataLoaded event.
Return whether the Drawings functionality is active.
Called when the first MapDraw object is created.
Initializes all variables required for MapDraw objects to be rendered.
Changes the behaviour of some vanilla shaders.
Object for modders to use to access and modify their Overlay.
Modders should modify the texture directly.
Texture to draw overlay texture information to
Set true to render this overlay, false to hide
Flag to determine if this overlay had changes since its last draw
Flag to determine if this overlay should be hidden in unexplored areas
Hide .ctor
Function called on Texture2D.Apply to check if one of our member textures was changed
Destroys the overlay texture
Object for modders to use to access and modify their Overlay.
Modders should modify the texture directly.
Texture to draw main texture information to
Texture to draw height filter information to
Texture to draw forest filter information to
Texture to draw fog filter information to
Set true to render this overlay, false to hide
Flag to determine if this overlay had changes since its last draw
Hide .ctor
Function called on Texture2D.Apply to check if one of our member textures was changed
Destroys all textures
Overlay Base to inherit from
Unique name per overlay
Initial texture size to calculate the relative drawing position
Reference to the GUI toggle element to notify changes on the overlay state
Hide .ctor
Helper function to create and copy overlay texture instances
Handles all logic to do with managing mocked prefabs added into the game.
The singleton instance of this manager.
Hide .ctor
Legacy ValheimLib prefix used by the Mock System to recognize Mock gameObject that must be replaced at some point.
Prefix used by the Mock System to recognize Mock gameObject that must be replaced at some point.
String used by the Mock System to recognize start of a relative path of a replacement for a Mock gameObject.
Internal container for mocked prefabs
Creates the container and registers all hooks
Create an empty GameObject with the mock string prepended
Name of the mocked vanilla prefab
Mocked GameObject reference
Create a mocked component on an empty GameObject
Will try to find the real vanilla prefab from the given mock
the real prefab
Will try to find the real vanilla prefab from the given mock
the real prefab
Replaces all mock Textures with the real Texture
true if no mocks were found or all mock could be resolved
Replaces a potential mock Shader with the real Shader
true if no mock was found or the mock could be resolved
Manager handling all network related code
Singleton instance
Hide .ctor
Delegate for receiving ZPackages.
Gets called inside a .
Sender ID of the package
Package sent
Internal list of registered RPCs
Manager's main init
Get a for your mod
Unique name for your RPC
Delegate which gets called on client instances when packages are received
Delegate which gets called on server instances when packages are received
Existing or newly created
Get the for a given mod.
Reference to the which added this entity
Unique name for your RPC
Delegate which gets called on client instances when packages are received
Delegate which gets called on server instances when packages are received
Existing or newly created .
Register all custom RPCs as ZRoutedRPCs
Manager for handling custom pieces added to the game.
The singleton instance of this manager.
Hide .ctor
Event that gets fired after all pieces were added to their respective PieceTables.
Your code will execute every time a new ObjectDB is created (on every game start).
If you want to execute just once you will need to unregister from the event after execution.
Settings of the hammer UI tab selection.
Piece table tab header width.
Minimum size of a piece table tab. The tab can grow bigger than this the name doesn't fit.
Tab size per name character. This determines how fast the tab size grows.
Minimum left/right space that is visible for not selected adjacent tabs.
Creates the piece table container and registers all hooks.
Add a to the game.
Checks if the custom piece table is valid and unique and adds it to the list of custom piece tables.
The custom piece table to add.
true if the custom piece table was added to the manager.
Add a new from .
Creates a and adds it to the manager.
The to add.
Add a new from string.
Creates a and adds it to the manager.
Name of the new piece table.
Get a by name.
Search hierarchy:
- PieceTable with the exact name (e.g. "_HammerPieceTable")
- PieceTable via "item" name (e.g. "Hammer")
Prefab or item name of the PieceTable
component
Returns all instances in the game.
The list is gathered on every ObjectDB.Awake() from all items in it,
so depending on the timing of the call, the list might not be complete.
A list of instances
Optimistically guess the for a given by the piece category, and optionally by attached components, prefab name and localized name.
The to find the usage tags for.
If true, Jötunn will try to guess the usage tags for pieces that have no usage tags set.
All vanilla that match
Add a new by name. A new category
gets assigned a random integer for internal use. If you pass a vanilla category
the actual integer value of the enum is returned.
Prefab or item name of the PieceTable.
Name of the category.
int value of the vanilla or custom category
Add a new by name. A new category
gets assigned a random integer for internal use. If you pass a vanilla category
the actual integer value of the enum is returned.
Since Valheim 1.0 pieces of a custom category are shown under an own tag
in the build menu, next to the vanilla tags.
Name of the category.
int value of the vanilla or custom category
Get a by name. Translates
vanilla or custom Piece Categories to their current integer value.
Name of the category.
int value of the vanilla or custom category
Remove a from a table by name.
This does noting if a piece is still assigned to the category, remove it before calling this.
Prefab or item name of the PieceTable.
Name of the category.
Remove a by name.
The category id stays registered, only a refresh of the displayed categories is triggered.
Name of the category.
Get a list of all custom Jötunn piece category names
Get a complete map of all piece categories.
This includes vanilla, Jötunn and other modded categories that use the same system
Add a to the game.
Checks if the custom piece is valid and unique and adds it to the list of custom pieces.
Custom pieces are added to their respective s after .
The custom piece to add.
true if the custom piece was added to the manager.
Get a custom piece by its name.
Name of the piece to search.
Remove a custom piece by its name.
Name of the piece to remove.
Remove a custom piece by its ref.
to remove.
Loop all items in the game and get all PieceTables used (vanilla and custom ones).
Registers all custom pieces to their respective piece tables.
Removes erroneous ones from the manager.
Register a single piece prefab into a piece table by name.
Also adds the prefab to the and if necessary.
Custom categories can be referenced if they have been added to the manager before.
No mock references are fixed.
with a component to add to the table
Prefab or item name of the PieceTable
Optional category string, does not create new custom categories
Internal method for adding a prefab to a piece table.
Determines if usage tags may be guessed for pieces added to a table.
Only custom tables can opt out, vanilla tables always guess.
Hook on to refresh recipes for the custom items.
Updates the piece categories, should be called after setting the m_category field of a piece.
Manager for handling custom prefabs added to the game.
The singleton instance of this manager.
Hide .ctor
Event that gets fired after the vanilla prefabs are in memory and available for cloning.
Your code will execute every time before a new is copied (on every menu start).
If you want to execute just once you will need to unregister from the event after execution.
Event that gets fired after registering all custom prefabs to .
Your code will execute every time a new ZNetScene is created (on every game start).
If you want to execute just once you will need to unregister from the event after execution.
Container for custom prefabs in the DontDestroyOnLoad scene.
Dictionary of all added custom prefabs by name hash.
Creates the prefab container and registers all hooks.
Makes sure the PrefabManager initializes. Only needed if timing is important.
Add a custom prefab to the manager with known source mod metadata. Don't fix references.
Prefab to add
Metadata of the mod adding this prefab
true if the custom prefab was added to the manager.
Add a custom prefab to the manager.
Checks if a prefab with the same name is already added.
Added prefabs get registered to the on .
Prefab to add
Add a custom prefab to the manager.
Checks if a prefab with the same name is already added.
Added prefabs get registered to the on .
Prefab to add
Create a new prefab from an empty primitive.
The name of the new GameObject
When true a ZNetView component is added to the new GameObject for ZDO generation and networking. Default: true
The newly created empty prefab
Create a copy of a given prefab without modifying the original.
Name of the new prefab.
Name of the vanilla prefab to copy from.
Newly created prefab object
Create a copy of a given prefab without modifying the original.
Name of the new prefab.
Prefab instance to copy.
Newly created prefab object
Get a prefab by its name.
Search hierarchy:
- Custom prefab with the exact name
- Vanilla prefab with the exact name from if already instantiated
- Vanilla prefab from the prefab cache
Name of the prefab to search for.
The existing prefab, or null if none exists with given name
Remove a custom prefab from the manager.
Name of the prefab to remove
Destroy a custom prefab.
Removes it from the manager and if already instantiated also from the .
The name of the prefab to destroy
Register all custom prefabs to m_prefabs/m_namedPrefabs in .
Register a single prefab to the current .
Checks for existence of the object via GetStableHashCode() and adds the prefab if it is not already added.
Safely invoke the event
Global cache of Unity Objects by asset name.
Built on first access of every type and is cleared on scene change.
Get an instance of an Unity Object from the current scene with the given name.
to search for.
Name of the actual object to search for.
Get an instance of an Unity Object from the current scene by name.
Get all instances of an Unity Object from the current scene by type.
to search for.
Determines the best matching asset for a given name.
Only one asset can be associated with a name, this ties to find the best match if there is already a cached one present.
Clears the entire cache, resulting in a rebuilt on the next access.
This can be useful if an asset is loaded late after a scene change and might be missing in the cache.
Rebuilding can be an expensive operation, so use with caution.
Clears the cache for a specific type, resulting in a rebuilt on the next access.
This can be useful if an asset is loaded late after a scene change and might be missing in the cache.
Rebuilding can be an expensive operation, so use with caution.
The type of object to clear the cache for
Manager for rendering Sprites of GameObjects
Rotation of the prefab that will result in an isometric view
Appended string to file names to force a cache recreation, if changed
Singleton instance
Hide .ctor
Arbitrary unused Layer in the game
Initialize the manager
Create a of the
GameObject to render
Callback for the generated
If no active visual component is attached to the target or any child, this method invokes the callback with null immediately and returns false.
Enqueue a render of the
Callback for the generated
If no active visual component is attached to the target or any child, this method invokes the callback with null immediately and returns false.
Queues a new prefab to be rendered. The resulting will be ready at the next frame.
If there is no active visual Mesh attached to the target, this method invokes the callback with null immediately.
Object to be rendered. A copy of the provided GameObject will be created for rendering
Action that gets called when the rendering is complete
Width of the resulting
Height of the resulting
Only true if the target was queued for rendering
Create a of the
Can be a prefab or any existing GameObject in the world
If no active visual component is attached to the target or any child, this method returns null.
Create a of the
Can be a prefab or any existing GameObject in the world
Rotation while rendering of the GameObject. See RenderManager.IsometricRotation for example/>
If no active visual component is attached to the target or any child, this method returns null.
Create a from a />
If no active visual component is attached to the target or any child, this method returns null.
Spawn a prefab without any Components except visuals. Also prevents calling Awake methods of the prefab.
Recursively remove all components not needed for rendering in order of their dependencies.
false if components could not be removed, true otherwise
Topological sort (regarding dependencies between components) of all components of this transforms gameobject
A topologically sorted list of types. Null if cycles have been detected.
Wrapper to create and set a short-lived RenderTexture to a Camera, which is cleaned up afterwards
Queues a new prefab to be rendered. The resulting will be ready at the next frame.
Only true if the target was queued for rendering
Target GameObject to create a from
Pixel width of the generated
Pixel height of the generated
Rotation of the prefab to capture
Field of view of the camera used to create the . Default is small to simulate orthographic view. An orthographic camera is not possible because of shaders
Distance multiplier, should not be required with the default
Callback for the generated
Optional, Used for to determine a unique name-version combination
Save the render on the disc and reuse when called again. This reduces the time to re-render drastically.
When the game version changes, a new render will be made. When a is set, the version and name
will be used to determine if a new render should be made
Create a new RenderRequest
Object to be rendered. A copy of the provided GameObject will be created for rendering
Simulates the particle effects for this amount of seconds. Less than 0 for no particles.
Manager for handling custom skills added to the game.
Global singleton instance of the manager.
Hide .ctor
Initialize the manager
Add a new skill with given SkillConfig object.
SkillConfig object representing new skill to register
The SkillType of the newly added skill
Register a new skill with given parameters, and registers translations for it in the current localization.
Unique identifier of the new skill, ex: "com.jotunn.testmod.testskill"
Name of the new skill
Description of the new skill
Icon for the skill
The SkillType of the newly registered skill
Adds skills defined in a JSON file at given path, relative to BepInEx/plugins
JSON file path, relative to BepInEx/plugins folder
Gets a custom skill with given SkillType.
SkillType to look for
Custom skill with given SkillType
Gets a custom skill with given skill identifier.
String indentifer of SkillType to look for
Custom skill with given SkillType
Manager for handling synchronisation between client and server instances.
Event triggered after configuration has been synced on either the server or client
Event triggered before syncing configuration on either the server or client
Event triggered after a clients admin status changed on the server
Event triggered after the in-game configuration manager window is closed
Singleton instance
Hide .ctor
Clientside indicator if the current player has admin status on
the current world, always true on local games
Manager's main init
Registers a non default config file for possible synchronisation with all clients.
Entries still need the IsAdminOnly attribute in order to be synchronized.
The file path must be saved under the executing BepInEx config folder, see .
This guarantees the same relative path for all clients.
the file to synchronize
The config file is not saved under the BepInEx config folder
The config file is already registered
The config file is a default mod config and is already implicitly synchronized
Add a and a method for generating a to the manager.
The RPC will be initiated on the server side after login to sync arbitrary data to the connecting client.
The package is guaranteed to be received before the client's connection is fully established and the player loads into the world.
RPC to be called
Method generating the ZPackage payload, takes the client peer as its argument
Add a and a method for generating a to the manager.
The RPC will be initiated on the server side after login to sync arbitrary data to the connecting client.
The package is guaranteed to be received before the client's connection is fully established and the player loads into the world.
RPC to be called
Method generating the ZPackage payload
Harmony patch BepInEx to ensure locked values are not overwritten.
Return the cached local value of a bep config thats locked
Harmony patch BepInEx to ensure locked values are not overwritten.
Prevent overwriting bep config value when the setting is locked on config file reload.
Cache local config values for synced entries.
Reset configs which may have been overwritten with server values to the local value
if this machine is not the server.
Hook to start a watchdog Coroutine which monitors the admin list.
Hook to synchronize the admin status to the clients
Hook to synchronize the admin status to the clients
Checks the ZNet.m_instance.m_adminList against the cached list and send any
changes to the corresponding clients.
Sends the current admin state of a player on a server to the client
Socket host name of the peer
Admin state to send to the client
Safely invoke the event
Gets an IEnumerable of all default and custom config files that associated with plugins that have Jotunn as a dependency.
Checks if AdminOnly config entries should be locked based the AdminOnlyStrictness value for the plugin that the
config file is attached to (including custom config files) and whether the plugin is installed on the server or not.
Checks if AdminOnly config entries should be locked based the AdminOnlyStrictness value for the plugin
and whether the plugin is installed on the server or not.
Gets the corresponding Plugin GUID for a config file (works for custom config files)
and returns a boolean indicating success or failure.
Gets the corresponding Plugin GUID for a config file identifier (works for custom config files)
and returns a boolean indicating success or failure.
Unlock configuration entries.
Lock configuration entries.
Hook to unlock cursor properly and disable camera rotation
Window display state changed event.
Safely invoke the event
Register ourself to config reload events to trigger synchronizing configs
Un-Register ourself to config reload events to trigger synchronizing configs
Sync the local bep config on reload
Return the cached local value of a bep config thats locked
Prevent overwriting bep config value when the setting is locked on config file reload
Cache the current synchronizable configuration values for comparison
Get syncable configuration values as tuples
Syncs the changed configuration of a client to the server
Safely invoke the event
Safely invoke the event
Apply received configuration values locally and regenerate the cache
Package of config tuples
Indicator if this was an initial config package
Indicator if this was an initial config package
Generate ZPackage from configuration tuples
Indicator if this is the initial config package
List of config tuples to include in the package
Holds up and preserves PeerInfo or RoutedRPC packages until
the finished member is set to true. All other packages get sent. This will
stop the client from completing the login handshake with the server until ready.
Manager for handling undo and redo actions in mods. Can handle multiple undo queues.
Mods can make their own UndoActions using the provided interface
or use the default ones Jötunn provides in .
Undo queues get automatically reset on every login and logout.
Interface for actions which can be added to the undo queue.
Description of this action to show on the queue's history.
Code to revert whatever was executed.
Code to replay whatever was executed.
Message being displayed after a successful undo.
Message being displayed after a successful redo.
The singleton instance of this manager.
Hide .ctor
Container to hold all Queues.
Registers all hooks.
Add a message to the console or in the player HUD
Manually create a new queue by name and return it. If the queue already exists
no new queue is created but the existing is returned.
Global name of the queue
Optionally define the max history capacity of a newly generated queue
The with the given name
Get a list of all current undo queues.
List of all registered queue names
Get a queue by name. Creates a new queue if it does not exist.
Global name of the queue
The with the given name
Add a new action to a queue.
If a queue with the provided name does not exist it is automatically created.
Global name of the queue
Mod provided action which can undo and redo whatever was executed
Execute the undo action of the item at the queue's current position and decrease the position pointer.
If a queue with the provided name does not exist it is automatically created.
Global name of the queue
true if an action was undone, false if no actions exist or the action failed
Execute the redo action of the item after the queue's current position and increase the position pointer.
If a queue with the provided name does not exist it is automatically created.
Global name of the queue
true if an action was redone, false if no actions exist or the action failed
Undo queue implementation.
Add a new action to this queue.
Mod provided action which can undo and redo whatever was executed
Execute the undo action of the item at the queue's current position and decrease the position pointer.
true if an action was undone, false if no actions exist or the action failed
Execute the redo action of the item after the queue's current position and increase the position pointer.
true if an action was redone, false if no actions exist or the action failed
Reset the queue's history and position pointer to its initial state.
Get this queue's current position index, -1 when empty.
Get a string array of this queue's current history.
Manager for adding custom Locations, Vegetation and Clutter.
The singleton instance of this manager.
Hide .ctor
Event that gets fired after the vanilla locations are in memory and available for cloning or editing.
Your code will execute every time a new is available.
If you want to execute just once you will need to unregister from the event after execution.
Event that gets fired after all are registered in the .
Your code will execute every time a new is available.
If you want to execute just once you will need to unregister from the event after execution.
Event that gets fired after the vanilla clutter is in memory and available obtain.
Your code will execute every time a new is available.
If you want to execute just once you will need to unregister from the event after execution.
Event that gets fired after all are registered in the .
Your code will execute every time a new is available.
If you want to execute just once you will need to unregister from the event after execution.
Event that gets fired after the vanilla vegetation is in memory and available obtain.
Your code will execute every time a new is available.
If you want to execute just once you will need to unregister from the event after execution.
Event that gets fired after all are registered in the .
Your code will execute every time a new is available.
If you want to execute just once you will need to unregister from the event after execution.
Container for custom locations in the DontDestroyOnLoad scene.
Initialize the manager
Return a that matches any of the provided Biomes
Biomes that should match
Returns a list of all that match
Create an empty GameObject that is disabled, so any Components in instantiated GameObjects will not start their lifecycle.
Name of the location
Empty and hierarchy disabled GameObject
Create a copy that is disabled, so any Components in instantiated child GameObjects will not start their lifecycle.
Use this if you plan to alter your location prefab in code after importing it.
Don't create a separate container if you won't alter the prefab afterwards as it creates a new instance for the container.
Instantiated and hierarchy disabled location prefab
Loads and spawns a GameObject from an AssetBundle as a location container.
The copy is disabled, so any Components in instantiated child GameObjects will not start their lifecycle.
Use this if you plan to alter your location prefab in code after importing it.
Don't create a separate container if you won't alter the prefab afterwards as it creates a new instance for the container.
A preloaded
Name of the prefab in the bundle to be instantiated as the location cotainer
Create a copy that is disabled, so any Components in instantiated GameObjects will not start their lifecycle
Prefab to copy
Replace JVLmock GameObjects with a copy of their real prefab
Register a CustomLocation to be added to the ZoneSystem
true if the custom location could be added to the manager
Get a custom location by name.
Name of the location (normally the prefab name)
The object with the given name if found
Get a ZoneLocation by its name.
Search hierarchy:
- Custom Location with the exact name
- Vanilla Location with the exact name from
Name of the ZoneLocation to search for.
The existing ZoneLocation, or null if none exists with given name
Create a CustomLocation that is a deep copy of the original.
Changes will not affect the original. The CustomLocation is already registered in the manager.
name of the custom location
name of the existing location to copy
A CustomLocation object with the cloned location prefab
Remove a CustomLocation by its name.
Removes the CustomLocation from the manager.
Does not remove the location from any current ZoneSystem instance.
Name of the CustomLocation to search for.
Destroy a CustomLocation by its name.
Removes the CustomLocation from the manager and from the if instantiated.
Name of the CustomLocation to search for.
Register a CustomVegetation to be added to the ZoneSystem
Get a ZoneVegetation by its name.
Search hierarchy:
- Custom Vegetation with the exact name
- Vanilla Vegetation with the exact name from
Name of the ZoneVegetation to search for.
The existing ZoneVegetation, or null if none exists with given name
Remove a CustomVegetation from this manager by its name.
Does not remove it from any current ZoneSystem instance.
Name of the CustomVegetation to search for.
Register a CustomClutter to be added to the ClutterSystem
Get a Clutter by its name.
Search hierarchy:
- Custom Clutter with the exact name
- Vanilla Clutter with the exact name from
Name of the Clutter to search for.
The existing Clutter, or null if none exists with given name
Remove a CustomClutter from this manager by its name.
Does not remove it from any current ClutterSystem instance.
Name of the CustomClutter to search for.
Register a single ZoneLocaton in the current ZoneSystem.
Also adds the location prefabs to the and if necessary.
No mock references are fixed.
to add to the
Failure that is tracked for a mock prefab which could not be resolved to a real prefab or other type.
Accumulated list of the tracked MockResolveFailure.
Creates a new instance of the class.
Creates a new instance of the class.
Additional message to display when printing warnings.
Name of the type that could not be resolved. Mock prefix is already removed.
Path within the prefab that could not be resolved.
Type of the prefab that could not be resolved.
Prints warning messages for all the tracked MockResolveFailure.
Custom MonoBehaviour for the ColorPicker
Event that gets called by the ColorPicker
received Color
Singeleton instance
True when the ColorPicker is closed
OnColorChanged event
OnColorSelected event
Color before editing
Current Color
UseAlpha bool
Interact bool
Component ref
Component ref
Component ref
Component ref
Component ref
Component ref
Component ref
Component ref
Creates a new Colorpicker
Color before editing
Display message
Event that gets called when the color gets modified
Event that gets called when one of the buttons done or cancel get pressed
When set to false the colors used don't have an alpha channel
False if the instance is already running
Called when color is modified, to update other UI components
Used by EventTrigger to calculate the chosen value in color box
Gets main Slider value
Gets r Slider value
Gets r InputField value
Gets g Slider value
Gets g InputField value
Gets b Slider value
Gets b InputField value
Gets a Slider value
Gets a InputField value
Gets hexa InputField value
Cancel button call
Manually cancel the ColorPicker and recover the default value
Done button call
Manually close the ColorPicker and apply the selected color
HSV helper class
Simple dragging
Add this MonoBehaviour to a GameObject
BeginDrag event trigger
Drag event trigger
Custom MonoBehaviour for the GradientPicker
Event that gets called by the GradientPicker.
received Gradient
Singeleton instance
True when the GradientPicker is closed
OnGradientChanged Event
OnGradientSelected Event
Gradient before editing
Current Gradient
Key template
Interact bool
Creates a new GradiantPicker
Color before editing
Display message
Event that gets called when the gradient gets modified
Event that gets called when one of the buttons done or cancel gets pressed
False if the instance is already running
Setup new GradientPicker
Creates a ColorKey UI object
Checks if new ColorKey should be created
Creates a AlphaKey UI object
Checks if new AlphaKey should be created
Accessed by alpha Slider
Accessed by alpha InputField
Checks if Key can be deleted
Changes Selected Key
Accessed by position Slider
Accessed by position InputField
Choose color button call
Cancel button call
Manually cancel the GradientPicker and recovers the default value
Done button call
Manually close the GradientPicker and apply the selected color
Panel for displaying and toggling custom map overlays
Toggle the overlay list
Add a new toggle for a map overlay
Util functions related to loading assets at runtime.
Path separator for AssetBundles
Method reference to .
Workaround for compiling a net 4.x mod against the nestandard 2.1 method reference.
Loads a from file at runtime.
Texture path relative to "plugins" BepInEx folder
Is the given path relative
Texture2D loaded, or null if invalid path
Wrapper for https://docs.unity3d.com/ScriptReference/ImageConversion.LoadImage.html,
creates a new .
The byte array containing the image data to load.
A new texture with the loaded image if the data can be loaded, null otherwise
Wrapper for https://docs.unity3d.com/ScriptReference/ImageConversion.LoadImage.html.
The texture to load the image into.
The byte array containing the image data to load.
true if the data can be loaded, false otherwise
Creates a readable copy of a rectangular region from a .
Source texture.
Region of the texture to copy.
A readable of the specified region, or null if the texture is null.
Creates a readable copy of a .
Source texture.
A readable copy of the texture, or null if the texture is null.
Creates a readable copy of a 's texture region.
If the sprite is part of an atlas, only its texture rectangle is copied.
Use AssetUtils.DuplicateTexture(sprite.texture) to copy the full texture.
Source sprite.
A readable of the sprite’s texture region, or null if the texture is null.
Creates a readable copy of a .
Source sprite.
A new with a readable copy of its texture region, or null if the texture is null.
Loads a from file at runtime.
Texture path relative to "plugins" BepInEx folder
Texture2D loaded, or null if invalid path
Loads a from file at runtime.
Texture path relative to "plugins" BepInEx folder
The pivot to use in the resulting Sprite
Texture2D loaded, or null if invalid path
Loads a mesh from a .obj file at runtime.
Mesh path relative to "plugins" BepInEx folder
Texture2D loaded, or null if invalid path
Loads an asset bundle at runtime.
Asset bundle path relative to "plugins" BepInEx folder
AssetBundle loaded, or null if invalid path
Load an assembly-embedded . Use this if the automatic detection of the assembly fails.
Name of the bundle. Folders are point-seperated e.g. folder/bundle becomes folder.bundle
Executing assembly
Load an assembly-embedded . The calling assembly is automatically detected.
Name of the bundle. Folders are point-seperated e.g. folder/bundle becomes folder.bundle
Load an assembly-embedded file as a . Use this if the automatic detection of the assembly fails.
Name of the file. Folders are point-seperated e.g. folder/file.json becomes folder.file.json
Executing assembly
Load an assembly-embedded file as a . The calling assembly is automatically detected.
Name of the file. Folders are point-seperated e.g. folder/file.json becomes folder.file.json
Loads the contents of a file as a char string
Loads a from a file path or an asset bundle (separated by )
Helper methods to access BepInEx plugin information
Cached plugin list
Cache loaded plugins which depend on Jotunn.
Get a dictionary of loaded plugins which depend on Jotunn.
Dictionary of plugin GUID and
Get a dictionary of all plugins loaded by BepInEx
Dictionary of plugin GUID and
Get from a
of the plugin main class
Get from an
of the plugin
Get from a path, also matches subfolder paths
object of the plugin path
Get metadata information from the current calling mod
Original code from https://github.com/GoldenJude.
Corrects any bone disorder caused by unity incorrectly importing ripped assets.
Once enabled, bone reordering will occur whenever the equipment changes.
If one plug-in requests application of reordering, it will be applied globally for all EquipmentChanged events.
The state of reordering bones OnEquipmentChanged.
Returns true when bone reordering is enabled.
Reorders bone ordering caused by importing ripped assets into unity.
It effectively matches the bone ordering from the ItemPrefab (itemPrefabHash parameter).
GameObjects that need to match the ordering from the ItemPrefab (itemPrefabHash parameter)
Reorders incorrect bone ordering caused by importing ripped assets into unity.
Returns a list of bone names, given a SkinnedMeshRenderer.
Returns a transform matching the given name within the transforms children.
Watches a for changes and raises events when the configuration file is modified.
Create a file watcher to trigger reloads of the config file when it is changed, created, or renamed.
Time in milliseconds before another event can be fired.
Event triggered after the file watcher reloads the configuration file.
Safely invoke the event
Reloads config file if and only if the last write time differs from the last read time.
Utility class for the BepInEx ConfigurationManager plugin, without requiring a hard dependency
The ConfigurationManager plugin instance if installed, otherwise null
Is the config manager main window displayed on screen
Safe to use even if ConfigurationManager is not installed.
Rebuild the setting list. Use to update the config manager window if config settings were removed or added while it was open.
Safe to call even if ConfigurationManager is not installed.
Event args class for configuration synchronization event
Is this the initial synchronization?
GUID for each Plugin that received configuration data.
Helper class for identifying the theme of custom rooms.
Name of a dungeon theme, used when matching generators with custom rooms.
Get non-vanilla variant indices from the ZDO
Check for variant changes and pass the variant to AttachItem
Check for variant changes and pass the variant to AttachBackItem
Check for variant changes and pass the variant to AttachArmor
Store the variant index of the right hand item to the ZDO if the variant has changed
Store the variant index of the right back item to the ZDO if the variant has changed
Store the variant index of the chest item to the ZDO if the variant has changed
Constants of hardcoded strings used in-game
GlobalKey strings
In-game value: ""
In-game value: "defeated_bonemass"
In-game value: "defeated_gdking"
In-game value: "defeated_goblinking"
In-game value: "defeated_dragon"
In-game value: "defeated_eikthyr"
In-game value: "KilledTroll"
In-game value: "killed_surtling"
Weather strings
In-game value: "Clear"
In-game value: "Heath_clear"
In-game value: "LightRain"
In-game value: "Rain"
In-game value: "ThunderStorm"
In-game value: "nofogts"
In-game value: "SwampRain"
In-game value: "Darklands_dark"
In-game value: "Ashrain"
In-game value: "Snow"
In-game value: "SnowStorm"
In-game value: "DeepForest Mist"
In-game value: "Misty"
In-game value: "Twilight_Snow"
In-game value: "Twilight_SnowStorm"
In-game value: "Twilight_Clear"
In-game value: "Eikthyr"
In-game value: "GDKing"
In-game value: "Bonemass"
In-game value: "Moder"
In-game value: "GoblinKing"
In-game value: "Crypt"
In-game value: "SunkenCrypt"
Utility class for getting game versions
The semantic version of the running Valheim game
The network version of the running Valheim game, determining compatibility with other clients
A util class for computing various hashes
Compute a SHA256 hash from a given string
Interface to match a prefab to the mod that has created it.
The target prefab.
Reference to the which added this prefab.
Utility class for converting inputs to different formats
Translates a Unity KeyCode to a InputSystem
The matching Key or Key.None, if not assignable
Tries to convert a KeyCode to a InputSystem
Translates a to its value
Translates a to its axis string value
Translates a to its printable string value
Translates an axis string to its value
Translate an axis string to its value
Translate an axis string to its UnityEngine.InputSystem.InputBinding.path value
Translate a to its
UnityEngine.InputSystem.InputBinding.path value
Translates a to its value
Implementation of the mod compatibility features.
Stores the last server message.
Check if a mod is installed and loaded on the server.
Can be called from both client and server.
BepInEx mod to check
true if the mod is loaded on the server.
false if the mod is not loaded on the server or no server connection is established
Check if a mod is installed and loaded on the server.
Can be called from both client and server.
BepInEx mod GUID to check
true if the mod is loaded on the server.
false if the mod is not loaded on the server or no server connection is established
Check if Jotunn is installed and loaded on the server.
Can be called from both client and server.
true if Jotunn is loaded on the server.
false if Jotunn is not loaded on the server or no server connection is established
Store server's message.
Compares version data on server and client.
Create and show mod compatibility error message
Create the error message(s) from the server and client message data
server data
client data
Get module.
DataLayoutVersion indicates the version layout of data within the ZPkg. If equal to 0 then it is a legacy format.
Identifier for mod based on DataLayoutVersion.
For legacy layout returns mod name, otherwise returns mod GUID.
Friendly version of mod name.
Version data for mod.
Compatibility level of the mod.
Version strictness level of the mod.
Whether the data layout is a legacy format or not.
Write to ZPkg
Module must at least be loaded on the server
Module must at least be loaded on the client
Module is not enforced by the server or client
Module is not enforced, only version check if both client and server have it
Module is formatted as in one of the supported data layout versions.
Should return false is data was received from a newer version of Jotunn.
Checks if the compare module has a lower version then the other base module
Deserialize version string into a usable format.
Valheim version
Module data
Whether all the ModModule instances were formatted in a supported
data layout and all instances had the same data layout.
Create from module data
Create from ZPackage
Create ZPackage
ZPackage
Determines the level of compatibility of a mod which is enforced by Jötunn.
Servers disconnect clients with mods which enforce their compatibility when
the version does not match as defined by the VersionStrictness attribute.
Mod is not checked at all, VersionsStrictness does not apply.
Mod is checked only if the client and server have loaded it and ignores if just one side has it.
Mod must be loaded on server and client. Version checking depends on the VersionStrictness.
If mod is installed on the server, every client has to have it. VersionStrictness does apply when both sides have it.
If mod is installed on the client, the server has to have it. VersionStrictness does apply when both sides have it.
Version check is performed when both server and client have the mod, no check if the mod is actually installed.
Mod is not checked at all, VersionsStrictness does not apply.
Enum used for telling whether or not the same mod version should be used by both the server and the clients.
This enum is only useful with certain CompatibilityLevel values.
No version check is done
Mod must have the same Major version
Mods must have the same Minor version
Mods must have the same Patch version
Mod compatibility attribute
If your mod adds its own RPCs, EnforceModOnClients is likely a must (otherwise clients would just discard the messages from the server), same version you do have to determine, if your sent data changed.
If your mod adds items, you always should enforce mods on client and same version (there could be nasty side effects with different versions of an item).
If your mod is just GUI changes (for example bigger inventory, additional equip slots) there is no need to set this attribute
Compatibility Level
Version Strictness
Network Compatibility Attribute
Create empty ServerData
Create from module data
Create from ZPackage
Enum used for telling whether AdminOnly settings for Config Entries should always be enforced
or if they should only be enforced when the mod is installed on the server.
AdminOnly is always enforced for Config Entries even if the mod is not installed on the server.
This means that AdminOnly configs cannot be edited in multiplayer if the mod is not on the server.
AdminOnly is only enforced for Config Entries if the mod is installed on the server.
This attribute is used to determine how Jotunn should enforce synchronization of Config Entries.
Only relevant for Config Entries that have the applied.
AdminOnly ConfigEntry Strictness
Synchronization mode Attribute
Check if AdminOnly Config Entries should always be locked if player is not an admin.
Utility class to query metadata about added content of any loaded mod, including non-Jötunn ones.
It is disabled by default, as it unnecessary increases the loading time when not used.
has to be called anytime before FejdStartup.Awake, meaning in your plugin's Awake or Start.
Enables the collection of mod metadata.
It is disabled by default, as it unnecessary increases the loading time when not used.
This method has to be called anytime before FejdStartup.Awake, meaning in your plugin's Awake or Start.
Get all prefabs that were added by mods. Does not include Vanilla prefabs.
Get all prefabs that were added by a specific mod
Get an prefab by its name.
Does not include Vanilla prefabs, see PrefabManager.GetPrefab(string)
for those.
Utility class to query metadata about loaded Jötunn mods and their added content
Get all loaded mod's metadata which are depending on Jötunn
An of for all loaded mods
Get all added CustomPrefabs
An of from all loaded mods
Get all added CustomPrefabs of a mod by GUID
GUID of the mod
An of from a specific mod
Get all added CustomItems
An of from all loaded mods
Get all added CustomItems of a mod by GUID
GUID of the mod
An of from a specific mod
Get all added CustomRecipes
An of from all loaded mods
Get all added CustomRecipes of a mod by GUID
GUID of the mod
An of from a specific mod
Get all added CustomItemConversions
An of from all loaded mods
Get all added CustomItemConversions of a mod by GUID
GUID of the mod
An of from a specific mod
Get all added CustomStatusEffects
An of from all loaded mods
Get all added CustomStatusEffects of a mod by GUID
GUID of the mod
An of from a specific mod
Get all added CustomPieceTables
An of from all loaded mods
Get all added CustomPieceTables of a mod by GUID
GUID of the mod
An of from a specific mod
Get all added CustomPieces
An of from all loaded mods
Get all added CustomPieces of a mod by GUID
GUID of the mod
An of from a specific mod
Get all added CustomLocations
An of from all loaded mods
Get all added CustomLocations of a mod by GUID
GUID of the mod
An of from a specific mod
Get all added CustomVegetations
An of from all loaded mods
Get all added CustomVegetations of a mod by GUID
GUID of the mod
An of from a specific mod
Get all added CustomClutter
An of from all loaded mods
Get all added CustomClutter of a mod by GUID
GUID of the mod
An of from a specific mod
Get all added CustomCreatures
An of from all loaded mods
Get all added CustomCreatures of a mod by GUID
GUID of the mod
An of from a specific mod
Get all added ConsoleCommands
An of from all loaded mods
Get all added ConsoleCommands of a mod by GUID
GUID of the mod
An of from a specific mod
Get all added CustomLocalizations
An of from all loaded mods
Get all added CustomLocalizations of a mod by GUID
GUID of the mod
An of from a specific mod
Model class holding metadata of Jötunn mods.
The mod GUID
Human readable name
Current version
Custom prefabs added by that mod
Custom items added by that mod
Custom recipes added by that mod
Custom item conversions added by that mod
Custom status effects added by that mod
Custom piece tables added by that mod
Custom pieces added by that mod
Custom locations added by that mod
Custom Vegetation added by that mod
Custom Clutter added by that mod
Custom Creatures added by that mod
Custom commands added by that mod
Custom commands added by that mod
Invoke patch initialization methods for all loaded mods.
Priority attribute for PatchInitalizer.
The patch priority.
negative - early
zero - neutral
positive - late
Patch Init Attribute
Various Path constants used in Jötunn
Path to the game's save path
Path to the custom item folder
Path to the global translation folder
Path to cached icons. See
Parses an array of human readable piece usage tag names into a combined value.
Invalid or unknown names are logged and skipped.
Array of usage tag names, see for valid values
The combined for all recognized names
Various utility methods aiding Reflection tasks.
All possible binding flags
Determines whether this type is the same or a subclass of another type
this type
Type against the type is checked
true if this type is the same or a subtype
Determine whether the specified type is a subtype of the specified generic type or implements the specified generic interface.
the type to be tested.
generic interface type, passing in typeof (IXxx<>)
returns true if it is a subtype of the generic interface, or false.
Determines if this type inherits from
this type
Get the generic type of this type.
https://stackoverflow.com/a/21995826
this type
Get the of the first caller outside of this assembly
The reflected type of the first caller outside of this assembly
Get the of the first caller outside of this assembly
The assembly of the first caller outside of this assembly
Invoke a private method of any class instance
Instance of the class
Name of the method
Argument values (if any) of the method
The return of the method as an
Get the value of a private property of any class instance
Generic property type
Instance of the class
Name of the property
The value of the property
Get the value of a private field of any class instance
Generic field type
Instance of the class
Name of the field
The value of the field
Get the value of a private static field of any class
Generic field type
Type of the class
Name of the field
The value of the field
Set a value of a private field of any class instance
Instance of the class
Name of the field
New value of the field
Cache for Reflection tasks.
of
of
of
Various static utility methods for working with Shaders
Get a list of all and in this GameObject and its childs.
Parent GameObject
List of and
Get a list of all renderer of a GameObject and its childs
Parent GameObject
List of
Get a list of all shared renderer of a GameObject and its childs
Parent GameObject
List of
Get a list of all normal and shared renderer of a GameObject and its childs
Parent GameObject
List of
Create a new, scaled texture from a given texture.
Source texture to scale
New width of the scaled texture
Scale a texture to a certain width, aspect ratio is preserved.
Texture to scale
New width of the scaled texture
Dumps all shader information of a GameObject and its childs onto debug log
Event args class for syncing configuration event
Pre-defined actions to use with the .
Helper to check object validity.
Helper to check object validity.
"Create" action for the . Can undo and redo ZDO creation.
Current ZDO data of this action.
Create new undo data for ZDO creation operations. Clones all ZDO data to prevent NREs.
Enumerable of ZDOs which were created.
Description of the executed action.
Remove stored ZDOs again.
Success message.
Recreate stored ZDOs again.
Success message.
"Remove" action for the . Can undo and redo ZDO removal.
Current ZDO data of this action.
Create new undo data for ZDO removal operations. Clones all ZDO data to prevent NREs.
Enumerable of ZDOs which were removed.
Description of the executed action.
Recreate stored ZDOs again.
Success message.
Remove stored ZDOs again.
Success message.
Heightmap data wrapper
"Smooth" member of the heightmap
"Level" member of the heightmap
"Index" member of the heightmap
"HeightModified" member of the heightmap
Paint data wrapper
"PaintModified" member of the heightmap paint
"Paint" member of the heightmap paint
"Index" member of the heightmap paint
Heightmap and Paint data collection
Collection of
Collection of
"Terrain" action for the . Can undo and redo terrain modifications.
Create new undo data for terrain modifications.
Terrain state before modification
Terrain state after modification
Position of the terrain modification center
Radius of the terrain modification
Description of the executed action.
Sets terrain data to the stored values of the "before" state.
Success message.
Sets terrain data to the stored values of the "after" state.
Success message.
Like a list but stores elements in the order specified by the weight.
Weighted item used in
Class that specifies how a setting should be displayed inside the ConfigurationManager settings window.
Usage:
This class template has to be copied inside the plugin's project and referenced by its code directly.
make a new instance, assign any fields that you want to override, and pass it as a tag for your setting.
If a field is null (default), it will be ignored and won't change how the setting is displayed.
If a field is non-null (you assigned a value to it), it will override default behavior.
Here's an example of overriding order of settings and marking one of the settings as advanced:
// Override IsAdvanced and Order
Config.Bind("X", "1", 1, new ConfigDescription("", null, new ConfigurationManagerAttributes { IsAdvanced = true, Order = 3 }));
// Override only Order, IsAdvanced stays as the default value assigned by ConfigManager
Config.Bind("X", "2", 2, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 1 }));
Config.Bind("X", "3", 3, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 2 }));
You can read more and see examples in the readme at https://github.com/BepInEx/BepInEx.ConfigurationManager
You can optionally remove fields that you won't use from this class, it's the same as leaving them null.
ctor
Should the setting be shown as a percentage (only use with value range settings).
Custom setting editor (OnGUI code that replaces the default editor provided by ConfigurationManager).
See below for a deeper explanation. Using a custom drawer will cause many of the other fields to do nothing.
Show this setting in the settings screen at all? If false, don't show.
Category the setting is under. Null to be directly under the plugin.
If set, a "Default" button will be shown next to the setting to allow resetting to default.
Force the "Reset" button to not be displayed, even if a valid DefaultValue is available.
Force the setting name to not be displayed. Should only be used with a to get more space.
Can be used together with to gain even more space.
Optional description shown when hovering over the setting.
Not recommended, provide the description when creating the setting instead.
Name of the setting.
Order of the setting on the settings list relative to other settings in a category.
0 by default, higher number is higher on the list.
Only show the value, don't allow editing it.
If true, don't show the setting by default. User has to turn on showing advanced settings or search for it.
Custom converter from setting type to string for the built-in editor textboxes.
Custom converter from string to setting type for the built-in editor textboxes.
Whether a config is only writable by admins and gets overwritten on connecting clients
Color of the entry text
Color of the description text
Whether a config is locked for direct writing
Set config values from an attribute array
Array of attribute values
Represents the json array.
Initializes a new instance of the class.
Initializes a new instance of the class.
The capacity of the json array.
The json representation of the array.
The json representation of the array.
Represents the json object.
The internal member dictionary.
Initializes a new instance of .
Initializes a new instance of .
The implementation to use when comparing keys, or null to use the default for the type of the key.
Gets the at the specified index.
Adds the specified key.
The key.
The value.
Determines whether the specified key contains key.
The key.
true if the specified key contains key; otherwise, false.
Gets the keys.
The keys.
Removes the specified key.
The key.
Tries the get value.
The key.
The value.
Gets the values.
The values.
Gets or sets the with the specified key.
Adds the specified item.
The item.
Clears this instance.
Determines whether [contains] [the specified item].
The item.
true if [contains] [the specified item]; otherwise, false.
Copies to.
The array.
Index of the array.
Gets the count.
The count.
Gets a value indicating whether this instance is read only.
true if this instance is read only; otherwise, false.
Removes the specified item.
The item.
Gets the enumerator.
Returns an enumerator that iterates through a collection.
An object that can be used to iterate through the collection.
Returns a json that represents the current .
A json that represents the current .
This class encodes and decodes JSON strings.
Spec. details, see http://www.json.org/
JSON uses Arrays and Objects. These correspond here to the datatypes JsonArray(IList<object>) and JsonObject(IDictionary<string,object>).
All numbers are parsed to doubles.
Parses the string json into a value
A JSON string.
An IList<object>, a IDictionary<string,object>, a double, a string, null, true, or false
Try parsing the json string into a value.
A JSON string.
The object.
Returns true if successfull otherwise false.
Converts a IDictionary<string,object> / IList<object> object into a JSON string
A IDictionary<string,object> / IList<object>
Serializer strategy to use
A JSON encoded string, or null if object 'json' is not serializable
Determines if a given object is numeric in any way
(can be integer, double, null, etc).