How to override custom block methods in drupal 8
Your other module can implement hook_block_access().

The example code in Drupal core looks like this:

function hook_block_access(\Drupal\block\Entity\Block $block, $operation, \Drupal\Core\Session\AccountInterface $account) {

  // Example code that would prevent displaying the 'Powered by Drupal' block in
  // a region different than the footer.
  if ($operation == 'view' &amp;&amp; $block
    -&gt;getPluginId() == 'system_powered_by_block') {
    return AccessResult::forbiddenIf($block
      -&gt;getRegion() != 'footer')
      -&gt;addCacheableDependency($block);
  }

  // No opinion.
  return AccessResult::neutral();
}


Since it's a hook, you would have to replace the word "hook" in the function name with the machine name of your module, and place this function in the .module file.