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){ $world->setBlock($this->position, $this->setDead(true)); } } } public function getDropsForCompatibleTool(Item $item) : array{ return []; } public function isAffectedBySilkTouch() : bool{ return true; } public function isSolid() : bool{ return false; } protected function recalculateCollisionBoxes() : array{ return []; } }