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

Popup Inventory

Discussion in 'Development' started by abimalek, Dec 8, 2017.

  1. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    How would I make it so that I could make a gold block popup in the inventory like when you interact with snowballs and xpbottles?
     
  2. KittyDev

    KittyDev Slime

    Messages:
    96
    GitHub:
    FreakingDev
    Any attempt?
     
  3. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    $player->getInventory()->getItemInHand()->setSize(5);
    sleep(1);
    $player->getInventory()->getItemInHand()->setSize(1);
     
  4. ItzAribie

    ItzAribie Spider Jockey

    Messages:
    41
    NEVER USE SLEEP WITH THE API PMMP YOU HAVE MANY SOLUTION BUT NEVER USE SLEEP !!!!!!!!!!!!
     
  5. Karanpatel567

    Karanpatel567 Baby Zombie

    Messages:
    115
    GitHub:
    Karanpatel567
    Never use sleep in your code! Sleep can affect your server!
     
  6. Karanpatel567

    Karanpatel567 Baby Zombie

    Messages:
    115
    GitHub:
    Karanpatel567
    The title doesn't match your description but here's some code I provided for you
    PHP:
    public function onInteract(PlayerInteractEvent $event){ //use the class Item and PlayerInteractEvent
    $player $event->getPlayer();
    $hand $player->getInventory()->getItemInHand();
    if(
    $hand->getID() === 384){ // 384 is experience bottle
        
    $player->getInventory()->addItem(Item::get(Item::4101)); // adds the gold block into the players inventory if interacted with the experience bottle
      
    }else{
            if(
    $hand->getID() === 332// 332 is the snowball
                
    $player->getInventory()->addItem(Item::get(Item::4101)); // adds the gold block into the players inventory if interacted with the snowball
        
    }
    }
     
    OnTheVerge likes this.
  7. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    What I mean Is when you use enchant bottled the bottle in your inventory increases in size then goes back to its normal size how would I do that with a golden block
     
  8. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    You can use a DelayedTask to set the player’s size back to 1 after one second (20 ticks).
     
  9. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    I know
    but how do I set the size
    this conversation got off track
     
  10. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    Explain what you mean by “size”.
     
  11. Karanpatel567

    Karanpatel567 Baby Zombie

    Messages:
    115
    GitHub:
    Karanpatel567
    I think he means by making the Image of the item small then back to normal size.
     
  12. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
  13. Karanpatel567

    Karanpatel567 Baby Zombie

    Messages:
    115
    GitHub:
    Karanpatel567
    I think there is already a small animation for it? Am i right? When you receive an item it goes small then big. This is in vanilla MCPE.
     
  14. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    You mean this when you pickup item it pop-up?
     
  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.