CommandList<T> constructor

CommandList<T>(
  1. List<T> commands
)

There is a more efficient way to list raw Minecraft commands.

The CommandList Widget allows you to input a List of Commands, a List of Strings representing a command or a multiline string.

This has basically the same function as For.of just for commands.

CommandList(List<Command>[
		Command('say 1'),
		Command('say 2'),
		Command('say 3')
]),

Implementation

CommandList(List<T> commands) {
  if (T.toString() == 'String') {
    _commands = commands.map((x) => Command(x.toString())).toList();
  } else if (T.toString() == 'Command') {
    _commands = (commands as List<Command>);
  } else {
    throw ('Please insert a string or a list into CommandList');
  }
}