dataModify method

RestActionAble dataModify({
  1. required String path,
  2. required DataModify modify,
})

Generates a Data Widget

entity.dataModify(path: 'CustomName', modify: ...).queue()

Implementation

RestActionAble dataModify(
    {required String path, required DataModify modify}) {
  if ((selector == 'a' ||
      selector == 'r' ||
      selector == 'p' ||
      arguments['type'] == 'minecraft:player' ||
      arguments['type'] == 'player')) {
    throw ('Cannot modify a player\'s data');
  }
  if ((selector == 'a' || selector == 'e') &&
      (arguments['limit'] == null || arguments['limit'] != '1')) {
    throw ('Cannot work with data of multiple entities in data command');
  }
  return StraitWidget.builder
      .create(Data.modify(this, path: path, modify: modify));
}