File constructor

File(
  1. String path, {
  2. Widget? child,
  3. bool execute = false,
  4. String? pack,
  5. bool create = true,
  6. bool inheritFolder = true,
  7. Comment? header,
})

The file class simply generates a new mcfunction file with content and a path.

The File class can be used as often as you want and where you want, so you can also define a new file in a For container for example.

File(
	path:"main",
	child: File.execute( // same as execute: true
		path: 'new'
		child: Command(...)
	)
)

Implementation

File(
  this.path, {
  this.child,
  this.execute = false,
  this.pack,
  this.create = true,
  this.inheritFolder = true,
  this.header,
}) {
  path.replaceAll('.mcfunction', '');
  if (path.substring(0, 1) == '/') path = path.substring(1);
}