Hey! I am trying to make a plugin where obsidian breaks by TNT PHP: <?phpnamespace minijaham\BreakableObsidian;use pocketmine\block\Block;use pocketmine\plugin\PluginBase;use pocketmine\block\Liquid;use pocketmine\entity\PrimedTNT;use pocketmine\event\entity\EntityExplodeEvent;use pocketmine\event\Listener;use pocketmine\block\Obsidian;class Main extends PluginBase implements Listener{ public function onEnable() { $this->getServer()->getPluginManager()->registerEvents($this, $this); } public function onExplodeTnt(EntityExplodeEvent $event) {echo ' Tnt Exploded BRUH '; $blockList = $event->getBlockList(); foreach($blockList as $key => $block) { if ($block->getId() === Block::OBSIDIAN) {echo ' I found Obsidon Block BRUH '; $level = $blockList[$key]->getLevel(); $level->setBlock($blockList[$key], Block::get(Block::AIR)); } } }} The code only returns: Doesn't break the obsidian >:[
try use pocketmine\block\Obsidian; if ($block instanceof Obsidian) and for your $level why get block via array, just use $block->getLevel() var_dump can help you, this is a function who paste your variable in your console. Use on $block->getId() or $blockList, it can help you
I've tried use pocketmine\block\Obsidian; if ($block instanceof Obsidian) which was my first code xD And I'll use the $block->getLevel90