Advancement.grant constructor

Advancement.grant(
  1. Entity entity,
  2. String advancement, {
  3. String mode = 'only',
  4. String? criteria,
})

This gives the advancement to the player:

Advancement.grant
Entity the target player
String your advancement
mode the advancement mode(default = only, modes are also separate constructors)
criteria optional String criteria for an advancement

Implementation

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