Class ChatCommandAbstract

A chat command that can be run by clients. Commands are executed on the server.

Constructors

  • Parameters

    • commandLabel: string

      Default command name. For example: teleport.

    • aliases: string[] = []

      Optional additional set of command labels that will execute this command. For example: tp (as an alias for teleport).

    • usage: string = ""

      Displayed when looking for command help. For example a usage of: <player> would display as /teleport <player>.

    • description: string = ""

      Description of how the command works. For example: Teleport to a target player.

    Returns ChatCommand

Properties

aliases: string[] = []

Optional additional set of command labels that will execute this command. For example: tp (as an alias for teleport).

commandLabel: string

Default command name. For example: teleport.

description: string = ""

Description of how the command works. For example: Teleport to a target player.

usage: string = ""

Displayed when looking for command help. For example a usage of: <player> would display as /teleport <player>.

Methods

  • Execute is run on the server when a client runs a command.

    Parameters

    • player: Player

      The player running the command.

    • args: string[]

      A list of arguments to the command (all contents after the command label split by space). For example in the command /teleport 1 2 3 args would be 1, 2, 3.

    Returns void