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

Solved Item floating off to player event?

Discussion in 'Development' started by aTmG, Jul 18, 2018.

  1. aTmG

    aTmG Silverfish

    Messages:
    22
    GitHub:
    ATMG
    Is there an event called when an item floats off to a player? If so, what is it called?
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    item drop event?
     
  3. aTmG

    aTmG Silverfish

    Messages:
    22
    GitHub:
    ATMG
    Isn't that when a player drops an Item? I'm talking about when an item is already dropped and if you go near, it goes to your inventory
     
  4. RumDaDuMCPE

    RumDaDuMCPE Witch

    Messages:
    67
    GitHub:
    RumDaDuMCPE
    I'd guess /pocketmine/event/inventory/InventoryPickupItemEvent
     
  5. aTmG

    aTmG Silverfish

    Messages:
    22
    GitHub:
    ATMG
    How would you get the player?
     
  6. DaPigGuy

    DaPigGuy Slime

    Messages:
    86
    GitHub:
    DaPigGuy
    PHP:
       public function onPickupItem(InventoryPickupItemEvent $event)
       {
          
    $inventory $event->getInventory();
          if (
    $inventory instanceof PlayerInventory) {
             
    $player $inventory->getHolder();
          }
       }
     
    RumDaDuMCPE likes this.
  7. RumDaDuMCPE

    RumDaDuMCPE Witch

    Messages:
    67
    GitHub:
    RumDaDuMCPE
    ye fast boi
     
  8. aTmG

    aTmG Silverfish

    Messages:
    22
    GitHub:
    ATMG
    Thanks:)
     
  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.