Table of Contents

Namespace Vintagestory.API.Common

Classes

ActiveSlotChangeEventArgs

This contains data about an event that fires when a player changes which slot they're actively using. Such as the currently selected hotbar slot.

AdvancedParticleProperties

Used to add a set of particle properties to a collectible.

AirBubbleParticles
AmbientModifier
AnimCacheEntry
AnimFrameCallback
AnimatableRenderer
Animation

Represents a shape animation and can calculate the transformation matrices for each frame to be sent to the shader Process

  1. For each frame, for each root element, calculate the transformation matrix. Curent model matrix is identy mat. 1.1. Get previous and next key frame. Apply translation, rotation and scale to model matrix. 1.2. Store this matrix as animationmatrix in list 1.3. For each child element 1.3.1. Multiply local transformation matrix with the animation matrix. This matrix is now the curent model matrix. Go to 1 with child elements as root elems

  2. For each frame, for each joint 2.1. Calculate the inverse model matrix 2.2. Multiply stored animationmatrix with the inverse model matrix

  3. done

AnimationCache
AnimationFrame
AnimationJoint
AnimationKeyFrame
AnimationKeyFrameElement
AnimationManager
AnimationMetaData

Animation Meta Data is a json type that controls how an animation should be played.

AnimationSound
AnimationTrigger

Data about when an animation should be triggered.

AnimationUtil
AnimatorBase

Syncs every frame with entity.ActiveAnimationsByAnimCode, starts, progresses and stops animations when necessary

ArgumentParserBase
AssetCategory
AssetLocation

Defines a complete path to an assets, including it's domain.

AssetLocationAndSource

Defines a complete path to an assets, including it's domain. Includes an extra Source field for debugging.

AssetLocationJsonParser
AsyncParseResults
AttachmentPoint

This is a spot on the shape that connects to another shape.

AttachmentPointAndPose
BagInventory

The contents of one or more bags

BakedBitmap
BakingProperties

Baking Properties are collectible attribute used for baking items in a clay oven. You will need to add these attributes if using Bake inside SmeltingType.

BitmapExternal
BitmapRef
Block

Basic class for a placeable block

BlockBehavior

Allows for definitions of behaviors of a block that can be applied to any block

BlockBreakingParticleProps
BlockBrokenParticleProps
BlockCropProperties
BlockCubeParticles
BlockDamage
BlockDropItemStack

Represents an itemstack that is dropped when breaking a block, with a potentially random quantity.

BlockEntity

Basic class for block entities - a data structures to hold custom information for blocks, e.g. for chests to hold it's contents

BlockEntityBehavior

Basic class for block entities - a data structures to hold custom information for blocks, e.g. for chests to hold it's contents

BlockEntityBehaviorType

Allows adding behaviors for block entities. Remember, block entities are specific instances of blocks placed within the world.

BlockGeneric
BlockLayersAccess

Constants used for GetBlock or GetBlockId calls throughout the engine, to guide whether the block should be read from the solid blocks layer, the fluids layer, or perhaps both.
The game engine supports different block layers in 1.17+. Currently there is a solid blocks layer (e.g. terrain, loose stones, plants, reeds) and a fluid layer (e.g. still water, flowing water, lava, lake ice). Both layers can contain a block at the same position.
Use the .Default value for getting blocks in the general case, use the .Solid/.Fluid value to read from the solid blocks or fluid layer specifically

BlockMaterialUtil
BlockOffsetAndNumber
BlockPatchAttributes
BlockSchematic
BlockSelection

Contains all the information for a players block selection event

BlockSounds

A set of sounds that are defined for a block. All fields use default or empty sounds if not set.

BlockUpdate
BoolArgParser
Caller
ChatCommand

A base class for all chat commands.

ChatCommandComparer
ChatLine

an internal control containing the properties of a chat message.

ClientAnimator

