91 if($sender instanceof
Player){
92 $senderPos = $sender->getPosition();
93 $world = $senderPos->getWorld();
95 $this->getRelativeDouble($senderPos->getX(), $sender, $args[1]),
96 $this->getRelativeDouble($senderPos->getY(), $sender, $args[2], World::Y_MIN, World::Y_MAX),
97 $this->getRelativeDouble($senderPos->getZ(), $sender, $args[3])
100 $world = $sender->getServer()->getWorldManager()->getDefaultWorld();
101 $pos =
new Vector3((
float) $args[1], (
float) $args[2], (
float) $args[3]);
104 $name = strtolower($args[0]);
106 $xd = (float) $args[4];
107 $yd = (float) $args[5];
108 $zd = (float) $args[6];
110 $count = isset($args[7]) ? max(1, (
int) $args[7]) : 1;
112 $data = $args[8] ??
null;
114 $particle = $this->getParticle($name, $data);
116 if($particle ===
null){
117 $sender->sendMessage(KnownTranslationFactory::commands_particle_notFound($name)->prefix(TextFormat::RED));
121 $sender->sendMessage(KnownTranslationFactory::commands_particle_success($name, (
string) $count));
123 $random =
new Random((
int) (microtime(
true) * 1000) + mt_rand());
125 for($i = 0; $i < $count; ++$i){
126 $world->addParticle($pos->add(
127 $random->nextSignedFloat() * $xd,
128 $random->nextSignedFloat() * $yd,
129 $random->nextSignedFloat() * $zd
216 if($data !==
null && ($block = StringToItemParser::getInstance()->parse($data)?->getBlock()) !==
null && $block->getTypeId() !== BlockTypeIds::AIR){