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

full inventory swap

Comments in 'Plugin Development' started by dxm_hippie, Sep 16, 2015.

  1. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    PHP:
    foreach($event->getDrops() as $item){
       
    $attacker->getInventory()->addItem($item);
    }
  2. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    And i think you're blindly doing copy n paste.
    PEMapModder and Legoboy0215 like this.
  3. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Me? No... :p
    foreach is a simple function in php.
  4. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Why you did you desided that im aiming at you?
    PEMapModder likes this.
  5. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Everyone aims their guns at me :eek::D
    Taha_The_Hacker likes this.
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Just use addItem(...$event->GetDrops) ;)
    Actually, it is a control structure, not a function ;) but no, he is talking to @dxm_hippie
    Then the code didn't get run at all. Did you make sure you had got everything imported? And listeners registered?
    Legoboy0215 likes this.
  7. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    I just learned that a few seconds before you posted this comment while I was chatting with my friend XD
  8. CookieSteve
    Offline

    CookieSteve Active Member

    Joined:
    Apr 22, 2014
    Posts:
    132
    Minecraft User:
    iStrqfeChris
    I know the API Learn life "
    If you live long enough, you'll make mistakes. But if you learn from them, you'll be a better person. It's how you handle adversity, not how it affects you. The main thing is never quit, never quit, never quit.

    William J. Clinton" A Random Quote
  9. dxm_hippie
    Offline

    dxm_hippie Active Member Plugin Developer

    Joined:
    Feb 1, 2015
    Posts:
    413
    Plugins:
    1
    Minecraft User:
    XxDXM_hippiexX
    No if i was then it would most likely just crash the server :p i do know a bit..
  10. dxm_hippie
    Offline

    dxm_hippie Active Member Plugin Developer

    Joined:
    Feb 1, 2015
    Posts:
    413
    Plugins:
    1
    Minecraft User:
    XxDXM_hippiexX
    Very well could have been the listeners XD oops
  11. dxm_hippie
    Offline

    dxm_hippie Active Member Plugin Developer

    Joined:
    Feb 1, 2015
    Posts:
    413
    Plugins:
    1
    Minecraft User:
    XxDXM_hippiexX
    That was the problem! :D thanks peeps!
  12. dxm_hippie
    Offline

    dxm_hippie Active Member Plugin Developer

    Joined:
    Feb 1, 2015
    Posts:
    413
    Plugins:
    1
    Minecraft User:
    XxDXM_hippiexX
  13. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    You probably misinterpreted the situation. There's something called "friendly arguments". :p
  14. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    you could use PlayerDeathEvent and just add the drops to the players inventory.
  15. dxm_hippie
    Offline

    dxm_hippie Active Member Plugin Developer

    Joined:
    Feb 1, 2015
    Posts:
    413
    Plugins:
    1
    Minecraft User:
    XxDXM_hippiexX
    that's what I was trying to figure out how to do lol we gots it now tho thanks anywho

Share This Page

Advertisement