1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Hotbar Menu

Discussion in 'Requests' started by XCodeMCPE, Oct 5, 2017.

  1. XCodeMCPE

    XCodeMCPE Slime

    Messages:
    96
    GitHub:
    xcodemcpe
    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?
     
    iiFlamiinBlaze likes this.
  2. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    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 IDDAMGEAMOUT)->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.
     
    MasterPE and NickTehUnicorn like this.
  3. XCodeMCPE

    XCodeMCPE Slime

    Messages:
    96
    GitHub:
    xcodemcpe
    Can you put that in a plugin form? Or is there already one.
     
  4. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    This is requests, not development.
     
  5. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    Oh, my bad i have not seen.
     
    MasterPE likes this.
  6. XCodeMCPE

    XCodeMCPE Slime

    Messages:
    96
    GitHub:
    xcodemcpe
    Can you make it a plugin?
     
  7. NickTehUnicorn

    NickTehUnicorn Zombie

    Messages:
    200
    GitHub:
    unickorn
    You should give more info about what you want in the hotbar menu. Only a transfer? Warps? Info message?
     
  8. XCodeMCPE

    XCodeMCPE Slime

    Messages:
    96
    GitHub:
    xcodemcpe
    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.
     
  9. Daniel23

    Daniel23 Witch

    Messages:
    65
    GitHub:
    daniel23
    How about a person running a command on tap?
     
  10. Mystic30

    Mystic30 Witch

    Messages:
    52
    GitHub:
    Mystic30
    That way is posible
     
  11. Daniel23

    Daniel23 Witch

    Messages:
    65
    GitHub:
    daniel23
    Code?
     
  12. Mystic30

    Mystic30 Witch

    Messages:
    52
    GitHub:
    Mystic30
    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
     
    Last edited: Oct 7, 2017
  13. Daniel23

    Daniel23 Witch

    Messages:
    65
    GitHub:
    daniel23
    I meant running another command instead of transfering... Like /nickname etc...
     
  14. themestl

    themestl Spider Jockey

    Messages:
    39
    GitHub:
    themestl
    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());
      }
    }
     
    NickTehUnicorn likes this.
  15. XCodeMCPE

    XCodeMCPE Slime

    Messages:
    96
    GitHub:
    xcodemcpe
    Its possibile, i just need it to transfer player from one server to another.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.