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

$inv->contains(); doesn't work for custom named items?

Discussion in 'Development' started by Az928, Sep 15, 2017.

  1. Az928

    Az928 Baby Zombie

    Messages:
    140
    GitHub:
    theaz928
    My code: (Not really, but the idea of how my code written)
    PHP:
    $check Item::get(37701)->setCustomName("Anything");
    if(
    $inv->contains($check)){
      
    $this->doStuff();
    }
    The problem I'm having is after player quit and rejoin, the custom named item is still in inventory but $inv->contains(); doesn't work then, it works when player online and the custom named item added to its inventory. Any help is appreciated.
     
    Last edited: Sep 16, 2017
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Item::setCustName does not exist.
     
    Levi likes this.
  3. Az928

    Az928 Baby Zombie

    Messages:
    140
    GitHub:
    theaz928
    Oh, that's a typo
     
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Does the player have more than 1 blaze powder (Item ID: 377) in their hand?
     
  5. Az928

    Az928 Baby Zombie

    Messages:
    140
    GitHub:
    theaz928
    @player has 64 Custom named blaze powders, but when relog, none is counted in inventory
     
  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.