set method

Bossbar set({
  1. String? name,
  2. List<TextComponent>? nameTexts,
  3. Color? color,
  4. String? style,
  5. int? value,
  6. int? max,
  7. bool? visible,
  8. Entity? players,
})

Implementation

Bossbar set({
  String? name,
  List<TextComponent>? nameTexts,
  Color? color,
  String? style,
  int? value,
  int? max,
  bool? visible,
  Entity? players,
}) {
  final b = copyWith(type: BossbarType.set);

  if (name != null) b.nameTexts = [TextComponent(name)];
  if (nameTexts != null) b.nameTexts = nameTexts;
  if (color != null) b.modifiers['color'] = color.toString();
  if (style != null) b.modifiers['style'] = style;
  if (value != null) b.modifiers['value'] = value.toString();
  if (max != null) b.modifiers['max'] = max.toString();
  if (visible != null) b.modifiers['visible'] = visible.toString();
  if (players != null) b.modifiers['players'] = players.toString();
  return b;
}