Does anyone know of a plugin that when you join the server it puts items in your hotbar and when you click them they either run a command like transfer you to another server or pops up the new menu feature with 2.0, and then Is anyone capable of making this?
1 - Search on github for Menu plugin or on pmmp plugins 2 - If you don't know how to search, use the function PlayerJoinEvent to put items after player join the server. Code: PHP: $player->getInventory()->setItem(0, \pocketmine\item\Item::get(ITEM ID, DAMGE, AMOUT)->setCustomName("CUSTOM NAME IF YOU WANT, IF NOT DELETE THIS")); 3 - To do that the player tap on any item id please use PlayerInteractEvent if you want to transfer any people use this example: PHP: $player = $event->getPlayer(); $item = $player->getInventory()->getItemInHand(); //get item in hand if($item->getId() == ITEM ID HERE){ //get id to tap $player->transfer("IP OF THE SERVER",19132); //Transfer code } Sorry by my bad english.
You should give more info about what you want in the hotbar menu. Only a transfer? Warps? Info message?
Like when you join it gives you three items, "Servers, Vote (Website), Twitter". When you click Servers, It gets rid of the current items and makes 3 more "OITQ, TeamKill, Factions, ect." And then a back button on each one. Then when you click the vote one it sends you a message of the link. And for the twitter as well.
PHP: public function onInteraction(PlayerInteractEvent $e){$o = $e->getPlayer();$item = $player->getInventory()->getItem()->getId() == Item::BONE;if($e->getItem()->getId() == Item::BONE) { $o->transfer("bla bla bla"); }} CORRECT ME IF IM WRONG
This way is easy, right? PHP: public function handleInteract(PlayerInteractEvent $event){ $items = [Item::BONE => function(Player $player){$player->transfer("127.0.0.1", 19133);}, Item::APPLE => function(Player $player){$player->sendMessage("This item not work today. Try in another day! :)");}]; if(isset($items[$event->getItem()->getId()])){ $items[$event->getItem()->getId()]($event->getPlayer()); }}