How to override custom block methods in drupal 8 i have created a block with all its methods like blockAccess()... i would like to override one of those in other module, in my project i have used page manager, then i cant call hook_block_access()..because blocks added with page manager doesnt get into this hook.
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.