This Plugin dosn't work. PHP: <?phpuse pocketmine\plugin\PluginBase;use pocketmine\math\Vector3;use pocketmine\level\particle\FlameParticle;use pocketmine\scheduler\PluginTask;class Main extends PluginBase { private $radius = 3; private $particles = 50; private $location, $level; private $sphere = false; public function __construct(Location &$location, bool $sphere) { $this->level = $location->getLevel(); $this->location = &$location; $this->sphere = $sphere; } private static function getRandomVector() : Vector3 { $x = 0; $y = 0; $z = 0; $x = (float)rand()/(float)getrandmax() * 2 - 1; $y = (float)rand()/(float)getrandmax() * 2 - 1; $z = (float)rand()/(float)getrandmax() * 2 - 1; $v = new Vector3($x, $y, $z); return $v->normalize(); } public function onRun($tick) { for ($i = 0; $i < $this->particles; ++$i) { $vector = self::getRandomVector()->multiply($this->radius); if (!$this->sphere) { $vector->y = abs($vector->getY()); } $this->level->addParticle(new FlameParticle($this->location->add($vector->x, $vector->y, $vector->z))); $this->location->add($vector->x, $vector->y, $vector->z); } }}
Could you please please be more specific with your questions? 'Plugin don't work'+Code sounds like you want us to just fix everything and give it back to you. Include meaningful error messages, if any, or at least a description what doesn't work. And from what i can see you did just copy random bits of code together and punch them into a Main class extending PluginBase and you expect it to work/be classified as a plugin? __construct is not called with anything for plugins and onRun() is belonging to a PluginTask.
That's because nothing is ever called. Put the code you have in a Repeating Task and schedule that task in onEnable.
This is a duplicated post https://forums.pmmp.io/threads/create-a-sphere-hemisphere-off-of-particles.1169/#post-13975