94 $this->position->getWorld()->dropItem($this->position, $this->asItem());
97 $this->position->getWorld()->setBlock($this->position, $this->setBerries(
false));
101 $newState = (clone $this)
103 ->setHead(!$this->getSide(Facing::DOWN)->hasSameTypeId($this));
104 if(BlockEventHelper::grow($this, $newState, $player)){
113 $head = !$this->getSide(
Facing::DOWN)->hasSameTypeId($this);
114 if($head !== $this->head){
115 $this->position->getWorld()->setBlock($this->position, $this->setHead($head));
118 if($this->age < self::MAX_AGE && mt_rand(1, 10) === 1){
119 $growthPos = $this->position->getSide(Facing::DOWN);
120 $world = $growthPos->getWorld();
121 if($world->isInWorld($growthPos->getFloorX(), $growthPos->getFloorY(), $growthPos->getFloorZ())){
122 $block = $world->getBlock($growthPos);
123 if($block->
getTypeId() === BlockTypeIds::AIR){
124 $newState = VanillaBlocks::CAVE_VINES()
125 ->setAge($this->age + 1)
126 ->setBerries(mt_rand(1, 9) === 1);
127 BlockEventHelper::grow($block, $newState,
null);