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

How to fill items on player inventory?

Discussion in 'Help' started by A354-PH, Dec 11, 2018.

  1. A354-PH

    A354-PH Baby Zombie

    Messages:
    186
    GitHub:
    Kizu
    How to add/fill items on all slots of an players inventory? Merry Christmas btw
     
  2. A354-PH

    A354-PH Baby Zombie

    Messages:
    186
    GitHub:
    Kizu
    BUMP
     
  3. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
    Calculate the empty slots of a player then use for() and addItem()

    Merry Christmas
     
    Last edited: Dec 12, 2018
  4. Ayzrix

    Ayzrix Witch

    Messages:
    66
    GitHub:
    Ayzrix
    PHP:
    $player->getInventory()->addItem(Item::get(<id>, <damage>, <number>));
     
  5. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
    It would be nice if you read the question first
     
  6. Ayzrix

    Ayzrix Witch

    Messages:
    66
    GitHub:
    Ayzrix
    Ah yes I read wrong it seems to me that this is functional

    PHP:
    $player->getInventory->setItem($slotItem::get(Item::STAINED_GLASS_PANE151)->setCustomName("§cBarrier"), true);
     
  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.