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

if player use chestplate

Discussion in 'Development' started by kingyousef, Jun 27, 2018.

  1. kingyousef

    kingyousef Silverfish

    Messages:
    17
    GitHub:
    kingyosuef
    i need code for if player use chestplate
     
  2. KHAV

    KHAV Baby Zombie

    Messages:
    152
    GitHub:
    xkhhv
    PHP:
    If($player->getArmorInventory()->getChestplate()->getId() == //Chestplate Id){
    //do something 
    }
    I didn’t try it but this maybe work
     
  3. PixelzChris

    PixelzChris Silverfish

    Messages:
    17
    It will work don't worry
     
    KHAV likes this.
  4. KHAV

    KHAV Baby Zombie

    Messages:
    152
    GitHub:
    xkhhv
    xD
     
  5. byyEmirhanWSD

    byyEmirhanWSD Witch

    Messages:
    50
    GitHub:
    EmirhanWSD
    He didnt't ask get player chestplate id.

    PHP:
    /** @var Player $g */
    if(!$player->getArmorInventory()->getChestplate() == null) {


    }
     
  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.