PluginCommand
extends Command
in package
implements
PluginOwned
Uses
PluginOwnedTrait
Interfaces, Classes, Traits and Enums
- PluginOwned
- This interface may be implemented by objects which are owned by plugins, to allow them to be identified as such.
Table of Contents
- $timings : TimingsHandler|null
- $description : Translatable|string
- $usageMessage : Translatable|string
- $activeAliases : array<string|int, string>
- $aliases : array<string|int, string>
- $commandMap : CommandMap|null
- $executor : CommandExecutor
- $label : string
- $name : string
- $nextLabel : string
- $owningPlugin : Plugin
- $permission : string|null
- $permissionMessage : string|null
- __construct() : mixed
- __toString() : string
- broadcastCommandMessage() : void
- execute() : mixed
- getAliases() : array<string|int, string>
- getDescription() : Translatable|string
- getExecutor() : CommandExecutor
- getLabel() : string
- getName() : string
- getOwningPlugin() : Plugin
- getPermission() : string|null
- getPermissionMessage() : string|null
- getUsage() : Translatable|string
- isRegistered() : bool
- register() : bool
- Registers the command into a Command map
- setAliases() : void
- setDescription() : void
- setExecutor() : void
- setLabel() : bool
- setPermission() : void
- setPermissionMessage() : void
- setUsage() : void
- testPermission() : bool
- testPermissionSilent() : bool
- unregister() : bool
- allowChangesFrom() : bool
Properties
$timings
public
TimingsHandler|null
$timings
= null
$description
protected
Translatable|string
$description
= ""
$usageMessage
protected
Translatable|string
$usageMessage
$activeAliases
private
array<string|int, string>
$activeAliases
= []
$aliases
private
array<string|int, string>
$aliases
= []
$commandMap
private
CommandMap|null
$commandMap
= null
$executor
private
CommandExecutor
$executor
$label
private
string
$label
$name
private
string
$name
$nextLabel
private
string
$nextLabel
$owningPlugin
private
Plugin
$owningPlugin
$permission
private
string|null
$permission
= null
$permissionMessage
private
string|null
$permissionMessage
= null
Methods
__construct()
public
__construct(string $name, Plugin $owner, CommandExecutor $executor) : mixed
Parameters
- $name : string
- $owner : Plugin
- $executor : CommandExecutor
Return values
mixed —__toString()
public
__toString() : string
Return values
string —broadcastCommandMessage()
public
static broadcastCommandMessage(CommandSender $source, Translatable|string $message[, bool $sendToSource = true ]) : void
Parameters
- $source : CommandSender
- $message : Translatable|string
- $sendToSource : bool = true
Return values
void —execute()
public
execute(CommandSender $sender, string $commandLabel, array<string|int, mixed> $args) : mixed
Parameters
- $sender : CommandSender
- $commandLabel : string
- $args : array<string|int, mixed>
Return values
mixed —getAliases()
public
getAliases() : array<string|int, string>
Return values
array<string|int, string> —getDescription()
public
getDescription() : Translatable|string
Return values
Translatable|string —getExecutor()
public
getExecutor() : CommandExecutor
Return values
CommandExecutor —getLabel()
public
getLabel() : string
Return values
string —getName()
public
getName() : string
Return values
string —getOwningPlugin()
public
getOwningPlugin() : Plugin
Return values
Plugin —getPermission()
public
getPermission() : string|null
Return values
string|null —getPermissionMessage()
public
getPermissionMessage() : string|null
Return values
string|null —getUsage()
public
getUsage() : Translatable|string
Return values
Translatable|string —isRegistered()
public
isRegistered() : bool
Return values
bool —register()
Registers the command into a Command map
public
register(CommandMap $commandMap) : bool
Parameters
- $commandMap : CommandMap
Return values
bool —setAliases()
public
setAliases(array<string|int, string> $aliases) : void
Parameters
- $aliases : array<string|int, string>
Return values
void —setDescription()
public
setDescription(Translatable|string $description) : void
Parameters
- $description : Translatable|string
Return values
void —setExecutor()
public
setExecutor(CommandExecutor $executor) : void
Parameters
- $executor : CommandExecutor
Return values
void —setLabel()
public
setLabel(string $name) : bool
Parameters
- $name : string
Return values
bool —setPermission()
public
setPermission(string|null $permission) : void
Parameters
- $permission : string|null
Return values
void —setPermissionMessage()
public
setPermissionMessage(string $permissionMessage) : void
Parameters
- $permissionMessage : string
Return values
void —setUsage()
public
setUsage(Translatable|string $usage) : void
Parameters
- $usage : Translatable|string
Return values
void —testPermission()
public
testPermission(CommandSender $target[, string|null $permission = null ]) : bool
Parameters
- $target : CommandSender
- $permission : string|null = null
Return values
bool —testPermissionSilent()
public
testPermissionSilent(CommandSender $target[, string|null $permission = null ]) : bool
Parameters
- $target : CommandSender
- $permission : string|null = null
Return values
bool —unregister()
public
unregister(CommandMap $commandMap) : bool
Parameters
- $commandMap : CommandMap
Return values
bool —allowChangesFrom()
private
allowChangesFrom(CommandMap $commandMap) : bool
Parameters
- $commandMap : CommandMap