Show / Hide Table of Contents

Interface ICoreClientAPI

The core api implemented by the client. The main interface for accessing the client. Contains all sub components and some miscellaneous methods.

Inherited Members
ICoreAPI.Logger
ICoreAPI.CmdlArguments
ICoreAPI.Side
ICoreAPI.ClassRegistry
ICoreAPI.Assets
ICoreAPI.ModLoader
ICoreAPI.RegisterEntityClass(String, EntityProperties)
ICoreAPICommon.RegisterRecipeRegistry<T>(String)
ICoreAPICommon.RegisterColorMap(ColorMap)
ICoreAPICommon.RegisterEntity(String, Type)
ICoreAPICommon.RegisterEntityBehaviorClass(String, Type)
ICoreAPICommon.RegisterBlockClass(String, Type)
ICoreAPICommon.RegisterCropBehavior(String, Type)
ICoreAPICommon.RegisterBlockEntityClass(String, Type)
ICoreAPICommon.RegisterItemClass(String, Type)
ICoreAPICommon.RegisterCollectibleBehaviorClass(String, Type)
ICoreAPICommon.RegisterBlockBehaviorClass(String, Type)
ICoreAPICommon.RegisterBlockEntityBehaviorClass(String, Type)
ICoreAPICommon.RegisterMountable(String, GetMountableDelegate)
ICoreAPICommon.ObjectCache
ICoreAPICommon.DataBasePath
ICoreAPICommon.GetOrCreateDataPath(String)
ICoreAPICommon.StoreModConfig<T>(T, String)
ICoreAPICommon.LoadModConfig<T>(String)
Namespace: Vintagestory.API.Client
Assembly: VintagestoryAPI.dll
Syntax
public interface ICoreClientAPI : ICoreAPI, ICoreAPICommon

Properties

| Improve this Doc View Source

Ambient

API Component to control the clients ambient values

Declaration
IAmbientManager Ambient { get; }
Property Value
Type Description
IAmbientManager
| Improve this Doc View Source

BlockTextureAtlas

API for the Block Texture Atlas

Declaration
IBlockTextureAtlasAPI BlockTextureAtlas { get; }
Property Value
Type Description
IBlockTextureAtlasAPI
| Improve this Doc View Source

CurrentMusicTrack

Returns the currently playing music track, if any is playing

Declaration
IMusicTrack CurrentMusicTrack { get; }
Property Value
Type Description
IMusicTrack
| Improve this Doc View Source

ElapsedMilliseconds

Amount of milliseconds ellapsed since client startup

Declaration
long ElapsedMilliseconds { get; }
Property Value
Type Description
System.Int64
| Improve this Doc View Source

EntityTextureAtlas

API for the Entity Texture Atlas

Declaration
ITextureAtlasAPI EntityTextureAtlas { get; }
Property Value
Type Description
ITextureAtlasAPI
| Improve this Doc View Source

Event

API Component for registering to various Events

Declaration
IClientEventAPI Event { get; }
Property Value
Type Description
IClientEventAPI
| Improve this Doc View Source

Forms

Platform independent ui methods and features.

Declaration
IXPlatformInterface Forms { get; }
Property Value
Type Description
IXPlatformInterface
| Improve this Doc View Source

Gui

API for GUI Related methods

Declaration
IGuiAPI Gui { get; }
Property Value
Type Description
IGuiAPI
| Improve this Doc View Source

HideGuis

If true, the player is in gui-less mode (through the F4 key)

