EffectiveCommand

abstract class EffectiveCommand : BasicCommand

Base class for a Brigadier-backed command.

A subclass declares identity (getNamespacedData), getDescription, a required getPermission (empty string = no permission) and a commandTree built with CommandNode. The command registers itself with the owning plugin's lifecycle on construction; execution walks the tree by argument and runs the deepest matching executor, and tab-completion is driven by the same tree.

Instantiate it from onLoad (not onEnable) — Brigadier commands register during the server's load phase, so a command touched only in onEnable won't be registered.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun canUse(sender: CommandSender): Boolean
Link copied to clipboard
abstract fun commandTree(): CommandNode?

The argument tree (choices, dynamic completions, executors), or null for no arguments.

Link copied to clipboard
open override fun execute(commandSourceStack: CommandSourceStack, args: Array<out String>)
Link copied to clipboard
abstract fun getDescription(): String

Short command description shown in help.

Link copied to clipboard
abstract fun getNamespacedData(): Pair<JavaPlugin, String>

Owning plugin and the command's literal name (its second element).

Link copied to clipboard

Unique identity as "<plugin-name>/<command>", both lowercased.

Link copied to clipboard
abstract fun getPermission(): String

Permission node required to run the command; empty string means no permission check.

Link copied to clipboard
@ApiStatus.OverrideOnly
open fun permission(): @Nullable String?
Link copied to clipboard
open override fun suggest(commandSourceStack: CommandSourceStack, args: Array<out String>): Collection<String>