Terraria ModLoader  0.10.1.5
A framework for Terraria mods
Terraria.ModLoader.ModCommand Class Referenceabstract

This class represents a chat or console command. Use the CommandType to specify the scope of the command. More...

+ Collaboration diagram for Terraria.ModLoader.ModCommand:

Public Member Functions

abstract void Action (CommandCaller caller, string input, string[] args)
 The code that is executed when the command is triggered. More...
 
virtual bool Autoload (ref string name)
 Autoload this command, defaults to Mod.Properties.Autoload. More...
 

Public Attributes

virtual string Description => ""
 A short description of this command. More...
 
virtual string Usage => "/" + Command
 A short usage explanation for this command. More...
 

Properties

abstract string Command [get]
 The desired text to trigger this command. More...
 
Mod mod [get, set]
 The Mod this ModCommand belongs to. More...
 
string Name [get, set]
 Internal name of this command. More...
 
abstract CommandType Type [get]
 A flag enum representing context where this command operates. More...
 

Detailed Description

This class represents a chat or console command. Use the CommandType to specify the scope of the command.

Definition at line 31 of file ModCommand.cs.

Member Function Documentation

abstract void Terraria.ModLoader.ModCommand.Action ( CommandCaller  caller,
string  input,
string[]  args 
)
pure virtual

The code that is executed when the command is triggered.

Referenced by Terraria.ModLoader.CommandManager.Matches().

+ Here is the caller graph for this function:

virtual bool Terraria.ModLoader.ModCommand.Autoload ( ref string  name)
virtual

Autoload this command, defaults to Mod.Properties.Autoload.

Member Data Documentation

virtual string Terraria.ModLoader.ModCommand.Description => ""

A short description of this command.

Definition at line 44 of file ModCommand.cs.

virtual string Terraria.ModLoader.ModCommand.Usage => "/" + Command

A short usage explanation for this command.

Definition at line 42 of file ModCommand.cs.

Property Documentation

abstract string Terraria.ModLoader.ModCommand.Command
get

The desired text to trigger this command.

Definition at line 38 of file ModCommand.cs.

Referenced by Terraria.ModLoader.CommandManager.GetHelp(), and Terraria.ModLoader.CommandManager.Matches().

Mod Terraria.ModLoader.ModCommand.mod
getset

The Mod this ModCommand belongs to.

Definition at line 34 of file ModCommand.cs.

Referenced by Terraria.ModLoader.Mod.AddCommand().

string Terraria.ModLoader.ModCommand.Name
getset

Internal name of this command.

Definition at line 36 of file ModCommand.cs.

Referenced by Terraria.ModLoader.Mod.AddCommand().

abstract CommandType Terraria.ModLoader.ModCommand.Type
get

A flag enum representing context where this command operates.

Definition at line 40 of file ModCommand.cs.