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

Problem with addItem

Discussion in 'Development' started by Palente, Oct 28, 2017.

  1. Palente

    Palente Slime

    Messages:
    75
    GitHub:
    palente
    Hey I have a problem with addItem That don't add Item In Inventory i explain
    If the hot bar is not empty that add It When the hot bar That dont add item directly into inventory i try it with setContents but even problem
    My code
    PHP:
        if($player->getInventory()->contains(Item::get(264,0,5))){
            
    $player->getInventory()->removeItem(Item::get(264,0,5));
    $player->getInventory()->addItem(Item::get(49,0,10));
    [
    PHP/]
     
  2. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    what is the problem now? that the item doesn't get removed/added when in the hotbar? or the other way around?
     
  3. Palente

    Palente Slime

    Messages:
    75
    GitHub:
    palente
    No i dont explain correctly if the hot bar is full the item will dont add in inventory but with not error i dont know why.
     
    Last edited: Oct 29, 2017
  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.