Syncs every frame with entity.ActiveAnimationsByAnimCode, starts and stops animations when necessary and does recursive interpolation on the rotation, position and scale value for each frame, for each element and for each active element this produces always correctly blended animations but is significantly more costly for the cpu when compared to the technique used by the AnimatorBase.

ClientChatCommand

A handle for creating client commands.

Climate
ClimateCondition
CmdArgs

The arguments from a client or sever command

CollectibleArgParser
CollectibleBehavior
CollectibleObject

Contains all properties shared by Blocks and Items

CollectibleParticleProperties

Abstract class used for BlockVoxelParticles and ItemVoxelParticles

ColorArgParser
ColorMap
CombustibleProperties

Marks an item as combustible, either by cooking, smelting or firing. This can either imply it is used as a fuel, or can be cooked into another object.

CommandArgumentParsers
CompositeShape

Holds shape data to create 3D representations of objects. Also allows shapes to be overlayed on top of one another recursively.

CoralPlantConfig
CraftingRecipeIngredient

A crafting recipe ingredient

CreativeInventoryTab
CreativeTabAndStackList

Allows you to add a list of item stacks to put various into creative menu tabs.

CropBehavior
CrushingProperties

Defines a set of properties that allow an object to be ground in a quern.

DamageSource
DatetimeArgParser
DecorFlags
DirectionArgParser<T>
DoubleArgParser
DummyInventory

A place holder inventory, useful, e.g., for when you want to render an itemstack and not have it spoil

DummyLoggerException
DummySlot

A single slot not attached to a given inventory.

ElementPose

The position of an element.

EntitiesArgParser
Entitlement
EntityAgent

A goal-directed entity which observes and acts upon an environment

EntityBehaviorNameTag
EntityBehaviorPassivePhysics
EntityChunky
EntityControls

The available controls to move around a character in a game world

EntityCubeParticles
EntityFloatStats
EntityHeadController
EntityHumanoid
EntityItem
EntityItemSlot
EntityPlayer
EntitySelection
EntityStat<T>
EntityStats
EntityTypeArgParser
EntityUpdate
EnumAppSideExtensions
EnumWindBitModeMask

Windmode flags, which can be ORed with existing vertex data to add the specified wind mode (assuming it was 0 previously!)

ExplosionParticles

A subclass of ExplosionSmokeParticles.

ExplosionSmokeParticles

Handles the smoke particles of where the explosion was.

ExtraHandbookSection
FastParticlePool
FertilizerProps
FloatArgParser
FloatingSedimentParticles
FoodNutritionProperties

Allows you to make collectibles edible, and adds data about their nutrition.

FrameProfilerUtil
GeneratedStructure
GridRecipe

Represents a crafting recipe

GridRecipeIngredient
GrindingProperties

Defines a set of properties that allow an object to be ground in a quern.

HeldSounds

Defines a set of sounds for a collectible object.

HistoryState
IntArgParser
InventoryBase

Basic class representing an item inventory

InventoryBasePlayer

Abstract class used for all inventories that are "on" the player. Any inventory not inheriting from this class will not be stored to the savegame as part of the players inventory.

InventoryDisplayed

A general purpose inventory which sends update packets to nearby players (used for rendering Display Case, Pulveriser, etc)

InventoryGeneric

A general purpose inventory

Item

Represents an in game Item of Vintage Story

ItemClassMethods
ItemSlot

The default item slot to item stacks

ItemSlotBackpack

A slot that can hold mobile containers

ItemSlotBagContent
ItemSlotCharacter
ItemSlotCreative
ItemSlotOffhand

A slot that only accepts collectibles designated for the off-hand slot

ItemSlotOutput

A slot from which the player can only take stuff out of, but not place anything in it

ItemSlotSkill
ItemSlotSurvival

Standard survival mode slot that can hold everything except full backpacks

ItemSlotUniversal

A universal item slot type that can hold anything.

ItemStack
ItemStackMergeOperation
ItemStackMoveOperation
JsonAttributesConverter
JsonItemStack

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.

JsonUtil
LandClaim
LayeredVoxelRecipe<T>
LoggerBase

