asItem() ]; } public function isAffectedBySilkTouch() : bool{ return true; } public function ticksRandomly() : bool{ return true; } public function onRandomTick() : void{ //TODO: light levels $x = mt_rand($this->position->x - 1, $this->position->x + 1); $y = mt_rand($this->position->y - 2, $this->position->y + 2); $z = mt_rand($this->position->z - 1, $this->position->z + 1); $world = $this->position->getWorld(); $block = $world->getBlockAt($x, $y, $z); if($block instanceof Dirt && $block->getDirtType()->equals(DirtType::NORMAL())){ if($block->getSide(Facing::UP) instanceof Transparent){ $ev = new BlockSpreadEvent($block, $this, VanillaBlocks::MYCELIUM()); $ev->call(); if(!$ev->isCancelled()){ $world->setBlock($block->position, $ev->getNewState()); } } } } }