Recipe class

A basic recipe takes in ingredient Items with the slot and a result Item.

Inheritance

Constructors

Recipe(Map<int, Item> ingredients, Item result, {String name = 'recipe', int? id, bool exactlyPlaced = false, int? exactResult, RecipeType type = RecipeType.shaped, double experience = 0.1, int cookingtime = 200})
A basic recipe takes in ingredient Items with the slot and a result Item. The recipes of a craftingtable are instantiated in the recipes field. A basic recipe takes in ingredient Items with the slot and a result Item.
Recipe.fromJson(Map<String, dynamic> json, {int? id, bool exactlyPlaced = false, int? exactResult})
With objD you can also import usual minecraft recipes in json data. objD automatically parses that and converts it to a command.
factory
Recipe.pattern(List<String> pattern, Map<String, Item> keys, Item result, {int? id, String name = 'recipe', bool exactlyPlaced = false, int? exactResult, RecipeType type = RecipeType.shaped})
Want to stay close to the original minecraft notation and want to prove a pattern? You can also do that with:
factory
Recipe.shapeless(List<Item> ingreds, Item result, {String name = 'recipe', int? id, bool exactlyPlaced = false, int? exactResult})
The API also supports shapeless crafting. That means you can set the ingredients in any shape and it would be the same result.
factory
Recipe.smelting(Item ingredient, Item result, {String name = 'recipe', int? id, bool exactlyPlaced = false, int? exactResult, double experience = 0.1, int cookingtime = 200, RecipeType type = RecipeType.smelting})
Since smelting requires just one ingredient, just give it an Item and its result. Futhermore you can change the cooktime and experience gained:
Recipe.smithing(Item base, Item result, {Item? addition, String name = 'recipe', int? id, bool exactlyPlaced = false, int? exactResult, RecipeType type = RecipeType.smithing})
For smithing you can define an additional item on top to the base item:

Properties

cookingtime int
final
exactlyPlaced bool
final
exactResult int?
final
experience double
final
hashCode int
The hash code for this object.
no setterinherited
id int?
final
ingredients Map<int, Item>
final
name String
final
result Item
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type RecipeType
final

Methods

copyWith({String? name, RecipeType? type, bool? exactlyPlaced, int? exactResult, Item? result, Map<int, Item>? ingredients, double? experience, int? cookingtime, int? id}) Recipe
generate(Context context) Widget
override
getPattern() MapEntry<List<String>, Map<String, Item>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toMap() → dynamic
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

recipeId int
getter/setter pair