PHP: $x = 120;$z = 120;$this->getServer()->addParticle(new <name>Particle(new Vector3($x+(mt_rand(0, 100) / 100), $y+(mt_rand(0, 100) /100), $z+(mt_rand(0, 100) / 100))));
Use this function. PHP: public function randomParticlesWithinRadius($player, $radius = 2, $amount = 20){for($i = 0; $i <= $amount; ++$i){$pos = $player->getPosition();$pos->x = mt_rand($pos->x - $radius, $pos->x + $radius);$pos->y = mt_rand($pos->y - $radius, $pos->y + $radius);$pos->z = mt_rand($pos->z - $radius, $pos->z + $radius);$player->level->addParticle(new ParticleName(new Vector3($pos->x, $pos->y, $pos->z));}}//Usage$radius = 4;//blocks of radius$amount = 20;//amount of particles to spawn$class->randomParticlesWithinRadius($playerObject, $radius, $amount);