Show / Hide Table of Contents

Class ItemConfig

Configuration class for adding custom items. Automatically creates a recipe for this item.
Use this in a constructor of CustomItem and Jötunn resolves the references to the game objects at runtime.
Inheritance
System.Object
ItemConfig
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Jotunn.Configs
Assembly: Jotunn.dll
Syntax
public class ItemConfig

Properties

| Improve this Doc View Source

Amount

The amount of Item that will be created when crafting this item. Defaults to 1.
Declaration
public int Amount { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

CraftingStation

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.
Declaration
public string CraftingStation { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Description

The description of your item. May be tokenized.
Declaration
public string Description { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Enabled

Whether this item is craftable or not. Defaults to true.
Declaration
public bool Enabled { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Icons

Icons for this item. If more than one icon is added, this item automatically has variants.
Declaration
public Sprite[] Icons { get; set; }
Property Value
Type Description
Sprite[]
| Improve this Doc View Source

Item

The name of the item prefab. Is automatically set in CustomItem.
Declaration
public string Item { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

MinStationLevel

The minimum required level for the crafting station. Defaults to 1.
Declaration
public int MinStationLevel { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Name

The unique name for your item. May be tokenized.
Declaration
public string Name { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

PieceTable

The name of the piece table prefab this item uses to build pieces.
Declaration
public string PieceTable { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

RepairStation

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.
Declaration
public string RepairStation { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Requirements

Array of RequirementConfigs for all crafting materials it takes to craft the recipe.
Declaration
public RequirementConfig[] Requirements { get; set; }
Property Value
Type Description
RequirementConfig[]
| Improve this Doc View Source

StyleTex

Texture holding the variants different styles.
Declaration
public Texture2D StyleTex { get; set; }
Property Value
Type Description
Texture2D

Methods

| Improve this Doc View Source

Apply(GameObject)

Apply this config's values to a GameObject's ItemDrop.
Declaration
public void Apply(GameObject prefab)
Parameters
Type Name Description
GameObject prefab
| Improve this Doc View Source

FromJson(String)

Loads a single ItemConfig from a JSON string
Declaration
public static ItemConfig FromJson(string json)
Parameters
Type Name Description
System.String json JSON text
Returns
Type Description
ItemConfig Loaded ItemConfig
| Improve this Doc View Source

GetRecipe()

Converts the ItemConfig to a Valheim style Recipe.
Declaration
public Recipe GetRecipe()
Returns
Type Description
Recipe The Valheim recipe
| Improve this Doc View Source

GetRequirements()

Converts the RequirementConfigs to Valheim style Piece.Requirements
Declaration
public Piece.Requirement[] GetRequirements()
Returns
Type Description
Piece.Requirement[] The Valheim Piece.Requirement array
| Improve this Doc View Source

ListFromJson(String)

Loads a list of ItemConfigs from a JSON string
Declaration
public static List<ItemConfig> ListFromJson(string json)
Parameters
Type Name Description
System.String json JSON text
Returns
Type Description
System.Collections.Generic.List<ItemConfig> Loaded list of ItemConfigs

Extension Methods

PrefabExtension.FixReferences(Object)
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