Adding Constraint to Paragraph field I have a Content Type with a field that references 6 different paragraph types.  The field is set up to accept unlimited values.   For one of the types I would like to have exactly four values added.  I've been trying to add a Constraint but it seems that Constraints are built to check if a fields values are valid and not if there are only four items

Is using hook_entity_bundle_field_info_alter the correct hook or should I be focused on using hook_entity_type_alter or maybe even some other method?
Yes, use hook_entity_bundle_field_info_alter and when you add a constraint to the field (and not to a item or property), your constraint gets the entire field item list, so you can check how many items you have of which type, see FieldConfigInterface::addConstraint:

function mymodule_entity_bundle_field_info_alter(&amp;$fields, \Drupal\Core\Entity\EntityTypeInterface $entity_type, $bundle) {
  if ($entity_type-&gt;id() == 'node' &amp;&amp; $bundle == 'page') {
    $fields['field_paragraph']-&gt;addConstraint('MymoduleParagraphTypes');
  }
}


Example for a constraint restricting the field to four paragraph items of a specific type:

  public function validate($items, Constraint $constraint) {
    $paragraphs = array_filter($items-&gt;referencedEntities(), function ($paragraph) {
      return $paragraph-&gt;bundle() === 'image';
    });
    if (!empty($paragraphs) &amp;&amp; count($paragraphs) != 4) {
      $this-&gt;context-&gt;addViolation($constraint-&gt;errorMessage);
    }
  }


You can generate the constraint with the Drush command:

drush generate plugin-constraint