Item.this

Constructs an item with some extra data.

  1. this()
  2. this(string data)
    class Item
    @trusted
    this
    (
    string data
    )
  3. this(std.json.JSONValue data)

Throws

JSONException if the JSON string is malformed

Examples

auto item = new Items.Apple(`{"customName":"SPECIAL APPLE","enchantments":[{"name":"protection","level":"IV"}]}`);
assert(item.customName == "SPECIAL APPLE");
assert(Enchantments.protection in item);

Meta