Hi, I'm new to Pocketmine plugin development. I'm creating a plugin for a minigame, so now i'm testing setBlock and getBlock. With my script I want to create a platform with a different color of wool every 5 seconds Here's my script: PHP: <?php/*__PocketMine Plugin__name=Blocksversion=0.0.1author=YoDevilclass=Blocksapiversion=12*/class Blocks implements Plugin{ private $api; public function __construct(ServerAPI $api, $server = false){ $this->api = $api; } public function init(){ $this->api->schedule(5*20, array($this, "timer"), array(), false); } public function __destruct(){ } public function timer(){ $wool_color = rand(1,15); $level = $this->api->level->get("blocks"); for ($x = 1; $x <= 20; $x++) { for ($z = 1; $z <= 20; $z++) { $testforBlock = $level->getBlock(new Vector3($x,80,$z)); if ($testforBlock->getID() === BlockAPI::get(0, 0)) { $wool_block = BlockAPI::get(35, $wool_color); $level->setBlock(new Vector3($x,80,$z), $wool_block); } } } }} This code doesn't work, and I don't understand why. It looks ok for me, but I'm also new to PHP so maybe i can't really see my mistake. I've tested and the blocks at height 80 are air blocks (line 34), so that is not the problem. Please help me! Thanks in advance
I recommend you to learn the new API, it easier to use, but a little bit hard to learn xD http://docs.pocketmine.net