Terraria ModLoader  0.11.1
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

◆ Action()

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:

◆ Autoload()

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

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

Member Data Documentation

◆ Description

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

A short description of this command.

Definition at line 44 of file ModCommand.cs.

◆ Usage

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

A short usage explanation for this command.

Definition at line 42 of file ModCommand.cs.

Property Documentation

◆ Command

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

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().

◆ Name

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().

◆ Type

abstract CommandType Terraria.ModLoader.ModCommand.Type
get

A flag enum representing context where this command operates.

Definition at line 40 of file ModCommand.cs.