Base implementation for ILogger which implements all methods besides a new abstract method LogImpl(EnumLogType, string, params object[]).

LongArgParser
MetalProperty
MetalPropertyVariant
Mod

Represents a mod in the mod manager. May contain zero to multiple ModSystem instances within it.

ModDependency

Represents a mod dependency requirement of one mod for another.

ModDependencyAttribute

Applied to a mod assembly multiple times for each required dependency. Superseded by this mod's "modinfo.json" file, if available.

ModInfo

Meta data for a specific mod folder, archive, source file or assembly. Either loaded from a "modinfo.json" or from the assembly's ModInfoAttribute.

ModInfoAttribute

Applied to a mod assembly to provide additional meta data information about a code mod. Superseded by "modinfo.json" file, if available.

ModSystem

Base of a system, which is part of a code mod. Takes care of setting up, registering and handling all sorts of things. You may choose to split up a mod into multiple distinct systems if you so choose, but there may also be just one.

ModWorldConfiguration
ModelTransform

Used for transformations applied to a block or item model. Uses values from ModelTransformNoDefaults but will assign defaults if not included.

ModelTransformKeyFrame

A keyframe for model transformation.

ModelTransformNoDefaults

Controls the transformations of 3D shapes. Note that defaults change depending on where this class is used.

MountableUtil
MouseButtonConverter
MultiblockStructure

You can export one of these by making a selection with worldedit, looking at the center block (which should be your controller/master) then typing /we mgencode. Please note, air blocks are not exported

NoAnimationManager

A No-Animation Manager built off of IAnimationManager.

NoAnimator

A NoAnimator built off of IAnimator

OnlinePlayerArgParser
ParticleBase

Represents a particle that has been spawned

ParticlesProviderBase

A base class for all particle providers.

PermaFertilityBoost
PlayStyle
PlayerAnimationManager
PlayerGroupMembership
PlayerHeadController
PlayerRoleArgParser
PlayerSpawnPos
PlayerUidName
PlayersArgParser
PositionArgumentParserBase
PrivilegeArgParser
ProfileEntry
ProfileEntryRange
RecipeBase<T>

Creates a new base recipe type.

RecipeRegistryBase
RecipeRegistryGeneric<T>
RegistryObject

A registerable object with variants, i.e. an item, a block or an entity

RunningAnimation
SQLiteDBConnection
SeatConfig
ServerAnimator
ServerChatCommand

A handler for creating server commands.

Shape

The base shape for all json objects.

ShapeElement

A shape element built from JSON data within the model.

ShapeElementFace
ShapeElementWeights
SimpleParticleProperties

A configurable implementation of IParticlePropertiesProvider

StackCubeParticles
StandardWorldProperty
StringArgParser
StrongBlockBehavior

Same as block behavior but allows even more control over a block, such as the blocks collision boxes and world gen behavior. These are not part of default block behaviors for performance reasons. Requires the block to use the GenericBlock block class (or inherit from it)

SurfaceDrawImage
TextCommandCallingArgs
TextCommandResult
TransitionState
TransitionableProperties

This is a versatile way of allowing a collectible to change to another after a certain time in the inventory.

TyronThreadPool
UnparsedArg
Vec3iArgParser
VertexFlags

Special class to handle the vertex flagging in a very nicely compressed space.
Bit 0-7: Glow level
Bit 8-10: Z-Offset
Bit 11: Reflective bit
Bit 12: Lod 0 Bit
Bit 13-24: X/Y/Z Normals
Bit 25, 26, 27, 28: Wind mode
Bit 29, 30, 31: Wind data (also sometimes used for other data, e.g. reflection mode if Reflective bit is set, or additional water surface data if this is a water block)

VtmlParser
VtmlTagToken
VtmlTextToken
VtmlToken
VtmlUtil
VtmlUtilApiAdditions
WaterSplashParticles
WeightedSlot
WordArgParser
WordRangeArgParser
WorldConfigurationAttribute
WorldConfigurationValue
WorldPosition2DArgParser
WorldPositionArgParser
WorldPropertyVariant
WorldProperty<T>

Structs

DecorUpdate
SolarSphericalCoords
SourceStringComponents

For performance, don't build and store new concatenated strings for every block variant, item and entity, when these will only be used (if ever) for error logging

Interfaces

IAmbientManager

This is the system that manages the worlds ambient settings, such as fog color/density and clouds. The ambient manager basically blends ambientmodifiers on top of each other to generate the final ambient values. Blending is in order how the modifiers are held in CurrentModifiers in the likes of float weight = modifier.FogMin.Weight; BlendedFogMin = w * modifier.FogMin.Value + (1 - w) * BlendedFogMin;

IAnimationManager

Everything needed for allowing animations the Entity class holds a reference to an IAnimator. Currently implemented by ServerAnimator

IAnimator
IAsset

Represents a loaded asset from the assets folder

IAssetManager

Takes care loading, reloading and managing all files inside the assets folder. All asset names and paths are always converted to lower case.

IAssetOrigin
IBitmap
IBlockAccessor

Provides read/write access to the blocks of a world

IBlockAccessorPrefetch

Useful for when you have to scan multiple times over the same set of blocks

IBlockAccessorRevertable

Provides read/write access to the blocks of a world.

IBlockEntityContainer
IBlockFlowing
IBlockShapeSupplier

Adds a tesselator to your block WARNING: please make sure whatever functions and fields you use with the OnTesselation event are THREAD SAFE!

IBulkBlockAccessor

Useful for setting many blocks at once efficiently

IByteSerializable
ICachingBlockAccessor
IChatCommand
IChatCommandApi
IChunkBlocks
IChunkLight
IClassRegistryAPI

Interface for creating instances

IClientChunk
IClientGameCalendar
ICollectibleDisplayable

A collectible object that can be placed on the ground or on shelves or in display cases, but require custom code or rendering for it

ICollectibleOnDisplayInteractable

A collectible object that can be placed on the ground or on shelves or in display cases, but also can still accept interactions from the player

ICombustible
ICommandArgumentParser
ICoreAPI

Common API Components that are available on the server and the client. Cast to ICoreServerAPI or ICoreClientAPI to access side specific features.

ICoreAPICommon

API Methods common to the server and client

IDrawYAdjustable

Used for blocks (e.g. crops and dead crops) where the y-position might need to be adjusted at the time of tesselating an individual block

IEntityPartitioning
IEventAPI

Events that are available on the server and the client

IFarmlandBlockEntity
IGameCalendar

Main API for retrieving anything calender or astronomy related

IGeometryTester

Used for blocks (e.g. chiselled blocks) where the basic block geometry: AO shading, side opaque etc - depends on the individual block or blockEntity

IHeldBag

Bag is a non-placed block container, usually one that is attached to an entity

IInventory

Basic interface representing an item inventory

IInventoryNetworkUtil
IItemStack

Represents a stack of items or blocks

ILandClaimAPI
ILogger

Interface to the client's and server's event, debug and error logging utilty.

IMapChunk

Holds 2 dimensional data for one chunk column

IMapRegion

2D Map data for a 16x16 area of chunk columns. Holds a few maps for the chunk generation.

IMaterialExchangeable
IMiniDimension

Provides read/write access to the blocks of a movable mini-dimension.

IModLoader
IMountable

Represents something the player can mount. Usually a block or an entity.

IMountableListener
IMountableSeat

Represents a seat of a mountable object.

INetworkAPI
IOwnedInventory
IParticlePropertiesProvider

Represents a provider of particle properties to be used when generating a particle

IPlayer

Represents a player

IPlayerInventoryManager

Let's you do various interesting things with the players inventory.

IPlayerRole
IRecipeBase<T>
IRecipeIngredient
IRecipeOutput
IResolvableCollectible
IRotatable

