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

Solved Undefined getInvetory()

Comments in 'Plugin Development' started by FlamingGenius, Oct 13, 2015.

  1. FlamingGenius
    Offline

    FlamingGenius Active Member

    Joined:
    Sep 23, 2015
    Posts:
    173
    Minecraft User:
    FlamingGenius
    Idk how else to do this?

    PHP:
    ErrorCall to undefined method pocketmine\Player::getInvetory()
    File: /phar_Lottery-master_Spj8JZ0dLkVzO9H.phar/src/FlamingGenius/Lottery/Lottery
    Line
    37
    Type
    E_ERROR

    THIS CRASH WAS CAUSED BY A PLUGIN
    BAD PLUGIN
    Lottery_Minigame v1.0.0

    Code
    :
    [
    28]    
    [
    29]    $sender->sendMessage("Your ticket number is" " " $ticket);
    [
    30]    if($ticket == $winT){
    [
    31]     //debug line 30
    [32]     $this->getServer()->broadcastMessage($player " " "Got a winning lottery ticket" " " "Ticket Number:" "ยง6" $ticket);
    [
    33]     $id $this->getConfig()->get("item-id");
    [
    34]     $damage $this->getConfig()->get("item-damage");
    [
    35]     $amount $this->getConfig()->get("item-amount");
    [
    36]     $item Item::get($id,$damage,$amount);
    [
    37]     $sender->getInvetory()->addItem($item);
    [
    38]     $sender->sendMessage("You recieved" " " $amount " " $id);
    [
    39]    }
    [
    40]    else{
    [
    41]     $sender->sendMessage("Sorry your ticket is not a winning number");
    [
    42]    }
    [
    43]   }
    [
    44]  }
    [
    45
    [
    46
    [
    47
  2. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    Learn to read the error. You spelled getInventory() wrong.
  3. FlamingGenius
    Offline

    FlamingGenius Active Member

    Joined:
    Sep 23, 2015
    Posts:
    173
    Minecraft User:
    FlamingGenius
    Ive been working on this sense 8pm is currently 2:09am if theres something mispelled and i dont see it that should be conpletly nderstandable lol
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    But the error message told you that.
    MCPEPIG likes this.

Share This Page

Advertisement