ColosseumCommand

abstract class ColosseumCommand(plugin: ColosseumPlugin) : CommandExecutor, TabCompleter

Abstract base class for Colosseum commands.

Parameters

plugin

The ColosseumPlugin instance.

Inheritors

Constructors

Link copied to clipboard
constructor(plugin: ColosseumPlugin)

Types

Link copied to clipboard
class CommandContext<T : CommandSender>(val sender: T, val args: Array<out Any>)

Context class for command execution.

Link copied to clipboard
data class CommandData(val name: String, val aliases: Set<String>, val description: String, val subCommandName: String?, val permissions: Set<String>, val arguments: List<ParsableArgument<*>>, val optionalArguments: List<ParsableArgument<*>>, val mcCommand: Command?)

Data class representing command metadata.

Properties

Link copied to clipboard

The command metadata for this Colosseum command.

Functions

Link copied to clipboard
open fun execute(ctx: ColosseumCommand.CommandContext<CommandSender>): Unit?

Executes the command.

Link copied to clipboard
open fun executeCommandBlock(ctx: ColosseumCommand.CommandContext<BlockCommandSender>)

Executes the command for a command block sender.

Link copied to clipboard
open fun executeConsole(ctx: ColosseumCommand.CommandContext<ConsoleCommandSender>)

Executes the command for a console sender.

Link copied to clipboard

Executes the command for a player sender.

Link copied to clipboard

Generates the command format string for display.

Link copied to clipboard
open override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>): Boolean

Handles command execution. If the command throws an exception during parsing or execution, an appropriate error message is sent to the sender, along with the correct command format.

Link copied to clipboard
open override fun onTabComplete(sender: CommandSender, command: Command, label: String, args: Array<out String>): List<String>?

Handles tab completion for the command.