How to get a custom block form in another custom block? I have a custom block
/**
 * Provides block A.
 *
 * @Block(
 *   id = &quot;block A&quot;,
 *   admin_label = @Translation(&quot;Block A&quot;),
 * )
 */
class Block A extends BlockBase implements ContainerFactoryPluginInterface {

  public function defaultConfiguration() {
    return [some_value]
  }

  public function blockForm($form, FormStateInterface $form_state) {
    // Configuration form
  }
}

Now I have another block
/**
     * Provides block B.
     *
     * @Block(
     *   id = &quot;block B&quot;,
     *   admin_label = @Translation(&quot;Block B&quot;),
     * )
     */
    class Block B extends AnotherClass {
    
      public function defaultConfiguration() {
        return [some_value]
      }
    
      public function blockForm($form, FormStateInterface $form_state) {
        $form = BlockA-&gt;buildForm()
        return $form;
      }
    }

The AnotherClass extends BlockBase.
Is it possible to display the Block A configuration form in Block B?
Like $form = BlockA-&gt;buildForm()?
The problem with @Clive comment is that Block A is from the contrib module. So I can't change its base class.
The answer is to use the plugin.manager.block service
Example:
In the Block B BlockForm method.
public function blockForm($form, FormStateInterface $form_state) {
  $block_manager = \Drupal::service('plugin.manager.block');
  $block_a = $block_manager-&gt;createInstance('block_a');
  $form = block_a-&gt;blockForm($form, $form_state)
  return $form;
}