How can I broadcast a message to a specific level ex) world when a player joins that world. ex) "Player has joined the match!"
PHP: Public function onLevelChange(EntityLevelChangeEvent $event) { $entity = $event->getEntity(); If($entity instanceof pocketmine\Player) { Foreach($event->getTarget()->getPlayers() as $p) { $p->sendMessage($entity->getName() . " has joined the match."); } }}
@Hotshot_9930 If I were to disable world saving after I had saved it restarting the server removes everything made after that save right? If so then what could I use instead of restarting the entire server and have that just affect the level? Would I need to re-load the level or what?
Yes. many threads have been made asking how to reset levels and got answers. If you search you will find one.
I ment restoring the map to a previous version (skywars plug) I have everything done except the map reset.
I believe there's map reset somewhere in the code of this plugin maybe take a look https://github.com/ImagicalCorp/SpleefPE And there is a lot of threads about this I'll point them out if necessary
In PocketMine's understanding, FloatingTextParticle is a particle not an entity. You have to spawn an air item entity to teleport it.
The code specified players but even if not I have tested it and it doesn't broadcast a message when I shove my dog into a NetherPortal. xD