Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

get MetaData of an Item?

Comments in 'Plugin Development' started by cake23, Apr 22, 2016.

  1. cake23
    Offline

    cake23 Active Member

    Joined:
    Aug 10, 2015
    Posts:
    124
    Minecraft User:
    TheEnd
    Hey! I want to check if the player have an red wool block in the hand, but how can I get the Meta Data?
    ( $player->getInventory()->getItemInHand() === Item::WOOL.... )
    Thanks! :D
  2. Nawaf_Craft1b
    Offline

    Nawaf_Craft1b Active Member Plugin Developer

    Joined:
    May 8, 2015
    Posts:
    232
    Plugins:
    1
    Minecraft User:
    Nawaf_Craft1b
    PHP:
    $player->getInventory()->getItemInHand()->getId(); # id 
    $player->getInventory()->getItemInHand()->getDamage(); # damage
  3. cake23
    Offline

    cake23 Active Member

    Joined:
    Aug 10, 2015
    Posts:
    124
    Minecraft User:
    TheEnd
    Thnanks!! I will try it out :3

Share This Page

Advertisement