Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(),false);
Target target = new TargetCreaturePermanent(filter);
ability.addTarget(target);
this.addAbility(ability);
// At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.
TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(new SacrificeTargetEffect(), TargetController.YOU, false);
target = new TargetControlledCreaturePermanent();
target.setNotTarget(false);
triggeredAbility.addTarget(target);
this.addAbility(new ConditionalTriggeredAbility(
triggeredAbility,
new InvertCondition(new CreatureCardsInControllerGraveCondition(6)),
"At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature"));