pocketmine\block\Carrot::getDrops PHP Method

getDrops() public method

public getDrops ( Item $item ) : array
$item pocketmine\item\Item
return array
    public function getDrops(Item $item) : array
    {
        $drops = [];
        if ($this->meta >= 0x7) {
            $fortunel = $item->getEnchantmentLevel(Enchantment::TYPE_MINING_FORTUNE);
            $fortunel = $fortunel > 3 ? 3 : $fortunel;
            $drops[] = [Item::CARROT, 0, mt_rand(1, 4 + $fortunel)];
        } else {
            $drops[] = [Item::CARROT, 0, 1];
        }
        return $drops;
    }