I'm using interact event to set the block to air, but it doesn't work and there's no errors. Code: PHP: public function onInteract(PlayerInteractEvent $event){ $block = $event->getBlock(); if($block->getId() == 46){ $block->getLevel()->setBlock(new Vector3($block->getX(), $block->getY(), $block->getZ()), Block::get(Block::AIR), true); }} Like i said, there's no errors or anything, i'm using all the correct use imports idk how to fix
Add PHP: var_dump($block->getId()); right after declaring the $block variable and check if you get any console output.
that's weird. try this: PHP: public function onInteract(PlayerInteractEvent $event){ $block = $event->getBlock(); var_dump($block->getId()); if($block->getId() == 46){ var_dump($block->getLevel()->setBlock($block), Block::get(Block::AIR), true)); }}