Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Set item popup

Comments in 'Plugin Development' started by MyAJVideo, Jul 14, 2015.

  1. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    Is it able to set a item popup ?
    If not could you cancel the item popup and make a popup to overwrite? Like a diamond sword an when you hold it it says diamond sword but could i cancel that popup and make slaping diamond out of it ? So if you tap it it now says slaping diamond
    xiaoq likes this.
  2. BalAnce
    Offline

    BalAnce Active Member

    Joined:
    Mar 10, 2015
    Posts:
    125
    Minecraft User:
    BalAnce
    Now im not sure how to cancel item popup or if its possible but ive done a similar effect use PlayerItemHeldEvent and if its a certain item i send a normal popup to the player. The real item name shows up for like a split second tho but it works pretty well as i use it on a server.
  3. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    Can you send me a code ?
  4. BalAnce
    Offline

    BalAnce Active Member

    Joined:
    Mar 10, 2015
    Posts:
    125
    Minecraft User:
    BalAnce
    Here it looks weird cause i wrote it on my phone so.. yea
    PHP:
    public function playerItemHeld(PlayerItemHeldEvent $ev){
            
    $item $ev->getItem();
            
    $player $ev->getPlayer();
            if (
    $item instanceof Item){
                switch (
    $item->getId()){
                    case 
    296:
                        
    $player->sendPopup("Name");
                     
                    break;
                 
             
                }
            }
        }
    CraftYourBukkit and MyAJVideo like this.
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Note that there is still a few hundreds of milliseconds before the popup is shown, so don't expect the real item name to be completely hidden.
  6. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    It wouldnt work realy
  7. ahoj_truhliku
    Offline

    ahoj_truhliku Banned

    Joined:
    Jul 9, 2015
    Posts:
    89
    Minecraft User:
    Creeperface001
    it will be avalaible in 0.12.0 but i dont if will be avalaible item description too.
    (this)[​IMG]
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Then wait for 0.12. PocketMine has no reason to add it if it isn't implemented for clients.
  9. ahoj_truhliku
    Offline

    ahoj_truhliku Banned

    Joined:
    Jul 9, 2015
    Posts:
    89
    Minecraft User:
    Creeperface001
    amd will description under item name too in 0.12.0?
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    No. sendPopup only sends a popup that overrides the client popup.
    Jon likes this.
  11. ahoj_truhliku
    Offline

    ahoj_truhliku Banned

    Joined:
    Jul 9, 2015
    Posts:
    89
    Minecraft User:
    Creeperface001
    i know but in 0.12.0 will be anvil and changable item names so will be description under item name avalaible too?
  12. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Plus, the description under item name is not a popup.
  13. Jon
    Offline

    Jon Active Member Plugin Developer

    Joined:
    Sep 1, 2013
    Posts:
    201
    Plugins:
    3
    Minecraft User:
    Heromine14
    But you can make the description easily when the client's popup has overridden with a popup or a tip (so it will be up).
    obviously will be on the hotbar or just up it but it can be done with a "\n"
  14. ahoj_truhliku
    Offline

    ahoj_truhliku Banned

    Joined:
    Jul 9, 2015
    Posts:
    89
    Minecraft User:
    Creeperface001
    i only asked if it will be added in 0.12.0 and i think \n doesn´t work in popup
  15. Jon
    Offline

    Jon Active Member Plugin Developer

    Joined:
    Sep 1, 2013
    Posts:
    201
    Plugins:
    3
    Minecraft User:
    Heromine14
    yes \n works, i use it
    PEMapModder likes this.
  16. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Do we even know how description are going to be displayed in 0.12?
  17. Jon
    Offline

    Jon Active Member Plugin Developer

    Joined:
    Sep 1, 2013
    Posts:
    201
    Plugins:
    3
    Minecraft User:
    Heromine14
    I was talking for 0.11

Share This Page

Advertisement