setToData method

Score setToData(
  1. Data data
)

sets the score to an nbt value

Implementation

Score setToData(Data data) {
  if (!data.isGetting) {
    throw ('Please set a score to Data.get and not Data.${data.subcommand}');
  }
  return addCommandRet(
    Builder(
      (c) => Command(
        'execute store result score ${toString()} run data get ${data.getTarget(c)} ${data.path} ${data.scale ?? 1}',
      ),
    ),
  );
}