coralType = CoralType::TUBE(); } public function onNearbyBlockChange() : void{ if(!$this->dead){ $world = $this->position->getWorld(); $hasWater = false; foreach($this->position->sides() as $vector3){ if($world->getBlock($vector3) instanceof Water){ $hasWater = true; break; } } //TODO: check water inside the block itself (not supported on the API yet) if(!$hasWater){ $ev = new BlockDeathEvent($this, $this->setDead(true)); $ev->call(); if(!$ev->isCancelled()){ $world->setBlock($this->position, $ev->getNewState()); } } } } public function getDropsForCompatibleTool(Item $item) : array{ return []; } public function isAffectedBySilkTouch() : bool{ return true; } public function isSolid() : bool{ return false; } protected function recalculateCollisionBoxes() : array{ return []; } public function getSupportType(int $facing) : SupportType{ return SupportType::NONE(); } }