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

Set item in inventory to selected slot

Discussion in 'Development' started by Kyd, Oct 10, 2017.

  1. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    I want to set item to 3rd slot in chest with InventoryContentPacket, but it always set to first slot :/
    PHP:
    $pk2 = new \pocketmine\network\mcpe\protocol\InventoryContentPacket;
    $pk2->windowId $ac->windowId;
    $pk2->items[3] = $ac->oldItem;
    $player->dataPacket($pk2);
     
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Yeah, it's become pretty annoying since 1.2
    PHP:
    $pk2->items array_fill(02Item::get(Item::AIR00));
    $pk2->items[3] = $ac->oldItem;
     
    iiFlamiinBlaze and jasonwynn10 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.