Hello guys I have to be able to clear all the blocks in 6 y of endstone but I can not someone can help me out? Error : Call to a member function getBlockIdAt() on null Code: PHP: $lv = $this->$arenas; for ($x = -999; $x <= 1000; $x++){ for ($z = -999; $z <= 100; $z++){ if ($lv->getBlockIdAt($x,6,$z) == Block::END_STONE){ $lv->setBlock(new Vector3($x,$y,$z), Block::get(0)); $pl->sendMessage("debug"); } } }
can we see your full code? we want help you you should change $this->$arenas; to $this->arenas; for getBlockIdAt, i give you one example : PHP: $player = $ev->getPlayer();$direction = $player->getDirectionVector();$x = $direction->getX();$z = $direction->getZ();$block = $player->getLevel()->getBlockIdAt($player->getX(), ($player->getY() - 0.1), $player->getZ());