Class JsonItemStack
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
This is a representation of an item stack in JSON. It resembles a standard in-game item stack but can be stored before the game is loaded.
[ProtoContract]
public class JsonItemStack
- Inheritance
-
JsonItemStack
- Derived
Examples
"output": {
"type": "item",
"code": "knifeblade-flint",
"stacksize": 1
},
"output": {
"type": "block",
"code": "ladder-wood-north",
"quantity": 3
},
Fields
Code (Required)
The asset location code of the block or item.
[ProtoMember(2)]
public AssetLocation Code
Field Value
Type (Recommended) (Default: Block)
Block or Item?
[ProtoMember(1)]
public EnumItemClass Type
Field Value
Attributes (Optional) (Default: None)
Tree Attributes that should be attached to the resulting itemstack.
[JsonProperty]
[JsonConverter(typeof(JsonAttributesConverter))]
[ProtoMember(4)]
public JsonObject Attributes
Field Value
StackSize (Optional) (Default: 1)
Amount of items in this stacks
[ProtoMember(3)]
public int StackSize
Field Value
Properties
Quantity (Optional) (Default: 1)
Alias of StackSize. No real need to use this instead of it.
public int Quantity { get; set; }