PocketMine-MP 5.23.3 git-976fc63567edab7a6fb6aeae739f43cf9fe57de4
Loading...
Searching...
No Matches
pocketmine\command\Command Class Reference
+ Inheritance diagram for pocketmine\command\Command:
+ Collaboration diagram for pocketmine\command\Command:

Public Member Functions

 __construct (string $name, Translatable|string $description="", Translatable|string|null $usageMessage=null, array $aliases=[])
 
 __toString ()
 
 execute (CommandSender $sender, string $commandLabel, array $args)
 
 getAliases ()
 
 getDescription ()
 
 getLabel ()
 
 getName ()
 
 getPermissionMessage ()
 
 getPermissions ()
 
 getUsage ()
 
 isRegistered ()
 
 register (CommandMap $commandMap)
 
 setAliases (array $aliases)
 
 setDescription (Translatable|string $description)
 
 setLabel (string $name)
 
 setPermission (?string $permission)
 
 setPermissionMessage (Translatable|string $permissionMessage)
 
 setPermissions (array $permissions)
 
 setUsage (Translatable|string $usage)
 
 testPermission (CommandSender $target, ?string $permission=null)
 
 testPermissionSilent (CommandSender $target, ?string $permission=null)
 
 unregister (CommandMap $commandMap)
 

Static Public Member Functions

static broadcastCommandMessage (CommandSender $source, Translatable|string $message, bool $sendToSource=true)
 

Protected Attributes

Translatable string $description = ""
 
Translatable string $usageMessage
 

Detailed Description

Definition at line 41 of file Command.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\command\Command::__construct ( string $name,
Translatable|string $description = "",
Translatable|string|null $usageMessage = null,
array $aliases = [] )
Parameters
string[]$aliases@phpstan-param list<string> $aliases

Definition at line 74 of file Command.php.

References pocketmine\command\Command\setAliases().

+ Here is the call graph for this function:

Member Function Documentation

◆ __toString()

pocketmine\command\Command::__toString ( )

Definition at line 255 of file Command.php.

◆ broadcastCommandMessage()

static pocketmine\command\Command::broadcastCommandMessage ( CommandSender $source,
Translatable|string $message,
bool $sendToSource = true )
static

Definition at line 237 of file Command.php.

◆ execute()

pocketmine\command\Command::execute ( CommandSender $sender,
string $commandLabel,
array $args )
abstract
Parameters
string[]$args@phpstan-param list<string> $args
Returns
mixed
Exceptions
CommandException

Reimplemented in pocketmine\command\ClosureCommand, pocketmine\command\defaults\BanCommand, pocketmine\command\defaults\BanIpCommand, pocketmine\command\defaults\BanListCommand, pocketmine\command\defaults\ClearCommand, pocketmine\command\defaults\DefaultGamemodeCommand, pocketmine\command\defaults\DeopCommand, pocketmine\command\defaults\DifficultyCommand, pocketmine\command\defaults\DumpMemoryCommand, pocketmine\command\defaults\EffectCommand, pocketmine\command\defaults\EnchantCommand, pocketmine\command\defaults\GamemodeCommand, pocketmine\command\defaults\GarbageCollectorCommand, pocketmine\command\defaults\GiveCommand, pocketmine\command\defaults\HelpCommand, pocketmine\command\defaults\KickCommand, pocketmine\command\defaults\KillCommand, pocketmine\command\defaults\ListCommand, pocketmine\command\defaults\MeCommand, pocketmine\command\defaults\OpCommand, pocketmine\command\defaults\PardonCommand, pocketmine\command\defaults\PardonIpCommand, pocketmine\command\defaults\ParticleCommand, pocketmine\command\defaults\PluginsCommand, pocketmine\command\defaults\SaveCommand, pocketmine\command\defaults\SaveOffCommand, pocketmine\command\defaults\SaveOnCommand, pocketmine\command\defaults\SayCommand, pocketmine\command\defaults\SeedCommand, pocketmine\command\defaults\SetWorldSpawnCommand, pocketmine\command\defaults\SpawnpointCommand, pocketmine\command\defaults\StatusCommand, pocketmine\command\defaults\StopCommand, pocketmine\command\defaults\TeleportCommand, pocketmine\command\defaults\TellCommand, pocketmine\command\defaults\TimeCommand, pocketmine\command\defaults\TimingsCommand, pocketmine\command\defaults\TitleCommand, pocketmine\command\defaults\TransferServerCommand, pocketmine\command\defaults\VersionCommand, pocketmine\command\defaults\WhitelistCommand, pocketmine\command\defaults\XpCommand, pocketmine\command\FormattedCommandAlias, and pocketmine\command\PluginCommand.

