22declare(strict_types=1);
26use pocketmine\block\utils\AgeableTrait;
29use pocketmine\block\utils\StaticSupportTrait;
36 use StaticSupportTrait;
38 public const MAX_AGE = 3;
40 private function canBeSupportedAt(
Block $block) :
bool{
41 return $block->
getSide(Facing::DOWN)->getTypeId() === BlockTypeIds::SOUL_SAND;
45 return $this->age < self::MAX_AGE;
49 if($this->age < self::MAX_AGE && mt_rand(0, 10) === 0){
52 BlockEventHelper::grow($this, $block,
null);
58 $this->asItem()->setCount($this->age === self::MAX_AGE ?
FortuneDropHelper::discrete($item, 2, 4) : 1)
getSide(int $side, int $step=1)
getDropsForCompatibleTool(Item $item)