pocketmine\tile\Chest::getItem PHP Method

getItem() public method

This method should not be used by plugins, use the Inventory
public getItem ( integer $index ) : Item
$index integer
return pocketmine\item\Item
    public function getItem($index)
    {
        $i = $this->getSlotIndex($index);
        if ($i < 0) {
            return Item::get(Item::AIR, 0, 0);
        } else {
            return NBT::getItemHelper($this->namedtag->Items[$i]);
        }
    }