◆ getAliases()

pocketmine\command\Command::getAliases ( )
Returns
string[] @phpstan-return list<string>

Definition at line 197 of file Command.php.

◆ getDescription()

pocketmine\command\Command::getDescription ( )

Definition at line 205 of file Command.php.

◆ getLabel()

pocketmine\command\Command::getLabel ( )

Definition at line 145 of file Command.php.

◆ getName()

pocketmine\command\Command::getName ( )

Definition at line 91 of file Command.php.

◆ getPermissionMessage()

pocketmine\command\Command::getPermissionMessage ( )

Definition at line 201 of file Command.php.

◆ getPermissions()

pocketmine\command\Command::getPermissions ( )
Returns
string[]

Definition at line 98 of file Command.php.

◆ getUsage()

pocketmine\command\Command::getUsage ( )

Definition at line 209 of file Command.php.

◆ isRegistered()

pocketmine\command\Command::isRegistered ( )

Definition at line 189 of file Command.php.

◆ register()

pocketmine\command\Command::register ( CommandMap $commandMap)

Registers the command into a Command map

Definition at line 163 of file Command.php.

◆ setAliases()

pocketmine\command\Command::setAliases ( array $aliases)
Parameters
string[]$aliases@phpstan-param list<string> $aliases

Definition at line 217 of file Command.php.

Referenced by pocketmine\command\Command\__construct().

+ Here is the caller graph for this function:

◆ setDescription()

pocketmine\command\Command::setDescription ( Translatable|string $description)

Definition at line 225 of file Command.php.

◆ setLabel()

pocketmine\command\Command::setLabel ( string $name)

Definition at line 149 of file Command.php.

◆ setPermission()

pocketmine\command\Command::setPermission ( ?string $permission)

Definition at line 115 of file Command.php.

◆ setPermissionMessage()

pocketmine\command\Command::setPermissionMessage ( Translatable|string $permissionMessage)

Definition at line 229 of file Command.php.

◆ setPermissions()

pocketmine\command\Command::setPermissions ( array $permissions)
Parameters
string[]$permissions

Definition at line 105 of file Command.php.

Referenced by pocketmine\command\ClosureCommand\__construct().

+ Here is the caller graph for this function:

◆ setUsage()

pocketmine\command\Command::setUsage ( Translatable|string $usage)

Definition at line 233 of file Command.php.

◆ testPermission()

pocketmine\command\Command::testPermission ( CommandSender $target,
?string $permission = null )

Definition at line 119 of file Command.php.

◆ testPermissionSilent()

pocketmine\command\Command::testPermissionSilent ( CommandSender $target,
?string $permission = null )

Definition at line 134 of file Command.php.

◆ unregister()

pocketmine\command\Command::unregister ( CommandMap $commandMap)

Definition at line 173 of file Command.php.

Member Data Documentation

◆ $description

Translatable string pocketmine\command\Command::$description = ""
protected

Definition at line 62 of file Command.php.

◆ $usageMessage

Translatable string pocketmine\command\Command::$usageMessage
protected

Definition at line 64 of file Command.php.


The documentation for this class was generated from the following file: