ItemStorage.fromString

Gets an item using a string.

class ItemStorage
fromString
(
string name
,
ushort damage = 0
)

Return Value

Type: Item

an instance of Item or null if there are no items with the given name

Examples

assert(items.fromString("grass") == Items.grass);
assert(items.fromString("polished granite") == Items.polishedGranite);
assert(items.fromString("polished_andesite") == Items.polishedAndesite);
assert(items.fromString("not an item") is null);

Meta