Data.fromScore constructor

Data.fromScore(
  1. dynamic target, {
  2. required String path,
  3. required Score? score,
  4. num? scale = 1,
  5. String? datatype = 'byte',
})

You can also convert a score directly to a nbt field with Data.fromScore:

Data.fromScore
dynamic The target Entity OR Location which you want to modify
path the nbt path you want to copy to
score The source Score
scale optional int (default = 1)
datatype a Java datatype for the score(default = byte)

Implementation

Data.fromScore(
  this.target, {
  required this.path,
  required this.score,
  this.scale = 1,
  this.datatype = 'byte',
}) : _subcommand = 'score' {
  handleTarget(target);
}