Show / Hide Table of Contents

Interface ICoreServerAPI

The core api implemented by the server. The main interface for accessing the server. 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.Server
Assembly: VintagestoryAPI.dll
Syntax
public interface ICoreServerAPI : ICoreAPI, ICoreAPICommon

Properties

| Improve this Doc View Source

Event

API Component for registering to various Events

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

Groups

Everything related to player groups

Declaration
IGroupManager Groups { get; }
Property Value
Type Description
IGroupManager
| Improve this Doc View Source

Network

API for sending/receiving network packets

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

Permissions

Everything related to roles and privileges

Declaration
IPermissionManager Permissions { get; }
Property Value
Type Description
IPermissionManager
| Improve this Doc View Source

PlayerData

World-agnostic player data. You can query this information even when the player is offline

Declaration
IPlayerDataManager PlayerData { get; }
Property Value
Type Description
IPlayerDataManager
| Improve this Doc View Source

Server

API Component for accessing server related functionality

Declaration
IServerAPI Server { get; }
Property Value
Type Description
IServerAPI
| Improve this Doc View Source

World

API for accessing anything in the game world

Declaration
IServerWorldAccessor World { get; }
Property Value
Type Description
IServerWorldAccessor
| Improve this Doc View Source

WorldManager

API Component for access/modify everything game world related

Declaration
IWorldManagerAPI WorldManager { get; }
Property Value
Type Description
IWorldManagerAPI

Methods

| Improve this Doc View Source

BroadcastMessageToAllGroups(String, EnumChatType, String)

Sends a chat message to all online players in all of their channels

Declaration
void BroadcastMessageToAllGroups(string message, EnumChatType chatType, string data = null)
Parameters
Type Name Description
System.String message
EnumChatType chatType
System.String data

Custom data to a message to be received by the client

| Improve this Doc View Source

HandleCommand(IServerPlayer, String)

Calls a command as if given player called it

Declaration
void HandleCommand(IServerPlayer player, string message)
Parameters
Type Name Description
IServerPlayer player
System.String message
| Improve this Doc View Source

InjectConsole(String)

Injects a message or command into the server console input processing system. This lets you run commands or chat as Admin.

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

RegisterBlock(Block)

Register a new Block. Must happen before server runphase LoadGame. These are sent to the client during connect, so only need to register them on the server side.

Declaration
void RegisterBlock(Block block)
Parameters
Type Name Description
Block block

BlockType to register. The Server assigns a block id and sets block.blockId

| Improve this Doc View Source

RegisterCommand(String, String, String, ServerChatCommandDelegate, String)

Registers a chat command. When registered on the client you access the command by prefixing a dot (.), on the server it's a slash (/)

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

RegisterCommand(ServerChatCommand)

Registers a chat command. When registered on the client you access the command by prefixing a dot (.), on the server it's a slash (/)

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

RegisterCraftingRecipe(GridRecipe)

Registers a new crafting recipe. These are sent to the client during connect, so only need to register them on the server side.

Declaration
void RegisterCraftingRecipe(GridRecipe recipe)
Parameters
Type Name Description
GridRecipe recipe
| Improve this Doc View Source

RegisterItem(Item)

Register a new item type

Declaration
void RegisterItem(Item item)
Parameters
Type Name Description
Item item
| Improve this Doc View Source

RegisterTreeGenerator(AssetLocation, GrowTreeDelegate)

Registers a new tree generator

Declaration
void RegisterTreeGenerator(AssetLocation generatorCode, GrowTreeDelegate genhandler)
Parameters
Type Name Description
AssetLocation generatorCode
GrowTreeDelegate genhandler
| Improve this Doc View Source

RegisterTreeGenerator(AssetLocation, ITreeGenerator)

Registers a new tree generator

Declaration
void RegisterTreeGenerator(AssetLocation generatorCode, ITreeGenerator gen)
Parameters
Type Name Description
AssetLocation generatorCode
ITreeGenerator gen
| Improve this Doc View Source

SendIngameDiscovery(IServerPlayer, String, String, Object[])

Shows a discovery text on the players screen. If text is null the client will try to find a language entry using supplied code prefixed with 'ingamediscovery-' (which is recommended so that the errors are translated to the users local language)

Declaration
void SendIngameDiscovery(IServerPlayer player, string discoveryCode, string text = null, params object[] langparams)
Parameters
Type Name Description
IServerPlayer player
System.String discoveryCode
System.String text
System.Object[] langparams

If text is null, these are the arguments passed into the Language translation tool

| Improve this Doc View Source

SendIngameError(IServerPlayer, String, String, Object[])

Shows a vibrating red text in the players screen. If text is null the client will try to find a language entry using supplied code prefixed with 'ingameerror-' (which is recommended so that the errors are translated to the users local language)

Declaration
void SendIngameError(IServerPlayer player, string errorCode, string text = null, params object[] langparams)
Parameters
Type Name Description
IServerPlayer player
System.String errorCode
System.String text
System.Object[] langparams

If text is null, these are the arguments passed into the Language translation tool

| Improve this Doc View Source

SendMessage(IPlayer, Int32, String, EnumChatType, String)

Sends a chat message only to given player in given groupId

Declaration
void SendMessage(IPlayer player, int groupId, string message, EnumChatType chatType, string data = null)
Parameters
Type Name Description
IPlayer player
System.Int32 groupId
System.String message
EnumChatType chatType
System.String data

Custom data to a message to be received by the client

| Improve this Doc View Source

SendMessageToGroup(Int32, String, EnumChatType, String)

Sends a chat message to all online players in given player group

Declaration
void SendMessageToGroup(int groupid, string message, EnumChatType chatType, string data = null)
Parameters
Type Name Description
System.Int32 groupid
System.String message
EnumChatType chatType
System.String data

Custom data to a message to be received by the client

Extension Methods

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