Implement this interface if schematics containing this block entity needs to modify it's tree attribute data. Beware, this method is called without the block entity existing in the world (yet). The modified tree will then be used to actually create the block

ISearchTextProvider
IServerMapChunk
ISkillItemRenderer
ISlotProvider
ITextureLocationDictionary
ITimedDespawn
IVariableSeatsMountable
IWearableShapeSupplier
IWithDrawnHeight

Used for blocks (e.g. tallgrass and flowers) where the drawnHeight is set in attributes

IWorldAccessor

Important interface to access the game world.

IWorldChunk
IWorldPlayerData

Some world-specific information about a connected player. If you want modify any value, also broadcast the playerdata to all connected clients. This is the object that stored and loaded with the save game

IXPlatformInterface

The platform interface for various controls. Used by the game to handle various properties.

Enums

EntityAgent.EntityClientPacketId
EntityAgent.EntityServerPacketId
EnumAICreatureType

Types of creatures used for pathfinding. Humanoids prefer taking paths.

EnumAnimationBlendMode

Defines how multiple animations should be blended together.

EnumAppSide
EnumBlastType
EnumBlockAccessFlags
EnumBlockMaterial

Materials of which a block may be made of. Currently only used for mining speed for tools and blast resistance.

EnumCallerType
EnumCharacterDressType
EnumChatType

A definition for the types of chat that could occur.

EnumChunkDirtyReason
EnumClaimError
EnumCommandStatus
EnumDamageSource
EnumDamageType
EnumDataType
EnumDeathCause
EnumDespawnReason
EnumEntityAction

A players in-world action

EnumEntityActivityStoppedHandling
EnumEntityAnimationEndHandling
EnumEntityState
EnumFoodCategory

Types of nutrition for foods.

EnumFreeMovAxisLock
EnumGameMode

A players game mode

EnumGetClimateMode

The type of climate values you wish to receive

EnumHabitat

Habitats for entities. Controls some minor logic for entities.

EnumHand
EnumHandHandling

How the engine should handle attacking with an item in hands

EnumHandInteract
EnumHandling

Tells the engine how to handle default or subsequent similar behaviors

EnumHemisphere
EnumHighlightShape
EnumHighlightSlot
EnumInteractMode
EnumItemClass

The type of collectible in an itemstack.

EnumItemDamageSource

Types for how an item can damage it's durability.

EnumItemStorageFlags

Determines the kinds of storage types the item can be put into

EnumItemUseCancelReason
EnumLightLevelType

Used in blockAccessor.GetLightLevel() to determine what kind of light level you want

EnumLogType
EnumMatterState

Various states of matter to use for collectibles.

EnumMergePriority
EnumModSourceType

Represents the origin file type of the mod.

EnumModType

Describes the type of a mod. Allows easy recognition and limiting of what any particular mod can do.

EnumModifierKey
EnumMonth
EnumMoonPhase
EnumMountAngleMode
EnumMouseButton

A list of mouse buttons.

EnumOrigin
EnumOwnerType
EnumParseResult
EnumParseResultStatus
EnumParticleModel

Types of model for a particle.

EnumPlayerAccessResult
EnumPlayerGroupMemberShip
EnumPlayerJoinBehavior
EnumRandomizeAxes

When picking a random seed for this block, what axes should we base it on?

EnumReflectiveMode

On the graphics card we have only one reflective bit, but we can store the mode in the wind data bits

EnumReplaceMode
EnumRetentionType
EnumSeason
EnumShapeFormat

Types of shape that can be loaded by the game.

EnumSmeltType

The type of smelting for the collectible. This effects how the object is smelted.

EnumSoilNutrient

The three types of soil nutrient for farmland and crops.

EnumSpecialKey
EnumStatBlendType
EnumTokenType
EnumTool

Types for each tool in the game. Some of these are unused.

EnumTransitionType

Types of transition for items.

EnumWindBitMode
EnumWorldAccessResponse
VtmlParser.ParseState

Delegates

ActionBoolReturn

Return true if the action/event was successfull

ActionBoolReturn<T>

Returns true if the action/event was successfull.

ActionBoolReturn<T1, T2>

Returns true if the action/event was successfull.

ActionBoolReturn<T1, T2, T3>

Returns true if the action/event was successfull.

ActionConsumable

Return true if the action/event should be "consumed" (e.g. mark a mouse click as handled)

ActionConsumable<T>

Return true if the action/event should be "consumed" (e.g. mark a mouse click as handled)

ActionConsumable<T1, T2>

Return true if the action/event should be "consumed" (e.g. mark a mouse click as handled)

BlockBehaviorDelegate
BlockBreakDelegate
BlockBrokenDelegate
BlockPlacedDelegate
BlockUsedDelegate
CanPlaceOrBreakDelegate

Test if a player has the privilege to modify a block at given block selection

CanSpawnNearbyDelegate
CanUseDelegate
ChunkColumnBeginLoadChunkThread

Triggered immediately when the server loads a chunk column from disk or generates a new one, in the SupplyChunks thread (not the main thread)

ChunkColumnGenerationDelegate
ChunkColumnLoadedDelegate

Triggered when the server loaded a chunk column from disk or generated a new one

ChunkColumnUnloadDelegate

Triggered just before a chunk column gets unloaded

ChunkDirtyDelegate

For handling dirty chunks

ClientChatCommandDelegate
CollectibleBehaviorDelegate
CommandPreconditionDelegate
CustomGetTransitionSpeedMulDelegate

Custom transition speed handler

DialogClickDelegate

The delegate for a dialogue click.

EntityDeathDelegate
EntityDelegate
EntityDespawnDelegate
EventBusListenerDelegate

For handling events on the event bus

FastParticlePool.CreateParticleDelegate
Func<T1, TResult>
Func<T1, T2, TResult>
Func<T1, T2, T3, TResult>
Func<T1, T2, T3, T4, TResult>
Func<T1, T2, T3, T4, T5, T6, T7, TResult>
GetAutoPullFromSlotDelegate
GetAutoPushIntoSlotDelegate
GetLatitudeDelegate
GetMountableDelegate

This method needs to find your mountable based on the tree attribute data, which you can write to in IMountable.MountableToTreeAttributes() For example if its an entity, you will want to store the entity id, then this method can simply contain

return world.GetEntityById(tree.GetLong("entityId"));
GetSuitabilityDelegate
HemisphereDelegate
HitEntityDelegate
LogEntryDelegate
MapChunkGeneratorDelegate
MapRegionGeneratorDelegate
MapRegionLoadedDelegate

Triggered when the server loaded a map region from disk or generated a new one

MapRegionUnloadDelegate

Triggered just before a map region gets unloaded

MatchGridRecipeDelegate
NewSlotDelegate
OnCommandDelegate
OnEntityAction
OnGetClimateDelegate
OnGetWindSpeedDelegate
OnInteractDelegate
OnInventoryClosedDelegate
OnInventoryOpenedDelegate
OnInventorySlot

Return false to stop walking the inventory

PlaceBlockDelegate
PlayerChatDelegate

When the player wrote a chat message. Set consumed.value to true to prevent further processing of this chat message

PlayerDeathDelegate

When the player died, this delegate will fire.

PlayerDelegate
PositionMismatchDelegate
PositionProviderDelegate
ResumeServerDelegate
SelectedHotbarSlotDelegate
ServerChatCommandDelegate
SolarSphericalCoordsDelegate

Should return sin(solar altitude angle). i.e. -1 for 90 degrees far below horizon, 0 for horizon and 1 for vertical

StartAnimationDelegate
SuspendServerDelegate
Tag2RichTextDelegate

A tag parser

TestBlockAccessDelegate
TrySpawnEntityDelegate
UpdateEntityDelegate
UseEntityDelegate
WalkSpeedSupplierDelegate
WorldGenHookDelegate
WorldGenThreadDelegate