tModLoader v0.11.8.9
A mod to make and play 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...

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

Properties

abstract string Command [get]
 The desired text to trigger this command. More...
 
virtual string Description [get]
 A short description of 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...
 
virtual string Usage [get]
 A short usage explanation for this command. More...
 

Detailed Description

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

Definition at line 41 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.

◆ Autoload()

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

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

Property Documentation

◆ Command

abstract string Terraria.ModLoader.ModCommand.Command
get

The desired text to trigger this command.

Definition at line 48 of file ModCommand.cs.

48{ get; }

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

◆ Description

virtual string Terraria.ModLoader.ModCommand.Description
get

A short description of this command.

Definition at line 54 of file ModCommand.cs.

◆ mod

Mod Terraria.ModLoader.ModCommand.mod
getset

The Mod this ModCommand belongs to.

Definition at line 44 of file ModCommand.cs.

44{ get; internal set; }

◆ Name

string Terraria.ModLoader.ModCommand.Name
getset

Internal name of this command.

Definition at line 46 of file ModCommand.cs.

46{ get; internal set; }

◆ Type

abstract CommandType Terraria.ModLoader.ModCommand.Type
get

A flag enum representing context where this command operates.

Definition at line 50 of file ModCommand.cs.

50{ get; }

◆ Usage

virtual string Terraria.ModLoader.ModCommand.Usage
get

A short usage explanation for this command.

Definition at line 52 of file ModCommand.cs.