1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

ItemSlot

Discussion in 'Development' started by abimalek, Nov 14, 2017.

  1. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    I what to know how to check if comething is in slot 3 of a players inventory so I can do

    I tried if($item->getSlot() === 1){ but it didn't work

    pls help me
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Item::getSlot() is not a method that exists in PocketMine.
    try this:
    PHP:
    if($player->getInventory()->getSlot(2)->getId() === Block::STONE) {
        
    //code here
    }
     
    Vaxrp, SleepSpace9 and Muqsit like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.