Class CustomItem
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 ItemManager.
All custom items have to be wrapped inside this class to add it to Jötunns ItemManager.
Inherited Members
Namespace: Jotunn.Entities
Assembly: Jotunn.dll
Syntax
public class CustomItem : CustomEntity
Constructors
Name | Description |
---|---|
CustomItem(AssetBundle, string, bool, ItemConfig) | Custom item from a prefab loaded from an AssetBundle with a Recipe made from a ItemConfig. Can fix references for Mock<T>s. |
CustomItem(GameObject, bool) | Custom item from a prefab. Can fix references for Mock<T>s and the Recipe. |
CustomItem(GameObject, bool, ItemConfig) | Custom item from a prefab with a Recipe made from a ItemConfig. Can fix references for Mock<T>s. |
CustomItem(string, bool) | Custom item created as an "empty" primitive. At least the name and the Icon of the ItemDrop must be edited after creation. |
CustomItem(string, bool, ItemConfig) | Custom item created as an "empty" primitive with a Recipe made from a ItemConfig. |
CustomItem(string, string) | Custom item created as a copy of a vanilla Valheim prefab. |
CustomItem(string, string, ItemConfig) | Custom item created as a copy of a vanilla Valheim prefab with a Recipe made from a ItemConfig. |
Properties
Name | Description |
---|---|
FixReference | Indicator if references from Mock<T>s will be replaced at runtime. |
ItemDrop | The ItemDrop component for this custom item as a shortcut. |
ItemPrefab | The prefab for this custom item. |
Recipe | The CustomRecipe associated with this custom item. Is needed to craft this item on a workbench or from the players crafting menu. |
Methods
Name | Description |
---|---|
Equals(object) | Determines whether the specified object is equal to the current object. |
GetHashCode() | Serves as the default hash function. |
IsCustomItem(string) | Helper method to determine if a prefab with a given name is a custom item created with Jötunn. |
IsValid() | Checks if a custom item is valid (i.e. has a prefab, an ItemDrop and an icon, if it should be craftable). |
ToString() | Returns a string that represents the current object. |