|
| | __construct ($name) |
| |
| | execute (CommandSender $sender, $currentAlias, array $args) |
| |
Public Member Functions inherited from VanillaCommand |
| | __construct ($name, $description="", $usageMessage=null, array $aliases=[]) |
| |
Public Member Functions inherited from Command |
| | __construct ($name, $description="", $usageMessage=null, array $aliases=[]) |
| |
| | getDefaultCommandData () |
| |
| | generateCustomCommandData (Player $player) |
| |
| | getOverloads () |
| |
| | execute (CommandSender $sender, $commandLabel, array $args) |
| |
| | getName () |
| |
| | getPermission () |
| |
| | setPermission ($permission) |
| |
| | testPermission (CommandSender $target) |
| |
| | testPermissionSilent (CommandSender $target) |
| |
| | getLabel () |
| |
| | setLabel ($name) |
| |
| | register (CommandMap $commandMap) |
| |
| | unregister (CommandMap $commandMap) |
| |
| | isRegistered () |
| |
| | getAliases () |
| |
| | getPermissionMessage () |
| |
| | getDescription () |
| |
| | getUsage () |
| |
| | setAliases (array $aliases) |
| |
| | setDescription ($description) |
| |
| | setPermissionMessage ($permissionMessage) |
| |
| | setUsage ($usage) |
| |
| | __toString () |
| |
|
Static Public Member Functions inherited from Command |
| static | generateDefaultData () |
| |
| static | broadcastCommandMessage (CommandSender $source, $message, $sendToSource=true) |
| |
Data Fields inherited from VanillaCommand |
| const | MAX_COORD = 30000000 |
| |
| const | MIN_COORD = -30000000 |
| |
Data Fields inherited from Command |
| | $timings |
| |
Protected Member Functions inherited from VanillaCommand |
| | getInteger (CommandSender $sender, $value, $min=self::MIN_COORD, $max=self::MAX_COORD) |
| |
| | getRelativeDouble ($original, CommandSender $sender, $input, $min=self::MIN_COORD, $max=self::MAX_COORD) |
| |
| | getDouble (CommandSender $sender, $value, $min=self::MIN_COORD, $max=self::MAX_COORD) |
| |
Protected Attributes inherited from Command |
| | $commandData = null |
| |
| | $description = "" |
| |
| | $usageMessage |
| |
◆ __construct()
ParticleCommand constructor.
- Parameters
-
71 "%pocketmine.command.particle.description",
72 "%pocketmine.command.particle.usage"
◆ execute()
- Parameters
-
- Returns
- bool
90 $sender->sendMessage(
new TranslationContainer(
"commands.generic.usage", [$this->usageMessage]));
95 if($sender instanceof Player){
96 $level = $sender->getLevel();
98 $level = $sender->getServer()->getDefaultLevel();
101 $name = strtolower($args[0]);
103 $pos =
new Vector3((
float) $args[1], (
float) $args[2], (
float) $args[3]);
105 $xd = (float) $args[4];
106 $yd = (float) $args[5];
107 $zd = (float) $args[6];
109 $count = isset($args[7]) ? max(1, (
int) $args[7]) : 1;
111 $data = isset($args[8]) ? (int) $args[8] : null;
113 $particle = $this->getParticle($name, $pos, $xd, $yd, $zd, $data);
115 if($particle === null){
116 $sender->sendMessage(
new TranslationContainer(
TextFormat::RED .
"%commands.particle.notFound", [$name]));
121 $sender->sendMessage(
new TranslationContainer(
"commands.particle.success", [$name, $count]));
123 $random =
new Random((
int) (microtime(
true) * 1000) + mt_rand());
125 for($i = 0; $i < $count; ++$i){
126 $particle->setComponents(
127 $pos->x + $random->nextSignedFloat() * $xd,
128 $pos->y + $random->nextSignedFloat() * $yd,
129 $pos->z + $random->nextSignedFloat() * $zd
131 $level->addParticle($particle);
The documentation for this class was generated from the following file:
- src/pocketmine/command/defaults/ParticleCommand.php