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

What? :D

Comments in 'Plugin Development' started by Marcelo234, Mar 16, 2016.

Thread Status:
Not open for further replies.
  1. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    Hey Guys...Here I have a simple code.....But it won't work.Maybe you can help me. Thnaks :D
    PHP:
    $p->getInventory()->addItem(20,0,1);
    ERROR:
    Code:
    [12:31:05] [Server thread/CRITICAL]: "Could not pass event 'pocketmine\event\player\PlayerInteractEvent' to 'McKaff_BowBash v0.1.0': Expected Item[], got integer on McKaff_BowBash\Arena\Arena
    [12:31:05] [Server thread/CRITICAL]: InvalidArgumentException: "Expected Item[], got integer" (EXCEPTION) in "/src/pocketmine/inventory/BaseInventory" at line 252
    
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Read the error. Inventory::addItem() basically an Item object. Means:
    PHP:
    $p->getInventory()->addItem(Item::get(20,0,1));
  3. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    Thanks... ;)
  4. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Code:
    $p->getInventory()->addItem(new Item(20,0,1));
  5. Intyre
    Offline

    Intyre Staff Member PocketMine Team

    Joined:
    Aug 24, 2013
    Posts:
    118
    Minecraft User:
    Intyre
    CraftYourBukkit likes this.
Thread Status:
Not open for further replies.

Share This Page

Advertisement