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

How to remove a certain item from Inventory?

Discussion in 'Development' started by CryptoKey, Mar 5, 2019.

  1. CryptoKey

    CryptoKey Spider

    Messages:
    6
    GitHub:
    cryptokey98
    I know you can

    $player->getInventory()->clearAll();

    But I was wondering how can can clear a certain item from inventory. Thank you.
     
  2. A354-PH

    A354-PH Baby Zombie

    Messages:
    186
    GitHub:
    Kizu
    PHP:
    $player->getInventory()->remove(Item::get($id$meta$count));
    I think this will work
     
    CryptoKey likes this.
  3. CryptoKey

    CryptoKey Spider

    Messages:
    6
    GitHub:
    cryptokey98
    Thank you man it works perfectly.
     
    A354-PH likes this.
  4. A354-PH

    A354-PH Baby Zombie

    Messages:
    186
    GitHub:
    Kizu
    Np
     
    CryptoKey likes 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.