PHP: // To create the particle $ftext = new FloatingTextParticle(Vector3 $position, int $text, string $title); // To spawn it so players can see it: $level->addParticle($ftext); The class path is pocketmine\level\particle\FloatingTextParticle. It's pretty self explanatory, but you need an instance of Vector3 for the position of the floating text, and a string to set the text of the particle I'm not sure why, but $text is supposed to be an int according to PMMP's source code, and $title is a string. You can use a player or block object for the position if you want to. Fun Fact: Floating Text Particles aren't an actual particle. They are invisible entities with set nametags.
I was asking if you could give the name of what you want help with. What player info? Players have a lot of data. You were very vague about what you were asking.
$level->addParticle has an optional second parameter for what players you want to spawn the floating text particle to. If you leave it null, it is broadcasted as a chunkpacket. You can see the entire method in the source here. If you want to send it to a single player, you can do this: PHP: /** @var Player $player */ $ftext = new FloatingTextParticle($player, "Text"); $player->level->addParticle($ftext, [$player]);
You can set it invisible, but without using packets, you can't, really. You may be interested in using packets directly. You can send it to players when they join. There's some good content in this thread about that.
The level the player is in, or the level you chose I recommend getting the level by name PHP: $level = $this->getServer()->getLevelByName("kitpvp");
That probably means the world isn't loaded, or doesn't exist What's the name of your world, and can you show the lines of code that give that error?
I load world but floating text don't work. My code: PHP: public function add(PlayerJoinEvent $ev) { foreach((array) $this->getServer()->getProperty("lobby", []) as $lobby){ $this->getServer()->loadLevel($lobby); $text = "Welcome"; $title = "+++++++"; $floating = new FloatingTextParticle(new Vector3(100, 100, 100), $text, $title); $level = $this->getServer()->getLevelByName("lobby"); $level->addParticle($floating);}}