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

Solved Call to a member function setCount() on integer? Need Help. (Please lock thread now)

Comments in 'Plugin Development' started by CavinMiana, Oct 19, 2015.

  1. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    Nope

    $item = $ev->getItem();

    That all.
  2. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    No. $item = $ev->getItem();
  3. CavinMiana
    Offline

    CavinMiana Active Member

    Joined:
    Aug 26, 2015
    Posts:
    101
    Minecraft User:
    CavinMiana
    Now its telling me this...
    PHP:
    PocketMine-MP Crash Dump Mon Oct 19 23:47:50 UTC 2015

    Error
    Call to undefined function CavinMiana\PaintBallWars\getItem()
    File: /PaintBallWars/src/CavinMiana/PaintBallWars/Main
    Line
    71
    Type
    E_ERROR

    THIS CRASH WAS CAUSED BY A PLUGIN
    BAD PLUGIN
    PaintBallWars v1.1.0

    Code
    :
    [
    62]                            "Health" => new Short("Health"5),
    [
    63]                            "Item" => new Compound("Item", [
    [
    64]                                "id" => new Short("id"Item::SNOWBALL),
    [
    65]                                "Damage" => new Short("Damage"0),
    [
    66]                                "Count" => new Byte("Count"1),
    [
    67]                            ]),
    [
    68]                            "PickupDelay" => new Short("PickupDelay"0x7F),
    [
    69]                         ]);
    [
    70]                         $f 1.5;
    [
    71]                         $item getItem();
    [
    72]                         $snowball Entity::createEntity("Item"$player->getLevel()->getChunk($player->getFloorX() >> 4$player->getFloorZ() >> 4), $nbt$player);
    [
    73]                         $snowball->setMotion($snowball->getMotion()->multiply($f));
    [
    74]                         if($player->isSurvival()){
    [
    75]                             $item->setCount($item->getCount() - 1);
    [
    76]                             $player->getInventory()->setItemInHand($item->getCount() > $item Item::get(Item::AIR));
    [
    77]                         }
    [
    78]                         $player->getLevel()->addSound(new LaunchSound($player), $player->getViewers());
    [
    79]                         $snowball->spawnToAll();
    [
    80]         }
    [
    81]     }

    Backtrace:
    #0 (): pocketmine\Server->crashDump()

    PocketMine-MP version1.5dev #1261 [Protocol 27; API 1.12.0]
    Git commit0000000000000000000000000000000000000000
    uname 
    -aDarwin administrators-macbook.local 10.8.0 Darwin Kernel Version 10.8.0Tue Jun  7 16:33:36 PDT 2011root:xnu-1504.15.3~1/RELEASE_I386 i386
    PHP Version
    5.6.10
    Zend version
    2.6.0
    OS 
    Darwinmac

    Loaded plugins
    :
    DevTools 1.10.0 by PocketMine Team for API(s1.3.1
    PaintBallWars 1.1.0 by CavinMiana 
    for API(s1.12.0

    ----------------------REPORT THE DATA BELOW THIS LINE-----------------------

    ===
    BEGIN CRASH DUMP===
    eNrNWvtPHEmS/ldSbUsLp66mH9BAWfjEYLzDLR44wOvTTY+srKqs7lrqNZVZND0j799+X0RmPRoY
    xtq7Hw6NRp2vyIjIL76IzPLvA5NkauBP9vcPpsdH
    +4fj4UBVVVEN/N8HZlNiaHD+9fzm5upmMBxk
    Smu5pL4zmabCFKLOIxUnuYpEXOehSYpcnMmHJP
    +UyFwuFtcyyc0PmPtFVnqxWCpzYVS2swtZcZKS
    oL2tKXu6Cvc6AU8GP6GFlSn2G
    /iHk2/DQZnWS/T5g62JmBMWkSIT5lMMij/+Wwx+VDI1q8VAnLwX
    uVqL21VRmZ2ufygOdoeQOJ
    /9mSQyrZNzVmRlAffsNAND8TOJ2X9djBWVRM8Vor6hIFm+f/vT1Zcf
    Ti8vrWYH3yPyg8xwdM
    /FNv1DMbbS5t8j7QymmU7YDxujdtreoZhYUYevi/rFzjr6M8deJ+F9XX5Q
    qdw8139rEEY8Hn60Yo9fEfvL7jtMORy
    /MuVtLE7EZHTAEyevTUxwJJjbgptXvIa7tzov1gFF0Ik4
    z01iNr4fVkoaZVs9yLwtYZeqvPeQfqkeVLqzy7
    /PVnV+v9Mf/ZgWRfVfO7vi/Xuxv72Qh/7bDe1i
    LA9MO8OqO
    /sedb33WplPBUX5Tq9z2XZCt6xOTVKmm5238a4V/Rrgk7izIdG3dfWQPEjYuPs7rfwz
    XLPnWSkG3o5rL5v2rvCARFbiz0Ddd9dF
    /qByU1QbskfbU73If5SI5ec7vBdj8e8OA76LTgzv2F+n
    FzfOC6
    +Fwjea8FoUvIgCGUW3TDAUDZcS9Luy7eZgt0Hw90StVaV3nD7H33ngpVznd8VpmlpcH1HI
    LMzCkM5HE258G4CJTSVDMO7PgzdjsbPri7II75XJQNWLxa2qHkiLsJJ69aHOSiSAX4aDpcpVJVOi
    aQxrAAjiEHGReoDwoE7SCIlpOp
    +A56vCFGGBudPD4UCWCc+cTEdjzFwmBs3xd/5hQSXv0ySgNaND
    llDnkpIguLBaJ7mQEfRONEwCCrSXyTAoivtRWoQyFZPx6Gg0Fm7q31SVq1T83ervBn1xVyvxH3Uu
    xKGYzP3ZzJ
    /NxfWHOzEdTybvRFUUxn/Ma29yMN4fTQ5Gs39O9m7OL89Pb8+/XsyO5iLB/6BXuSqh
    1cFoPpqQmr
    +pHB4ZTNEe29GvhW7VRg+3oO6gTY2avPtBPdwVRcq/G0ubruGW76E/SZa1AbtqOs5r
    PsdPOEdxp2RG58bu
    /xmzZ6MJtVUug1RBM1PVajiIVAk9aTHGdBGbD/2OTHK+bvZfLHqapIUk+27v
    Tm
    /uPl+jY60CjchC38qYUvt7ezjrVR2MwiLb6zTba2XA7u1KoLP4aYWwZfZTq7sSZMtgBty/aPEr
    ZVFT11jzr69u775c3Vx
    +6Dsgr9P0G52qrGCOUVWzG4fWCPFRqsokigDw5rptoQrJ42QpqNhaVIv8
    zSeA9Co0YnIspjN
    //9CfTcXnuzMC5gFNsPI88tmJ0xgKdwMlku7J5Hgym1LnEtMyVFonY2pl8tGz
    hKNPptzD7OFR8CquDU+8CXWvV7DJSxFhJ0UcU491qPdrrarNk74qxLoipx76OSql1uuiik7+jf+w
    bWGiE4IB6CU2vrg
    +F5ZwaInMc3BiqJxingxXCQg0A8FrJx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WMsA1VY/E
    rVVlzJsnmo7XRjpsWiesGDtbUGKwchr
    /a/ZLnAAuoClFFwWSEoMjmh3t8cOYmkG7LGBHQaFBPsM+
    S1bSY8V8MV4wVTArG1CNjP6fq0/lzCvKU/r7XymvTVHy/o6qWn2cNC0QUlQEgGWcNrRno9JkPN23
    Wl2rKik4HVEsatowZEJ22rXxNsFWoJqIMMYzPMSDspHGNF7gVp4jQuE3Yoc
    /cqt1J4qblBmeYt1O
    W3DCJRmIvi6SLR3RDldEIZThePro
    +WQy2xWdcGGpQkqEmt1Culof27WtAfCkKnVn5mzs7NS7Lyrk
    rJ5Zq5eyCnD
    +Hi5dqS3eKMJe9CrDiVRxa4Rbg9jNZF5zyu1rgXKkBhZwP9UvgsGhwfJqHDfckHUo
    G4krm
    ++4BUSsijqNWkUSMMg6F53qhFtRsuYwcI5bINso3nzkSHjGjYwVu7o1Kq6KrKFYWuvGvT4r
    9c4URrijewqFF
    /DTW0dFdEiPO9r6+5JRT4TInaQZ3RPIGmFr2iGHZ4UCRNtJHtUAVMt0skhUc8wu
    UI7nTs8PhV329PgoCVClZJf1Jdhd3LT
    /A5s5EXkhanNlrXZYaDaigTZ7vypqkefK0Fm0pRugkdpM
    GEiD4p8KEUlVLhIg8ORYiQPQFqZu1JJRoNqcyHTzpk9fzQgFfrUxJHsovEkPzJT7eFvPNKqAVg7m
    llW6XMv1PCW6yNKdO0C7Fp1Op5H4EZcUuPcEtTCAe3b9eYi10CAA
    /6yTyKwsa3N8t+I9Fu+LQ1cY
    dCWDZsf0po7EaYR4Wsk03kORb6uYiN5W3UbY0uKvyPsB2WbnnqxenXT
    +SMFHZZBMhzawaeMvSY4q
    EmYBNoqhTbn
    +83V+3VQKXc1ORRAtWoPrF1Sw56Xnmv2aDLcsFdRL3xUd78WEig2XWaiq5OGmotTM
    YyvVVJoLdxRII12dqMWeNtLUAMzeMrSuBa9Furdpcz
    /bujeopogkvWGJvTHxVAcvMpcP3L7+Rly3
    8hLPLvFFhqGlu0
    /AIH5wIHUBOYCUSUluyQdz0o3M9LaHM81zbThG+eje/HR1d+4LZl38F9a4XOW4
    XLGgJCtTrmBZPbdzq157xKdbpxXiHgEmcbYyijglQRNCjSHkTMcuhRCV2cxEMKJLLPW7dOSifru7
    4TBbC99SuJKBgdSqt9nOBIHywi5DMaWn
    /ZcGlAlHuxy0WvW1YDjckWS6WrlHDqFATHY/Sv32JPkS
    291uiQj4FkTVE9GBTNdyo61sJ6eHoy3
    +ZhidZvTQ3EsA2tVsjRKkPkmjKwO4mX76Yv+Pl8qKHomt
    7lbGdtYRk
    +Ppi6sZXbmy98hAWWmBiomJ+G2EGIuOoZVqX0x61GeZ71Y+IOlSfZfQdVnR9avcuKcB
    l4vagoaJIpbasFfZL47G4jrlaYUGVD0K0SS0qYSvYBXdxwEMiG1c9Y
    +CbkI2NrTMCCsZcyUlmNb+
    J4dBDm0O45N8FPKpX3AHCjk/dHjYPgsG6Y2Mklr3lrlzkE47DlK71OGO5qNaIU6ipymvLiNgsVMQ
    V20l7Sb8ltZlQat4d7FrdB89V97x31omfEfHfbxW7nzdeg577vc0DssXR
    /+StLIo69RJc78pNT0R
    vMg5Jj14j5S2D3Ae40iTJ8mVGbja0JOL6504eqCXL1
    /Y4q45Ungor0sUO7bis4Bk8rCFhpMFKYe0
    ym1IQg
    +ouZa0UdvJfTILEiDfTnGPbvaO7lsyoucE+tAhbK/NsQ4kFr2ukm/JjXDt0QPPdk+bTrZ6
    y1WZ5HHRwWBV0NnzlqPeex8KIdYvL
    /JNRmU+R4iGf3WrKN1b3LDohllhYE0KuVwi+7jHgfbZhWpE
    +txz/7I1Vh8Sp1/Sh/xlocxH/HQ1MGFHfXsAVe655NxVgNxblL0HozN6M+RHLJUWJWWrIdqwgF7o
    TFOKoTKJUSkrOBv5Kac8T5Ncaq3pdBCPPSHCfSTo1RA1Ck5tbIJrCM9JoxOyw418
    /cQp6/X6JZek
    CdKNPZXzR0n51jaoYIF8p4TfaMNDADvdlH3xM
    /30kGSGfHX+hSRaFmzKkP5rKxvR3Bfspa15hebb
    2EuPt3y55SymuWIgs91n3ibF91TnXVkB
    /iXo0ZpCl1NSt5svPl6e3vnTd4fDg+PHyXD2OBtO303e
    RcjElrV2TKXQAMOcHI3FEvjWtrV
    /sMuP2+rRqJwcwp95zpCH+h/LCEP9NhLCcuBz0AwHZUiTXUP/
    miZGzez3QM9+ffzNfiC0HxiDEJXNqp1PT6d5JKuuw/5DmaZVV2nbiJMUQGfRE/uVKTZlO7qMup9Z
    171CKPN3KZr
    /D+0+Uk1HE/onOIF92G0no0DclKYzxkjSLeqbfnt9yRpM6YtAiMquW7yB8fxR0f0S
    ByPSlLwgPPoqNB0fjGf4
    +faCrs7h/OgomAdBOBtHs7mMZzKc7cdRtB8cBgfB4dFhrA7wJ95ip+sV
    uYhcaDcudPLYHYC7ursJEzLtRsXu3ole3k
    /F8VEQhfODYBwoGR/F+zJS83g8j4/2j9Q82p9FcXQ0
    nfN
    +epUVnQ81h5netjSxB4HJprhXObJO1fZ8UfIe/GAdNaKvrxvJn0zo8yBN+C0pm6/OB4Nv3/4H
    g2xryA
    ==
    ===
    END CRASH DUMP===
    @Hotshot_9930
    @Asparanc
  4. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    $item = $ev->getItem();
  5. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    $item does not equal getItem().
    Its supposed to be $item = $ev->getItem();
  6. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    Do you understand ?
  7. CavinMiana
    Offline

    CavinMiana Active Member

    Joined:
    Aug 26, 2015
    Posts:
    101
    Minecraft User:
    CavinMiana
  8. CavinMiana
    Offline

    CavinMiana Active Member

    Joined:
    Aug 26, 2015
    Posts:
    101
    Minecraft User:
    CavinMiana
    Thx guys. Works now(I think...). NOW IM OFFICIALLY DONE WITH PAINTBALLWARS!!!!
  9. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    Lol, good luck
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    If you have some basic knowledge in OOP in PHP, you'd realize that there is no function called getItem(). Learn PHP.
  11. TheMaks
    Offline

    TheMaks Active Member

    Joined:
    Jul 19, 2015
    Posts:
    58
    Minecraft User:
    TheMaks
    use:
    $item = Item::get();
  12. CavinMiana
    Offline

    CavinMiana Active Member

    Joined:
    Aug 26, 2015
    Posts:
    101
    Minecraft User:
    CavinMiana
    No
    Thx for the reply... I just forgot to add $ev->getItem(). And I see you made a documentation about making mods. Your Kewl...

Share This Page

Advertisement