68 $world = $this->position->getWorld();
69 if($this->age < self::MAX_AGE){
72 BlockEventHelper::grow($this, $block,
null);
74 $grow = $this->getPlant();
75 foreach(Facing::HORIZONTAL as $side){
76 if($this->getSide($side)->hasSameTypeId($grow)){
81 $facing = Facing::HORIZONTAL[array_rand(Facing::HORIZONTAL)];
82 $side = $this->getSide($facing);
83 if($side->getTypeId() === BlockTypeIds::AIR && $side->getSide(Facing::DOWN)->hasTypeTag(BlockTypeTags::DIRT)){
84 if(BlockEventHelper::grow($side, $grow,
null)){
85 $this->position->getWorld()->setBlock($this->position, $this->setFacing($facing));