xSuperr / VanillaBlocks

A plugin to add more blocks to PocketMine
GNU General Public License v3.0
26 stars 12 forks source link

how can i set a block in onRandomTick y + 1 #48

Closed efor89 closed 2 years ago

efor89 commented 2 years ago

hi i try to set the block y + 1 but its always updateblock with id 255 i hope you can help me

public function onRandomTick(): void{ if($this->getDamage() === 0 and mt_rand(0, 50) == 16 and mt_rand(1, 5) == 3 and mt_rand(1, 6) == 3){ $block = clone $this; $block->setDamage(1); $this->getLevel()->setBlock($block, new Placeholder($block), true, true); $this->getLevel()->setBlock(new Vector3($block->x, $block->y + 1, $block->z), new Placeholder($block), true, true); }