Item class

The Item class represents an item in an inventory in Minecraft. It is used in the Give or Nbt Commands.

Constructors

Item(dynamic type, {int? count, Slot? slot, int? damage, int? model, int? hideFlags, TextComponent? name, List<TextComponent>? lore, Map<String, dynamic>? nbt})
The Item class represents an item in an inventory in Minecraft. It is used in the Give or Nbt Commands.
Item.Book(List<BookPage> pages, {String title = '', String author = '', int? count, Slot? slot, int? damage, int? model, int? hideFlags, TextComponent? name, List<TextComponent>? lore, Map<String, dynamic>? nbt})
Item.SpawnEgg(dynamic type, Summon entity, {int? count, Slot? slot, int? damage, int? model, int? hideFlags, TextComponent? name, List<TextComponent>? lore, Map<String, dynamic>? nbt})
Item.type(String type, {int? count, Slot? slot, int? damage, Map<String, dynamic>? tag})
const

Properties

count int?
final
damage int?
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
slot Slot?
final
tag Map<String, dynamic>?
final
type String
final

Methods

copyWith({String? type, int? count, int? damage, Slot? slot, int? model, int? hideFlags, TextComponent? name, List<TextComponent>? lore, Map<String, dynamic>? nbt}) Item
getGiveNotation({bool withDamage = true}) String
getId() String
getMap([bool useId = true]) Map<String, dynamic>
getNbt() String
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

clone(Item it) Item
creates a new object based on a existing Item to modify properties.
fromJson(Map<String, dynamic> json) Item
creates an Item based on nbt or json data.