How do you define multiple blocks? I want cactus to spawn on SAND and CACTUS. For now, it only spawns on sand. Code: private function canCactusStay($x, $y, $z){ $b = $this->level->getBlockIdAt($x, $y, $z); return ($b === Block::AIR or $b === Block::SNOW_LAYER) and $this->level->getBlockIdAt($x, $y - 1, $z) === Block::SAND; }
PHP: private function canCactusStay($x, $y, $z){ $array = [Block::SAND, Block::ANOTHER_BLOCK]; $b = $this->level->getBlockIdAt($x, $y, $z); return ($b === Block::AIR or $b === Block::SNOW_LAYER) and in_array($this->level->getBlockIdAt($x, $y - 1, $z), $array); }