So, i want to ban block is Polished Andesite in my mining world. PHP: public function onBreak(BlockBreakEvent $event){ $block = $event->getBlock(); $player = $event->getPlayer() if($player->getLevel()->getName() === "Mining"){ if($block->getId() == Block::STONE_BRICK_STAIRS || $block->getId() == Block::STAINED_GLASS || $block->getId() == Block::get(1, 6) || $block->getId() == Block::STONE_BRICKS || $block->getId() == Block::STONE_SLAB || $block->getId() == Block::get(35, 14) || $block->getId() == Block::SEA_LANTERN){ $event->setCancelled(); $player->sendMessage("§cYou cant break the block here!"); } }} but i get internal server error when i break block in the mining world
Eu tenho um plugin que criei AntiXRay I have a plugin that I made AntiXRay I think that if I change some values I can prevent the breaking of that block, or even make it drop Stone like mine
Code: Block::get(35, 14) returns Block object, but not the expected ID. You should compare the ID with ID 35 directly but this will restrict any Wool block. If you want to restrict specifically Red or Green Wool, you need to compare the damage value too.