Scoreboard constructor

Scoreboard(
  1. String name, {
  2. String type = 'dummy',
  3. TextComponent? display,
  4. bool addIntoLoad = true,
})

A scoreboard objective holds values, kind a like a Variable inside Minecraft.

The Scoreboard class just handles adding or removing objectives. The value assignment is handled by the Score class.

objD automatically keeps a list of all scoreboards and inserts them into the given load file, ignoring doubled names.

Implementation

Scoreboard(
  this.name, {
  this.type = 'dummy',
  TextComponent? display,
  bool addIntoLoad = true,
}) : subcommand = addIntoLoad ? 'add' : 'addHere' {
  if (display != null) type += ' ${display.toJson()!}';
  prefixName();
}