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
Parsers
CommandArgumentParsers Parsers { get; }
Property Value
Methods
Create()
IChatCommand Create()
Returns
Create(string)
IChatCommand Create(string name)
Parameters
name
string
Returns
Execute(string, TextCommandCallingArgs, Action<TextCommandResult>)
Executes a parsed command
void Execute(string name, TextCommandCallingArgs args, Action<TextCommandResult> onCommandComplete = null)
Parameters
name
stringName of the command without arguments, without prefix
args
TextCommandCallingArgsonCommandComplete
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
stringFull command line, e.g. /entity spawn chicken-hen 1
args
TextCommandCallingArgsonCommandComplete
Action<TextCommandResult>Called when the command finished executing
Get(string)
IChatCommand Get(string name)
Parameters
name
string
Returns
GetOrCreate(string)
IChatCommand GetOrCreate(string name)
Parameters
name
string
Returns
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
GetOrdered(IChatCommandApi)
Get all commands from IChatCommandApi ordered by name ASC
public static Dictionary<string, IChatCommand> GetOrdered(IChatCommandApi chatCommandApi)
Parameters
chatCommandApi
IChatCommandApi