Advancement.only constructor

Advancement.only(
  1. Entity entity,
  2. String advancement, {
  3. bool revoke = false,
  4. String? criteria,
})

Every mode also has a separated named constructor:

Advancement.only Only unlocks on Advancement
Entity the target player
String your advancement
revoke set true if you want to revoke
criteria optional String for an advancement

Implementation

Advancement.only(this.entity, this.advancement,
    {this.revoke = false, this.criteria})
    : mode = 'only';