Table of Contents

Interface IChatCommandApi

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public interface IChatCommandApi : IEnumerable<KeyValuePair<string, IChatCommand>>, IEnumerable
Inherited Members
Extension Methods

Properties

this[string]

IChatCommand this[string name] { get; }

Parameters

name string

Property Value

IChatCommand

Parsers

CommandArgumentParsers Parsers { get; }

Property Value

CommandArgumentParsers

Methods

Create()

IChatCommand Create()

Returns

IChatCommand

Create(string)

IChatCommand Create(string name)

Parameters

name string

Returns

IChatCommand

Execute(string, TextCommandCallingArgs, Action<TextCommandResult>)

Executes a parsed command

void Execute(string name, TextCommandCallingArgs args, Action<TextCommandResult> onCommandComplete = null)

Parameters

name string

Name of the command without arguments, without prefix

args TextCommandCallingArgs
onCommandComplete Action<TextCommandResult>

Called when the command finished executing

ExecuteUnparsed(string, TextCommandCallingArgs, Action<TextCommandResult>)

Executes a raw command

void ExecuteUnparsed(string message, TextCommandCallingArgs args, Action<TextCommandResult> onCommandComplete = null)

Parameters

message string

Full command line, e.g. /entity spawn chicken-hen 1

args TextCommandCallingArgs
onCommandComplete Action<TextCommandResult>

Called when the command finished executing

Get(string)

IChatCommand Get(string name)

Parameters

name string

Returns

IChatCommand

GetOrCreate(string)

IChatCommand GetOrCreate(string name)

Parameters

name string

Returns

IChatCommand

GetOrdered(Dictionary<string, IChatCommand>)

Get all commands ordered by name ASC

public static Dictionary<string, IChatCommand> GetOrdered(Dictionary<string, IChatCommand> command)

Parameters

command Dictionary<string, IChatCommand>

Returns

Dictionary<string, IChatCommand>

GetOrdered(IChatCommandApi)

Get all commands from IChatCommandApi ordered by name ASC

public static Dictionary<string, IChatCommand> GetOrdered(IChatCommandApi chatCommandApi)

Parameters

chatCommandApi IChatCommandApi

Returns

Dictionary<string, IChatCommand>