Declaration
bool HideGuis { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Input

API for Mouse / Keyboard input related things

Declaration
IInputAPI Input { get; }
Property Value
Type Description
IInputAPI
| Improve this Doc View Source

InWorldEllapsedMilliseconds

Amount of milliseconds ellapsed while in a running game that is not paused

Declaration
long InWorldEllapsedMilliseconds { get; }
Property Value
Type Description
System.Int64
| Improve this Doc View Source

IsGamePaused

True if the game is currently paused (only available in singleplayer)

Declaration
bool IsGamePaused { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsShuttingDown

True if the client is currently in the process of exiting

Declaration
bool IsShuttingDown { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsSinglePlayer

True if this is a singleplayer session

Declaration
bool IsSinglePlayer { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ItemTextureAtlas

API for the Item Texture Atlas

Declaration
IItemTextureAtlasAPI ItemTextureAtlas { get; }
Property Value
Type Description
IItemTextureAtlasAPI
| Improve this Doc View Source

LinkProtocols

Add your own link protocol here if you want to implement a custom protocol. E.g. image://url-to-picture

Declaration
Dictionary<string, Action<LinkTextComponent>> LinkProtocols { get; }
Property Value
Type Description
Dictionary<System.String, Action<LinkTextComponent>>
| Improve this Doc View Source

MacroManager

Api to the client side macros system

Declaration
IMacroManager MacroManager { get; }
Property Value
Type Description
IMacroManager
| Improve this Doc View Source

Network

API for doing sending/receiving network packets

Declaration
IClientNetworkAPI Network { get; }
Property Value
Type Description
IClientNetworkAPI
| Improve this Doc View Source

OpenedGuis

Active GUI objects.

Declaration
IEnumerable<object> OpenedGuis { get; }
Property Value
Type Description
IEnumerable<System.Object>
| Improve this Doc View Source

PlayerReadyFired

True if all SendPlayerNowReady() was sent, signalling the player is now ready (called by the character selector upon submit)

Declaration
bool PlayerReadyFired { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Render

API for Rendering stuff onto the screen using OpenGL

Declaration
IRenderAPI Render { get; }
Property Value
Type Description
IRenderAPI
| Improve this Doc View Source

Settings

The clients game settings as stored in the clientsettings.json

Declaration
ISettings Settings { get; }
Property Value
Type Description
ISettings
| Improve this Doc View Source

Shader

API for Rendering stuff onto the screen using OpenGL

Declaration
IShaderAPI Shader { get; }
Property Value
Type Description
IShaderAPI
| Improve this Doc View Source

TagConverters

Add your own rich text elements here. Your will need to convert a VTML tag into a RichTextComponentBase element.

Declaration
Dictionary<string, Tag2RichTextDelegate> TagConverters { get; }
Property Value
Type Description
Dictionary<System.String, Tag2RichTextDelegate>
| Improve this Doc View Source

Tesselator

API for Meshing in the Mainthread. Thread safe.

Declaration
ITesselatorAPI Tesselator { get; }
Property Value
Type Description
ITesselatorAPI
| Improve this Doc View Source

TesselatorManager

Holds the default meshes of all blocks

Declaration
ITesselatorManager TesselatorManager { get; }
Property Value
Type Description
ITesselatorManager
| Improve this Doc View Source

World

API for accessing anything in the game world

Declaration
IClientWorldAccessor World { get; }
Property Value
Type Description
IClientWorldAccessor

Methods

| Improve this Doc View Source

RegisterCommand(String, String, String, ClientChatCommandDelegate)

Registers a chat command

Declaration
bool RegisterCommand(string command, string descriptionMsg, string syntaxMsg, ClientChatCommandDelegate handler)
Parameters
Type Name Description
System.String command
System.String descriptionMsg
System.String syntaxMsg
ClientChatCommandDelegate handler
Returns
Type Description
System.Boolean
| Improve this Doc View Source

RegisterCommand(ClientChatCommand)

Registers a chat command

Declaration
bool RegisterCommand(ClientChatCommand chatcommand)
Parameters
Type Name Description
ClientChatCommand chatcommand
Returns
Type Description
System.Boolean
| Improve this Doc View Source

RegisterEntityRendererClass(String, Type)

Registers an entity renderer for given entity

Declaration
void RegisterEntityRendererClass(string className, Type rendererType)
Parameters
Type Name Description
System.String className
Type rendererType
| Improve this Doc View Source

RegisterLinkProtocol(String, Action<LinkTextComponent>)

Register a link protocol handler

Declaration
void RegisterLinkProtocol(string protocolname, Action<LinkTextComponent> onLinkClicked)
Parameters
Type Name Description
System.String protocolname
Action<LinkTextComponent> onLinkClicked
| Improve this Doc View Source

SendChatMessage(String, Int32, String)

Sends a chat message to the server

Declaration
void SendChatMessage(string message, int groupId, string data = null)
Parameters
Type Name Description
System.String message
System.Int32 groupId
System.String data
| Improve this Doc View Source

SendChatMessage(String, String)

Sends a chat message to the server in the players currently active channel

Declaration
void SendChatMessage(string message, string data = null)
Parameters
Type Name Description
System.String message
System.String data
| Improve this Doc View Source

ShowChatMessage(String)

Shows a client side only chat message in the current chat channel. Uses the same code paths a server => client message takes. Does not execute client commands.

Declaration
void ShowChatMessage(string message)
Parameters
Type Name Description
System.String message
| Improve this Doc View Source

StartTrack(AssetLocation, Single, EnumSoundType, Action<ILoadedSound>)

Tells the music engine to load and immediately start given track once loaded, if the priority is higher than the currently playing track. May also be stopped while playing if another track with a higher priority is started. If you supply an onLoaded method the track is not started immediately and you can manually start it at any given time by calling sound.Start()

Declaration
MusicTrack StartTrack(AssetLocation soundLocation, float priority, EnumSoundType soundType, Action<ILoadedSound> onLoaded = null)
Parameters
Type Name Description
AssetLocation soundLocation
System.Single priority
EnumSoundType soundType
Action<ILoadedSound> onLoaded
Returns
Type Description
MusicTrack
| Improve this Doc View Source

TriggerChatMessage(String)

Same as ShowChatMessage(String) but will also execute client commands if they are prefixed with a dot.

Declaration
void TriggerChatMessage(string message)
Parameters
Type Name Description
System.String message
| Improve this Doc View Source

TriggerIngameDiscovery(Object, String, String)

Triggers a discovery event. HudDiscoveryMessage registers to this event and fades in/out a "discovery message" on the players screen

Declaration
void TriggerIngameDiscovery(object sender, string errorCode, string text)
Parameters
Type Name Description
System.Object sender
System.String errorCode
System.String text
| Improve this Doc View Source

TriggerIngameError(Object, String, String)

Triggers an in-game-error event. HudIngameError registers to this event and shows a vibrating red text on the players screen

Declaration
void TriggerIngameError(object sender, string errorCode, string text)
Parameters
Type Name Description
System.Object sender
System.String errorCode
System.String text

Extension Methods

VtmlUtilApiAdditions.RegisterVtmlTagConverter(ICoreAPI, String, Tag2RichTextDelegate)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX