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

InventoryPickUpItemEvent

Comments in 'Plugin Development' started by Xenturio, Aug 20, 2015.

  1. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    can someone say me how to get the right item id from
    the inventoypickupitemevent??? is this possible?

    Code:
    [13:30:17] [Server thread/INFO]: 280 Item Stick (280:0)x64 <--this i need
    [13:30:27] [Server thread/INFO]: 3 Item(3) <- this i get
    
  2. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    it is because it is Item Entity
  3. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    so try
    PHP:
    $event->getItem()->getItem();
    Xenturio likes this.
  4. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
  5. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    this i tryed but error

    Code:
    [14:00:22] [Server thread/CRITICAL]: "Could not pass event 'pocketmine\event\inventory\InventoryPickupItemEvent' to 'SurvivalHiveCaptchatheFlag v1': Illegal offset type in isset or empty on main\captchatheflag
    [14:00:22] [Server thread/WARNING]: RuntimeException: "Illegal offset type in isset or empty" (E_WARNING) in "/src/pocketmine/level/Level__64bit" at line 1745
    
  6. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    hm can you post full event code? or more code?
  7. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    ok think i found my mistake :D your right ^^

    had a line before that crashed the code xD dont know why i used that xD but
    $event->getItem()->getItem()->getName() worked! Thx
  8. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    $event->getItem()->getName() is shorter
  9. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    ok did someone know how to get the player then? so
    i see which player picup which item?
  10. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    this crashed by pickupitemevent!
  11. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    this is freaky -.-
  12. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    this is why i like this community :-*

    no hour is over and my problem is solved xD
    Creeperface likes this.
  13. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    You did not really check docs did you :D?
    Creeperface likes this.
  14. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It shows something different.
    Legoboy0215 likes this.

Share This Page

Advertisement