Hello fellows! I'm Building a Tutorial for an Original Game for Minecraft: Pocket Edition under the title "Swords & Castles" where I'm learning a bit how to program some basic plugins. Well, I've learned how to create the playerJoinEvent thanks to my old thread where some good lads helped ! My small problem now is that I can't figure out how I will make the player spawn in another world rather then the default one IF the player as never joined so he can get teleported to the "Tutorial Island" World! (best name lol) Here's the code I have so far thanks to @Teamblocket and @Nathaniel Fredericks PHP: namespace learning;use pocketmine\plugin\PluginBase;use pocketmine\plugin\PlayerJoinEvent;use pocketmine\Player;use pocketmine\event\Listener;use pocketmine\utils\TextFormat;class learning extends PluginBase implements Listener { public function onEnable { $this-getServer()->getPluginManager()->registerEvents($this, $this); $this->getLogger()->Info("Plugin Enabled. OMG!"); } public function onDisable { $this->getLogger()->Info("Plugin Disabled. Bai!"); } public function playerJoinEvent(PlayerJoinEvent $event) { $player = $event->getPlayer(); if($player->hasPlayedBefore() == true) { $player->sendMessage("Welcome back, " . $player-getName()); } else { // It's probably here where I will put the code that I need. But how is it? $player->sendMessage(TextFormat::GOLD . "Welcome to the Swords & Castles ! Let's start with a Tutorial."); } }} Note : I do know that the Event can be made in other ways that for a lot of you it's more simple but in my head this way makes more sense to me and readable. Thanks everyone that reply here! Have a good day.
wow.. lol. that's uh.. simple. I get the server so I can get the Level and store it in the $world variable. Then I teleport the player to the $world with the teleport function! lmao so simple. XD Thanks @xXNiceAssassinlo YT for the brief but effective help.