Hi, when i used FloatingTextParticle in PlayerJoinEvent, it will be duplicated... Idk if anybody realized... but heres an example: 1st player joined, one TextParticle spawned 2nd player joined, another one TextParticle spawned 3rd player joined, one more TextParticle spawned And this make that: 1st player see 1 TextParticle (not duplicated) 2nd player see 2 same TextParticle(duplicated) and 3rd player see 3.... Then... how can I spawn only one TextParticle to every player? In which Event should i put?? Or any other way to do this? Thanks
Well, if you're the last player joined the server... u can see many identical FloatingTextParticle at the same coordinate... And... it will be very LAGGED! This is how it bothers me..
and if you add púarticle only once so it doesn't work? else use $particle->setInvisible() and then add new particle
I do like this: PHP: $this->pt1->setInvisible(); $this->level->addParticle($this->pt1); Yes, it make the particle become invisible, but after that I do addParticle I cant spawn it back How?? Idk how, I searched trough the forum... doesnt see anything related.. zzz
Instead of creating a new particle every time someone joins, create all your particles when the server starts and then send it to the players when they join. PHP: private $particles = [];public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this); $this->particles[] = new FloatingTextParticle(new Vector3(138.5, 43.5, 157.5), "", "§l§c>>§aSurvival§c<<"); $this->particles[] = new FloatingTextParticle(new Vector3(132.5, 43.5, 157.5), "", "§l§c>>§aCreative§c<<"); $this->particles[] = new FloatingTextParticle(new Vector3(126.5, 43.5, 157.5), "", "§l§c>>§aSpleef§c<<"); $this->particles[] = new FloatingTextParticle(new Vector3(120.5, 43.5, 157.5), "", "§l§c>>§aInget/Nothing§c<<");}public function onPlayerJoin(PlayerJoinEvent $event){ foreach($this->particles as $particle){ $event->getPlayer()->getLevel()->addParticle($particle, [$event->getPlayer()]); }}