Item.SpawnEgg constructor

Item.SpawnEgg(
  1. dynamic type,
  2. Summon entity, {
  3. int? count,
  4. Slot? slot,
  5. int? damage,
  6. int? model,
  7. int? hideFlags,
  8. TextComponent? name,
  9. List<TextComponent>? lore,
  10. Map<String, dynamic>? nbt,
})

Implementation

Item.SpawnEgg(
  dynamic type,
  Summon entity, {
  this.count,
  this.slot,
  this.damage,
  int? model,
  int? hideFlags,
  TextComponent? name,
  List<TextComponent>? lore,
  Map<String, dynamic>? nbt,
})  : assert(
        type is String || type is Item || type is Block,
        'Please provide either a String, Item or Block',
      ),
      tag = {},
      type = type.toString() {
  nbt ??= {};

  nbt.addAll({
    'EntityTag': {
      'id': entity.type.type,
      ...entity.nbt ?? {},
    }
  });

  _checkTags(model, type, hideFlags, name, lore, nbt);
}