Closed efor89 closed 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); }
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); }