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

ItemInHand

Discussion in 'Development' started by abimalek, Oct 21, 2017.

  1. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    How would I check if a player has 64 tnt in his or her hand
     
  2. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    I know it would be
    $player->getInventory()->getItemInHand()
     
  3. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    but it only checks the id
     
  4. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    if($player->getInventory()->getItemInHand()->getCount() === 64)
     
  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.