An HTML5 crafting API.
It loads up most (not all) of the Minecraft recipes and items. The textures are completely themeable using existing Minecraft texture packs too.
// create a craftervar crafter = ;// add a recipe for a torchcrafter;// craft your itemvar item = crafter;console;// item is now a normalized recipe
If you specify more than one argument to
crafter.recipe() it will assume
you're entering a recipe in a Minecraft-like format:
// turn a box of dirt into 2 diamondscrafter;
crafter.recipe() also accepts a shorthand popular mod format. Enter as
strings, a single recipe per line:
Also included is a web user interface.
var webui =container: document;
View the example for a more in depth example.
Returns a new craft instance.
Add a new recipe to the crafter.
have into the crafter and it will search for a matching recipe then
return the matching recipe.
Returns a crafting web UI instance. Specify a
container option that contains
your crafting grids.
Events emitted as an item is picked up and dropped:
With npm do:
npm install craft
Use browserify to
Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.
Minecraft is property of Mojang AB