Why doesn't this work? There is error on both of the if statements. Code:java public void onBlockBreak(BlockBreakEvent event) { Player p = event.getPlayer(); Block b = event.getBlock(); if (p.hasPermission("lcplugin.adminstick")) { if (p.getItemInHand() == Material.STICK) { if (Action.LEFT_CLICK_BLOCK == true) { b.setType(Material.AIR); } } } }
I see 3 if statements. getItemInHand() returns and ItemStack, not a Material. if (Action.LEFT_CLICK_BLOCK == true) { is complete nonsense. Try: if (event.getAction() == Action.LEFT_CLICK_BLOCK) {