Table of Contents

Class Item

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

Represents an in game Item of Vintage Story

public class Item : CollectibleObject
Inheritance
Item
Inherited Members

Constructors

Item()

Instantiate a new item with default model transforms

public Item()

Item(int)

Instantiates a new item with given item id and stacksize = 1

public Item(int itemId)

Parameters

itemId int

Fields

ItemId

The unique number of the item, dynamically assigned by the game

public int ItemId

Field Value

int

Shape

The items shape. Null for automatic shape based on the texture.

public CompositeShape Shape

Field Value

CompositeShape

Textures

Default textures to be used for this block

public Dictionary<string, CompositeTexture> Textures

Field Value

Dictionary<string, CompositeTexture>

Properties

FirstTexture

Returns the first texture in Textures

public CompositeTexture FirstTexture { get; }

Property Value

CompositeTexture

Id

The unique number of the item, dynamically assigned by the game

public override int Id { get; }

Property Value

int

ItemClass

The type of the collectible object

public override EnumItemClass ItemClass { get; }

Property Value

EnumItemClass

Methods

Clone()

Creates a deep copy of the item

public Item Clone()

Returns

Item

GetRandomColor(ICoreClientAPI, ItemStack)

Should return a random pixel within the items/blocks texture

public override int GetRandomColor(ICoreClientAPI capi, ItemStack stack)

Parameters

capi ICoreClientAPI
stack ItemStack

Returns

int