Hello, i want to spawn a floating text in each of the worlds, but it doesnt work. PHP: public function EntityLevelChangeEvent(EntityLevelChangeEvent $event){ $player = $event->getEntity(); $leveln = $event->getTarget(); if($player instanceof Player) { foreach($this->config as $coord => $text) { $coord = explode(':', $coord); $x = $coord[0]; $y = $coord[1]; $z = $coord[2]; $level = $coord[3]; $br = explode("-", $text); if($level == $leveln->getName()){ foreach($br as $line){ $y = round($y-0.3, 2); $leveln->addParticle(new FloatingTextParticle(new Vector3(intval($x), $y, intval($z)), "", $line)); } } } } }
Fixed it, i need the worlds loaded to put somthing there PHP: $this->getServer()->loadLevel("level1");$this->getServer()->loadLevel("level2");
or simply on join: $level->addParticle(new FloatingTextParticle($vector, "text"), [$player]); // Basically adds a floating text particle to that player only, no need any delay
Maybe you didn't get what I'm saying, I was saying if you set argument 2 of addParticle, it sends the particle directly to player client, If the argument 2 is empty as usual, it adds chunk packet which needs delay to show up