pocketmine\item\Item::getId PHP Method

getId() final public method

final public getId ( ) : integer
return integer
    public final function getId() : int
    {
        return $this->id;
    }

Usage Example

Example #1
8
 /**
  * @param Item $item
  * @param int  $slot
  * @return CompoundTag
  */
 public static function putItemHelper(Item $item, $slot = null)
 {
     $tag = new CompoundTag(null, ["id" => new ShortTag("id", $item->getId()), "Count" => new ByteTag("Count", $item->getCount()), "Damage" => new ShortTag("Damage", $item->getDamage())]);
     if ($slot !== null) {
         $tag->Slot = new ByteTag("Slot", (int) $slot);
     }
     if ($item->hasCompoundTag()) {
         $tag->tag = clone $item->getNamedTag();
         $tag->tag->setName("tag");
     }
     return $tag;
 }
All Usage Examples Of pocketmine\item\Item::getId